test: setting up nas structure

This commit is contained in:
Nick 2025-12-07 04:37:17 -06:00
parent 7cf2f70441
commit 312c52d613
8 changed files with 100 additions and 73 deletions

View file

@ -83,7 +83,7 @@ in
impermanence
lix
microvm
opencloud0
nas
sambaEris
;
};

View file

@ -0,0 +1,18 @@
{
flake,
pkgs,
lib,
...
}:
let
syncthing = import ./syncthing { inherit flake; };
photoprism = import ./photoprism { inherit flake lib; };
opencloud = import ./opencloud { inherit flake pkgs; };
in
{
imports = [
syncthing
photoprism
opencloud
];
}

View file

@ -91,7 +91,7 @@ in
network = {
enable = true;
networks."20-lan" = {
matchConfig.Name = "enp0s6";
matchConfig.Name = "enp0s5";
addresses = [
{ Address = "${ip}/24"; }
];
@ -110,7 +110,6 @@ in
tmpfiles.rules = [
"d /var/lib/${serviceCfg.name} 0755 ${serviceCfg.name} ${serviceCfg.name} -"
"z /etc/opencloud 0700 ${serviceCfg.name} ${serviceCfg.name} -"
];
};
microvm = {

View file

@ -1,6 +1,6 @@
{ flake, ... }:
{ flake, pkgs, ... }:
let
inherit (import ./config) opencloudVM;
inherit (import ./config { inherit flake pkgs; }) opencloudVM;
inherit (flake.config.people) user0;
opencloudNick = opencloudVM {
@ -12,23 +12,24 @@ let
host = "";
};
opencloudStacie = opencloudVM {
user = "stacie";
ip = "192.168.50.68";
mac = "02:00:00:00:58:68";
userMac = "02:00:00:00:00:68";
ssh = 2508;
host = "";
};
# opencloudStacie = opencloudVM {
# user = "stacie";
# ip = "192.168.50.68";
# mac = "02:00:00:00:58:68";
# userMac = "02:00:00:00:00:68";
# ssh = 2508;
# host = "";
# };
opencloudGarnet = opencloudVM {
user = "garnet";
ip = "192.168.50.69";
mac = "02:00:00:00:59:69";
userMac = "02:00:00:00:00:69";
ssh = 2509;
host = "";
};
# opencloudGarnet = opencloudVM {
# user = "garnet";
# ip = "192.168.50.69";
# mac = "02:00:00:00:59:69";
# userMac = "02:00:00:00:00:69";
# ssh = 2509;
# host = "";
# };
in
opencloudNick // opencloudStacie // opencloudGarnet
opencloudNick
# // opencloudStacie // opencloudGarnet

View file

@ -1,6 +1,6 @@
{
config,
flake,
lib,
...
}:
let
@ -35,8 +35,10 @@ in
PHOTOPRISM_DEFAULT_LOCAL = "en";
};
passwordFile = "/run/secrets/${user}-pass";
storagePath = "/var/lib/${serviceCfg.name}";
originalsPath = "/var/lib/${serviceCfg.name}-media";
importPath = "photos";
address = "0.0.0.0";
};
openssh = {
enable = true;
@ -47,6 +49,13 @@ in
};
};
users.users.photoprism = {
isSystemUser = true;
group = "photoprism";
home = "/var/lib/photoprism";
};
users.groups.photoprism = { };
networking.firewall.allowedTCPPorts = [
22
2342
@ -54,6 +63,13 @@ in
systemd = {
services = {
photoprism = {
serviceConfig = {
DynamicUser = lib.mkForce false;
User = serviceCfg.name;
Group = serviceCfg.name;
};
};
systemd-networkd.wantedBy = [
"multi-user.target"
];
@ -78,12 +94,11 @@ in
};
};
tmpfiles.rules = [
"Z /var/lib/${serviceCfg.name} 0755 ${serviceCfg.name} ${serviceCfg.name} -"
"d /var/lib/${serviceCfg.name}-media 0755 ${serviceCfg.name} ${serviceCfg.name} -"
"d /var/lib/${serviceCfg.name}-media/photos 0755 ${serviceCfg.name} ${serviceCfg.name} -"
];
# tmpfiles.rules = [
# "d /var/lib/${serviceCfg.name} 0755 ${serviceCfg.name} ${serviceCfg.name} -"
# "d /var/lib/${serviceCfg.name}-media 0755 ${serviceCfg.name} ${serviceCfg.name} -"
# "d /var/lib/${serviceCfg.name}-media/photos 0755 ${serviceCfg.name} ${serviceCfg.name} -"
# ];
};
microvm = {

View file

@ -1,6 +1,6 @@
{ flake, ... }:
{ flake, lib, ... }:
let
inherit (import ./config) photoprismVM;
inherit (import ./config { inherit flake lib; }) photoprismVM;
inherit (flake.config.people) user0;
photoprismNick = photoprismVM {
@ -11,21 +11,22 @@ let
ssh = 2504;
};
photoprismStacie = photoprismVM {
user = "stacie";
ip = "192.168.50.65";
mac = "02:00:00:00:55:65";
userMac = "02:00:00:00:00:65";
ssh = 2505;
};
# photoprismStacie = photoprismVM {
# user = "stacie";
# ip = "192.168.50.65";
# mac = "02:00:00:00:55:65";
# userMac = "02:00:00:00:00:65";
# ssh = 2505;
# };
photoprismGarnet = photoprismVM {
user = "garnet";
ip = "192.168.50.66";
mac = "02:00:00:00:56:66";
userMac = "02:00:00:00:00:66";
ssh = 2506;
};
# photoprismGarnet = photoprismVM {
# user = "garnet";
# ip = "192.168.50.66";
# mac = "02:00:00:00:56:66";
# userMac = "02:00:00:00:00:66";
# ssh = 2506;
# };
in
photoprismNick // photoprismStacie // photoprismGarnet
photoprismNick
# // photoprismStacie // photoprismGarnet

View file

@ -195,12 +195,5 @@ in
systemd.tmpfiles.rules = [
"d /mnt/storage/users/${user}/guests/${serviceCfg.name} 0751 microvm wheel - -"
];
sops.secrets = {
"${serviceCfg.name}/${user}-pass" = {
owner = "root";
mode = "0600";
};
};
};
}

