nixos/iio-niri: move from programs to services/misc
The module was wrongly put in programs following PR #454551 and we didn't catch it during review. This commit fixes that issue so the path is compliant to the guidelines.
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
types
|
||||
mkIf
|
||||
getExe
|
||||
escapeShellArgs
|
||||
mkDefault
|
||||
;
|
||||
cfg = config.services.iio-niri;
|
||||
in
|
||||
{
|
||||
options.services.iio-niri = {
|
||||
enable = mkEnableOption "IIO-Niri";
|
||||
|
||||
package = mkPackageOption pkgs "iio-niri" { };
|
||||
|
||||
niriUnit = mkOption {
|
||||
type = types.nonEmptyStr;
|
||||
default = "niri.service";
|
||||
description = "The Niri **user** service unit to bind IIO-Niri's **user** service unit to.";
|
||||
};
|
||||
|
||||
extraArgs = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = "Extra arguments to pass to IIO-Niri.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hardware.sensor.iio.enable = mkDefault true;
|
||||
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
systemd.user.services.iio-niri = {
|
||||
description = "IIO-Niri";
|
||||
wantedBy = [ cfg.niriUnit ];
|
||||
bindsTo = [ cfg.niriUnit ];
|
||||
partOf = [ cfg.niriUnit ];
|
||||
after = [ cfg.niriUnit ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${getExe cfg.package} ${escapeShellArgs cfg.extraArgs}";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ zhaithizaliel ];
|
||||
}
|
||||
Reference in New Issue
Block a user