aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorRoman Melnikov2023-06-05 14:59:10 +0800
committerGitHub2023-06-05 14:59:10 +0800
commit65211db63ba1199f09b4c9f27e5eba5ec50d76ac (patch)
tree0c1b42ffc901315b8ef1671a27d48309e4ec5448 /flake.nix
parentc80189917086e43d49eece2bd86f56813500a0eb (diff)
parent8ef5b948e308d809cb7882036007e0ef9743acc8 (diff)
Merge pull request #213 from serokell/rvem/darwin-activation
[#210] Add activation script for darwin system and provide a usage example
Diffstat (limited to '')
-rw-r--r--flake.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index 9e8bb4e..edfb6bd 100644
--- a/flake.nix
+++ b/flake.nix
@@ -106,6 +106,13 @@
home-manager = base: custom base.activationPackage "$PROFILE/activate";
+ # Activation script for 'darwinSystem' from nix-darwin.
+ # 'HOME=/var/root' is needed because 'sudo' on darwin doesn't change 'HOME' directory,
+ # while 'darwin-rebuild' (which is invoked under the hood) performs some nix-channel
+ # checks that rely on 'HOME'. As a result, if 'sshUser' is different from root,
+ # deployment may fail without explicit 'HOME' redefinition.
+ darwin = base: custom base.config.system.build.toplevel "HOME=/var/root $PROFILE/activate";
+
noop = base: custom base ":";
};