From 24f92176fbfc68803657904c70a63340a0343a57 Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Mon, 14 Jul 2025 22:26:58 +0100 Subject: [PATCH] nixos/kryoflux: init --- nixos/modules/hardware/kryoflux.nix | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 nixos/modules/hardware/kryoflux.nix diff --git a/nixos/modules/hardware/kryoflux.nix b/nixos/modules/hardware/kryoflux.nix new file mode 100644 index 000000000000..fc46f2d0bbf4 --- /dev/null +++ b/nixos/modules/hardware/kryoflux.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.programs.kryoflux; + +in +{ + options.programs.kryoflux = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Enables kryoflux udev rules, ensures 'floppy' group exists. This is a + prerequisite to using devices supported by kryoflux without being root, + since kryoflux device descriptors will be owned by floppy through udev. + ''; + }; + package = lib.mkPackageOption pkgs "kryoflux" { }; + }; + + config = lib.mkIf cfg.enable { + services.udev.packages = [ cfg.package ]; + environment.systemPackages = [ cfg.package ]; + users.groups.floppy = { }; + }; + + meta.maintainers = with lib.maintainers; [ matthewcroughan ]; +}