diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2021-05-15 22:16:10 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2021-05-15 22:16:10 +0200 |
commit | 98ce9a9d0307c4695728ee09de2e54c30cfbdac2 (patch) | |
tree | f9a49b59b9ac9541327bbd956e3e2cafe3bb46fc /flake.nix | |
parent | 0e0f035264d897e65676ecdc06aee555fae796a8 (diff) | |
parent | 3e5346ccfd542e9abb928a7eca2e831b9c30df2e (diff) | |
download | nixos-98ce9a9d0307c4695728ee09de2e54c30cfbdac2.tar nixos-98ce9a9d0307c4695728ee09de2e54c30cfbdac2.tar.gz nixos-98ce9a9d0307c4695728ee09de2e54c30cfbdac2.tar.bz2 nixos-98ce9a9d0307c4695728ee09de2e54c30cfbdac2.tar.xz nixos-98ce9a9d0307c4695728ee09de2e54c30cfbdac2.zip |
Merge branch 'flakes-template' into flakes
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -29,7 +29,7 @@ | |||
29 | inherit (builtins) attrNames attrValues elemAt toJSON isNull pathExists; | 29 | inherit (builtins) attrNames attrValues elemAt toJSON isNull pathExists; |
30 | inherit (nixpkgs) lib; | 30 | inherit (nixpkgs) lib; |
31 | utils = import ./utils { inherit lib; }; | 31 | utils = import ./utils { inherit lib; }; |
32 | inherit (utils) recImport overrideModule; | 32 | inherit (utils) nixImport overrideModule; |
33 | inherit (lib) nixosSystem mkIf splitString filterAttrs listToAttrs mapAttrsToList nameValuePair concatMap composeManyExtensions mapAttrs mapAttrs' recursiveUpdate genAttrs unique elem optionalAttrs; | 33 | inherit (lib) nixosSystem mkIf splitString filterAttrs listToAttrs mapAttrsToList nameValuePair concatMap composeManyExtensions mapAttrs mapAttrs' recursiveUpdate genAttrs unique elem optionalAttrs; |
34 | 34 | ||
35 | accountUserName = accountName: | 35 | accountUserName = accountName: |
@@ -109,7 +109,7 @@ | |||
109 | 109 | ||
110 | activateNixosConfigurations = forAllSystems (system: _pkgs: mapAttrs' (hostName: nixosConfig: nameValuePair "${hostName}-activate" { type = "app"; program = "${nixosConfig.config.system.build.toplevel}/bin/switch-to-configuration"; }) self.nixosConfigurations); | 110 | activateNixosConfigurations = forAllSystems (system: _pkgs: mapAttrs' (hostName: nixosConfig: nameValuePair "${hostName}-activate" { type = "app"; program = "${nixosConfig.config.system.build.toplevel}/bin/switch-to-configuration"; }) self.nixosConfigurations); |
111 | 111 | ||
112 | overlayPaths = recImport rec { dir = ./overlays; _import = (path: _name: dir + "/${path}"); } // { pkgs = ./pkgs; }; | 112 | overlayPaths = nixImport rec { dir = ./overlays; _import = (path: _name: dir + "/${path}"); } // { pkgs = ./pkgs; }; |
113 | 113 | ||
114 | installerProfiles = system: | 114 | installerProfiles = system: |
115 | let nixpkgs-path = nixpkgs.legacyPackages.${system}.path; | 115 | let nixpkgs-path = nixpkgs.legacyPackages.${system}.path; |
@@ -126,16 +126,16 @@ | |||
126 | in | 126 | in |
127 | { | 127 | { |
128 | nixosModules = | 128 | nixosModules = |
129 | let modulesAttrs = recImport { dir = ./modules; }; | 129 | let modulesAttrs = nixImport { dir = ./modules; }; |
130 | systemProfiles = recImport rec { dir = ./system-profiles; _import = mkSystemProfile dir; }; | 130 | systemProfiles = nixImport rec { dir = ./system-profiles; _import = mkSystemProfile dir; }; |
131 | users = recImport rec { dir = ./users; _import = mkUserModule dir; }; | 131 | users = nixImport rec { dir = ./users; _import = mkUserModule dir; }; |
132 | userProfiles = forAllUsers (userName: recImport rec { dir = ./user-profiles; _import = mkUserProfile userName dir; }); | 132 | userProfiles = forAllUsers (userName: nixImport rec { dir = ./user-profiles; _import = mkUserProfile userName dir; }); |
133 | accounts = recursiveUpdate rootAccounts (recImport rec { dir = ./accounts; _import = mkAccountModule dir; }); | 133 | accounts = recursiveUpdate rootAccounts (nixImport rec { dir = ./accounts; _import = mkAccountModule dir; }); |
134 | rootAccounts = mapAttrs' (hostName: _value: nameValuePair "root@${hostName}" ({...}: { imports = [ self.nixosModules.users.root or ({...}: { imports = defaultUserProfiles "root"; }) ]; })) self.nixosConfigurations; | 134 | rootAccounts = mapAttrs' (hostName: _value: nameValuePair "root@${hostName}" ({...}: { imports = [ self.nixosModules.users.root or ({...}: { imports = defaultUserProfiles "root"; }) ]; })) self.nixosConfigurations; |
135 | in modulesAttrs // { inherit systemProfiles users userProfiles accounts; }; | 135 | in modulesAttrs // { inherit systemProfiles users userProfiles accounts; }; |
136 | nixosConfigurations = optionalAttrs (!(isNull installerConfig)) { installer = installerConfig; } // recImport rec { dir = ./hosts; _import = mkNixosConfiguration [] dir; }; | 136 | nixosConfigurations = optionalAttrs (!(isNull installerConfig)) { installer = installerConfig; } // nixImport rec { dir = ./hosts; _import = mkNixosConfiguration [] dir; }; |
137 | 137 | ||
138 | homeManagerModules = recImport rec { dir = ./home-modules; }; | 138 | homeManagerModules = nixImport rec { dir = ./home-modules; }; |
139 | 139 | ||
140 | overlay = import overlayPaths.pkgs; | 140 | overlay = import overlayPaths.pkgs; |
141 | overlays = mapAttrs (_name: path: import path) overlayPaths; | 141 | overlays = mapAttrs (_name: path: import path) overlayPaths; |