1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 02:37:09 +00:00

system: cleanup patches activation

This commit is contained in:
Daiderd Jordan 2020-05-29 22:54:25 +02:00
parent 77121650d4
commit f55568ea4e
No known key found for this signature in database
GPG key ID: D02435D05B810C96
2 changed files with 13 additions and 7 deletions

View file

@ -3,6 +3,8 @@
{
# imports = [ ~/.config/nixpkgs/darwin/local-configuration.nix ];
# system.patches = [ ./pam.patch ];
system.defaults.NSGlobalDomain.AppleKeyboardUIMode = 3;
system.defaults.NSGlobalDomain.ApplePressAndHoldEnabled = false;
system.defaults.NSGlobalDomain.InitialKeyRepeat = 10;

View file

@ -50,14 +50,18 @@ in
# Applying patches to /.
echo "applying patches..." >&2
f=$(readlink /run/current-system/patches)
if ! test "$f" = ${config.system.build.patches}/patches; then
for f in $(find /run/current-system/patches/ -type l); do
patch --reverse --backup -d / -p1 < "$f" >/dev/null || true
done
for f in $(ls /run/current-system/patches 2> /dev/null); do
if test ! -e "${config.system.build.patches}/patches/$f"; then
patch --reverse --backup -d / -p1 < "/run/current-system/patches/$f" || true
fi
done
${concatMapStringsSep "\n" (f: "patch --forward --backup -d / -p1 < '${f}' || true") cfg.patches}
fi
${concatMapStringsSep "\n" (f: ''
f="$(basename ${f})"
if ! diff "${cfg.build.patches}/patches/$f" "/run/current-system/patches/$f" &> /dev/null; then
patch --forward --backup -d / -p1 < '${f}' || true
fi
'') cfg.patches}
'';
};