mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-14 02:20:53 -06:00
fix: syncthing cucked
This commit is contained in:
parent
1eacc3aa09
commit
2cd05e31fc
15 changed files with 64 additions and 23 deletions
|
|
@ -85,6 +85,7 @@ in
|
||||||
vaultwardenEris
|
vaultwardenEris
|
||||||
syncthingEris
|
syncthingEris
|
||||||
photoprismEris
|
photoprismEris
|
||||||
|
nasDirs
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ../../helpers.nix) labHelpers;
|
inherit (import ../../../helpers.nix) labHelpers;
|
||||||
inherit (labHelpers) guestPath;
|
inherit (labHelpers) guestPath;
|
||||||
inherit (import ../config { inherit config flake pkgs; }) fireflyVM;
|
inherit (import ../config { inherit config flake pkgs; }) fireflyVM;
|
||||||
inherit (flake.config.people) user0;
|
inherit (flake.config.people) user0;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ../../helpers.nix) labHelpers;
|
inherit (import ../../../helpers.nix) labHelpers;
|
||||||
inherit (labHelpers) mntPath;
|
inherit (labHelpers) mntPath;
|
||||||
inherit (import ../config { inherit flake pkgs; }) forgejoVM;
|
inherit (import ../config { inherit flake pkgs; }) forgejoVM;
|
||||||
inherit (flake.config.people) user0;
|
inherit (flake.config.people) user0;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ../../helpers.nix) labHelpers;
|
inherit (import ../../../helpers.nix) labHelpers;
|
||||||
inherit (labHelpers) mntPath;
|
inherit (labHelpers) mntPath;
|
||||||
inherit (import ../config { inherit flake config; }) jellyfinVM;
|
inherit (import ../config { inherit flake config; }) jellyfinVM;
|
||||||
inherit (flake.config.people) user0;
|
inherit (flake.config.people) user0;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ../../helpers.nix) labHelpers;
|
inherit (import ../../../helpers.nix) labHelpers;
|
||||||
inherit (labHelpers) mntPath;
|
inherit (labHelpers) mntPath;
|
||||||
inherit
|
inherit
|
||||||
(import ../config {
|
(import ../config {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ../../helpers.nix) labHelpers;
|
inherit (import ../../../helpers.nix) labHelpers;
|
||||||
inherit (labHelpers) mntPath;
|
inherit (labHelpers) mntPath;
|
||||||
inherit (import ../config { inherit flake pkgs; }) minecraftVM;
|
inherit (import ../config { inherit flake pkgs; }) minecraftVM;
|
||||||
inherit (flake.config.services) instances;
|
inherit (flake.config.services) instances;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ../../helpers.nix) labHelpers;
|
inherit (import ../../../helpers.nix) labHelpers;
|
||||||
inherit (labHelpers) mntPath;
|
inherit (labHelpers) mntPath;
|
||||||
inherit (import ../config { inherit flake pkgs; }) opencloudVM;
|
inherit (import ../config { inherit flake pkgs; }) opencloudVM;
|
||||||
inherit (flake.config.people) user0;
|
inherit (flake.config.people) user0;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ../../helpers.nix) labHelpers;
|
inherit (import ../../../helpers.nix) labHelpers;
|
||||||
inherit (labHelpers) guestPath;
|
inherit (labHelpers) guestPath;
|
||||||
inherit (import ../config { inherit flake pkgs; }) opencloudVM;
|
inherit (import ../config { inherit flake pkgs; }) opencloudVM;
|
||||||
inherit (flake.config.people) user0;
|
inherit (flake.config.people) user0;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ../../helpers.nix) labHelpers;
|
inherit (import ../../../helpers.nix) labHelpers;
|
||||||
inherit (labHelpers) guestPath mediaPath;
|
inherit (labHelpers) guestPath mediaPath;
|
||||||
inherit (import ../config { inherit flake lib; }) photoprismVM;
|
inherit (import ../config { inherit flake lib; }) photoprismVM;
|
||||||
inherit (flake.config.services.instances) photoprism;
|
inherit (flake.config.services.instances) photoprism;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ../../helpers.nix) labHelpers;
|
inherit (import ../../../helpers.nix) labHelpers;
|
||||||
inherit (labHelpers) mntPath;
|
inherit (labHelpers) mntPath;
|
||||||
inherit (import ../config { inherit config flake pkgs; }) qbittorrentVM;
|
inherit (import ../config { inherit config flake pkgs; }) qbittorrentVM;
|
||||||
inherit (flake.config.people) user0;
|
inherit (flake.config.people) user0;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ in
|
||||||
devices,
|
devices,
|
||||||
tmpIn,
|
tmpIn,
|
||||||
mounts,
|
mounts,
|
||||||
tmpOut,
|
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
microvm.vms = {
|
microvm.vms = {
|
||||||
|
|
@ -149,8 +148,7 @@ in
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d ${mnt} 0751 microvm wheel - -"
|
"d ${mnt} 0751 microvm wheel - -"
|
||||||
"d ${mnt}/${serviceCfg.name} 0751 microvm wheel - -"
|
"d ${mnt}/${serviceCfg.name} 0751 microvm wheel - -"
|
||||||
]
|
];
|
||||||
++ tmpOut;
|
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
"${serviceCfg.name}/${user}-pass" = {
|
"${serviceCfg.name}/${user}-pass" = {
|
||||||
owner = "root";
|
owner = "root";
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ../../helpers.nix) labHelpers;
|
inherit (import ../../../helpers.nix) labHelpers;
|
||||||
inherit (labHelpers)
|
inherit (labHelpers)
|
||||||
guestPath
|
guestPath
|
||||||
mediaPath
|
mediaPath
|
||||||
|
|
@ -81,13 +81,6 @@ let
|
||||||
"d /var/lib/${serviceCfg.name}/misc 0755 ${serviceCfg.name} ${serviceCfg.name} -"
|
"d /var/lib/${serviceCfg.name}/misc 0755 ${serviceCfg.name} ${serviceCfg.name} -"
|
||||||
];
|
];
|
||||||
|
|
||||||
tmpRulesOut = user: [
|
|
||||||
"d ${guestPath user} 0751 microvm wheel - -"
|
|
||||||
"d ${docsPath user} 0751 microvm wheel - -"
|
|
||||||
"d ${mediaPath user} 0751 microvm wheel - -"
|
|
||||||
"d ${miscPath user} 0751 microvm wheel - -"
|
|
||||||
];
|
|
||||||
|
|
||||||
syncthingNick =
|
syncthingNick =
|
||||||
let
|
let
|
||||||
phoneID = "OALKHLZ-OODUWVX-PAC2LI7-UMZMSZO-FELLRCD-RS4DHJS-PVA5YQK-WTFXXQI";
|
phoneID = "OALKHLZ-OODUWVX-PAC2LI7-UMZMSZO-FELLRCD-RS4DHJS-PVA5YQK-WTFXXQI";
|
||||||
|
|
@ -102,8 +95,7 @@ let
|
||||||
folders = foldersHelper user0;
|
folders = foldersHelper user0;
|
||||||
devices = devicesHelper user0 phoneID "Phone" "192.168.50.8";
|
devices = devicesHelper user0 phoneID "Phone" "192.168.50.8";
|
||||||
mounts = mountsHelper user0;
|
mounts = mountsHelper user0;
|
||||||
tmpIn = tmpRulesIn;
|
tmp = tmpRulesIn;
|
||||||
tmpOut = tmpRulesOut user0;
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
syncthingNick
|
syncthingNick
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (import ../../helpers.nix) labHelpers;
|
inherit (import ../../../helpers.nix) labHelpers;
|
||||||
inherit (labHelpers) guestPath;
|
inherit (labHelpers) guestPath;
|
||||||
inherit (import ../config { inherit flake; }) vaultwardenVM;
|
inherit (import ../config { inherit flake; }) vaultwardenVM;
|
||||||
inherit (flake.config.people) user0;
|
inherit (flake.config.people) user0;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,21 @@
|
||||||
|
{ flake, ... }:
|
||||||
|
let
|
||||||
|
inherit (flake.config.people) user0;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
labHelpers = {
|
labHelpers = {
|
||||||
mntPath = "/mnt/storage";
|
mntPath = "/mnt/storage";
|
||||||
|
groupPath = "/mnt/storage/users";
|
||||||
|
userPath = user: "/mnt/storage/users/${user}";
|
||||||
guestPath = user: "/mnt/storage/users/${user}/guests";
|
guestPath = user: "/mnt/storage/users/${user}/guests";
|
||||||
|
homePath = user: "/mnt/storage/users/${user}/home";
|
||||||
docsPath = user: "/mnt/storage/users/${user}/home/docs";
|
docsPath = user: "/mnt/storage/users/${user}/home/docs";
|
||||||
mediaPath = user: "/mnt/storage/users/${user}/home/media";
|
mediaPath = user: "/mnt/storage/users/${user}/home/media";
|
||||||
miscPath = user: "/mnt/storage/users/${user}/home/misc";
|
miscPath = user: "/mnt/storage/users/${user}/home/misc";
|
||||||
};
|
};
|
||||||
|
nasUsers = {
|
||||||
|
nasUser0 = user0;
|
||||||
|
nasUser1 = "stacie";
|
||||||
|
nasUser2 = "garnet";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
38
modules/nixos/homelab/nasDirs/default.nix
Normal file
38
modules/nixos/homelab/nasDirs/default.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
let
|
||||||
|
inherit (import ./helpers.nix) labHelpers nasUsers;
|
||||||
|
inherit (labHelpers)
|
||||||
|
guestPath
|
||||||
|
mediaPath
|
||||||
|
docsPath
|
||||||
|
homePath
|
||||||
|
miscPath
|
||||||
|
userPath
|
||||||
|
groupPath
|
||||||
|
mntPath
|
||||||
|
;
|
||||||
|
|
||||||
|
nasDirs = user: [
|
||||||
|
"d ${userPath user} 0751 microvm wheel - -"
|
||||||
|
"d ${homePath user} 0751 microvm wheel - -"
|
||||||
|
"d ${guestPath user} 0751 microvm wheel - -"
|
||||||
|
"d ${docsPath user} 0751 microvm wheel - -"
|
||||||
|
"d ${mediaPath user} 0751 microvm wheel - -"
|
||||||
|
"d ${miscPath user} 0751 microvm wheel - -"
|
||||||
|
];
|
||||||
|
|
||||||
|
nasUserList = [
|
||||||
|
nasUsers.nasUser0
|
||||||
|
nasUsers.nasUser1
|
||||||
|
nasUsers.nasUser2
|
||||||
|
];
|
||||||
|
|
||||||
|
nasDirBuilder = builtins.concatLists (builtins.map (user: nasDirs user) nasUserList);
|
||||||
|
|
||||||
|
defaultDirs = [
|
||||||
|
"d ${mntPath} 0751 microvm wheel - -"
|
||||||
|
"d ${groupPath} 0751 microvm wheel - -"
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
systemd.tmpfiles.rules = defaultDirs ++ nasDirBuilder;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue