chore: init

This commit is contained in:
Nick 2025-10-01 19:51:55 -05:00
commit 1b2c1ea359
891 changed files with 37053 additions and 0 deletions

View file

@ -0,0 +1,49 @@
{ moduleFunctions }:
let
inherit (moduleFunctions.devicesFunctions)
sshfsOptions
fileModeAndDirMode
ceresStorageDriveName
ownerExclusiveReadWriteMask
readWritePermissions
sambaPermissions
userIdForUser0
ceresIP
deviceNames
;
inherit (moduleFunctions.usersFunctions) user0;
inherit (moduleFunctions.devicesFunctions) externalIP;
ceresName = deviceNames.server;
in
{
label = deviceNames.serverLabel;
name = ceresName;
sync = {
address0 = "";
};
ip = {
address0 = ceresIP;
};
boot = {
options = ownerExclusiveReadWriteMask;
};
wireguard = {
ip0 = "10.100.0.1";
};
storage0 = {
mount = "/mnt/media/${ceresStorageDriveName}";
device = "/dev/disk/by-label/${ceresStorageDriveName}";
options = readWritePermissions;
};
samba0 = {
mount = "/mnt/media/${ceresName}";
device = "//${ceresIP}";
options = sambaPermissions ++ fileModeAndDirMode ++ userIdForUser0;
};
remote0 = {
mount = "/mnt/media/remote";
device = "${user0}@${externalIP}:/mnt/media/${ceresStorageDriveName}";
options = sshfsOptions;
};
}

View file

@ -0,0 +1,24 @@
{ moduleFunctions }:
let
inherit (moduleFunctions.devicesFunctions)
ownerWriteOthersReadMask
deimosIP
deviceNames
;
in
{
label = deviceNames.laptopLabel;
name = deviceNames.laptop;
sync = {
address0 = deimosIP;
};
ip = {
address0 = deimosIP;
};
wireguard = {
ip0 = "10.100.0.3";
};
boot = {
options = ownerWriteOthersReadMask;
};
}

View file

@ -0,0 +1,35 @@
{ moduleFunctions }:
let
inherit (moduleFunctions.devicesFunctions)
ownerWriteOthersReadMask
readWritePermissions
marsIP
deviceNames
;
in
{
label = deviceNames.desktopLabel;
name = deviceNames.desktop;
sync = {
address0 = "";
};
ip = {
address0 = marsIP;
};
boot = {
options = ownerWriteOthersReadMask;
};
wireguard = {
ip0 = "10.100.0.2";
};
storage0 = {
mount = "/mnt/media/games";
device = "/dev/disk/by-label/Games";
options = readWritePermissions;
};
storage1 = {
mount = "/mnt/media/storage";
device = "/dev/disk/by-label/Storage";
options = readWritePermissions;
};
}

View file

@ -0,0 +1,21 @@
{ moduleFunctions }:
let
inherit (moduleFunctions.devicesFunctions)
ownerWriteOthersReadMask
phobosIP
deviceNames
;
in
{
label = deviceNames.laptop2Label;
name = deviceNames.laptop2;
sync = {
address0 = phobosIP;
};
ip = {
address0 = phobosIP;
};
boot = {
options = ownerWriteOthersReadMask;
};
}

View file

@ -0,0 +1,18 @@
{ moduleFunctions }:
let
inherit (moduleFunctions.devicesFunctions)
phoneIP
dummy
deviceNames
;
in
{
name = deviceNames.phone;
label = dummy;
sync = {
address0 = "RMDKNJY-BTX6FYF-G6SR332-WS6HARI-PF74SC6-VPBSGRQ-MKVQZEQ-KSIB6QV"; # User0
};
ip = {
address0 = phoneIP;
};
}

View file

@ -0,0 +1,12 @@
{ moduleFunctions }:
let
inherit (moduleFunctions.devicesFunctions) dummy;
in
{
name = dummy;
label = "Canon-TR7620a";
ip = {
address0 = "";
};
}

View file

@ -0,0 +1,12 @@
{ moduleFunctions }:
let
inherit (moduleFunctions.devicesFunctions) brotherIP dummy;
in
{
name = dummy;
label = "Brother-HL-2170W";
ip = {
address0 = brotherIP;
};
}

View file

@ -0,0 +1,34 @@
{ moduleFunctions }:
let
inherit (moduleFunctions.devicesFunctions)
sambaPermissions
userIdForUser0
userIdForUser1
synologyIP
deviceNames
;
inherit (moduleFunctions.usersFunctions) user0 user0Label user1;
synologyName = deviceNames.nas;
in
{
label = deviceNames.nasLabel;
sync = {
address0 = "MWRGX2V-F5XKE5E-REP6ECT-OOPFBMF-22NHSMW-YFBU6MB-PLFUN63-R3MW2QX"; # User0
};
name = synologyName;
ip = {
address0 = synologyIP;
};
# Nick Home Folder
folder0 = {
mount = "/mnt/media/${synologyName}/${user0}";
device = "//${synologyIP}/homes/${user0Label}";
options = sambaPermissions ++ userIdForUser0;
};
# Streaming Folder
folder1 = {
mount = "/mnt/media/${synologyName}/${user1}";
device = "//${synologyIP}/homes/${user0Label}";
options = sambaPermissions ++ userIdForUser1;
};
}

View file

@ -0,0 +1,45 @@
{ moduleFunctions }:
let
configPath = ./config;
printerPath = configPath + /printers;
deviceswithFunctions = builtins.listToAttrs (
map
(name: {
name = builtins.substring 0 (builtins.stringLength name - 4) name;
value = import (configPath + "/${name}") {
inherit
moduleFunctions
;
};
})
(
builtins.filter (name: builtins.match ".*\\.nix$" name != null) (
builtins.attrNames (builtins.readDir configPath)
)
)
);
devicesPrinters = builtins.listToAttrs (
map
(name: {
name = builtins.substring 0 (builtins.stringLength name - 4) name;
value = import (printerPath + "/${name}") {
inherit
moduleFunctions
;
};
})
(
builtins.filter (name: builtins.match ".*\\.nix$" name != null) (
builtins.attrNames (builtins.readDir printerPath)
)
)
);
devices = deviceswithFunctions // devicesPrinters;
in
{
devices = devices;
}