diff options
Diffstat (limited to 'util')
| -rw-r--r-- | util/default.nix | 14 | ||||
| -rw-r--r-- | util/host.nix | 48 | ||||
| -rw-r--r-- | util/user.nix | 38 |
3 files changed, 0 insertions, 100 deletions
diff --git a/util/default.nix b/util/default.nix deleted file mode 100644 index b909fe5..0000000 --- a/util/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - inputs, - lib, -}: let - inherit (builtins) readDir; - inherit (lib) filterAttrs mapAttrs; - - mapFilterDirs = dir: filter: map: let - dirs = filterAttrs filter (readDir dir); - in - mapAttrs map dirs; -in - (import ./host.nix {inherit inputs mapFilterDirs;}) - // (import ./user.nix {inherit inputs mapFilterDirs;}) diff --git a/util/host.nix b/util/host.nix deleted file mode 100644 index a8af69f..0000000 --- a/util/host.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - inputs, - mapFilterDirs, -}: rec { - mkHost = { - name, - modules, - specialArgs ? {}, - system ? "x86_64-linux", - stateVersion ? "22.11", - pkgs, - }: - with pkgs.lib; - nixosSystem { - inherit system specialArgs; - modules = - [ - ../profiles/base - ../profiles/nixos - ../hosts/${name} - - { - system.stateVersion = stateVersion; - networking.hostName = mkDefault name; - nixpkgs = { - overlays = with inputs; [nur.overlay getchoo.overlays.default]; - config = { - allowUnfree = true; - allowUnsupportedSystem = true; - }; - }; - nix.registry.getchoo.flake = inputs.getchoo; - } - ] - ++ modules; - }; - - mapHosts = hosts: - mapFilterDirs ../hosts (n: v: v == "directory" && n != "turret") (name: _: - mkHost { - inherit name; - inherit (hosts.${name}) modules system stateVersion pkgs; - specialArgs = - if builtins.hasAttr "specialArgs" hosts.${name} - then hosts.${name}.specialArgs - else {}; - }); -} diff --git a/util/user.nix b/util/user.nix deleted file mode 100644 index 3355459..0000000 --- a/util/user.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - inputs, - mapFilterDirs, -}: rec { - mkHMUser = { - username, - pkgs, - stateVersion ? "22.11", - modules ? [], - }: - inputs.home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = - [ - ../users/${username}/home.nix - { - home = { - inherit username stateVersion; - homeDirectory = "/home/${username}"; - }; - - programs.home-manager.enable = true; - } - ] - ++ modules; - }; - - mapHMUsers = users: - mapFilterDirs ../users (n: v: v == "directory" && n != "root" && n != "secrets") (username: _: - mkHMUser { - inherit username; - inherit (users.${username}) pkgs stateVersion; - modules = - if builtins.hasAttr "modules" users.${username} - then users.${username}.modules - else {}; - }); -} |
