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 | |
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
-rw-r--r-- | accounts/gkleen@sif/default.nix | 4 | ||||
-rw-r--r-- | flake.nix | 18 | ||||
-rw-r--r-- | modules/yggdrasil/default.nix | 2 | ||||
-rw-r--r-- | system-profiles/openssh/default.nix | 2 | ||||
-rw-r--r-- | utils/default.nix | 2 |
5 files changed, 14 insertions, 14 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 676c12a3..440efa4e 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix | |||
@@ -55,7 +55,7 @@ in { | |||
55 | home-manager.users.${userName} = { | 55 | home-manager.users.${userName} = { |
56 | programs = { | 56 | programs = { |
57 | ssh = { | 57 | ssh = { |
58 | matchBlocks = import ./ssh-hosts.nix; # customUtils.recImport { dir = ./ssh-hosts; }; | 58 | matchBlocks = import ./ssh-hosts.nix; # customUtils.nixImport { dir = ./ssh-hosts; }; |
59 | extraConfig = '' | 59 | extraConfig = '' |
60 | Match host uniworx3.ifi.lmu.de,uniworx4.ifi.lmu.de,uniworx5.ifi.lmu.de,uni2workgw.ifi.lmu.de,blackbeard.tcs.ifi.lmu.de,gitlab2.rz.ifi.lmu.de,oregon.tcs.ifi.lmu.de !exec "nc -z -w 1 %h %p &>/dev/null" | 60 | Match host uniworx3.ifi.lmu.de,uniworx4.ifi.lmu.de,uniworx5.ifi.lmu.de,uni2workgw.ifi.lmu.de,blackbeard.tcs.ifi.lmu.de,gitlab2.rz.ifi.lmu.de,oregon.tcs.ifi.lmu.de !exec "nc -z -w 1 %h %p &>/dev/null" |
61 | ProxyJump remote.cip.ifi.lmu.de | 61 | ProxyJump remote.cip.ifi.lmu.de |
@@ -125,7 +125,7 @@ in { | |||
125 | ${pkgs.systemd}/bin/systemctl --user try-restart trayer xmobar | 125 | ${pkgs.systemd}/bin/systemctl --user try-restart trayer xmobar |
126 | ''; | 126 | ''; |
127 | }; | 127 | }; |
128 | profiles = customUtils.recImport { dir = ./autorandr-profiles; }; | 128 | profiles = customUtils.nixImport { dir = ./autorandr-profiles; }; |
129 | }; | 129 | }; |
130 | 130 | ||
131 | zsh.initExtra = "source ${./zshrc}"; | 131 | zsh.initExtra = "source ${./zshrc}"; |
@@ -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; |
diff --git a/modules/yggdrasil/default.nix b/modules/yggdrasil/default.nix index 3d59051c..f4100e73 100644 --- a/modules/yggdrasil/default.nix +++ b/modules/yggdrasil/default.nix | |||
@@ -24,7 +24,7 @@ in { | |||
24 | config = lib.mkIf cfg.enable { | 24 | config = lib.mkIf cfg.enable { |
25 | services.tinc.networks.yggdrasil = { | 25 | services.tinc.networks.yggdrasil = { |
26 | name = config.networking.hostName; | 26 | name = config.networking.hostName; |
27 | hostSettings = customUtils.recImport { dir = ./hosts; }; | 27 | hostSettings = customUtils.nixImport { dir = ./hosts; }; |
28 | debugLevel = 2; | 28 | debugLevel = 2; |
29 | interfaceType = "tap"; | 29 | interfaceType = "tap"; |
30 | settings = { | 30 | settings = { |
diff --git a/system-profiles/openssh/default.nix b/system-profiles/openssh/default.nix index ee7d8868..33a3e136 100644 --- a/system-profiles/openssh/default.nix +++ b/system-profiles/openssh/default.nix | |||
@@ -1,7 +1,7 @@ | |||
1 | { customUtils, lib, config, hostName, pkgs, ... }: | 1 | { customUtils, lib, config, hostName, pkgs, ... }: |
2 | { | 2 | { |
3 | config = { | 3 | config = { |
4 | programs.ssh.knownHosts = lib.zipAttrsWith (_name: values: builtins.head values) (lib.mapAttrsToList (name: lib.mapAttrs' (type: value: lib.nameValuePair "${name}-${type}" value)) (customUtils.recImport { dir = ./known-hosts; })); | 4 | programs.ssh.knownHosts = lib.zipAttrsWith (_name: values: builtins.head values) (lib.mapAttrsToList (name: lib.mapAttrs' (type: value: lib.nameValuePair "${name}-${type}" value)) (customUtils.nixImport { dir = ./known-hosts; })); |
5 | 5 | ||
6 | systemd.user.services."ssh-agent".enable = lib.mkForce false; # ssh-agent should be done via home-manager | 6 | systemd.user.services."ssh-agent".enable = lib.mkForce false; # ssh-agent should be done via home-manager |
7 | 7 | ||
diff --git a/utils/default.nix b/utils/default.nix index d00357af..48add212 100644 --- a/utils/default.nix +++ b/utils/default.nix | |||
@@ -3,7 +3,7 @@ rec { | |||
3 | inherit (builtins) readDir; | 3 | inherit (builtins) readDir; |
4 | inherit (lib) filterAttrs hasSuffix removeSuffix mapAttrs' nameValuePair isFunction functionArgs setFunctionArgs id; | 4 | inherit (lib) filterAttrs hasSuffix removeSuffix mapAttrs' nameValuePair isFunction functionArgs setFunctionArgs id; |
5 | mapFilterAttrs = seive: f: attrs: filterAttrs seive (mapAttrs' f attrs); | 5 | mapFilterAttrs = seive: f: attrs: filterAttrs seive (mapAttrs' f attrs); |
6 | recImport = { dir, _import ? name: _base: import "${toString dir}/${name}" }: | 6 | nixImport = { dir, _import ? name: _base: import "${toString dir}/${name}" }: |
7 | mapFilterAttrs | 7 | mapFilterAttrs |
8 | (_: v: v != null) | 8 | (_: v: v != null) |
9 | (n: v: | 9 | (n: v: |