nixos/iio-niri: init module
This commit is contained in:
@@ -166,6 +166,8 @@ In addition to numerous new and upgraded packages, this release has the followin
|
||||
|
||||
- [twingate](https://docs.twingate.com/docs/linux), a high performance, easy to use zero trust solution that enables access to private resources from any device with better security than a VPN.
|
||||
|
||||
- [iio-niri](https://github.com/Zhaith-Izaliel/iio-niri), a utils that listens to `iio-sensor-proxy` and updates Niri output orientation depending on the accelerometer orientation.
|
||||
|
||||
## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
|
||||
|
||||
- The NixOS VM test framework, `pkgs.nixosTest`/`make-test-python.nix` (`pkgs.testers.nixosTest` since 22.05), now requires detaching commands such as `succeed("foo &")` and `succeed("foo | xclip -i")` to close stdout.
|
||||
|
||||
@@ -240,6 +240,7 @@
|
||||
./programs/iay.nix
|
||||
./programs/iftop.nix
|
||||
./programs/iio-hyprland.nix
|
||||
./programs/iio-niri.nix
|
||||
./programs/immersed.nix
|
||||
./programs/iotop.nix
|
||||
./programs/java.nix
|
||||
|
||||
59
nixos/modules/programs/iio-niri.nix
Normal file
59
nixos/modules/programs/iio-niri.nix
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
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