users: make the service manager partly configurable
This commit is contained in:
@@ -153,6 +153,13 @@ let
|
|||||||
services to define for this user.
|
services to define for this user.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
serviceManager = mkOption {
|
||||||
|
type = types.nullOr (types.enum [ "s6" ]);
|
||||||
|
default = "s6";
|
||||||
|
description = ''
|
||||||
|
which service manager to plumb `services` into.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
userModule = let
|
userModule = let
|
||||||
nixConfig = config;
|
nixConfig = config;
|
||||||
|
@@ -325,7 +325,7 @@ in
|
|||||||
xdg_runtime_dir = "/run/user/${name}";
|
xdg_runtime_dir = "/run/user/${name}";
|
||||||
scanDir = mkScanDir "${xdg_runtime_dir}/s6/live" compiled;
|
scanDir = mkScanDir "${xdg_runtime_dir}/s6/live" compiled;
|
||||||
liveDir = mkLiveDir compiled;
|
liveDir = mkLiveDir compiled;
|
||||||
in {
|
in lib.mkIf (config.serviceManager == "s6") {
|
||||||
fs.".config/s6/live".symlink.target = liveDir;
|
fs.".config/s6/live".symlink.target = liveDir;
|
||||||
fs.".config/s6/scandir".symlink.target = scanDir;
|
fs.".config/s6/scandir".symlink.target = scanDir;
|
||||||
fs.".config/s6/compiled".symlink.target = compiled;
|
fs.".config/s6/compiled".symlink.target = compiled;
|
||||||
|
Reference in New Issue
Block a user