zaphyra's git: tgcNUR

fork of https://git.transgirl.cafe/zaphoid/tgc-nix-user-repository

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
{ tgcMaintainers, tgcFlake, ... }:
{
  config,
  pkgs,
  lib,
  ...
}:

let
  cfg = config.tgc.programs.nirius;

in
{

  meta.maintainers = [ tgcMaintainers.zaphyra ];

  options.tgc.programs.nirius = {
    enable = lib.mkEnableOption "Enable nirius - utility commands for the niri wayland compositor";
    package = lib.mkPackageOption tgcFlake.packages.${pkgs.system} "nirius" { };
  };

  config = lib.mkIf cfg.enable {
    home.packages = [ cfg.package ];

    systemd.user.services.niriusd = {
      Unit = {
        Description = "Nirius: utility commands for the niri wayland compositor";
        Documentation = "https://git.sr.ht/~tsdh/nirius";
        After = [
          "graphical-session-pre.target"
          "niri.service"
        ];
        PartOf = [ "graphical-session.target" ];
      };
      Service = {
        Restart = "on-failure";
        RestartSec = 5;
        ExecStart = lib.getExe' cfg.package "niriusd";
      };
      Install.WantedBy = [ "niri.service" ];
    };
  };

}