depot/third_party/home-manager/modules/services/plan9port.nix
Default email cfcd52ff70 Project import generated by Copybara.
GitOrigin-RevId: 70c5b268e10025c70823767f4fb49e240b40151d
2021-11-05 00:42:44 +08:00

38 lines
1 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.plan9port;
in {
meta.maintainers = [ maintainers.ehmry ];
options.services.plan9port = {
fontsrv.enable =
mkEnableOption "the Plan 9 file system access to host fonts";
plumber.enable =
mkEnableOption "the Plan 9 file system for interprocess messaging";
};
config = mkIf (cfg.fontsrv.enable || cfg.plumber.enable) {
assertions = [
(hm.assertions.assertPlatform "services.plan9port" pkgs platforms.linux)
];
systemd.user.services.fontsrv = mkIf cfg.fontsrv.enable {
Unit.Description = "the Plan 9 file system access to host fonts";
Install.WantedBy = [ "default.target" ];
Service.ExecStart = "${pkgs.plan9port}/bin/9 fontsrv";
};
systemd.user.services.plumber = mkIf cfg.plumber.enable {
Unit.Description = "file system for interprocess messaging";
Install.WantedBy = [ "default.target" ];
Service.ExecStart = "${pkgs.plan9port}/bin/9 plumber -f";
};
};
}