formatting
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.collabora;
|
||||
let cfg = config.nas-apps.collabora;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
@@ -16,9 +13,9 @@ in {
|
||||
# ...
|
||||
];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
with lib; {
|
||||
options.nas-apps.collabora = {
|
||||
enable = mkEnableOption "collabora docker service";
|
||||
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.jellyfin;
|
||||
let cfg = config.nas-apps.jellyfin;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
|
||||
systemd.services.jellyfin-nvidia-docker = {
|
||||
path = [ pkgs.bash pkgs.docker ];
|
||||
script = ''
|
||||
@@ -74,4 +71,4 @@ in {
|
||||
# # PGID = "1000";
|
||||
# # };
|
||||
# # };
|
||||
# }
|
||||
# }
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
with lib; {
|
||||
options.nas-apps.jellyfin = {
|
||||
enable = mkEnableOption "jellyfin docker service";
|
||||
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
@@ -55,4 +54,4 @@ with lib;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.jellyseerr;
|
||||
let cfg = config.nas-apps.jellyseerr;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
autoStart = cfg.autoStart;
|
||||
image = cfg.image;
|
||||
ports = [ "${cfg.port}:5055" ];
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
];
|
||||
volumes = [ "${cfg.configPath}:/config" ];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
with lib; {
|
||||
options.nas-apps.jellyseerr = {
|
||||
enable = mkEnableOption "jellyseerr docker service";
|
||||
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
@@ -45,4 +44,4 @@ with lib;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,23 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.mariadb;
|
||||
let cfg = config.nas-apps.mariadb;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
autoStart = cfg.autoStart;
|
||||
image = cfg.image;
|
||||
ports = [ "${cfg.port}:3306" ];
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
];
|
||||
volumes = [ "${cfg.configPath}:/config" ];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
MYSQL_ROOT_PASSWORD = cfg.rootPassword;
|
||||
MYSQL_DATABASE = cfg.databaseName;
|
||||
MYSQL_USER = cfg.databaseUser;
|
||||
MYSQL_PASSWORD = cfg.databasePassword;
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
MYSQL_ROOT_PASSWORD = cfg.rootPassword;
|
||||
MYSQL_DATABASE = cfg.databaseName;
|
||||
MYSQL_USER = cfg.databaseUser;
|
||||
MYSQL_PASSWORD = cfg.databasePassword;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
with lib; {
|
||||
options.nas-apps.mariadb = {
|
||||
enable = mkEnableOption "mariadb docker service";
|
||||
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
||||
@@ -1,25 +1,19 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.nextcloud;
|
||||
let cfg = config.nas-apps.nextcloud;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
autoStart = cfg.autoStart;
|
||||
image = cfg.image;
|
||||
ports = [ "${cfg.httpPort}:80" "${cfg.httpsPort}:443" ];
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
"${cfg.dataPath}:/data"
|
||||
];
|
||||
volumes = [ "${cfg.configPath}:/config" "${cfg.dataPath}:/data" ];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
with lib; {
|
||||
options.nas-apps.nextcloud = {
|
||||
enable = mkEnableOption "nextcloud docker service";
|
||||
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
@@ -54,4 +53,4 @@ with lib;
|
||||
default = "America/Chicago";
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.radarr;
|
||||
let cfg = config.nas-apps.radarr;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
@@ -13,14 +10,14 @@ in {
|
||||
image = cfg.image;
|
||||
ports = [ "${cfg.port}:7878" ];
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
"${cfg.moviesPath}:/movies"
|
||||
"${cfg.downloadsPath}:/downloads"
|
||||
"${cfg.configPath}:/config"
|
||||
"${cfg.moviesPath}:/movies"
|
||||
"${cfg.downloadsPath}:/downloads"
|
||||
];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
with lib; {
|
||||
options.nas-apps.radarr = {
|
||||
enable = mkEnableOption "radarr docker service";
|
||||
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.sabnzbd;
|
||||
let cfg = config.nas-apps.sabnzbd;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
@@ -13,16 +10,16 @@ in {
|
||||
image = cfg.image;
|
||||
ports = [ "${cfg.port}:8080" ];
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
"${cfg.moviesPath}:/movies"
|
||||
"${cfg.tvPath}:/tv"
|
||||
"${cfg.downloadsPath}:/downloads"
|
||||
"${cfg.downloadsIncompletePath}:/downloads-incomplete"
|
||||
"${cfg.configPath}:/config"
|
||||
"${cfg.moviesPath}:/movies"
|
||||
"${cfg.tvPath}:/tv"
|
||||
"${cfg.downloadsPath}:/downloads"
|
||||
"${cfg.downloadsIncompletePath}:/downloads-incomplete"
|
||||
];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
with lib; {
|
||||
options.nas-apps.sabnzbd = {
|
||||
enable = mkEnableOption "sabnzbd docker service";
|
||||
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.sonarr;
|
||||
let cfg = config.nas-apps.sonarr;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
@@ -13,14 +10,14 @@ in {
|
||||
image = cfg.image;
|
||||
ports = [ "${cfg.port}:8989" ];
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
"${cfg.tvPath}:/tv"
|
||||
"${cfg.downloadsPath}:/downloads"
|
||||
"${cfg.configPath}:/config"
|
||||
"${cfg.tvPath}:/tv"
|
||||
"${cfg.downloadsPath}:/downloads"
|
||||
];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
{ lib, ... }:
|
||||
with lib; {
|
||||
options.nas-apps.sonarr = {
|
||||
enable = mkEnableOption "sonarr docker service";
|
||||
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-apps.swag;
|
||||
let cfg = config.nas-apps.swag;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ cfg.httpPort cfg.httpsPort ];
|
||||
allowedUDPPorts = [ cfg.httpPort cfg.httpsPort ];
|
||||
@@ -18,17 +15,15 @@ in {
|
||||
autoStart = cfg.autoStart;
|
||||
image = cfg.image;
|
||||
ports = [ "${toString cfg.httpPort}:80" "${toString cfg.httpsPort}:443" ];
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
];
|
||||
volumes = [ "${cfg.configPath}:/config" ];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
EMAIL = cfg.email;
|
||||
URL = cfg.url;
|
||||
VALIDATION = cfg.validation;
|
||||
SUBDOMAINS = cfg.subdomains;
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
EMAIL = cfg.email;
|
||||
URL = cfg.url;
|
||||
VALIDATION = cfg.validation;
|
||||
SUBDOMAINS = cfg.subdomains;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
{ lib, ... }:
|
||||
with lib; {
|
||||
options.nas-apps.swag = {
|
||||
enable = mkEnableOption "swag docker service";
|
||||
|
||||
@@ -13,7 +12,7 @@ with lib;
|
||||
type = types.int;
|
||||
default = 80;
|
||||
};
|
||||
|
||||
|
||||
httpsPort = mkOption {
|
||||
type = types.int;
|
||||
default = 443;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{ ... }:
|
||||
{
|
||||
{ ... }: {
|
||||
imports = [
|
||||
./samba
|
||||
./apps/collabora
|
||||
@@ -13,4 +12,4 @@
|
||||
./apps/sonarr
|
||||
./apps/swag
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-samba;
|
||||
let cfg = config.nas-samba;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# make shares visible for Windows clients
|
||||
@@ -24,7 +21,7 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
services.samba = {
|
||||
enable = true;
|
||||
securityType = "user";
|
||||
@@ -42,26 +39,26 @@ in {
|
||||
guest account = nobody
|
||||
map to guest = bad user
|
||||
'';
|
||||
shares =
|
||||
let
|
||||
make = name: share: nameValuePair "${name}"
|
||||
{
|
||||
path = share.sharePath;
|
||||
public = if share.enableTimeMachine then false else share.public;
|
||||
private = if !share.public || share.enableTimeMachine then "yes" else "no";
|
||||
browseable = if share.browseable then "yes" else "no";
|
||||
writable = "yes";
|
||||
"read only" = if share.readOnly then "yes" else "no";
|
||||
"guest ok" = if share.guestOk then "yes" else "no";
|
||||
"create mask" = share.createMask;
|
||||
"directory mask" = share.directoryMask;
|
||||
"fruit:aapl" = if share.enableTimeMachine then "yes" else "no";
|
||||
"fruit:time machine" = if share.enableTimeMachine then "yes" else "no";
|
||||
"vfs objects" = "catia fruit streams_xattr";
|
||||
"fruit:time machine max size" = share.timeMachineMaxSize;
|
||||
};
|
||||
in
|
||||
mapAttrs' make cfg.shares;
|
||||
shares = let
|
||||
make = name: share:
|
||||
nameValuePair "${name}" {
|
||||
path = share.sharePath;
|
||||
public = if share.enableTimeMachine then false else share.public;
|
||||
private =
|
||||
if !share.public || share.enableTimeMachine then "yes" else "no";
|
||||
browseable = if share.browseable then "yes" else "no";
|
||||
writable = "yes";
|
||||
"read only" = if share.readOnly then "yes" else "no";
|
||||
"guest ok" = if share.guestOk then "yes" else "no";
|
||||
"create mask" = share.createMask;
|
||||
"directory mask" = share.directoryMask;
|
||||
"fruit:aapl" = if share.enableTimeMachine then "yes" else "no";
|
||||
"fruit:time machine" =
|
||||
if share.enableTimeMachine then "yes" else "no";
|
||||
"vfs objects" = "catia fruit streams_xattr";
|
||||
"fruit:time machine max size" = share.timeMachineMaxSize;
|
||||
};
|
||||
in mapAttrs' make cfg.shares;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
with lib; {
|
||||
options.nas-samba = {
|
||||
enable = mkEnableOption "nas samba service";
|
||||
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
@@ -22,48 +21,46 @@ with lib;
|
||||
};
|
||||
|
||||
shares = mkOption {
|
||||
type = types.attrsOf (types.submodule
|
||||
{
|
||||
options = {
|
||||
public = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
sharePath = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
readOnly = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
browseable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
guestOk = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
createMask = mkOption {
|
||||
type = types.str;
|
||||
default = "0644";
|
||||
};
|
||||
directoryMask = mkOption {
|
||||
type = types.str;
|
||||
default = "0755";
|
||||
};
|
||||
enableTimeMachine = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
timeMachineMaxSize = mkOption {
|
||||
type = types.str;
|
||||
default = "0K";
|
||||
};
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
public = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
}
|
||||
);
|
||||
sharePath = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
readOnly = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
browseable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
guestOk = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
createMask = mkOption {
|
||||
type = types.str;
|
||||
default = "0644";
|
||||
};
|
||||
directoryMask = mkOption {
|
||||
type = types.str;
|
||||
default = "0755";
|
||||
};
|
||||
enableTimeMachine = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
timeMachineMaxSize = mkOption {
|
||||
type = types.str;
|
||||
default = "0K";
|
||||
};
|
||||
};
|
||||
});
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user