about summary refs log tree commit diff
path: root/pkgs/servers/klipper/klipper-genconf.nix
blob: 52c0d1e14216952b407b0c5c11723462a6c90cd9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ writeShellApplication
, klipper
, python2
, gnumake
, pkgsCross
}: writeShellApplication {
  name = "klipper-genconf";
  runtimeInputs = [
    python2
    pkgsCross.avr.stdenv.cc
  ];
  text = ''
    CURRENT_DIR=$(pwd)
    TMP=$(mktemp -d)
    pushd ${klipper.src}
    ${gnumake}/bin/make OUT="$TMP" KCONFIG_CONFIG="$CURRENT_DIR/config" menuconfig
    popd
    rm -rf "$TMP" config.old
    printf "\nYour firmware configuration for klipper:\n\n"
    cat config
  '';
}