diff --git a/configuration.nix b/configuration.nix index e27c943..9fb5ae5 100644 --- a/configuration.nix +++ b/configuration.nix @@ -71,17 +71,6 @@ # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.hermannsn = { - isNormalUser = true; - description = "Niklas Hermanns"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; [ - kdePackages.kate - # thunderbird - ]; - }; - # Install firefox. programs.firefox.enable = true; diff --git a/flake.lock b/flake.lock index 2694b63..67b6d30 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,41 @@ { "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1719827385, + "narHash": "sha256-qs+nU20Sm8czHg3bhGCqiH+8e13BJyRrKONW34g3i50=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "391ca6e950c2525b4f853cbe29922452c14eda82", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.05", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1716542732, + "narHash": "sha256-0Y9fRr0CUqWT4KgBITmaGwlnNIGMYuydu2L8iLTfHU4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d12251ef6e8e6a46e05689eeccd595bdbd3c9e60", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1719707984, "narHash": "sha256-RoxIr/fbndtuKqulGvNCcuzC6KdAib85Q8gXnjzA1dw=", @@ -18,7 +53,8 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "home-manager": "home-manager", + "nixpkgs": "nixpkgs_2" } } }, diff --git a/flake.nix b/flake.nix index 60da89f..4223d1c 100644 --- a/flake.nix +++ b/flake.nix @@ -3,14 +3,29 @@ description = "My flakes configuration"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + home-manager.url = "github:nix-community/home-manager/release-24.05"; }; -outputs = { self, nixpkgs }@inputs: +outputs = { self, nixpkgs, home-manager }@inputs: + let + system = "x86_64-linux"; + specialArgs = inputs // { inherit system; }; + shared-modules = [ + home-manager.nixosModules.home-manager + { + home-manager = { + useUserPackages = true; + extraSpecialArgs = specialArgs; + }; + } + ]; + in { nixosConfigurations = { nos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ ./nos.nix]; + specialArgs = specialArgs; + system = system; + modules = shared-modules ++ [ ./nos.nix]; }; }; }; diff --git a/hermannsn.nix b/hermannsn.nix new file mode 100644 index 0000000..d9e87b9 --- /dev/null +++ b/hermannsn.nix @@ -0,0 +1,15 @@ +# hermannsn.nix + +{ pkgs, ...}: + +{ + users.users.hermannsn = { + isNormalUser = true; + description = "Niklas Hermanns"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + kdePackages.kate + # thunderbird + ]; + }; +} diff --git a/nos.nix b/nos.nix index 9a8e4a0..abcd0bc 100644 --- a/nos.nix +++ b/nos.nix @@ -4,7 +4,7 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = [ ./configuration.nix ]; + imports = [ ./configuration.nix ./hermannsn.nix ]; # Bootloader. boot.loader.grub.enable = true;