diff --git a/nix/configurations.nix b/nix/configurations.nix index c2a87e0..645e60e 100644 --- a/nix/configurations.nix +++ b/nix/configurations.nix @@ -6,7 +6,6 @@ }: let inherit (lib) nixosSystem; - inherit (cfg.lib) flattenAttrs; inherit (lib.attrsets) mapAttrs; cfg = config.flake; hosts = cfg.manifest.hosts or { }; @@ -22,7 +21,7 @@ let hostName = name; }; modules = [ - (flattenAttrs cfg.modules.nixos) + cfg.modules.nixos.default (value.extraCfg or { }) ]; } diff --git a/nix/lib/default.nix b/nix/lib/default.nix index 0e94c00..26ad51d 100644 --- a/nix/lib/default.nix +++ b/nix/lib/default.nix @@ -1,36 +1,10 @@ { lib, config, ... }: let cfg = config.flake; - inherit (lib.attrsets) mapAttrs concatMapAttrs; + inherit (lib.attrsets) mapAttrs; in { flake.lib = { - /** - Remove the top level attributes from an attribute set and return the merged attributes. - - # Inputs - - `attrset` - - : An attribute set to flatten. - - # Type - - ``` - flattenAttrs :: AttrSet -> AttrSet - ``` - - # Examples - :::{.example} - ## `flattenAttrs` usage example - - ```nix - flattenAttrs { x = { a = 1; b = 2; }; y = { c = 3; d = 4; }; } - => { a = 1; b = 2; c = 3; d = 4; } - ``` - */ - flattenAttrs = attrset: concatMapAttrs (_: v: v) attrset; - /** Return an attribute set for use with a option that needs to be used for all users. diff --git a/nix/modules/home-manager.nix b/nix/modules/home-manager.nix index 7b11f4d..c3c8de4 100644 --- a/nix/modules/home-manager.nix +++ b/nix/modules/home-manager.nix @@ -1,15 +1,13 @@ { inputs, config, ... }: let - inherit (cfg.lib) forAllUsers' flattenAttrs; + inherit (cfg.lib) forAllUsers'; cfg = config.flake; hm = inputs.home-manager; globalCfg = { useGlobalPkgs = true; useUserPackages = true; extraSpecialArgs = { inherit (cfg) manifest; }; - sharedModules = [ - (flattenAttrs (cfg.modules.homeManager or { })) - ]; + sharedModules = [ cfg.modules.homeManager.default ]; users = forAllUsers' (name: _: cfg.homes.${name}); }; in