mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-22 01:31:33 +01:00
Add paperless-ngx container
This commit is contained in:
parent
65bd45bfac
commit
2c347bab77
8 changed files with 125 additions and 15 deletions
60
hosts/stratus/containers/paperless/default.nix
Normal file
60
hosts/stratus/containers/paperless/default.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
sops.secrets = {
|
||||
"paperless-admin-password" = { };
|
||||
tailscale-auth-key = { };
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /data/paperless - - -"
|
||||
"d /var/lib/tailscale-paperless - - -"
|
||||
];
|
||||
|
||||
containers.paperless = {
|
||||
autoStart = true;
|
||||
ephemeral = true;
|
||||
macvlans = [ "eno1" ];
|
||||
|
||||
bindMounts = {
|
||||
# Secrets
|
||||
"/run/secrets/paperless-admin-password" = { };
|
||||
"/run/secrets/tailscale-auth-key" = { };
|
||||
|
||||
# State
|
||||
"/data/paperless".isReadOnly = false;
|
||||
"/var/lib/tailscale" = {
|
||||
hostPath = "/var/lib/tailscale-paperless";
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
||||
specialArgs = {
|
||||
inherit (config.networking) domain;
|
||||
};
|
||||
config =
|
||||
{ domain, ... }:
|
||||
{
|
||||
system.stateVersion = "24.05";
|
||||
|
||||
networking = {
|
||||
inherit domain;
|
||||
useNetworkd = true;
|
||||
useHostResolvConf = false;
|
||||
};
|
||||
systemd.network = {
|
||||
enable = true;
|
||||
networks."40-mv-eno1" = {
|
||||
matchConfig.Name = "mv-eno1";
|
||||
address = [ "192.168.2.253/24" ];
|
||||
networkConfig.DHCP = "yes";
|
||||
dhcpV4Config.ClientIdentifier = "mac";
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./paperless.nix
|
||||
./tailscale.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue