From 0eb60a668cf750755e7919ad272008d32dd75edb Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 26 Jun 2024 11:23:36 +0300 Subject: [PATCH] Paper : Rollback to stable. --- container/Cloud.nix | 1 - container/Paper.nix | 5 ++--- flake.nix | 4 ++-- lib/Util.nix | 8 ++++---- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/container/Cloud.nix b/container/Cloud.nix index e0cf6c8..84db157 100644 --- a/container/Cloud.nix +++ b/container/Cloud.nix @@ -40,7 +40,6 @@ in { }; config = { config, ... }: container.mkContainerConfig cfg { - environment.systemPackages = [ pkgs.postgresql ]; services.nextcloud = { enable = true; # package = pkgs.nextcloud29; diff --git a/container/Paper.nix b/container/Paper.nix index 6ee42bf..f0602cf 100644 --- a/container/Paper.nix +++ b/container/Paper.nix @@ -1,4 +1,4 @@ -{ container, pkgs, util, lib, config, ... }: with lib; let +{ container, pkgs, pkgsStable, lib, config, ... }: with lib; let cfg = config.container.module.paper; in { options = { @@ -41,14 +41,13 @@ in { }; config = { lib, ... }: container.mkContainerConfig cfg { - environment.systemPackages = with pkgs; [ postgresql inetutils ]; - services.paperless = { enable = true; dataDir = "/var/lib/paperless"; # address = cfg.domain; address = "0.0.0.0"; port = cfg.port; + package = pkgsStable.paperless-ngx; passwordFile = pkgs.writeText "PaperlessPassword" "root"; settings = { PAPERLESS_URL = "https://${cfg.domain}"; diff --git a/flake.nix b/flake.nix index 2749f7b..e91a1f5 100644 --- a/flake.nix +++ b/flake.nix @@ -191,7 +191,7 @@ secret = import ./secret {}; # Secrets (public keys). container = import ./lib/Container.nix { inherit lib pkgs config; inherit (self) const; }; # Container utils. - util = import ./lib/Util.nix { inherit pkgs lib; }; # Util functions. + util = import ./lib/Util.nix { inherit lib; }; # Util functions. in { flake = self; @@ -267,7 +267,7 @@ flake = self; # This Flake itself. inputs = inputs; # Our dependencies. secret = import ./lib/Secret.nix {}; # Secrets (public keys). - util = import ./lib/Util.nix { inherit pkgs lib; }; # Util functions. + util = import ./lib/Util.nix { inherit lib; }; # Util functions. }; }; }; diff --git a/lib/Util.nix b/lib/Util.nix index 591cf5c..378f897 100644 --- a/lib/Util.nix +++ b/lib/Util.nix @@ -1,12 +1,12 @@ # Collection of common functions. -{ pkgs, lib, ... }: rec { +{ lib }: rec { # Remove tabs indentation, trimTabs = text: let - shouldStripTab = lines: builtins.all (line: (line == "") || (pkgs.lib.strings.hasPrefix " " line)) lines; - stripTab = lines: builtins.map (line: pkgs.lib.strings.removePrefix " " line) lines; + shouldStripTab = lines: builtins.all (line: (line == "") || (lib.strings.hasPrefix " " line)) lines; + stripTab = lines: builtins.map (line: lib.strings.removePrefix " " line) lines; stripTabs = lines: if (shouldStripTab lines) then (stripTabs (stripTab lines)) else lines; in - builtins.concatStringsSep "\n" (stripTabs (pkgs.lib.strings.splitString "\n" text)); + builtins.concatStringsSep "\n" (stripTabs (lib.strings.splitString "\n" text)); # List all files in a dir. ls = path: map (f: "${path}/${f}") (builtins.attrNames (builtins.readDir path));