From e632eff25b20a9d384804faec0fb3a2c897ec3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Fri, 31 May 2024 14:29:38 +0200 Subject: [PATCH] Add Home-Manager --- NixOS/configuration.nix | 11 ++++++++--- NixOS/flake.nix | 11 +++++++++-- NixOS/home.nix | 0 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 NixOS/home.nix diff --git a/NixOS/configuration.nix b/NixOS/configuration.nix index 5a1006f..5dcc3e1 100644 --- a/NixOS/configuration.nix +++ b/NixOS/configuration.nix @@ -80,14 +80,13 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - vim wget curl git ]; - environment.variables.EDITOR = "vim"; + environment.variables.EDITOR = "neovim"; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; @@ -99,7 +98,13 @@ # List services that you want to enable: # Enable the OpenSSH daemon. - services.openssh.enable = true; + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; diff --git a/NixOS/flake.nix b/NixOS/flake.nix index 0d24aba..316024b 100644 --- a/NixOS/flake.nix +++ b/NixOS/flake.nix @@ -1,5 +1,5 @@ { - description = "A simple NixOS flake"; + description = "NixOS flake"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; @@ -9,11 +9,18 @@ }; }; - outputs = { self, nixpkgs, ... }@inputs: { + outputs = { self, nixpkgs, home-manager, ... }@inputs: { nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = { inherit inputs; }; # allows access to flake inputs in nixos modules modules = [ ./configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; # makes hm use nixos's pkgs value + home-manager.extraSpecialArgs = { inherit inputs; }; # allows access to flake inputs in hm modules + home-manager.users.user.imports = [ ./home.nix ]; + } ]; }; }; diff --git a/NixOS/home.nix b/NixOS/home.nix new file mode 100644 index 0000000..e69de29