1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

darwin: show CHANGELOG during activation

This commit is contained in:
Daiderd Jordan 2017-07-23 18:56:37 +02:00
parent 7845fd0423
commit b5e0b273c4
No known key found for this signature in database
GPG key ID: D02435D05B810C96
3 changed files with 34 additions and 1 deletions

16
CHANGELOG Normal file
View file

@ -0,0 +1,16 @@
2017-07-23
- darwin entry in default the nix.nixPath was removed
Use a channel for nix-darwin or configure nix.nixPath
sudo nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
sudo nix-channel --update
nix.nixPath =
[ "darwin=$HOME/.nix-defexpr/darwin"
"darwin-config=$HOME/.nixpkgs/darwin-configuration.nix"
"/nix/var/nix/profiles/per-user/root/channels"
];
2017-01-09
- nix.profile was renamed to nix.package

View file

@ -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 "CHANGELOG" >&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 "error: Changed <darwin-config> but target does not exist, aborting activation" >&2
@ -68,6 +81,7 @@ in
system.activationScripts.checks.text = ''
set +e
${darwinChanges}
${buildUsers}
${nixPath}

View file

@ -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