]> git.scottworley.com Git - auto-upgrade-with-pinch/blobdiff - modules/auto-upgrade.nix
Absolute path to sudo
[auto-upgrade-with-pinch] / modules / auto-upgrade.nix
index cc98ad07d36103481ffcfd8b1861618a68e51b08..8bf21aaaf988c5d3b0b5d6648ca403785276d05f 100644 (file)
@@ -3,7 +3,7 @@ with lib;
 let
   cfg = config.system.autoUpgradeWithPinch;
   auto-upgrade-script = pkgs.writeShellScript "auto-upgrade" ''
-    flock /run/auto-upgrade-with-pinch ${
+    ${pkgs.utillinux}/bin/flock /run/auto-upgrade-with-pinch ${
       pkgs.writeShellScript "auto-upgrade-with-lock-held" ''
         set -e
 
@@ -18,7 +18,7 @@ let
         as_user() {
           ${
             if cfg.userEnvironment.enable then ''
-              sudo -u ${escapeShellArg cfg.userEnvironment.user} "$@"
+              /run/wrappers/bin/sudo -u ${escapeShellArg cfg.userEnvironment.user} "$@"
             '' else ''
               :
             ''
@@ -137,7 +137,7 @@ in {
       (import ../overlays/pinch.nix)
       (self: super: {
         auto-upgrade = super.writeShellScriptBin "auto-upgrade" ''
-          sudo ${auto-upgrade-script}
+          /run/wrappers/bin/sudo ${auto-upgrade-script}
         '';
       })
     ];