diff options
Diffstat (limited to 'hosts/default.nix')
-rw-r--r-- | hosts/default.nix | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/hosts/default.nix b/hosts/default.nix index e12b1f6..5abd965 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,35 +1,33 @@ -{ - nixpkgs, - self, - outputs, - ... -}: let - inputs = self.inputs; +{self, ...}: let + # get inputs from self + inherit (self) inputs; + # get necessary inputs from self.inputs + inherit (inputs) nixpkgs lanzaboote nixos-hardware; + inherit (inputs.home-manager.nixosModules) home-manager; + # get lib from nixpkgs and create and alias for lib.nixosSystem + # for potential future overrides & abstractions + inherit (nixpkgs) lib; + mkSystem = lib.nixosSystem; - home-manager = inputs.home-manager.nixosModules.home-manager; - homes = ../homes; -in { - nixbox = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [ - # this list defines which files will be imported to be used as "modules" in the system config - ./nixbox/configuration.nix + home = ../homes; - # use the nixos-module for home-manager - home-manager - homes - ]; - }; + # define a sharedArgs variable that we can simply inherit + # across all hosts to avoid traversing the file whenever + # we need to add a common specialArg + # if a host needs a specific arg that others do not need + # then we can merge into the old attribute set as such: + # specialArgs = commonArgs // { newArg = "value"; }; - nixpad = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; + commonArgs = {inherit self inputs;}; +in { + "nixpad" = mkSystem { + specialArgs = commonArgs; modules = [ # this list defines which files will be imported to be used as "modules" in the system config ./nixpad/configuration.nix - # use the nixos-module for home-manager home-manager - homes + home ]; }; } |