diff --git a/nixos/module.nix b/nixos/module.nix index fd439dcb8..35d7723f6 100644 --- a/nixos/module.nix +++ b/nixos/module.nix @@ -15,7 +15,6 @@ let mkPackageOption optionalString ; - arm = self.packages.${pkgs.system}.automatic-ripping-machine; json = pkgs.formats.json { }; ini = pkgs.formats.iniWithGlobalSection { }; cfg = config.services.automatic-ripping-machine; @@ -54,6 +53,8 @@ in handbrakePackage = mkPackageOption pkgs "handbrake" { }; + package = mkPackageOption self.packages.${pkgs.system} "automatic-ripping-machine" { }; + settings = mkOption { description = "Settings for ARM. Will be used to generate arm.yaml."; inherit (json) type; @@ -92,7 +93,7 @@ in HANDBRAKE_LOCAL = HANDBRAKE_CLI; DBFILE = "/var/lib/arm/arm.db"; LOGPATH = "/var/log/arm/"; - INSTALLPATH = "${arm}/lib/arm/"; + INSTALLPATH = "${cfg.package}/lib/arm/"; SKIP_TRANSCODE = !cfg.enableTranscoding; ABCDE_CONFIG_FILE = abcdeFile; APPRISE = mkIf (cfg.appriseSettings != { }) appriseFile; @@ -108,7 +109,7 @@ in groups.${cfg.group} = { }; }; - services.udev.packages = [ arm ]; + services.udev.packages = [ cfg.package ]; systemd = { services.armui = { @@ -138,7 +139,7 @@ in User = "arm"; Restart = "always"; RestartSec = "3"; - ExecStart = "${arm}/bin/armui"; + ExecStart = "${cfg.package}/bin/armui"; ProtectHome = true; ProtectSystem = "strict"; # Enforce read-only access for the entire system except for: StateDirectory = "arm"; # /var/lib/arm @@ -168,7 +169,7 @@ in serviceConfig = { User = "arm"; ExecStart = '' - ${arm}/bin/arm --no-syslog --devpath "%I" + ${cfg.package}/bin/arm --no-syslog --devpath "%I" ''; ProtectSystem = "strict"; ProtectHome = true; diff --git a/nixos/package.nix b/nixos/package.nix index ccc34545b..ce55c0f3f 100644 --- a/nixos/package.nix +++ b/nixos/package.nix @@ -59,7 +59,37 @@ python3Packages.buildPythonApplication { }" ]; + pythonRelaxDeps = [ + "alembic" + "apprise" + "bcrypt" + "discid" + "flask" + "flask-cors" + "flask-login" + "flask-migrate" + "flask-wtf" + "greenlet" + "idna" + "itsdangerous" + "jinja2" + "mako" + "markdown" + "markupsafe" + "prettytable" + "psutil" + "pyyaml" + "requests" + "sqlalchemy" + "urllib3" + "waitress" + "werkzeug" + "wtforms" + "xmltodict" + ]; + dependencies = with python3Packages; [ + pythonRelaxDepsHook psutil pyudev alembic