diff --git a/flake.nix b/flake.nix index 2a1fff7..8da1bb1 100755 --- a/flake.nix +++ b/flake.nix @@ -90,6 +90,9 @@ flake-parts, ... }: + let + buildLiminalOS = import ./lib/buildLiminalOS.nix; + in flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" @@ -98,30 +101,17 @@ ]; flake = { nixosConfigurations = { - demeter = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs; - }; - modules = [ - ./hosts/demeter - ]; + demeter = buildLiminalOS { + inherit inputs nixpkgs; + systemModule = ./hosts/demeter; }; - - callisto = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs; - }; - modules = [ - ./hosts/callisto - ]; + callisto = buildLiminalOS { + inherit nixpkgs inputs; + systemModule = ./hosts/callisto; }; - adrastea = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs; - }; - modules = [ - ./hosts/adrastea - ]; + adrastea = buildLiminalOS { + inherit inputs nixpkgs; + systemModule = ./hosts/adrastea; }; }; darwinConfigurations.phobos = nix-darwin.lib.darwinSystem { diff --git a/lib/buildLiminalOS.nix b/lib/buildLiminalOS.nix new file mode 100644 index 0000000..90b7046 --- /dev/null +++ b/lib/buildLiminalOS.nix @@ -0,0 +1,13 @@ +{ + nixpkgs, + inputs, + systemModule, +}: +nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + }; + modules = [ + systemModule + ]; +}