Commit f827f7ad authored by nikstur's avatar nikstur
Browse files

nixos/wrappers: replace activationScript

Create the wrappers via a separate systemd service.
parent f0154409
Loading
Loading
Loading
Loading
+31 −26
Original line number Diff line number Diff line
@@ -275,10 +275,14 @@ in
      mrpx ${wrap.source},
    '') wrappers;

    ###### wrappers activation script
    system.activationScripts.wrappers =
      lib.stringAfter [ "specialfs" "users" ]
        ''
    systemd.services.suid-sgid-wrappers = {
      description = "Create SUID/SGID Wrappers";
      wantedBy = [ "sysinit.target" ];
      before = [ "sysinit.target" ];
      unitConfig.DefaultDependencies = false;
      unitConfig.RequiresMountsFor = [ "/nix/store" "/run/wrappers" ];
      serviceConfig.Type = "oneshot";
      script = ''
        chmod 755 "${parentWrapperDir}"

        # We want to place the tmpdirs for the wrappers to the parent dir.
@@ -302,6 +306,7 @@ in
          ln --symbolic "$wrapperDir" "${wrapperDir}"
        fi
      '';
    };

    ###### wrappers consistency checks
    system.checks = lib.singleton (pkgs.runCommandLocal