Compare commits

..

3 commits

Author SHA1 Message Date
Ingolf Wagner
6b4d8b2e71
🚑 pin clan-core revision
Some checks failed
Build all NixOS Configurations / nix build (push) Failing after 3h2m24s
because of clan-vars vs clan-facts
2024-11-23 14:25:37 +07:00
Ingolf Wagner
fe63dea188
🗑️ cleanup 2024-11-23 14:25:36 +07:00
Ingolf Wagner
1b47a9f823
♻️ service paperless split up 2024-11-23 14:25:35 +07:00
7 changed files with 79 additions and 55 deletions

View file

@ -16,7 +16,6 @@ with lib;
environment.systemPackages = [ pkgs.fail2ban ];
services.fail2ban = {
enable = true;
#package = pkgs.legacy_2311.fail2ban;
jails = { };
};
})

View file

@ -81,15 +81,16 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1732311754,
"narHash": "sha256-iwOnUIYlBPdWNoBa01v5khGsFtsogQuAviG8n7kPORA=",
"lastModified": 1730374010,
"narHash": "sha256-nEw0d7gbH5vFdr+ps5zlRywzaQ6zjbHFoQLjYyHhIeg=",
"ref": "refs/heads/main",
"rev": "0261d5905303090b0300042a06ae417953958e7a",
"revCount": 4841,
"rev": "1bd3af310ea074d0ea9de6233376476c6ca9149a",
"revCount": 4535,
"type": "git",
"url": "https://git.clan.lol/clan/clan-core"
},
"original": {
"rev": "1bd3af310ea074d0ea9de6233376476c6ca9149a",
"type": "git",
"url": "https://git.clan.lol/clan/clan-core"
}
@ -145,11 +146,11 @@
]
},
"locked": {
"lastModified": 1731746438,
"narHash": "sha256-f3SSp1axoOk0NAI7oFdRzbxG2XPBSIXC+/DaAXnvS1A=",
"lastModified": 1730045523,
"narHash": "sha256-W5Avk1THhZALXITHGazKfZbIZ5+Bc4nSYvAYHUn96EU=",
"owner": "nix-community",
"repo": "disko",
"rev": "cb64993826fa7a477490be6ccb38ba1fa1e18fa8",
"rev": "89e458a3bb3693e769bfb2b2447c3fe72092d498",
"type": "github"
},
"original": {
@ -632,11 +633,11 @@
},
"nixos-facter-modules": {
"locked": {
"lastModified": 1731843871,
"narHash": "sha256-aIy8m4jjr/BFXzniNzoH16sF7HEFV/01/5b3FhtUHrw=",
"lastModified": 1730026316,
"narHash": "sha256-AzP+trH/ykBJGTx3twkpuwbkhFSmsY1PJDQtRmK4k4c=",
"owner": "numtide",
"repo": "nixos-facter-modules",
"rev": "5a1c2a28589e34f8a44d46dd1909cfacf928cb1a",
"rev": "15b6531d44aa6f0bbd2fd8309cd2a6d7f183ba32",
"type": "github"
},
"original": {
@ -1108,14 +1109,17 @@
"nixpkgs": [
"clan-core",
"nixpkgs"
],
"nixpkgs-stable": [
"clan-core"
]
},
"locked": {
"lastModified": 1731862312,
"narHash": "sha256-NVUTFxKrJp/hjehlF1IvkPnlRYg/O9HFVutbxOM8zNM=",
"lastModified": 1729999681,
"narHash": "sha256-qm0uCtM9bg97LeJTKQ8dqV/FvqRN+ompyW4GIJruLuw=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "472741cf3fee089241ac9ea705bb2b9e0bfa2978",
"rev": "1666d16426abe79af5c47b7c0efa82fd31bf4c56",
"type": "github"
},
"original": {
@ -1361,11 +1365,11 @@
]
},
"locked": {
"lastModified": 1730321837,
"narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=",
"lastModified": 1729242555,
"narHash": "sha256-6jWSWxv2crIXmYSEb3LEVsFkCkyVHNllk61X4uhqfCs=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "746901bb8dba96d154b66492a29f5db0693dbfcc",
"rev": "d986489c1c757f6921a48c1439f19bfb9b8ecab5",
"type": "github"
},
"original": {

View file

@ -5,7 +5,7 @@
clan-core.inputs.flake-parts.follows = "flake-parts";
clan-core.inputs.nixpkgs.follows = "nixpkgs";
clan-core.url = "git+https://git.clan.lol/clan/clan-core";
clan-core.url = "git+https://git.clan.lol/clan/clan-core?rev=1bd3af310ea074d0ea9de6233376476c6ca9149a"; # last time clan was using facts instead of vars
clan-fact-generators.inputs.clan-core.follows = "clan-core";
clan-fact-generators.url = "github:mrvandalo/clan-fact-generators";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";

View file

@ -47,6 +47,8 @@
./service-atuin.nix
./service-forgejo.nix
./service-paperless.nix
./service-paperless-backup.nix
./service-paperless-healthchecks.nix
./service-s3.nix
#./service-taskwarrior.nix
./service-vault.nix

View file

@ -0,0 +1,40 @@
{
config,
pkgs,
lib,
factsGenerator,
...
}:
{
clan.core.facts.services."paperless-ngx.borg" = factsGenerator.password { name = "borgbackup"; };
clan.core.facts.services."paperless-ngx.ssh" = factsGenerator.ssh { name = "paperless-ngx"; };
# backup
services.borgbackup.jobs."paperless-ngx" = {
paths = [ config.services.paperless.dataDir ];
repo = "root@orbi.bear:borg-${config.networking.hostName}-paperless";
compression = "auto,lzma";
startAt = "daily";
encryption = {
mode = "keyfile-blake2";
passCommand = "cat ${
toString config.clan.core.facts.services."paperless-ngx.borg".secret."password.borgbackup".path
}";
};
environment = {
BORG_RSH = "ssh -i ${
toString
config.clan.core.facts.services."paperless-ngx.ssh".secret."ssh.paperless-ngx.id_ed25519".path
}";
BORG_RELOCATED_REPO_ACCESS_IS_OK = "yes";
};
prune.keep = {
within = "3d"; # Keep all backups in the last 10 days.
weekly = 2; # Keep 8 additional end of week archives.
monthly = -1; # Keep end of month archive for every month
};
doInit = true;
};
}

