diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2017-07-23 18:56:37 +0200 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2017-07-23 18:56:37 +0200 |
| commit | b5e0b273c4cf12842a7cfee0fc4b0bdabf74ce7c (patch) | |
| tree | cfa0a742e16f9aab81b408a5536661b9c71d2f44 /modules/system | |
| parent | 7845fd042311f3bc8203f0e97cd77a07ff05f656 (diff) | |
darwin: show CHANGELOG during activation
Diffstat (limited to 'modules/system')
| -rw-r--r-- | modules/system/activation-checks.nix | 16 | ||||
| -rw-r--r-- | modules/system/default.nix | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/modules/system/activation-checks.nix b/modules/system/activation-checks.nix index 2289ace..dc8e51a 100644 --- a/modules/system/activation-checks.nix +++ b/modules/system/activation-checks.nix @@ -3,6 +3,19 @@ with lib; let + darwinChanges = '' + if test -e /run/current-system/darwin-changes; then + darwinChanges=$(grep -v -f /run/current-system/darwin-changes $systemConfig/darwin-changes 2> /dev/null) + if test -n "$darwinChanges"; then + echo >&2 + echo "[1;1mCHANGELOG[0m" >&2 + echo >&2 + echo "$darwinChanges" >&2 + echo >&2 + fi + fi + ''; + buildUsers = optionalString config.services.nix-daemon.enable '' buildUser=$(dscl . -read /Groups/nixbld GroupMembership 2>&1 | awk '/^GroupMembership: / {print $2}') if [ -z $buildUser ]; then @@ -18,7 +31,7 @@ let fi ''; - nixPath = optionalString true '' + nixPath = '' darwinConfig=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin-config>') if ! test -e "$darwinConfig"; then echo "[1;31merror: Changed <darwin-config> but target does not exist, aborting activation[0m" >&2 @@ -68,6 +81,7 @@ in system.activationScripts.checks.text = '' set +e + ${darwinChanges} ${buildUsers} ${nixPath} diff --git a/modules/system/default.nix b/modules/system/default.nix index 2710777..1cc0290 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -87,6 +87,9 @@ in systemConfig=$out + mkdir -p $out/darwin + cp -f ${<darwin/CHANGELOG>} $out/darwin-changes + ln -s ${cfg.build.etc}/etc $out/etc ln -s ${cfg.path} $out/sw |
