mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
Add options to support more flexible module configurations. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
41 lines
1.1 KiB
Nix
41 lines
1.1 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
|
|
cfg = config.services.plan9port;
|
|
|
|
in
|
|
{
|
|
meta.maintainers = [ lib.maintainers.ehmry ];
|
|
|
|
options.services.plan9port = {
|
|
package = lib.mkPackageOption pkgs "plan9port" { };
|
|
|
|
fontsrv.enable = lib.mkEnableOption "the Plan 9 file system access to host fonts";
|
|
plumber.enable = lib.mkEnableOption "the Plan 9 file system for interprocess messaging";
|
|
};
|
|
|
|
config = lib.mkIf (cfg.fontsrv.enable || cfg.plumber.enable) {
|
|
assertions = [
|
|
(lib.hm.assertions.assertPlatform "services.plan9port" pkgs lib.platforms.linux)
|
|
];
|
|
|
|
systemd.user.services.fontsrv = lib.mkIf cfg.fontsrv.enable {
|
|
Unit.Description = "the Plan 9 file system access to host fonts";
|
|
Install.WantedBy = [ "default.target" ];
|
|
Service.ExecStart = "${lib.getExe' cfg.package "9"} fontsrv";
|
|
};
|
|
|
|
systemd.user.services.plumber = lib.mkIf cfg.plumber.enable {
|
|
Unit.Description = "file system for interprocess messaging";
|
|
Install.WantedBy = [ "default.target" ];
|
|
Service.ExecStart = "${lib.getExe' cfg.package "9"} plumber -f";
|
|
};
|
|
|
|
};
|
|
|
|
}
|