mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
nixos/klipper: Remove automatic flashing option flashing.enable
This commit is contained in:
parent
2da038a900
commit
b391d98a71
@ -76,11 +76,9 @@ in
|
||||
type = with types; attrsOf
|
||||
(submodule {
|
||||
options = {
|
||||
flashing.enable = mkEnableOption ''
|
||||
automatic flashing of firmware to microcontroller
|
||||
|
||||
WARNING: Be careful with this option. Enabling this will automatically flash your microcontroller on e.g. nixos-rebuild.
|
||||
This can potentially brick your microcontroller. Alternatively, use `klipper-flash-$mcu` to flash manually.
|
||||
enable = mkEnableOption ''
|
||||
building of firmware and addition of klipper-flash tools for manual flashing.
|
||||
This will add `klipper-flash-$mcu` scripts to your environment which can be called to flash the firmware.
|
||||
'';
|
||||
configFile = mkOption {
|
||||
type = path;
|
||||
@ -143,15 +141,14 @@ in
|
||||
environment.systemPackages =
|
||||
with pkgs;
|
||||
let
|
||||
firmwares = mapAttrs
|
||||
(mcu: { flashing, configFile }: pkgs.klipper-firmware.override {
|
||||
flashDevice = if flashing.enable then cfg.settings."${mcu}".serial else null;
|
||||
firmwares = filterAttrs (n: v: v!= null) (mapAttrs
|
||||
(mcu: { enable, configFile }: if enable then pkgs.klipper-firmware.override {
|
||||
mcu = lib.strings.sanitizeDerivationName mcu;
|
||||
firmwareConfig = configFile;
|
||||
})
|
||||
cfg.firmwares;
|
||||
} else null)
|
||||
cfg.firmwares);
|
||||
firmwareFlasher = mapAttrsToList
|
||||
(mcu: firmware: pkgs.callPackage pkgs.klipper-flash.override {
|
||||
(mcu: firmware: pkgs.klipper-flash.override {
|
||||
mcu = lib.strings.sanitizeDerivationName mcu;
|
||||
klipper-firmware = firmware;
|
||||
flashDevice = cfg.settings."${mcu}".serial;
|
||||
|
@ -14,7 +14,6 @@
|
||||
, stm32flash
|
||||
, mcu ? "mcu"
|
||||
, firmwareConfig ? ./simulator.cfg
|
||||
, flashDevice ? null
|
||||
}: stdenv.mkDerivation rec {
|
||||
name = "klipper-firmware-${mcu}-${version}";
|
||||
version = klipper.version;
|
||||
@ -49,7 +48,7 @@
|
||||
mkdir -p $out
|
||||
cp ./.config $out/config
|
||||
cp -r out/* $out
|
||||
'' + lib.optionalString (flashDevice != null) "make FLASH_DEVICE=${toString flashDevice} OUT=$out/ KCONFIG_CONFIG=$out/config flash";
|
||||
'';
|
||||
|
||||
dontFixup = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user