diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 37e90232da2a..a191318a7022 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -90,6 +90,7 @@ ./programs/criu.nix ./programs/dconf.nix ./programs/digitalbitbox/default.nix + ./programs/dmrconfig.nix ./programs/environment.nix ./programs/firejail.nix ./programs/fish.nix diff --git a/nixos/modules/programs/dmrconfig.nix b/nixos/modules/programs/dmrconfig.nix new file mode 100644 index 000000000000..e48a4f318370 --- /dev/null +++ b/nixos/modules/programs/dmrconfig.nix @@ -0,0 +1,38 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.programs.dmrconfig; + +in { + meta.maintainers = [ maintainers.etu ]; + + ###### interface + options = { + programs.dmrconfig = { + enable = mkOption { + default = false; + type = types.bool; + description = '' + Whether to configure system to enable use of dmrconfig. This + enables the required udev rules and installs the program. + ''; + relatedPackages = [ "dmrconfig" ]; + }; + + package = mkOption { + default = pkgs.dmrconfig; + type = types.package; + defaultText = "pkgs.dmrconfig"; + description = "dmrconfig derivation to use"; + }; + }; + }; + + ###### implementation + config = mkIf cfg.enable { + environment.systemPackages = [ cfg.package ]; + services.udev.packages = [ cfg.package ]; + }; +}