mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 18:15:13 -05:00
refactor: complete overhaul
This commit is contained in:
parent
fb3e6fed86
commit
0541b3d61f
154 changed files with 936 additions and 904 deletions
27
config/devices/config/desktop.nix
Normal file
27
config/devices/config/desktop.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{devicesFunctions}: let
|
||||
inherit
|
||||
(devicesFunctions)
|
||||
ownerWriteOthersReadMask
|
||||
readWritePermissions
|
||||
;
|
||||
in {
|
||||
label = "Desktop";
|
||||
name = "desktop";
|
||||
sync = "";
|
||||
ip = {
|
||||
address0 = "192.168.50.196";
|
||||
};
|
||||
boot = {
|
||||
options = ownerWriteOthersReadMask;
|
||||
};
|
||||
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;
|
||||
};
|
||||
}
|
16
config/devices/config/laptop.nix
Normal file
16
config/devices/config/laptop.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{devicesFunctions}: let
|
||||
inherit
|
||||
(devicesFunctions)
|
||||
ownerWriteOthersReadMask
|
||||
;
|
||||
in {
|
||||
label = "Laptop";
|
||||
name = "laptop";
|
||||
sync = "";
|
||||
ip = {
|
||||
address0 = "192.168.50.142";
|
||||
};
|
||||
boot = {
|
||||
options = ownerWriteOthersReadMask;
|
||||
};
|
||||
}
|
13
config/devices/config/phone.nix
Normal file
13
config/devices/config/phone.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{devicesFunctions}: let
|
||||
inherit
|
||||
(devicesFunctions)
|
||||
dummy
|
||||
;
|
||||
in {
|
||||
name = "pixel";
|
||||
label = dummy;
|
||||
sync = "RMDKNJY-BTX6FYF-G6SR332-WS6HARI-PF74SC6-VPBSGRQ-MKVQZEQ-KSIB6QV";
|
||||
ip = {
|
||||
address0 = "192.168.50.243";
|
||||
};
|
||||
}
|
12
config/devices/config/printers/printer0.nix
Normal file
12
config/devices/config/printers/printer0.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{devicesFunctions}: let
|
||||
inherit
|
||||
(devicesFunctions)
|
||||
dummy
|
||||
;
|
||||
in {
|
||||
name = dummy;
|
||||
label = "Canon-TR7620a";
|
||||
ip = {
|
||||
address0 = "";
|
||||
};
|
||||
}
|
12
config/devices/config/printers/printer1.nix
Normal file
12
config/devices/config/printers/printer1.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{devicesFunctions}: let
|
||||
inherit
|
||||
(devicesFunctions)
|
||||
dummy
|
||||
;
|
||||
in {
|
||||
name = dummy;
|
||||
label = "Brother-HL-2170W";
|
||||
ip = {
|
||||
address0 = "192.168.50.195";
|
||||
};
|
||||
}
|
32
config/devices/config/server.nix
Normal file
32
config/devices/config/server.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{devicesFunctions}: let
|
||||
inherit
|
||||
(devicesFunctions)
|
||||
fileModeAndDirMode
|
||||
ownerExclusiveReadWriteMask
|
||||
readWritePermissions
|
||||
sambaPermissions
|
||||
userIdForUser0
|
||||
;
|
||||
serverName = "server";
|
||||
serverIP = "192.168.50.140";
|
||||
serverStorageDriveName = "NAS1";
|
||||
in {
|
||||
label = "Server";
|
||||
name = serverName;
|
||||
ip = {
|
||||
address0 = serverIP;
|
||||
};
|
||||
boot = {
|
||||
options = ownerExclusiveReadWriteMask;
|
||||
};
|
||||
storage0 = {
|
||||
mount = "/mnt/media/${serverStorageDriveName}";
|
||||
device = "/dev/disk/by-label/${serverStorageDriveName}";
|
||||
options = readWritePermissions;
|
||||
};
|
||||
samba0 = {
|
||||
mount = "/mnt/media/${serverName}";
|
||||
device = "//${serverIP}";
|
||||
options = sambaPermissions ++ fileModeAndDirMode ++ userIdForUser0;
|
||||
};
|
||||
}
|
40
config/devices/config/synology.nix
Normal file
40
config/devices/config/synology.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{devicesFunctions}: let
|
||||
inherit
|
||||
(devicesFunctions)
|
||||
sambaPermissions
|
||||
userIdForUser0
|
||||
userIdForUser1
|
||||
;
|
||||
|
||||
user0 = "nick";
|
||||
user1 = "garnet";
|
||||
user0Name = "Nick";
|
||||
user1Name = "Garnet";
|
||||
synologyName = "synology";
|
||||
synologyIP = "192.168.50.209";
|
||||
in {
|
||||
label = "Synology";
|
||||
sync = "MWRGX2V-F5XKE5E-REP6ECT-OOPFBMF-22NHSMW-YFBU6MB-PLFUN63-R3MW2QX";
|
||||
name = synologyName;
|
||||
ip = {
|
||||
address0 = synologyIP;
|
||||
};
|
||||
# Nick Home Folder
|
||||
folder0 = {
|
||||
mount = "/mnt/media/${synologyName}/${user0}";
|
||||
device = "//${synologyIP}/homes/${user0Name}";
|
||||
options = sambaPermissions ++ userIdForUser0;
|
||||
};
|
||||
# Garnet Home Folder
|
||||
folder1 = {
|
||||
mount = "/mnt/media/${synologyName}/${user1}";
|
||||
device = "//${synologyIP}/homes/${user1Name}";
|
||||
options = sambaPermissions ++ userIdForUser1;
|
||||
};
|
||||
# Minecraft Worlds
|
||||
folder2 = {
|
||||
mount = "/home/${user1}/.local/share/PrismLauncher/instances/1.21/.minecraft/saves";
|
||||
device = "//${synologyIP}/homes/${user1Name}/Minecraft";
|
||||
options = sambaPermissions ++ userIdForUser1;
|
||||
};
|
||||
}
|
13
config/devices/config/tablet.nix
Normal file
13
config/devices/config/tablet.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{devicesFunctions}: let
|
||||
inherit
|
||||
(devicesFunctions)
|
||||
dummy
|
||||
;
|
||||
in {
|
||||
name = "tablet";
|
||||
label = dummy;
|
||||
sync = "I2ZSCZU-T4JMUJJ-XCUQ3MY-G5EUFZ5-KRG2DRY-XIBJZZM-FQW3UMY-CBCTUQU";
|
||||
ip = {
|
||||
address0 = "192.168.50.189";
|
||||
};
|
||||
}
|
35
config/devices/default.nix
Executable file
35
config/devices/default.nix
Executable file
|
@ -0,0 +1,35 @@
|
|||
let
|
||||
configPath = ./config;
|
||||
printerPath = configPath + /printers;
|
||||
|
||||
devicesFunctions = {
|
||||
ownerWriteOthersReadMask = ["fmask=0022" "dmask=0022"];
|
||||
ownerExclusiveReadWriteMask = ["fmask=0077" "dmask=0077"];
|
||||
readWritePermissions = ["rw"];
|
||||
sambaPermissions = ["rw" "gid=100" "vers=3.0" "x-systemd.automount" "x-systemd.requires=network-online.target"];
|
||||
fileModeAndDirMode = ["file_mode=0644" "dir_mode=0755"];
|
||||
userIdForUser0 = ["uid=1000"];
|
||||
userIdForUser1 = ["uid=1001"];
|
||||
dummy = [];
|
||||
};
|
||||
|
||||
deviceswithFunctions = builtins.listToAttrs (map (name: {
|
||||
name = builtins.substring 0 (builtins.stringLength name - 4) name; # Remove the last 4 characters (".nix")
|
||||
value = import (configPath + "/${name}") {inherit devicesFunctions;};
|
||||
})
|
||||
(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; # Remove the last 4 characters (".nix")
|
||||
value = import (printerPath + "/${name}") {inherit devicesFunctions;};
|
||||
})
|
||||
(builtins.filter (name:
|
||||
builtins.match ".*\\.nix$" name != null) (builtins.attrNames
|
||||
(builtins.readDir printerPath))));
|
||||
|
||||
devices = deviceswithFunctions // devicesPrinters;
|
||||
in {
|
||||
devices = devices;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue