fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert HelgessonMove platform check into modules5f433eb1

master
1.0 KiB38 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.services.plan9port;
8
9in {
10  meta.maintainers = [ maintainers.ehmry ];
11
12  options.services.plan9port = {
13    fontsrv.enable =
14      mkEnableOption "the Plan 9 file system access to host fonts";
15    plumber.enable =
16      mkEnableOption "the Plan 9 file system for interprocess messaging";
17  };
18
19  config = mkIf (cfg.fontsrv.enable || cfg.plumber.enable) {
20    assertions = [
21      (hm.assertions.assertPlatform "services.plan9port" pkgs platforms.linux)
22    ];
23
24    systemd.user.services.fontsrv = mkIf cfg.fontsrv.enable {
25      Unit.Description = "the Plan 9 file system access to host fonts";
26      Install.WantedBy = [ "default.target" ];
27      Service.ExecStart = "${pkgs.plan9port}/bin/9 fontsrv";
28    };
29
30    systemd.user.services.plumber = mkIf cfg.plumber.enable {
31      Unit.Description = "file system for interprocess messaging";
32      Install.WantedBy = [ "default.target" ];
33      Service.ExecStart = "${pkgs.plan9port}/bin/9 plumber -f";
34    };
35
36  };
37
38}