From 7aa390883104725c64c65d20a0713cfcd654f637 Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Tue, 21 Oct 2025 10:38:26 -0500 Subject: More correct dfu-util flash script + rearranged personal devices --- modules/klipper.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 modules/klipper.nix (limited to 'modules/klipper.nix') diff --git a/modules/klipper.nix b/modules/klipper.nix new file mode 100644 index 0000000..2782bcd --- /dev/null +++ b/modules/klipper.nix @@ -0,0 +1,42 @@ +{ + lib, + pkgs, + config, + ... +}: +let + inherit (lib) mkOption mkIf mkPackageOption types; +in { + options = { + type = mkOption { + type = types.enum [ "klipper" ]; + }; + + klipper = { + klipper-firmware = mkPackageOption pkgs "klipper-firmware" {}; + + mcu = mkOption { + type = types.str; + }; + + firmwareConfig = mkOption { + type = types.path; + }; + + build = { + bin = mkOption { + type = types.path; + default = "${config.klipper.klipper-firmware.override { + inherit (config.klipper) mcu firmwareConfig; + }}/klipper.bin"; + }; + flash = mkOption { + type = types.functionTo <| types.either types.str types.package; + }; + }; + }; + }; + + config = mkIf (config.type == "klipper") { + }; +} -- cgit v1.2.3