mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-15 09:35:12 -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";
|
||||
user1Name = "Garnet";
|
||||
synologyName = "synology";
|
||||
synologyIP = "192.168.50.210";
|
||||
synologyIP = "192.168.50.209";
|
||||
in
|
||||
{
|
||||
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 }:
|
||||
let
|
||||
inherit (instancesFunctions)
|
||||
jellyfinLabel
|
||||
jellyfinName
|
||||
servicePath
|
||||
sopsPath
|
||||
;
|
||||
|
||||
|
@ -17,9 +14,6 @@ in
|
|||
path0 = "${sopsPath}/${sambaName}";
|
||||
};
|
||||
paths = {
|
||||
path0 = "${servicePath}/${jellyfinLabel}";
|
||||
path1 = jellyfinName;
|
||||
path2 = "";
|
||||
};
|
||||
ports = {
|
||||
port0 = 445; # Samba
|
||||
|
|
|
@ -4,6 +4,8 @@ let
|
|||
instancesFunctions = {
|
||||
jellyfinLabel = "Jellyfin";
|
||||
jellyfinName = "jellyfin";
|
||||
audiobookshelfLabel = "Audiobookshelf";
|
||||
audiobookshelfName = "audiobookshelf";
|
||||
domain0 = "cloudbert.fun";
|
||||
domain1 = "the-nutrivore.social";
|
||||
domain2 = "the-nutrivore.com";
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
{
|
||||
home.packages = builtins.attrValues {
|
||||
inherit (pkgs.elmPackages)
|
||||
elm
|
||||
elm-format
|
||||
elm-land
|
||||
elm-language-server
|
||||
elm-review
|
||||
# elm
|
||||
# elm-format
|
||||
# elm-land
|
||||
# elm-language-server
|
||||
# elm-review
|
||||
# elm-test
|
||||
;
|
||||
};
|
||||
|
|
|
@ -27,6 +27,7 @@ in
|
|||
prismLauncher
|
||||
steam
|
||||
zed
|
||||
vsCode
|
||||
feishin
|
||||
obsidian
|
||||
libreOffice
|
||||
|
|
|
@ -31,5 +31,7 @@ in
|
|||
"editor.fontLigatures" = true;
|
||||
"elmLS.disableElmLSDiagnostics" = true;
|
||||
"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;
|
||||
package = pkgs.vscode;
|
||||
keybindings = keybindingsPath;
|
||||
extensions = extensionsPath;
|
||||
userSettings = userSettingsPath;
|
||||
profiles.default = {
|
||||
keybindings = keybindingsPath;
|
||||
extensions = extensionsPath;
|
||||
userSettings = userSettingsPath;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -40,11 +40,7 @@ let
|
|||
|
||||
superShiftBinds = builtins.map (x: "SUPER SHIFT, " + x) [
|
||||
# Super+shift binds
|
||||
# Window Move
|
||||
"C, movewindow, l"
|
||||
"A, movewindow, u"
|
||||
"E, movewindow, d"
|
||||
"I, movewindow, r"
|
||||
|
||||
# Quick Action
|
||||
"T, exec, ghostty"
|
||||
"S, exec, flameshot gui"
|
||||
|
@ -61,15 +57,21 @@ let
|
|||
];
|
||||
superCtrlBinds = builtins.map (x: "SUPER CTRL, " + x) [
|
||||
# Super+shift binds
|
||||
|
||||
];
|
||||
|
||||
altBinds = builtins.map (x: "CTRL ALT, " + x) [
|
||||
# Alt binds
|
||||
"1, movetoworkspacesilent, 1"
|
||||
"2, movetoworkspacesilent, 2"
|
||||
"3, movetoworkspacesilent, 3"
|
||||
"4, movetoworkspacesilent, 4"
|
||||
"5, movetoworkspacesilent, 5"
|
||||
];
|
||||
|
||||
altBinds = builtins.map (x: "ALT, " + x) [
|
||||
# Alt binds
|
||||
# Window Move
|
||||
"C, movewindow, l"
|
||||
"A, movewindow, u"
|
||||
"E, movewindow, d"
|
||||
"I, movewindow, r"
|
||||
];
|
||||
|
||||
shiftBinds = builtins.map (x: "SHIFT, " + x) [
|
||||
|
|
|
@ -56,6 +56,7 @@ in
|
|||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
acme
|
||||
audiobookshelf
|
||||
caddy
|
||||
jellyfin
|
||||
logrotate
|
||||
|
|
|
@ -22,29 +22,29 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
# hardware.printers = {
|
||||
# ensurePrinters = [
|
||||
# {
|
||||
# name = printer0.label;
|
||||
# location = "Downstairs";
|
||||
# deviceUri = "https://${printer0.ip.address0}";
|
||||
# model = genericPPD;
|
||||
# ppdOptions = {
|
||||
# PageSize = pageSize;
|
||||
# };
|
||||
# }
|
||||
# {
|
||||
# name = printer1.label;
|
||||
# location = "Upstairs";
|
||||
# deviceUri = "https://${printer1.ip.address0}";
|
||||
# model = genericPPD;
|
||||
# ppdOptions = {
|
||||
# PageSize = pageSize;
|
||||
# };
|
||||
# }
|
||||
# ];
|
||||
# ensureDefaultPrinter = printer1.label;
|
||||
# };
|
||||
hardware.printers = {
|
||||
ensurePrinters = [
|
||||
{
|
||||
name = printer0.label;
|
||||
location = "Downstairs";
|
||||
deviceUri = "https://${printer0.ip.address0}";
|
||||
model = genericPPD;
|
||||
ppdOptions = {
|
||||
PageSize = pageSize;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = printer1.label;
|
||||
location = "Upstairs";
|
||||
deviceUri = "https://${printer1.ip.address0}";
|
||||
model = genericPPD;
|
||||
ppdOptions = {
|
||||
PageSize = pageSize;
|
||||
};
|
||||
}
|
||||
];
|
||||
ensureDefaultPrinter = printer1.label;
|
||||
};
|
||||
|
||||
networking = {
|
||||
firewall = {
|
||||
|
|
|
@ -38,6 +38,7 @@ in
|
|||
"syncthing"
|
||||
"searx"
|
||||
"vaultwarden"
|
||||
"audiobookshelf"
|
||||
]
|
||||
)
|
||||
++ (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)
|
||||
samba
|
||||
jellyfin
|
||||
audiobookshelf
|
||||
;
|
||||
service = samba;
|
||||
in
|
||||
|
@ -19,10 +20,14 @@ in
|
|||
enable = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
${service.paths.path1} = {
|
||||
${jellyfin.name} = {
|
||||
path = jellyfin.paths.path0;
|
||||
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)
|
||||
samba
|
||||
jellyfin
|
||||
audiobookshelf
|
||||
;
|
||||
|
||||
synologySecrets = config.sops.secrets."network/synology".path;
|
||||
ceresSecrets = config.sops.secrets."network/server".path;
|
||||
in
|
||||
|
@ -38,6 +39,11 @@ in
|
|||
"samba0"
|
||||
];
|
||||
|
||||
sambaFolders = [
|
||||
audiobookshelf.name
|
||||
jellyfin.name
|
||||
];
|
||||
|
||||
synologyMounts = synologyDrive: {
|
||||
name = "${synology.${synologyDrive}.mount}";
|
||||
value = {
|
||||
|
@ -58,10 +64,10 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
sambaMounts = sambaDrive: {
|
||||
name = "${ceres.${sambaDrive}.mount}/${samba.paths.path1}";
|
||||
sambaMounts = sambaDrive: folder: {
|
||||
name = "${ceres.${sambaDrive}.mount}/${folder}";
|
||||
value = {
|
||||
device = "${ceres.${sambaDrive}.device}/${samba.paths.path1}";
|
||||
device = "${ceres.${sambaDrive}.device}/${folder}";
|
||||
fsType = "cifs";
|
||||
options = ceres.${sambaDrive}.options ++ [
|
||||
"credentials=${ceresSecrets}"
|
||||
|
@ -82,7 +88,9 @@ in
|
|||
}
|
||||
// (builtins.listToAttrs (map synologyMounts synologyDrives))
|
||||
// (builtins.listToAttrs (map storageMounts storageDrives))
|
||||
// (builtins.listToAttrs (map sambaMounts sambaDrives));
|
||||
// (builtins.listToAttrs (
|
||||
builtins.concatMap (drive: map (folder: sambaMounts drive folder) sambaFolders) sambaDrives
|
||||
));
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/8b1d43a7-baf8-4d15-a1ad-dc0c9dda6970"; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue