mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
darwin: show CHANGELOG during activation
This commit is contained in:
parent
7845fd0423
commit
b5e0b273c4
3 changed files with 34 additions and 1 deletions
16
CHANGELOG
Normal file
16
CHANGELOG
Normal 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
|
|
@ -3,6 +3,19 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
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 ''
|
buildUsers = optionalString config.services.nix-daemon.enable ''
|
||||||
buildUser=$(dscl . -read /Groups/nixbld GroupMembership 2>&1 | awk '/^GroupMembership: / {print $2}')
|
buildUser=$(dscl . -read /Groups/nixbld GroupMembership 2>&1 | awk '/^GroupMembership: / {print $2}')
|
||||||
if [ -z $buildUser ]; then
|
if [ -z $buildUser ]; then
|
||||||
|
@ -18,7 +31,7 @@ let
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nixPath = optionalString true ''
|
nixPath = ''
|
||||||
darwinConfig=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin-config>')
|
darwinConfig=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin-config>')
|
||||||
if ! test -e "$darwinConfig"; then
|
if ! test -e "$darwinConfig"; then
|
||||||
echo "[1;31merror: Changed <darwin-config> but target does not exist, aborting activation[0m" >&2
|
echo "[1;31merror: Changed <darwin-config> but target does not exist, aborting activation[0m" >&2
|
||||||
|
@ -68,6 +81,7 @@ in
|
||||||
system.activationScripts.checks.text = ''
|
system.activationScripts.checks.text = ''
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
|
${darwinChanges}
|
||||||
${buildUsers}
|
${buildUsers}
|
||||||
${nixPath}
|
${nixPath}
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,9 @@ in
|
||||||
|
|
||||||
systemConfig=$out
|
systemConfig=$out
|
||||||
|
|
||||||
|
mkdir -p $out/darwin
|
||||||
|
cp -f ${<darwin/CHANGELOG>} $out/darwin-changes
|
||||||
|
|
||||||
ln -s ${cfg.build.etc}/etc $out/etc
|
ln -s ${cfg.build.etc}/etc $out/etc
|
||||||
ln -s ${cfg.path} $out/sw
|
ln -s ${cfg.path} $out/sw
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue