11 # To include additional plugins, pass them here as an overlay.
12 , packageOverrides ? self: super: { }
16 py = python3.override {
18 packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) (
21 # Due to flask > 2.3 the login will not work
23 werkzeug = super.werkzeug.overridePythonAttrs (oldAttrs: rec {
25 format = "setuptools";
29 hash = "sha256-LhzMlBfU2jWLnebxdOOsCUOR6h1PvvLWZ4ZdgZ39Cv4=";
32 flask = super.flask.overridePythonAttrs (oldAttrs: rec {
34 format = "setuptools";
38 hash = "sha256-7e6bCn/yZiG9WowQ/0hK4oc3okENmbC7mmhQx/uXeqA=";
42 netaddr = super.netaddr.overridePythonAttrs (oldAttrs: rec {
48 hash = "sha256-e0b6mxotcf1d6eSjeE7zOXAKU6CMgEDwi69fEZTaASg=";
57 octoprint-filecheck = self.buildPythonPackage rec {
58 pname = "OctoPrint-FileCheck";
59 version = "2021.2.23";
61 src = fetchFromGitHub {
63 repo = "OctoPrint-FileCheck";
65 sha256 = "sha256-e/QGEBa9+pjOdrZq3Zc6ifbSMClIyeTOi0Tji0YdVmI=";
75 octoprint-firmwarecheck = self.buildPythonPackage rec {
76 pname = "OctoPrint-FirmwareCheck";
77 version = "2021.10.11";
79 src = fetchFromGitHub {
81 repo = "OctoPrint-FirmwareCheck";
83 hash = "sha256-wqbD82bhJDrDawJ+X9kZkoA6eqGxqJc1Z5dA0EUwgEI=";
92 octoprint-pisupport = self.buildPythonPackage rec {
93 pname = "OctoPrint-PiSupport";
94 version = "2023.5.24";
95 format = "setuptools";
97 src = fetchFromGitHub {
99 repo = "OctoPrint-PiSupport";
101 hash = "sha256-KfkZXJ2f02G2ee+J1w+YQRKz+LSWwxVIIwmdevDGhew=";
104 # requires octoprint itself during tests
107 substituteInPlace octoprint_pi_support/__init__.py \
108 --replace /usr/bin/vcgencmd ${self.pkgs.libraspberrypi}/bin/vcgencmd
116 octoprint = self.buildPythonPackage rec {
120 src = fetchFromGitHub {
124 hash = "sha256-71uE8JvcS++xH8WSVWj5x0+9s3XIwf3A64c6YtxpSRc=";
127 propagatedBuildInputs = with self; [
151 octoprint-firmwarecheck
177 ] ++ lib.optionals stdenv.isDarwin [
179 ] ++ lib.optionals (!stdenv.isDarwin) [
183 nativeCheckInputs = with self; [
190 # substitute pip and let it find out, that it can't write anywhere
192 src = ./pip-path.patch;
193 pip = "${self.pip}/bin/pip";
196 # hardcore path to ffmpeg and hide related settings
198 src = ./ffmpeg-path.patch;
199 ffmpeg = "${pkgs.ffmpeg}/bin/ffmpeg";
205 ignoreVersionConstraints = [
225 ${lib.concatStringsSep "\n" (
228 ''-e 's@${e}[<>=]+.*@${e}",@g' \''
229 ) ignoreVersionConstraints
234 dontUseSetuptoolsCheck = true;
237 export HOME=$(mktemp -d)
242 "test_check_setup" # Why should it be able to call pip?
243 ] ++ lib.optionals stdenv.isDarwin [
244 "test_set_external_modification"
248 inherit (self) python;
249 updateScript = nix-update-script { };
251 plugins = (callPackage ./plugins.nix { }) super self;
252 inherit (nixosTests) octoprint;
257 homepage = "https://octoprint.org/";
258 description = "The snappy web interface for your 3D printer";
259 mainProgram = "octoprint";
260 license = licenses.agpl3Only;
261 maintainers = with maintainers; [ abbradar gebner WhittlesJr gador ];
266 (callPackage ./plugins.nix { })
272 with py.pkgs; toPythonApplication octoprint