View file

@ -1,6 +1,6 @@
{ flake, ... }:
let
inherit (import ./config) syncthingVM;
inherit (import ./config { inherit flake; }) syncthingVM;
inherit (flake.config.people) user0;
syncthingNick = syncthingVM {
@ -9,29 +9,29 @@ let
mac = "02:00:00:00:51:61";
userMac = "02:00:00:00:00:61";
ssh = 2501;
syncID = "RMDKNJY-BTX6FYF-G6SR332-WS6HARI-PF74SC6-VPBSGRQ-MKVQZEQ-KSIB6QV";
syncID = "OALKHLZ-OODUWVX-PAC2LI7-UMZMSZO-FELLRCD-RS4DHJS-PVA5YQK-WTFXXQI";
deviceIP = "192.168.50.8";
};
syncthingStacie = syncthingVM {
user = "stacie";
ip = "192.168.50.62";
mac = "02:00:00:00:52:62";
userMac = "02:00:00:00:00:62";
ssh = 2502;
syncID = "";
deviceIP = "";
};
# syncthingStacie = syncthingVM {
# user = "stacie";
# ip = "192.168.50.62";
# mac = "02:00:00:00:52:62";
# userMac = "02:00:00:00:00:62";
# ssh = 2502;
# syncID = "";
# deviceIP = "";
# };
syncthingGarnet = syncthingVM {
user = "garnet";
ip = "192.168.50.63";
mac = "02:00:00:00:53:63";
userMac = "02:00:00:00:00:63";
ssh = 2503;
syncID = "";
deviceIP = "";
};
# syncthingGarnet = syncthingVM {
# user = "garnet";
# ip = "192.168.50.63";
# mac = "02:00:00:00:53:63";
# userMac = "02:00:00:00:00:63";
# ssh = 2503;
# syncID = "";
# deviceIP = "";
# };
in
syncthingNick