mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 01:24:09 +01:00
nixos/systemd: allow disabling the path default for services (#482045)
This commit is contained in:
commit
999004c3c9
2 changed files with 21 additions and 11 deletions
|
|
@ -688,17 +688,19 @@ rec {
|
|||
};
|
||||
};
|
||||
|
||||
stage2ServiceConfig = {
|
||||
imports = [ serviceConfig ];
|
||||
# Default path for systemd services. Should be quite minimal.
|
||||
config.path = mkAfter [
|
||||
pkgs.coreutils
|
||||
pkgs.findutils
|
||||
pkgs.gnugrep
|
||||
pkgs.gnused
|
||||
systemd
|
||||
];
|
||||
};
|
||||
stage2ServiceConfig =
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [ serviceConfig ];
|
||||
# Default path for systemd services. Should be quite minimal.
|
||||
config.path = mkIf config.enableDefaultPath (mkAfter [
|
||||
pkgs.coreutils
|
||||
pkgs.findutils
|
||||
pkgs.gnugrep
|
||||
pkgs.gnused
|
||||
systemd
|
||||
]);
|
||||
};
|
||||
|
||||
stage1ServiceConfig = serviceConfig;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue