nixos/klipper: Allow overriding the Klipper package

wip/nixpkgs-raku
Zhaofeng Li 3 years ago
parent 94536fd6e3
commit 11313bc65d
  1. 11
      nixos/modules/services/misc/klipper.nix

@ -2,7 +2,6 @@
with lib;
let
cfg = config.services.klipper;
package = pkgs.klipper;
format = pkgs.formats.ini { mkKeyValue = generators.mkKeyValueDefault {} ":"; };
in
{
@ -11,6 +10,12 @@ in
services.klipper = {
enable = mkEnableOption "Klipper, the 3D printer firmware";
package = mkOption {
type = types.package;
default = pkgs.klipper;
description = "The Klipper package.";
};
octoprintIntegration = mkOption {
type = types.bool;
default = false;
@ -74,10 +79,10 @@ in
after = [ "network.target" ];
serviceConfig = {
ExecStart = "${package}/lib/klipper/klippy.py --input-tty=/run/klipper/tty /etc/klipper.cfg";
ExecStart = "${cfg.package}/lib/klipper/klippy.py --input-tty=/run/klipper/tty /etc/klipper.cfg";
RuntimeDirectory = "klipper";
SupplementaryGroups = [ "dialout" ];
WorkingDirectory = "${package}/lib";
WorkingDirectory = "${cfg.package}/lib";
} // (if cfg.user != null then {
Group = cfg.group;
User = cfg.user;

Loading…
Cancel
Save