diff options
author | rubiigen <alyxwren@proton.me> | 2024-02-02 18:29:45 +0000 |
---|---|---|
committer | Frankie B <frankieraybrown@gmail.com> | 2024-02-02 18:39:57 +0000 |
commit | d666f30475528ce7f50cc3dd92a1693241083fe8 (patch) | |
tree | 5b443f79a7100f2db735853335df81d9a7b95cc3 /hosts/default.nix | |
parent | ea3485f5c5dac7f89562db741bf981b2b743d01c (diff) |
major refactor (treewide amongst general cleaning based on my modified dots (with help from notashelf) - perks 1: it works
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 ]; }; } |