modules: add octoprint module with plugins

This commit is contained in:
Dmitriy Pleshevskiy 2023-12-05 12:43:57 +03:00
parent fbf4dc244e
commit fa670d7289
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985
3 changed files with 60 additions and 5 deletions

View file

@ -84,9 +84,5 @@
services.languagetool.enable = true; services.languagetool.enable = true;
# 3D printing # 3D printing
services.octoprint = { local.octoprint.enable = true;
enable = true;
port = 33002;
plugins = ps: [ ps.stlviewer ];
};
} }

View file

@ -43,6 +43,7 @@ in
extraModules = [ extraModules = [
hardware.common-cpu-intel hardware.common-cpu-intel
../modules/nix.nix ../modules/nix.nix
../modules/octoprint.nix
../modules/wireguard-client.nix ../modules/wireguard-client.nix
../../home/users/jan ../../home/users/jan
# ../../home/users/nas # ../../home/users/nas

View file

@ -0,0 +1,58 @@
{ lib, pkgs, config, ... }:
let
cfg = config.local.octoprint;
in
{
options.local.octoprint = with lib; {
enable = mkEnableOption "octoprint";
};
config = lib.mkIf cfg.enable {
services.octoprint = {
enable = true;
port = 33002;
plugins = ps:
let
octoprintDisplayLayerProgress = ps.buildPlugin rec {
pname = "DisplayLayerProgress";
version = "1.28.0";
src = pkgs.fetchFromGitHub {
owner = "OllisGit";
repo = "OctoPrint-DisplayLayerProgress";
rev = version;
sha256 = "sha256-FoQGv7a3ktodyQKOwR69/9Up+wPoW5NDq+k5LfP9WYs=";
};
};
octoprintDashboard = ps.buildPlugin rec {
pname = "Dashboard";
version = "1.19.10";
src = pkgs.fetchFromGitHub {
owner = "j7126";
repo = "OctoPrint-Dashboard";
rev = version;
sha256 = "sha256-d3HtSgJ9d6k7+F86aDuhq31jWZHdNxncFcK6MYPgUKo=";
};
};
octoprintBedLevelVisualizer = ps.buildPlugin rec {
pname = "BedLevelVisualizer";
version = "1.1.1";
src = pkgs.fetchFromGitHub {
owner = "jneilliii";
repo = "OctoPrint-BedLevelVisualizer";
rev = version;
sha256 = "sha256-6JcYvYgEmphp5zz4xZi4G0yTo4FCIR6Yh+MXYK7H7+w=";
};
};
in
[
octoprintDisplayLayerProgress
octoprintDashboard
octoprintBedLevelVisualizer
];
};
};
}