View file

@ -0,0 +1,16 @@
{
config,
pkgs,
lib,
factsGenerator,
...
}:
{
healthchecks.http.paperless = {
url = "http://paperless.ingolf-wagner.de/accounts/login/?next=/";
expectedContent = "paperless.chungus.private";
};
healthchecks.closed.retiolum.ports.paperless = [ config.services.paperless.port ];
}

View file

@ -2,8 +2,6 @@
config,
pkgs,
lib,
nixos-artwork,
factsGenerator,
...
}:
{
@ -36,11 +34,6 @@
};
networking.firewall.interfaces.wg0.allowedTCPPorts = [ config.services.paperless.port ];
healthchecks.http.paperless = {
url = "http://paperless.ingolf-wagner.de/accounts/login/?next=/";
expectedContent = "paperless.chungus.private";
};
healthchecks.closed.retiolum.ports.paperless = [ config.services.paperless.port ];
services.nginx.virtualHosts."paperless.${config.networking.hostName}.private" = {
serverAliases = [ "paperless.ingolf-wagner.de" ];
@ -58,34 +51,4 @@
};
};
clan.core.facts.services."paperless-ngx.borg" = factsGenerator.password { name = "borgbackup"; };
clan.core.facts.services."paperless-ngx.ssh" = factsGenerator.ssh { name = "paperless-ngx"; };
# backup
services.borgbackup.jobs."paperless-ngx" = {
paths = [ config.services.paperless.dataDir ];
repo = "root@orbi.bear:borg-${config.networking.hostName}-paperless";
compression = "auto,lzma";
startAt = "daily";
encryption = {
mode = "keyfile-blake2";
passCommand = "cat ${
toString config.clan.core.facts.services."paperless-ngx.borg".secret."password.borgbackup".path
}";
};
environment = {
BORG_RSH = "ssh -i ${
toString
config.clan.core.facts.services."paperless-ngx.ssh".secret."ssh.paperless-ngx.id_ed25519".path
}";
BORG_RELOCATED_REPO_ACCESS_IS_OK = "yes";
};
prune.keep = {
within = "3d"; # Keep all backups in the last 10 days.
weekly = 2; # Keep 8 additional end of week archives.
monthly = -1; # Keep end of month archive for every month
};
doInit = true;
};
}