Skip to content

Commit

Permalink
feat(nixos-server): Enable cleanuperr, move secrets to modules that u…
Browse files Browse the repository at this point in the history
…se them
  • Loading branch information
mrjones2014 committed Dec 11, 2024
1 parent 578550e commit 759a3f9
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 37 deletions.
13 changes: 13 additions & 0 deletions hosts/server/cleanuperr.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ config, ... }:
let envFile = config.age.secrets.cleanuperr_env.path;
in {
age.secrets.cleanuperr_env.file = ../../secrets/cleanuperr_env.age;
virtualisation.oci-containers = {
backend = "podman";
containers.cleanuperr = {
autoStart = true;
image = "ghcr.io/flmorg/cleanuperr:latest";
environmentFiles = [ envFile ];
};
};
}
1 change: 1 addition & 0 deletions hosts/server/content.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
./deluge.nix
# port 8082
./homepage.nix
./cleanuperr.nix
];
services = {
jellyfin = {
Expand Down
1 change: 0 additions & 1 deletion hosts/server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

imports = [
./hardware-configuration.nix
./secrets.nix
./content.nix
./nas.nix
./containers.nix
Expand Down
53 changes: 26 additions & 27 deletions hosts/server/deluge.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ let
configDir = "/var/lib/delugevpn";
wireguardConfigPath = config.age.secrets.mullvad_wireguard.path;
in {
age.secrets.mullvad_wireguard.file = ../../secrets/mullvad_wireguard.age;

systemd.tmpfiles.rules = [
"d ${configDir} 055 delugevpn delugevpn - -"
Expand All @@ -17,33 +18,31 @@ in {
};
virtualisation.oci-containers = {
backend = "podman";
containers = {
delugevpn = {
autoStart = true;
image = "ghcr.io/binhex/arch-delugevpn";
extraOptions =
[ "--sysctl=net.ipv4.conf.all.src_valid_mark=1" "--privileged=true" ];
ports = [ "8112:8112" "8118:8118" "58846:58846" "58946:58946" ];
volumes = [ "/mnt/jellyfin:/data" "${configDir}:/config" ];
environment = {
VPN_ENABLED = "yes";
VPN_PROV = "custom";
VPN_CLIENT = "wireguard";
STRICT_PORT_FORWARD = "yes";
ENABLE_PRIVOXY = "yes";
LAN_NETWORK = "192.168.189.0/24";
NAME_SERVERS =
"84.200.69.80,37.235.1.174,1.1.1.1,37.235.1.177,84.200.70.40,1.0.0.1";
DELUGE_DAEMON_LOG_LEVEL = "info";
DELUGE_WEB_LOG_LEVEL = "info";
DELUGE_ENABLE_WEBUI_PASSWORD = "yes";
VPN_INPUT_PORTS = "";
VPN_OUTPUT_PORTS = "";
DEBUG = "false";
UMASK = "000";
PUID = "0";
PGID = "0";
};
containers.delugevpn = {
autoStart = true;
image = "ghcr.io/binhex/arch-delugevpn";
extraOptions =
[ "--sysctl=net.ipv4.conf.all.src_valid_mark=1" "--privileged=true" ];
ports = [ "8112:8112" "8118:8118" "58846:58846" "58946:58946" ];
volumes = [ "/mnt/jellyfin:/data" "${configDir}:/config" ];
environment = {
VPN_ENABLED = "yes";
VPN_PROV = "custom";
VPN_CLIENT = "wireguard";
STRICT_PORT_FORWARD = "yes";
ENABLE_PRIVOXY = "yes";
LAN_NETWORK = "192.168.189.0/24";
NAME_SERVERS =
"84.200.69.80,37.235.1.174,1.1.1.1,37.235.1.177,84.200.70.40,1.0.0.1";
DELUGE_DAEMON_LOG_LEVEL = "info";
DELUGE_WEB_LOG_LEVEL = "info";
DELUGE_ENABLE_WEBUI_PASSWORD = "yes";
VPN_INPUT_PORTS = "";
VPN_OUTPUT_PORTS = "";
DEBUG = "false";
UMASK = "000";
PUID = "0";
PGID = "0";
};
};
};
Expand Down
1 change: 1 addition & 0 deletions hosts/server/homepage.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ config, ... }: {
age.secrets.homepage.file = ../../secrets/homepage.age;
services.homepage-dashboard = {
enable = true;
openFirewall = true;
Expand Down
9 changes: 0 additions & 9 deletions hosts/server/secrets.nix

This file was deleted.

1 change: 1 addition & 0 deletions hosts/server/wireguard.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ let
wireguard_interface = "wgvpn";
external_interface = "enp0s31f6";
in {
age.secrets.wireguard_server.file = ../../secrets/wireguard_server.age;
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
services.dnsmasq = {
enable = true;
Expand Down
1 change: 1 addition & 0 deletions secrets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ in {
"secrets/mullvad_wireguard.age".publicKeys = users ++ systems;
"secrets/homepage.age".publicKeys = users ++ systems;
"secrets/wireguard_server.age".publicKeys = users ++ systems;
"secrets/cleanuperr_env.age".publicKeys = users ++ systems;
}
Binary file added secrets/cleanuperr_env.age
Binary file not shown.

0 comments on commit 759a3f9

Please sign in to comment.