diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-03-13 10:41:41 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-03-13 10:41:41 +0100 |
commit | 46152e140fe428538a562dcfd1627a88a02dcc09 (patch) | |
tree | be9e750b58363bcde0749804681a2c5643883e2e | |
parent | b4d952460bdd970d90e91d7b8e778b44a0ef3394 (diff) | |
download | nixos-46152e140fe428538a562dcfd1627a88a02dcc09.tar nixos-46152e140fe428538a562dcfd1627a88a02dcc09.tar.gz nixos-46152e140fe428538a562dcfd1627a88a02dcc09.tar.bz2 nixos-46152e140fe428538a562dcfd1627a88a02dcc09.tar.xz nixos-46152e140fe428538a562dcfd1627a88a02dcc09.zip |
...
-rw-r--r-- | accounts/gkleen@sif/default.nix | 1 | ||||
-rw-r--r-- | flake.nix | 4 | ||||
-rw-r--r-- | installer/default.nix | 2 | ||||
-rw-r--r-- | modules/home-manager.nix | 13 | ||||
-rw-r--r-- | system-profiles/rebuild-machines/default.nix | 28 | ||||
-rw-r--r-- | system-profiles/rebuild-machines/rebuild-machine.zsh | 2 | ||||
-rw-r--r-- | user-profiles/core.nix | 27 |
7 files changed, 62 insertions, 15 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 84ac88a7..4322278e 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix | |||
@@ -192,6 +192,7 @@ in { | |||
192 | package = import ./taffybar { inherit (pkgs) haskellPackages; }; | 192 | package = import ./taffybar { inherit (pkgs) haskellPackages; }; |
193 | }; | 193 | }; |
194 | status-notifier-watcher.enable = true; | 194 | status-notifier-watcher.enable = true; |
195 | xembed-sni-proxy.enable = true; | ||
195 | pasystray.enable = true; | 196 | pasystray.enable = true; |
196 | udiskie = { | 197 | udiskie = { |
197 | enable = true; | 198 | enable = true; |
@@ -136,6 +136,8 @@ | |||
136 | packages = | 136 | packages = |
137 | let installerPackages = system: optionalAttrs (!(isNull installerConfig)) (mapAttrs' (profile: value: nameValuePair "installer-${profile}" value.output) installers.${system}); | 137 | let installerPackages = system: optionalAttrs (!(isNull installerConfig)) (mapAttrs' (profile: value: nameValuePair "installer-${profile}" value.output) installers.${system}); |
138 | in forAllSystems (system: systemPkgs: self.overlays.default (self.legacyPackages.${system}) systemPkgs // installerPackages system); | 138 | in forAllSystems (system: systemPkgs: self.overlays.default (self.legacyPackages.${system}) systemPkgs // installerPackages system); |
139 | |||
140 | activateHomeManager = system: base: (deploy-rs.lib.${system}.activate.custom // { dryActivate = "DRY_RUN=1 $PROFILE/activate"; }) base.activationPackage "$PROFILE/activate"; | ||
139 | in | 141 | in |
140 | { | 142 | { |
141 | nixosModules = | 143 | nixosModules = |
@@ -183,7 +185,7 @@ | |||
183 | }; | 185 | }; |
184 | } // (mapAttrs (_user: usercfg: { | 186 | } // (mapAttrs (_user: usercfg: { |
185 | user = usercfg.home.username; | 187 | user = usercfg.home.username; |
186 | path = deploy-rs.lib.${self.nixosConfigurations.${hostname}.config.nixpkgs.system}.activate.home-manager usercfg.home; | 188 | path = activateHomeManager (self.nixosConfigurations.${hostname}.config.nixpkgs.system) usercfg.home; |
187 | }) self.nixosConfigurations.${hostname}.config.home-manager.users); | 189 | }) self.nixosConfigurations.${hostname}.config.home-manager.users); |
188 | }) (nixImport { dir = ./hosts; _import = (_path: name: name); }); | 190 | }) (nixImport { dir = ./hosts; _import = (_path: name: name); }); |
189 | 191 | ||
diff --git a/installer/default.nix b/installer/default.nix index bf09c8d8..ad0c3849 100644 --- a/installer/default.nix +++ b/installer/default.nix | |||
@@ -28,5 +28,7 @@ | |||
28 | ]; | 28 | ]; |
29 | 29 | ||
30 | zramSwap.enable = true; | 30 | zramSwap.enable = true; |
31 | |||
32 | home-manager.enableSystemd = true; | ||
31 | }; | 33 | }; |
32 | } | 34 | } |
diff --git a/modules/home-manager.nix b/modules/home-manager.nix new file mode 100644 index 00000000..9c259381 --- /dev/null +++ b/modules/home-manager.nix | |||
@@ -0,0 +1,13 @@ | |||
1 | { lib, ... }: | ||
2 | |||
3 | with lib; | ||
4 | |||
5 | { | ||
6 | options = { | ||
7 | home-manager.enableSystemd = mkOption { | ||
8 | type = types.bool; | ||
9 | default = false; | ||
10 | example = true; | ||
11 | }; | ||
12 | }; | ||
13 | } | ||
diff --git a/system-profiles/rebuild-machines/default.nix b/system-profiles/rebuild-machines/default.nix index 68788023..fe9a5f14 100644 --- a/system-profiles/rebuild-machines/default.nix +++ b/system-profiles/rebuild-machines/default.nix | |||
@@ -26,7 +26,9 @@ let | |||
26 | phases = [ "buildPhase" "installPhase" ]; | 26 | phases = [ "buildPhase" "installPhase" ]; |
27 | 27 | ||
28 | inherit (pkgs) zsh coreutils openssh; | 28 | inherit (pkgs) zsh coreutils openssh; |
29 | inherit (cfg) flake scriptName; | 29 | inherit (cfg) scriptName; |
30 | inherit (cfg.flake) flakeOutput; | ||
31 | flake = cfg.flake.name; | ||
30 | nixosRebuild = config.system.build.nixos-rebuild; | 32 | nixosRebuild = config.system.build.nixos-rebuild; |
31 | inherit (config.security) wrapperDir; | 33 | inherit (config.security) wrapperDir; |
32 | inherit sshConfig; | 34 | inherit sshConfig; |
@@ -52,8 +54,21 @@ in { | |||
52 | }; | 54 | }; |
53 | 55 | ||
54 | flake = mkOption { | 56 | flake = mkOption { |
55 | type = types.nullOr types.str; | 57 | type = types.submodule { |
56 | default = "git+ssh://${cfg.repoHost}/nixos?ref=flakes#${hostName}"; | 58 | options = { |
59 | flake = mkOption { | ||
60 | type = types.attrs; | ||
61 | }; | ||
62 | flakeOutput = mkOption { | ||
63 | type = types.str; | ||
64 | }; | ||
65 | name = mkOption { | ||
66 | type = types.str; | ||
67 | default = "machines"; | ||
68 | }; | ||
69 | }; | ||
70 | }; | ||
71 | default = { flake.url = "git+ssh://${cfg.repoHost}/nixos?ref=flakes"; flakeOutput = hostName; }; | ||
57 | description = '' | 72 | description = '' |
58 | The Flake URI of the NixOS configuration to build. | 73 | The Flake URI of the NixOS configuration to build. |
59 | ''; | 74 | ''; |
@@ -136,5 +151,12 @@ in { | |||
136 | Persistent = true; | 151 | Persistent = true; |
137 | }; | 152 | }; |
138 | }; | 153 | }; |
154 | |||
155 | nix.registry = lib.mkIf (cfg.flake != null) { | ||
156 | ${cfg.flake.name} = { | ||
157 | exact = false; | ||
158 | to = cfg.flake.flake; | ||
159 | }; | ||
160 | }; | ||
139 | }; | 161 | }; |
140 | } | 162 | } |
diff --git a/system-profiles/rebuild-machines/rebuild-machine.zsh b/system-profiles/rebuild-machines/rebuild-machine.zsh index c06ef0e4..e018e7a7 100644 --- a/system-profiles/rebuild-machines/rebuild-machine.zsh +++ b/system-profiles/rebuild-machines/rebuild-machine.zsh | |||
@@ -7,4 +7,4 @@ fi | |||
7 | export NIX_SSHOPTS="-F @sshConfig@" | 7 | export NIX_SSHOPTS="-F @sshConfig@" |
8 | export GIT_SSH_COMMAND="@openssh@/bin/ssh -F @sshConfig@" | 8 | export GIT_SSH_COMMAND="@openssh@/bin/ssh -F @sshConfig@" |
9 | export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="init.defaultBranch" GIT_CONFIG_VALUE_0=main | 9 | export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="init.defaultBranch" GIT_CONFIG_VALUE_0=main |
10 | exec -- @nixosRebuild@/bin/nixos-rebuild --refresh --flake '@flake@' ${@:-switch} | 10 | exec -- @nixosRebuild@/bin/nixos-rebuild --refresh --flake '@flake@#@flakeOutput@' ${@:-switch} |
diff --git a/user-profiles/core.nix b/user-profiles/core.nix index cb2c400e..cf5db3b6 100644 --- a/user-profiles/core.nix +++ b/user-profiles/core.nix | |||
@@ -1,14 +1,21 @@ | |||
1 | { flake, userName, lib, ... }: | 1 | { flake, userName, config, lib, utils, ... }: |
2 | { | 2 | { |
3 | users.users.${userName} = {}; # Just make sure the user is created | 3 | config = { |
4 | 4 | users.users.${userName} = {}; # Just make sure the user is created | |
5 | home-manager.users.${userName} = { | 5 | |
6 | imports = lib.attrValues flake.homeModules; | 6 | home-manager.users.${userName} = { |
7 | 7 | imports = lib.attrValues flake.homeModules; | |
8 | config = { | 8 | |
9 | manual.manpages.enable = true; | 9 | config = { |
10 | home.stateVersion = "20.09"; | 10 | manual.manpages.enable = true; |
11 | systemd.user.startServices = "sd-switch"; | 11 | home.stateVersion = "20.09"; |
12 | systemd.user.startServices = "sd-switch"; | ||
13 | |||
14 | }; | ||
15 | }; | ||
16 | |||
17 | systemd.services."home-manager-${utils.escapeSystemdPath userName}" = lib.mkIf config.home-manager.enableSystemd { | ||
18 | enable = false; # deploy with deploy-rs | ||
12 | }; | 19 | }; |
13 | }; | 20 | }; |
14 | } | 21 | } |