Compare commits
4 commits
19120bca29
...
dec5dabf02
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | dec5dabf02 | ||
Bruno BELANYI | b2d2ff1798 | ||
Bruno BELANYI | c5a375d165 | ||
Bruno BELANYI | cb5eb68d35 |
60
flake.lock
60
flake.lock
|
@ -73,11 +73,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730504689,
|
"lastModified": 1733312601,
|
||||||
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
|
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
|
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -136,11 +136,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733175814,
|
"lastModified": 1733873195,
|
||||||
"narHash": "sha256-zFOtOaqjzZfPMsm1mwu98syv3y+jziAq5DfWygaMtLg=",
|
"narHash": "sha256-dTosiZ3sZ/NKoLKQ++v8nZdEHya0eTNEsaizNp+MUPM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "bf23fe41082aa0289c209169302afd3397092f22",
|
"rev": "f26aa4b76fb7606127032d33ac73d7d507d82758",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -152,11 +152,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733015953,
|
"lastModified": 1733759999,
|
||||||
"narHash": "sha256-t4BBVpwG9B4hLgc6GUBuj3cjU7lP/PJfpTHuSqE+crk=",
|
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "ac35b104800bff9028425fec3b6e8a41de2bbfff",
|
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -167,12 +167,21 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": [
|
||||||
|
"flake-parts"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733215745,
|
"lastModified": 1733873876,
|
||||||
"narHash": "sha256-RIlhnKlObJ1sEdzBP6Nuy4jLUiQnmWWXVsRHRbv6SzY=",
|
"narHash": "sha256-6YHWh0+E74hBiH0N+LeZPSWRvbmudF6mtEtFpRo3LWc=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "251d756a74e67bda25d89327b01a3da19dddabae",
|
"rev": "77c8486c65517272727884ca62b9322092f4f643",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -194,11 +203,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732021966,
|
"lastModified": 1733665616,
|
||||||
"narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=",
|
"narHash": "sha256-+XTFXYlFJBxohhMGLDpYdEnhUNdxN8dyTA8WAd+lh2A=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
|
"rev": "d8c02f0ffef0ef39f6063731fc539d8c71eb463a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -235,6 +244,27 @@
|
||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nur",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1733222881,
|
||||||
|
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
@ -55,6 +55,10 @@
|
||||||
owner = "nix-community";
|
owner = "nix-community";
|
||||||
repo = "NUR";
|
repo = "NUR";
|
||||||
ref = "master";
|
ref = "master";
|
||||||
|
inputs = {
|
||||||
|
flake-parts.follows = "flake-parts";
|
||||||
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
pre-commit-hooks = {
|
pre-commit-hooks = {
|
||||||
|
|
|
@ -25,7 +25,7 @@ let
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
||||||
overlays = (lib.attrValues self.overlays) ++ [
|
overlays = (lib.attrValues self.overlays) ++ [
|
||||||
inputs.nur.overlay
|
inputs.nur.overlays.default
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ let
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = (lib.attrValues self.overlays) ++ [
|
nixpkgs.overlays = (lib.attrValues self.overlays) ++ [
|
||||||
inputs.nur.overlay
|
inputs.nur.overlays.default
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
# Include generic settings
|
# Include generic settings
|
||||||
|
|
|
@ -61,11 +61,6 @@ in
|
||||||
PAPERLESS_ENABLE_HTTP_REMOTE_USER = true;
|
PAPERLESS_ENABLE_HTTP_REMOTE_USER = true;
|
||||||
PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME = "HTTP_X_USER";
|
PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME = "HTTP_X_USER";
|
||||||
|
|
||||||
# Use PostgreSQL
|
|
||||||
PAPERLESS_DBHOST = "/run/postgresql";
|
|
||||||
PAPERLESS_DBUSER = "paperless";
|
|
||||||
PAPERLESS_DBNAME = "paperless";
|
|
||||||
|
|
||||||
# Security settings
|
# Security settings
|
||||||
PAPERLESS_ALLOWED_HOSTS = paperlessDomain;
|
PAPERLESS_ALLOWED_HOSTS = paperlessDomain;
|
||||||
PAPERLESS_CORS_ALLOWED_HOSTS = "https://${paperlessDomain}";
|
PAPERLESS_CORS_ALLOWED_HOSTS = "https://${paperlessDomain}";
|
||||||
|
@ -87,40 +82,11 @@ in
|
||||||
|
|
||||||
# Secret key
|
# Secret key
|
||||||
environmentFile = cfg.secretKeyFile;
|
environmentFile = cfg.secretKeyFile;
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services = {
|
# Automatic PostgreSQL provisioning
|
||||||
paperless-scheduler = {
|
database = {
|
||||||
requires = [ "postgresql.service" ];
|
createLocally = true;
|
||||||
after = [ "postgresql.service" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
paperless-consumer = {
|
|
||||||
requires = [ "postgresql.service" ];
|
|
||||||
after = [ "postgresql.service" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
paperless-web = {
|
|
||||||
requires = [ "postgresql.service" ];
|
|
||||||
after = [ "postgresql.service" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
paperless-task-queue = {
|
|
||||||
requires = [ "postgresql.service" ];
|
|
||||||
after = [ "postgresql.service" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Set-up database
|
|
||||||
services.postgresql = {
|
|
||||||
enable = true;
|
|
||||||
ensureDatabases = [ "paperless" ];
|
|
||||||
ensureUsers = [
|
|
||||||
{
|
|
||||||
name = "paperless";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Set-up media group
|
# Set-up media group
|
||||||
|
|
|
@ -14,7 +14,7 @@ in
|
||||||
# Let other services enable postgres when they need it
|
# Let other services enable postgres when they need it
|
||||||
(lib.mkIf cfg.enable {
|
(lib.mkIf cfg.enable {
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
package = pkgs.postgresql_13;
|
package = pkgs.postgresql_17;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -23,15 +23,15 @@ in
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
let
|
let
|
||||||
pgCfg = config.services.postgresql;
|
pgCfg = config.services.postgresql;
|
||||||
newPackage' = pkgs.postgresql_13;
|
newPackage' = pkgs.postgresql_17;
|
||||||
|
|
||||||
oldPackage = if pgCfg.enableJIT then pgCfg.package.withJIT else pgCfg.package;
|
oldPackage = if pgCfg.enableJIT then pgCfg.package.withJIT else pgCfg.package;
|
||||||
oldData = pgCfg.dataDir;
|
oldData = pgCfg.dataDir;
|
||||||
oldBin = "${if pgCfg.extraPlugins == [] then oldPackage else oldPackage.withPackages pgCfg.extraPlugins}/bin";
|
oldBin = "${if pgCfg.extensions == [] then oldPackage else oldPackage.withPackages pgCfg.extensions}/bin";
|
||||||
|
|
||||||
newPackage = if pgCfg.enableJIT then newPackage'.withJIT else newPackage';
|
newPackage = if pgCfg.enableJIT then newPackage'.withJIT else newPackage';
|
||||||
newData = "/var/lib/postgresql/${newPackage.psqlSchema}";
|
newData = "/var/lib/postgresql/${newPackage.psqlSchema}";
|
||||||
newBin = "${if pgCfg.extraPlugins == [] then newPackage else newPackage.withPackages pgCfg.extraPlugins}/bin";
|
newBin = "${if pgCfg.extensions == [] then newPackage else newPackage.withPackages pgCfg.extensions}/bin";
|
||||||
in
|
in
|
||||||
[
|
[
|
||||||
(pkgs.writeScriptBin "upgrade-pg-cluster" ''
|
(pkgs.writeScriptBin "upgrade-pg-cluster" ''
|
||||||
|
|
Loading…
Reference in a new issue