diff --git a/modules/hosts/computer-mo/nixos-configurations.nix b/modules/hosts/computer-mo/nixos-configurations.nix index 6b6e920..9248db4 100644 --- a/modules/hosts/computer-mo/nixos-configurations.nix +++ b/modules/hosts/computer-mo/nixos-configurations.nix @@ -1,15 +1,12 @@ -{ inputs, ... }: { - flake.nixosConfigurations.computer-mo = inputs.nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { +{ inputs, ... }: +let + mkHost = inputs.self.lib.mkHost; +in +{ + flake.nixosConfigurations = { + computer-mo = mkHost { user = "mo"; - pkgs-unstable = import inputs.nixpkgs-unstable { - system = "x86_64-linux"; - config.allowUnfree = true; - }; + extraModules = [ inputs.self.nixosModules.computer-mo ]; }; - modules = [ - inputs.self.nixosModules.computer-mo - ]; }; } diff --git a/modules/platform/mkhost.nix b/modules/platform/mkhost.nix new file mode 100644 index 0000000..6d685e1 --- /dev/null +++ b/modules/platform/mkhost.nix @@ -0,0 +1,14 @@ +{ inputs, ... }: { + flake.lib.mkHost = { system ? "x86_64-linux", user, extraModules ? [] }: + inputs.nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit user; + pkgs-unstable = import inputs.nixpkgs-unstable { + inherit system; + config.allowUnfree = true; + }; + }; + modules = extraModules; + }; +}