stuff for sure
This commit is contained in:
@@ -21,6 +21,7 @@ in
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
"${cfg.dataPath}:/data"
|
||||
"${cfg.tmpPath}:/data-tmp"
|
||||
"${cfg.redisSock}:/var/redis/redis.sock"
|
||||
];
|
||||
environment = {
|
||||
|
||||
@@ -39,6 +39,11 @@ with lib;
|
||||
default = "/media/nas/main/nextcloud";
|
||||
};
|
||||
|
||||
tmpPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/media/nas/ssd/nix-app-data/tmp";
|
||||
};
|
||||
|
||||
redisSock = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
|
||||
33
modules/apps/wireguard/default.nix
Normal file
33
modules/apps/wireguard/default.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.wireguard;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
autoStart = cfg.autoStart;
|
||||
image = cfg.image;
|
||||
ports = [ "${cfg.port}:51820/udp" ];
|
||||
extraOptions = [
|
||||
"--cap-add=NET_ADMIN"
|
||||
"--sysctl=\"net.ipv4.conf.all.src_valid_mark=1\""
|
||||
];
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
47
modules/apps/wireguard/options.nix
Normal file
47
modules/apps/wireguard/options.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.nas-apps.wireguard = {
|
||||
enable = mkEnableOption "wireguard docker service";
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.str;
|
||||
default = "51820";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "wireguard";
|
||||
};
|
||||
|
||||
image = mkOption {
|
||||
type = types.str;
|
||||
default = "lscr.io/linuxserver/wireguard";
|
||||
};
|
||||
|
||||
configPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/media/nas/ssd/nix-app-data/wireguard";
|
||||
};
|
||||
|
||||
puid = mkOption {
|
||||
type = types.str;
|
||||
default = "911";
|
||||
};
|
||||
|
||||
pgid = mkOption {
|
||||
type = types.str;
|
||||
default = "1000";
|
||||
};
|
||||
|
||||
timeZone = mkOption {
|
||||
type = types.str;
|
||||
default = "America/Chicago";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -22,5 +22,6 @@
|
||||
./apps/swag
|
||||
./apps/tdarr
|
||||
./apps/vscode
|
||||
./apps/wireguard
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user