diff --git a/flake.nix b/flake.nix index 61e55a0..21a0317 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,7 @@ }; outputs = - { self, nixpkgs, nur, lanzaboote, flake-utils, ... }@inputs: + { self, nixpkgs, nur, lanzaboote, flake-utils, home-manager, ... }@inputs: let # FIXME: allow different systems systems = flake-utils.lib.system; @@ -39,31 +39,34 @@ modules = defaultModules ++ extraModules; inherit system; }; + mkHomeManager = confName: user: system: # unfortunately, home-manager configs are still system-specific + # FIXME: this is thus still linux-x86_64 specific + home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.${system}; + modules = [ + { + imports = [ + nur.hmModules.nur + # TODO: $name can be utilised to conditionally load other config files + ./home/home.nix + ]; + # extends the home config + home.username = user; + home.homeDirectory = "/home/${user}"; + } + ]; + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + extraSpecialArgs = { + inherit inputs system; + }; + }; in { nixosConfigurations = { thinknix = mkSystem systems.x86_64-linux [ ./hosts/thinknix inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t440s lanzaboote.nixosModules.lanzaboote ]; framenix = mkSystem systems.x86_64-linux [ ./hosts/framenix inputs.nixos-hardware.nixosModules.framework-13-7040-amd lanzaboote.nixosModules.lanzaboote ]; }; - # FIXME: see mkHomemanager - homeConfigurations.spiollinux = inputs.home-manager.lib.homeManagerConfiguration { - - modules = [ - { - imports = [ - nur.hmModules.nur - ./home/home.nix - ]; - # extends the home config - home.username = "spiollinux"; - home.homeDirectory = "/home/spiollinux"; - } - ]; - # Optionally use extraSpecialArgs - # to pass through arguments to home.nix - extraSpecialArgs = { - inherit inputs; - }; - }; + homeConfigurations.spiollinux = mkHomeManager "spiollinux" "spiollinux" systems.x86_64-linux; }; }