fixing permissions because of changes postUserActivation
This commit is contained in:
@ -11,6 +11,7 @@ with lib;
|
||||
let
|
||||
cfg = config.local.dock;
|
||||
inherit (pkgs) stdenv dockutil;
|
||||
user = "olaf";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
@ -77,17 +78,18 @@ in
|
||||
wantURIs = concatMapStrings (entry: "${entryURI entry.path}\n") cfg.entries;
|
||||
createEntries = concatMapStrings (
|
||||
entry:
|
||||
"if [ -e '${entry.path}' ]; then ${dockutil}/bin/dockutil --no-restart --add '${entry.path}' --section ${entry.section} ${entry.options} ; fi \n "
|
||||
"if [ -e '${entry.path}' ]; then ${dockutil}/bin/dockutil --no-restart --add '${entry.path}' --section ${entry.section} ${entry.options} /Users/${user} ; fi \n "
|
||||
) cfg.entries;
|
||||
in
|
||||
{
|
||||
system.activationScripts.postUserActivation.text = ''
|
||||
echo >&2 "Setting up the Dock..."
|
||||
haveURIs="$(${dockutil}/bin/dockutil --list | ${pkgs.coreutils}/bin/cut -f2)"
|
||||
if ! diff -wu <(echo -n "$haveURIs") <(echo -n '${wantURIs}') >&2 ; then
|
||||
system.activationScripts.postActivation.text = ''
|
||||
echo >&2 "Setting up the Dock for ${user}..."
|
||||
haveURIs="$(${dockutil}/bin/dockutil --list /Users/${user} | ${pkgs.coreutils}/bin/cut -f2)"
|
||||
|
||||
if ! diff -wu <(echo "$haveURIs") <(echo -n '${wantURIs}') >&2 ; then
|
||||
{
|
||||
echo >&2 "Resetting Dock."
|
||||
${dockutil}/bin/dockutil --no-restart --remove all
|
||||
${dockutil}/bin/dockutil --no-restart --remove all /Users/${user}
|
||||
${createEntries}
|
||||
killall Dock
|
||||
}
|
||||
|
Reference in New Issue
Block a user