Unverified Commit 999004c3 authored by Will Fancher's avatar Will Fancher Committed by GitHub
Browse files

nixos/systemd: allow disabling the path default for services (#482045)

parents 65f95e89 1312b27c
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -688,16 +688,18 @@ rec {
      };
    };

  stage2ServiceConfig = {
  stage2ServiceConfig =
    { config, ... }:
    {
      imports = [ serviceConfig ];
      # Default path for systemd services. Should be quite minimal.
    config.path = mkAfter [
      config.path = mkIf config.enableDefaultPath (mkAfter [
        pkgs.coreutils
        pkgs.findutils
        pkgs.gnugrep
        pkgs.gnused
        systemd
    ];
      ]);
    };

  stage1ServiceConfig = serviceConfig;
+8 −0
Original line number Diff line number Diff line
@@ -379,6 +379,14 @@ rec {
          '';
        };

        enableDefaultPath = mkOption {
          default = true;
          type = types.bool;
          description = ''
            Whether to append a minimal default {env}`PATH` environment variable to the service, containing common system utilities.
          '';
        };

        serviceConfig = mkOption {
          default = { };
          example = {