refactor: cleaned up nixos and home dirs

This commit is contained in:
Nick 2025-02-06 00:51:06 -06:00
parent 2000adb56a
commit 824a91d405
643 changed files with 323 additions and 195 deletions

View file

@ -1,65 +0,0 @@
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;
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;
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;
}

143
flake.lock generated
View file

@ -175,6 +175,22 @@
}
},
"flake-compat_5": {
"flake": false,
"locked": {
"lastModified": 1717312683,
"narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_6": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -190,7 +206,7 @@
"type": "github"
}
},
"flake-compat_6": {
"flake-compat_7": {
"flake": false,
"locked": {
"lastModified": 1733328505,
@ -206,7 +222,7 @@
"type": "github"
}
},
"flake-compat_7": {
"flake-compat_8": {
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
@ -400,11 +416,11 @@
"zig": "zig"
},
"locked": {
"lastModified": 1738619868,
"narHash": "sha256-q4h4SY1kVkZG4t/59CmJvaKjlx+xjojhdU1HqxiQhrQ=",
"lastModified": 1738781852,
"narHash": "sha256-fTr3m5Ktg1vWeAbscpYS7BTjOIACXMjkG1xazeRGvAc=",
"owner": "ghostty-org",
"repo": "ghostty",
"rev": "f0d276062b78658fc1f3857e9ea104788f1f4e58",
"rev": "4eb588501735e2df2910b54ed0dc8ad934b5d42f",
"type": "github"
},
"original": {
@ -488,11 +504,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1738625866,
"narHash": "sha256-0GibVm6Pfm99Lu5fcH68YGa3jO0zUdoO+V3DqmAcJTc=",
"lastModified": 1738723095,
"narHash": "sha256-5l7ghUJb++dh59VlaZlmAKDoaJgCtT7pCKP87bRNFZE=",
"owner": "helix-editor",
"repo": "helix",
"rev": "8995ccaae25b1af2e052d0d78ed74e7d225dec5a",
"rev": "b0e1eaf50d01257a743b8508f9eb29b78882c403",
"type": "github"
},
"original": {
@ -535,11 +551,11 @@
]
},
"locked": {
"lastModified": 1738610386,
"narHash": "sha256-yb6a5efA1e8xze1vcdN2HBxqYr340EsxFMrDUHL3WZM=",
"lastModified": 1738789832,
"narHash": "sha256-HdlMPfObPu5y7oDfH/w3vvlU3UTQ/bQjSULChZARm5M=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "066ba0c5cfddbc9e0dddaec73b1561ad38aa8abe",
"rev": "30ea6fed4e4b41693cebc2263373dd810de4de49",
"type": "github"
},
"original": {
@ -624,11 +640,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1738622170,
"narHash": "sha256-M9lm/lbT10cOXcfMMEzRFLehDlVWnkiy38xVDPWyqk4=",
"lastModified": 1738770121,
"narHash": "sha256-A51F7pmZXFrVB1AIhlTPL4cHlgkRKC0ffMs5y9zSazc=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "5e7292434a9189d0550187f8a6fb687848194a41",
"rev": "8a6778f0a087cdfc4bc1d3751b0be2c2bf3322aa",
"type": "github"
},
"original": {
@ -985,11 +1001,11 @@
"systems": "systems_6"
},
"locked": {
"lastModified": 1738530522,
"narHash": "sha256-6PdmWHiMmUEtDP324tKbHmgwYmeTvJju17DIN49ylqM=",
"lastModified": 1738663672,
"narHash": "sha256-+727mTmrCMOHQwOrAT5Ax4QsR7fQ0oPpAjaRP9sTu5s=",
"owner": "ngi-nix",
"repo": "ngipkgs",
"rev": "f3fb5a5b58f69fd79f432b7927fad41af5f71f59",
"rev": "d721deaf9a5f0359984dcebeadadfea8ec75081c",
"type": "github"
},
"original": {
@ -998,6 +1014,26 @@
"type": "github"
}
},
"nixos-cosmic": {
"inputs": {
"flake-compat": "flake-compat_5",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable_3"
},
"locked": {
"lastModified": 1738805812,
"narHash": "sha256-3wupg+xSzRPUius7y29btqCR2l28GpCjwS9q83uK9uU=",
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"rev": "bbab2cc88af97520259c5575bf29c83bf391424c",
"type": "github"
},
"original": {
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1738422722,
@ -1046,6 +1082,22 @@
"type": "github"
}
},
"nixpkgs-stable_3": {
"locked": {
"lastModified": 1738702386,
"narHash": "sha256-nJj8f78AYAxl/zqLiFGXn5Im1qjFKU8yBPKoWEeZN5M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "030ba1976b7c0e1a67d9716b17308ccdab5b381e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1733229606,
@ -1064,11 +1116,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1738546358,
"narHash": "sha256-nLivjIygCiqLp5QcL7l56Tca/elVqM9FG1hGd9ZSsrg=",
"lastModified": 1738680400,
"narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c6e957d81b96751a3d5967a0fd73694f303cc914",
"rev": "799ba5bffed04ced7067a91798353d360788b30d",
"type": "github"
},
"original": {
@ -1079,6 +1131,22 @@
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1738680400,
"narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "799ba5bffed04ced7067a91798353d360788b30d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1737003892,
"narHash": "sha256-RCzJE9wKByLCXmRBp+z8LK9EgdW+K+W/DXnJS4S/NVo=",
@ -1103,11 +1171,11 @@
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1738362438,
"narHash": "sha256-EO2dVkMVLThWqv4hobEZEZGWBEuH2Z9SYqQDrbLSclU=",
"lastModified": 1738816609,
"narHash": "sha256-y5cbTsuUCMYigHjV9cD9+zcqpwu+oJIUnVtcnCWmIhg=",
"owner": "nix-community",
"repo": "NUR",
"rev": "95ddad0ff0e67c90314c6ca46324dce5f9a910d2",
"rev": "e853d733b274463ff290f6f756f985406e740f30",
"type": "github"
},
"original": {
@ -1141,7 +1209,7 @@
},
"pre-commit-hooks-nix": {
"inputs": {
"flake-compat": "flake-compat_5",
"flake-compat": "flake-compat_6",
"gitignore": "gitignore_3",
"nixpkgs": [
"nixpkgs"
@ -1235,7 +1303,8 @@
"hyprland-portal": "hyprland-portal",
"lix-module": "lix-module",
"ngipkgs": "ngipkgs",
"nixpkgs": "nixpkgs_2",
"nixos-cosmic": "nixos-cosmic",
"nixpkgs": "nixpkgs_3",
"nur": "nur",
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
"sops-nix": "sops-nix_2",
@ -1537,17 +1606,17 @@
},
"waybar": {
"inputs": {
"flake-compat": "flake-compat_6",
"flake-compat": "flake-compat_7",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1738399335,
"narHash": "sha256-OvtDGDUX0P5oz/LzhzeAcGfd6ihlUHPMKR4CZgnScTA=",
"lastModified": 1738752268,
"narHash": "sha256-v2AXqro8mL5/IZNHNUAnRqLlR/vBiHxEXshYLiRAnTI=",
"owner": "Alexays",
"repo": "Waybar",
"rev": "0d5a4f82eca6df03b73908244d1dcd5fec2c3584",
"rev": "c32d5e3883558db2913dcd09c1b96a7e6c467c25",
"type": "github"
},
"original": {
@ -1600,15 +1669,15 @@
"yazi": {
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"rust-overlay": "rust-overlay_2"
},
"locked": {
"lastModified": 1738657731,
"narHash": "sha256-TfqSe8oywhZEIBs//PI7WXy+PtfkJTEbmFJ5tfXHvcM=",
"lastModified": 1738762515,
"narHash": "sha256-0LIVLou8bMYf4guwRy6YTNhMwwKWC4Ty1pg0bHm4588=",
"owner": "sxyazi",
"repo": "yazi",
"rev": "4e96341f512522d948977f5dc97a32c0c88f447b",
"rev": "e9fcab3b375afef4b0083687388b90e060a55a37",
"type": "github"
},
"original": {
@ -1620,18 +1689,18 @@
"zed-editor": {
"inputs": {
"crane": "crane_2",
"flake-compat": "flake-compat_7",
"flake-compat": "flake-compat_8",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay_3"
},
"locked": {
"lastModified": 1738656328,
"narHash": "sha256-bxFVQC8OuL2pdz4DYb8s0y+1pSftXGc375PDO0ZQRtk=",
"lastModified": 1738822025,
"narHash": "sha256-ME4bjL8qSnJuDf7rPnO0P8A3IVFPm89gp7yKuSuVQac=",
"owner": "zed-industries",
"repo": "zed",
"rev": "386cfacb25aae8e89d337f2893f5f8ec14cfee6b",
"rev": "c61f12dd225ffabd3913aa29adfdf3feb1a62522",
"type": "github"
},
"original": {

View file

@ -37,10 +37,7 @@
url = "github:helix-editor/helix";
inputs.nixpkgs.follows = "nixpkgs";
};
waybar = {
url = "github:Alexays/Waybar";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
@ -49,6 +46,10 @@
url = "github:hyprwm/xdg-desktop-portal-hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
waybar = {
url = "github:Alexays/Waybar";
inputs.nixpkgs.follows = "nixpkgs";
};
zed-editor = {
url = "github:zed-industries/zed";
inputs.nixpkgs.follows = "nixpkgs";
@ -59,11 +60,9 @@
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.pre-commit-hooks-nix.flakeModule
./home
./lib
./nixos
./modules
./parts
./config
];
flake =
@ -78,6 +77,7 @@
config.nixosModules.core
config.nixosModules.sops
config.nixosModules.system
inputs.nixos-cosmic.nixosModules.default
inputs.home-manager.nixosModules.home-manager
inputs.lix-module.nixosModules.default
inputs.nur.modules.nixos.default

View file

@ -1,9 +1,10 @@
{devicesFunctions}: let
inherit
(devicesFunctions)
{ devicesFunctions }:
let
inherit (devicesFunctions)
dummy
;
in {
in
{
name = dummy;
label = "Canon-TR7620a";
ip = {

View file

@ -1,9 +1,10 @@
{devicesFunctions}: let
inherit
(devicesFunctions)
{ devicesFunctions }:
let
inherit (devicesFunctions)
dummy
;
in {
in
{
name = dummy;
label = "Brother-HL-2170W";
ip = {

View file

@ -0,0 +1,76 @@
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;
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;
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;
}

View file

@ -1,13 +1,14 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
sslPath
sopsPath
;
acmeLabel = "Acme";
acmeName = "acme";
in {
in
{
label = acmeLabel;
name = acmeName;
paths = {

View file

@ -1,12 +1,13 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
sopsPath
;
caddyLabel = "Caddy";
caddyName = "caddy";
in {
in
{
label = caddyLabel;
name = caddyName;
sops = {

View file

@ -1,6 +1,6 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
domain0
jellyfinLabel
jellyfinName
@ -8,7 +8,8 @@
sslPath
sopsPath
;
in {
in
{
label = jellyfinLabel;
name = jellyfinName;
sops = {

View file

@ -1,13 +1,14 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
servicePath
sopsPath
;
matrixLabel = "Matrix";
matrixName = "matrix";
in {
in
{
label = matrixLabel;
name = matrixName;
sops = {

View file

@ -1,6 +1,6 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
domain0
servicePath
sslPath
@ -9,7 +9,8 @@
minecraftLabel = "Minecraft";
minecraftName = "minecraft";
in {
in
{
label = minecraftLabel;
name = minecraftName;
sops = {

View file

@ -1,6 +1,6 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
domain1
servicePath
sslPath
@ -9,7 +9,8 @@
nextcloudLabel = "Nextcloud";
nextcloudName = "nextcloud";
in {
in
{
label = nextcloudLabel;
name = nextcloudName;
sops = {

View file

@ -1,6 +1,6 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
domain0
servicePath
sslPath
@ -9,7 +9,8 @@
ollamaLabel = "Ollama";
ollamaName = "ollama";
in {
in
{
label = ollamaLabel;
name = ollamaName;
sops = {

View file

@ -1,6 +1,6 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
domain1
servicePath
sslPath
@ -10,7 +10,8 @@
owncastLabel = "Owncast";
owncastName = "owncast";
owncastSubdomain = "stream";
in {
in
{
label = owncastLabel;
name = owncastName;
sops = {

View file

@ -1,6 +1,6 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
domain3
servicePath
sslPath
@ -10,7 +10,8 @@
peertubeLabel = "PeerTube";
peertubeName = "peertube";
peertubeSubdomain = "video";
in {
in
{
label = peertubeLabel;
name = peertubeName;
email = {

View file

@ -1,13 +1,14 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
servicePath
sopsPath
;
postgresLabel = "PostgreSQL";
postgresName = "postgres";
in {
in
{
label = postgresLabel;
name = postgresName;
sops = {

View file

@ -1,6 +1,6 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
jellyfinLabel
jellyfinName
servicePath
@ -9,7 +9,8 @@
sambaLabel = "Samba";
sambaName = "samba";
in {
in
{
label = sambaLabel;
name = sambaName;
sops = {

View file

@ -1,6 +1,6 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
domain0
sslPath
sopsPath
@ -8,7 +8,8 @@
syncthingLabel = "Syncthing";
syncthingName = "syncthing";
in {
in
{
label = syncthingLabel;
name = syncthingName;
sops = {

View file

@ -1,12 +1,13 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
sopsPath
;
synologyLabel = "Synology";
synologyName = "synology";
in {
in
{
label = synologyLabel;
name = synologyName;
sops = {

View file

@ -1,6 +1,6 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
domain3
sslPath
sopsPath
@ -8,7 +8,8 @@
upRootNutritionLabel = "upRootNutrition";
upRootNutritionName = "uprootnutrition";
in {
in
{
label = upRootNutritionLabel;
name = upRootNutritionName;
email = {

View file

@ -1,6 +1,6 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
domain0
servicePath
sslPath
@ -9,7 +9,8 @@
vaultwardenLabel = "Vaultwarden";
vaultwardenName = "vaultwarden";
in {
in
{
label = vaultwardenLabel;
name = vaultwardenName;
email = {

View file

@ -1,12 +1,13 @@
{instancesFunctions}: let
inherit
(instancesFunctions)
{ instancesFunctions }:
let
inherit (instancesFunctions)
domain0
domain1
domain2
domain3
;
in {
in
{
domains = {
url0 = domain0;
url1 = domain1;

View file

@ -1,8 +1,10 @@
{user0}: let
{ user0 }:
let
inherit
user0
;
in {
in
{
name = "Nick";
aliases = {
name0 = "BRBWaffles";

View file

@ -1,8 +1,10 @@
{user1}: let
{ user1 }:
let
inherit
user1
;
in {
in
{
name = "Garnet";
email = {
address0 = "ninaeffler@gmail.com";

View file

@ -50,7 +50,7 @@ in
messaging
sharing
tools
hyprland
hypr
wayland
theming
;

Some files were not shown because too many files have changed in this diff Show more