From 299e01722f9f8ac0b54aad2310e0fedae10beaaf Mon Sep 17 00:00:00 2001 From: Olli Helenius Date: Fri, 29 Jun 2018 13:14:35 +0300 Subject: [PATCH] Add support for systemd path units --- modules/systemd.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index 16939ad2..74490691 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -11,7 +11,8 @@ let enabled = cfg.services != {} || cfg.sockets != {} || cfg.targets != {} - || cfg.timers != {}; + || cfg.timers != {} + || cfg.paths != {}; toSystemdIni = generators.toINI { mkKeyValue = key: value: @@ -108,6 +109,15 @@ in ''; }; + paths = mkOption { + default = {}; + type = attrsRecursivelyMerged; + description = '' + Definition of systemd per-user path units. Attributes are + merged recursively. + ''; + }; + startServices = mkOption { default = false; type = types.bool; @@ -138,7 +148,7 @@ in let names = concatStringsSep ", " ( attrNames ( - cfg.services // cfg.sockets // cfg.targets // cfg.timers + cfg.services // cfg.sockets // cfg.targets // cfg.timers // cfg.paths ) ); in @@ -159,6 +169,8 @@ in (buildServices "target" cfg.targets) ++ (buildServices "timer" cfg.timers) + ++ + (buildServices "path" cfg.paths) ); # Run systemd service reload if user is logged in. If we're