mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 01:55:13 -05:00
Compare commits
20 commits
879d7a45cc
...
4d1a19edfd
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4d1a19edfd | ||
![]() |
eb63e130eb | ||
![]() |
97ee6c4b24 | ||
![]() |
1d77c1286f | ||
![]() |
0fdd4f6fe9 | ||
![]() |
f90168c12e | ||
![]() |
38d26b947c | ||
![]() |
c923300f82 | ||
![]() |
637adca42f | ||
![]() |
abdcb547da | ||
![]() |
04317ca6d8 | ||
![]() |
9066b98124 | ||
![]() |
31f36102ee | ||
![]() |
b6b079e74f | ||
![]() |
47d338f0df | ||
![]() |
3ed3bbde4c | ||
![]() |
ca718a89ec | ||
![]() |
31c2337c1d | ||
![]() |
9d3ad35ef1 | ||
![]() |
b6f45eb6d9 |
16 changed files with 160 additions and 54 deletions
|
@ -11,7 +11,7 @@ let
|
||||||
user0Name = "Nick";
|
user0Name = "Nick";
|
||||||
user1Name = "Garnet";
|
user1Name = "Garnet";
|
||||||
synologyName = "synology";
|
synologyName = "synology";
|
||||||
synologyIP = "192.168.50.210";
|
synologyIP = "192.168.50.209";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
label = "Synology";
|
label = "Synology";
|
||||||
|
|
30
modules/config/instances/config/audiobookshelf.nix
Executable file
30
modules/config/instances/config/audiobookshelf.nix
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
{ instancesFunctions }:
|
||||||
|
let
|
||||||
|
inherit (instancesFunctions)
|
||||||
|
audiobookshelfLabel
|
||||||
|
audiobookshelfName
|
||||||
|
domain0
|
||||||
|
servicePath
|
||||||
|
sslPath
|
||||||
|
sopsPath
|
||||||
|
;
|
||||||
|
audiobookshelfSubdomain = "books";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
label = audiobookshelfLabel;
|
||||||
|
name = audiobookshelfName;
|
||||||
|
sops = {
|
||||||
|
path0 = "${sopsPath}/${audiobookshelfName}";
|
||||||
|
};
|
||||||
|
subdomain = audiobookshelfSubdomain;
|
||||||
|
paths = {
|
||||||
|
path0 = "${servicePath}/${audiobookshelfLabel}";
|
||||||
|
};
|
||||||
|
ports = {
|
||||||
|
port0 = 8000;
|
||||||
|
};
|
||||||
|
ssl = {
|
||||||
|
cert = "${sslPath}/${audiobookshelfSubdomain}.${domain0}/fullchain.pem";
|
||||||
|
key = "${sslPath}/${audiobookshelfSubdomain}.${domain0}/key.pem";
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,9 +1,6 @@
|
||||||
{ instancesFunctions }:
|
{ instancesFunctions }:
|
||||||
let
|
let
|
||||||
inherit (instancesFunctions)
|
inherit (instancesFunctions)
|
||||||
jellyfinLabel
|
|
||||||
jellyfinName
|
|
||||||
servicePath
|
|
||||||
sopsPath
|
sopsPath
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -17,9 +14,6 @@ in
|
||||||
path0 = "${sopsPath}/${sambaName}";
|
path0 = "${sopsPath}/${sambaName}";
|
||||||
};
|
};
|
||||||
paths = {
|
paths = {
|
||||||
path0 = "${servicePath}/${jellyfinLabel}";
|
|
||||||
path1 = jellyfinName;
|
|
||||||
path2 = "";
|
|
||||||
};
|
};
|
||||||
ports = {
|
ports = {
|
||||||
port0 = 445; # Samba
|
port0 = 445; # Samba
|
||||||
|
|
|
@ -4,6 +4,8 @@ let
|
||||||
instancesFunctions = {
|
instancesFunctions = {
|
||||||
jellyfinLabel = "Jellyfin";
|
jellyfinLabel = "Jellyfin";
|
||||||
jellyfinName = "jellyfin";
|
jellyfinName = "jellyfin";
|
||||||
|
audiobookshelfLabel = "Audiobookshelf";
|
||||||
|
audiobookshelfName = "audiobookshelf";
|
||||||
domain0 = "cloudbert.fun";
|
domain0 = "cloudbert.fun";
|
||||||
domain1 = "the-nutrivore.social";
|
domain1 = "the-nutrivore.social";
|
||||||
domain2 = "the-nutrivore.com";
|
domain2 = "the-nutrivore.com";
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
{
|
{
|
||||||
home.packages = builtins.attrValues {
|
home.packages = builtins.attrValues {
|
||||||
inherit (pkgs.elmPackages)
|
inherit (pkgs.elmPackages)
|
||||||
elm
|
# elm
|
||||||
elm-format
|
# elm-format
|
||||||
elm-land
|
# elm-land
|
||||||
elm-language-server
|
# elm-language-server
|
||||||
elm-review
|
# elm-review
|
||||||
# elm-test
|
# elm-test
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,6 +27,7 @@ in
|
||||||
prismLauncher
|
prismLauncher
|
||||||
steam
|
steam
|
||||||
zed
|
zed
|
||||||
|
vsCode
|
||||||
feishin
|
feishin
|
||||||
obsidian
|
obsidian
|
||||||
libreOffice
|
libreOffice
|
||||||
|
|
|
@ -31,5 +31,7 @@ in
|
||||||
"editor.fontLigatures" = true;
|
"editor.fontLigatures" = true;
|
||||||
"elmLS.disableElmLSDiagnostics" = true;
|
"elmLS.disableElmLSDiagnostics" = true;
|
||||||
"elmLS.elmReviewDiagnostics" = "warning";
|
"elmLS.elmReviewDiagnostics" = "warning";
|
||||||
"elmLS.elmReviewPath" = "/etc/profiles/per-user/nick/bin/elm-review";
|
"elmLS.elmReviewPath" =
|
||||||
|
"/nix/store/ms3g9cnwjhd1adccxar3vxy1gj98zsba-elm-review-2.12.0/bin/elm-review";
|
||||||
|
"editor.formatOnSave" = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,11 @@
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.vscode;
|
package = pkgs.vscode;
|
||||||
|
profiles.default = {
|
||||||
keybindings = keybindingsPath;
|
keybindings = keybindingsPath;
|
||||||
extensions = extensionsPath;
|
extensions = extensionsPath;
|
||||||
userSettings = userSettingsPath;
|
userSettings = userSettingsPath;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,11 +40,7 @@ let
|
||||||
|
|
||||||
superShiftBinds = builtins.map (x: "SUPER SHIFT, " + x) [
|
superShiftBinds = builtins.map (x: "SUPER SHIFT, " + x) [
|
||||||
# Super+shift binds
|
# Super+shift binds
|
||||||
# Window Move
|
|
||||||
"C, movewindow, l"
|
|
||||||
"A, movewindow, u"
|
|
||||||
"E, movewindow, d"
|
|
||||||
"I, movewindow, r"
|
|
||||||
# Quick Action
|
# Quick Action
|
||||||
"T, exec, ghostty"
|
"T, exec, ghostty"
|
||||||
"S, exec, flameshot gui"
|
"S, exec, flameshot gui"
|
||||||
|
@ -61,15 +57,21 @@ let
|
||||||
];
|
];
|
||||||
superCtrlBinds = builtins.map (x: "SUPER CTRL, " + x) [
|
superCtrlBinds = builtins.map (x: "SUPER CTRL, " + x) [
|
||||||
# Super+shift binds
|
# Super+shift binds
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
altBinds = builtins.map (x: "CTRL ALT, " + x) [
|
||||||
|
# Alt binds
|
||||||
"1, movetoworkspacesilent, 1"
|
"1, movetoworkspacesilent, 1"
|
||||||
"2, movetoworkspacesilent, 2"
|
"2, movetoworkspacesilent, 2"
|
||||||
"3, movetoworkspacesilent, 3"
|
"3, movetoworkspacesilent, 3"
|
||||||
"4, movetoworkspacesilent, 4"
|
"4, movetoworkspacesilent, 4"
|
||||||
"5, movetoworkspacesilent, 5"
|
"5, movetoworkspacesilent, 5"
|
||||||
];
|
# Window Move
|
||||||
|
"C, movewindow, l"
|
||||||
altBinds = builtins.map (x: "ALT, " + x) [
|
"A, movewindow, u"
|
||||||
# Alt binds
|
"E, movewindow, d"
|
||||||
|
"I, movewindow, r"
|
||||||
];
|
];
|
||||||
|
|
||||||
shiftBinds = builtins.map (x: "SHIFT, " + x) [
|
shiftBinds = builtins.map (x: "SHIFT, " + x) [
|
||||||
|
|
|
@ -56,6 +56,7 @@ in
|
||||||
imports = builtins.attrValues {
|
imports = builtins.attrValues {
|
||||||
inherit (modules)
|
inherit (modules)
|
||||||
acme
|
acme
|
||||||
|
audiobookshelf
|
||||||
caddy
|
caddy
|
||||||
jellyfin
|
jellyfin
|
||||||
logrotate
|
logrotate
|
||||||
|
|
|
@ -22,29 +22,29 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# hardware.printers = {
|
hardware.printers = {
|
||||||
# ensurePrinters = [
|
ensurePrinters = [
|
||||||
# {
|
{
|
||||||
# name = printer0.label;
|
name = printer0.label;
|
||||||
# location = "Downstairs";
|
location = "Downstairs";
|
||||||
# deviceUri = "https://${printer0.ip.address0}";
|
deviceUri = "https://${printer0.ip.address0}";
|
||||||
# model = genericPPD;
|
model = genericPPD;
|
||||||
# ppdOptions = {
|
ppdOptions = {
|
||||||
# PageSize = pageSize;
|
PageSize = pageSize;
|
||||||
# };
|
};
|
||||||
# }
|
}
|
||||||
# {
|
{
|
||||||
# name = printer1.label;
|
name = printer1.label;
|
||||||
# location = "Upstairs";
|
location = "Upstairs";
|
||||||
# deviceUri = "https://${printer1.ip.address0}";
|
deviceUri = "https://${printer1.ip.address0}";
|
||||||
# model = genericPPD;
|
model = genericPPD;
|
||||||
# ppdOptions = {
|
ppdOptions = {
|
||||||
# PageSize = pageSize;
|
PageSize = pageSize;
|
||||||
# };
|
};
|
||||||
# }
|
}
|
||||||
# ];
|
];
|
||||||
# ensureDefaultPrinter = printer1.label;
|
ensureDefaultPrinter = printer1.label;
|
||||||
# };
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
|
|
|
@ -38,6 +38,7 @@ in
|
||||||
"syncthing"
|
"syncthing"
|
||||||
"searx"
|
"searx"
|
||||||
"vaultwarden"
|
"vaultwarden"
|
||||||
|
"audiobookshelf"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
++ (map
|
++ (map
|
||||||
|
|
58
modules/nixos/services/audiobookshelf/default.nix
Executable file
58
modules/nixos/services/audiobookshelf/default.nix
Executable file
|
@ -0,0 +1,58 @@
|
||||||
|
{ flake, config, ... }:
|
||||||
|
let
|
||||||
|
inherit (flake.config.services.instances) audiobookshelf web;
|
||||||
|
inherit (flake.config.machines.devices) ceres;
|
||||||
|
service = audiobookshelf;
|
||||||
|
host = "${service.subdomain}.${web.domains.url0}";
|
||||||
|
localhost = web.localhost.address0;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services = {
|
||||||
|
audiobookshelf = {
|
||||||
|
enable = true;
|
||||||
|
host = localhost;
|
||||||
|
port = service.ports.port0;
|
||||||
|
dataDir = service.name;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
caddy = {
|
||||||
|
virtualHosts = {
|
||||||
|
"${host}" = {
|
||||||
|
extraConfig = ''
|
||||||
|
redir /.well-known/carddav /remote.php/dav/ 301
|
||||||
|
redir /.well-known/caldav /remote.php/dav/ 301
|
||||||
|
|
||||||
|
reverse_proxy ${localhost}:${toString service.ports.port0}
|
||||||
|
|
||||||
|
tls ${service.ssl.cert} ${service.ssl.key}
|
||||||
|
|
||||||
|
encode gzip zstd
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/var/lib/${service.name}" = {
|
||||||
|
device = service.paths.path0;
|
||||||
|
fsType = "none";
|
||||||
|
options = [
|
||||||
|
"bind"
|
||||||
|
];
|
||||||
|
depends = [
|
||||||
|
ceres.storage0.mount
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"Z ${service.paths.path0} 0755 ${service.name} ${service.name} -"
|
||||||
|
];
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
firewall = {
|
||||||
|
allowedTCPPorts = [
|
||||||
|
service.ports.port0
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ let
|
||||||
inherit (flake.config.services.instances)
|
inherit (flake.config.services.instances)
|
||||||
samba
|
samba
|
||||||
jellyfin
|
jellyfin
|
||||||
|
audiobookshelf
|
||||||
;
|
;
|
||||||
service = samba;
|
service = samba;
|
||||||
in
|
in
|
||||||
|
@ -19,10 +20,14 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
settings = {
|
settings = {
|
||||||
${service.paths.path1} = {
|
${jellyfin.name} = {
|
||||||
path = jellyfin.paths.path0;
|
path = jellyfin.paths.path0;
|
||||||
writable = "true";
|
writable = "true";
|
||||||
};
|
};
|
||||||
|
${audiobookshelf.name} = {
|
||||||
|
path = audiobookshelf.paths.path0;
|
||||||
|
writable = "true";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
BIN
profiles/user0/files/wallpaper/7yKtaRij2giAj0s09F6gmB8XIje.jpg
Executable file
BIN
profiles/user0/files/wallpaper/7yKtaRij2giAj0s09F6gmB8XIje.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 772 KiB |
|
@ -15,8 +15,9 @@ let
|
||||||
;
|
;
|
||||||
inherit (flake.config.services.instances)
|
inherit (flake.config.services.instances)
|
||||||
samba
|
samba
|
||||||
|
jellyfin
|
||||||
|
audiobookshelf
|
||||||
;
|
;
|
||||||
|
|
||||||
synologySecrets = config.sops.secrets."network/synology".path;
|
synologySecrets = config.sops.secrets."network/synology".path;
|
||||||
ceresSecrets = config.sops.secrets."network/server".path;
|
ceresSecrets = config.sops.secrets."network/server".path;
|
||||||
in
|
in
|
||||||
|
@ -38,6 +39,11 @@ in
|
||||||
"samba0"
|
"samba0"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
sambaFolders = [
|
||||||
|
audiobookshelf.name
|
||||||
|
jellyfin.name
|
||||||
|
];
|
||||||
|
|
||||||
synologyMounts = synologyDrive: {
|
synologyMounts = synologyDrive: {
|
||||||
name = "${synology.${synologyDrive}.mount}";
|
name = "${synology.${synologyDrive}.mount}";
|
||||||
value = {
|
value = {
|
||||||
|
@ -58,10 +64,10 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
sambaMounts = sambaDrive: {
|
sambaMounts = sambaDrive: folder: {
|
||||||
name = "${ceres.${sambaDrive}.mount}/${samba.paths.path1}";
|
name = "${ceres.${sambaDrive}.mount}/${folder}";
|
||||||
value = {
|
value = {
|
||||||
device = "${ceres.${sambaDrive}.device}/${samba.paths.path1}";
|
device = "${ceres.${sambaDrive}.device}/${folder}";
|
||||||
fsType = "cifs";
|
fsType = "cifs";
|
||||||
options = ceres.${sambaDrive}.options ++ [
|
options = ceres.${sambaDrive}.options ++ [
|
||||||
"credentials=${ceresSecrets}"
|
"credentials=${ceresSecrets}"
|
||||||
|
@ -82,7 +88,9 @@ in
|
||||||
}
|
}
|
||||||
// (builtins.listToAttrs (map synologyMounts synologyDrives))
|
// (builtins.listToAttrs (map synologyMounts synologyDrives))
|
||||||
// (builtins.listToAttrs (map storageMounts storageDrives))
|
// (builtins.listToAttrs (map storageMounts storageDrives))
|
||||||
// (builtins.listToAttrs (map sambaMounts sambaDrives));
|
// (builtins.listToAttrs (
|
||||||
|
builtins.concatMap (drive: map (folder: sambaMounts drive folder) sambaFolders) sambaDrives
|
||||||
|
));
|
||||||
|
|
||||||
swapDevices = [
|
swapDevices = [
|
||||||
{ device = "/dev/disk/by-uuid/8b1d43a7-baf8-4d15-a1ad-dc0c9dda6970"; }
|
{ device = "/dev/disk/by-uuid/8b1d43a7-baf8-4d15-a1ad-dc0c9dda6970"; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue