feat: changed naming convention for devices

This commit is contained in:
Nick 2025-02-17 18:52:02 -06:00
parent cc77a50fc1
commit a0e5ffb3d4
57 changed files with 351 additions and 341 deletions

View file

@ -5,7 +5,7 @@
}:
let
inherit (flake.config.people) user1;
inherit (flake.config.machines.devices) bartholomew;
inherit (flake.config.machines.devices) callisto;
in
{
fileSystems = {
@ -16,7 +16,7 @@ in
"/boot" = {
device = "/dev/disk/by-uuid/1703-D452";
fsType = "vfat";
options = bartholomew.boot.options;
options = callisto.boot.options;
};
};

View file

@ -5,12 +5,12 @@
}:
let
inherit (flake.config.machines.devices)
bartholomew
callisto
;
in
{
networking = {
hostName = bartholomew.name;
hostName = callisto.name;
networkmanager.enable = true;
nftables.enable = true;
useDHCP = lib.mkDefault true;

View file

@ -2,7 +2,8 @@
pkgs,
config,
...
}: {
}:
{
boot = {
extraModulePackages = [
config.boot.kernelPackages.v4l2loopback.out

View file

@ -2,30 +2,31 @@
flake,
config,
...
}: let
inherit
(flake.config.people)
}:
let
inherit (flake.config.people)
user0
;
inherit
(flake.config.machines.devices)
server
inherit (flake.config.machines.devices)
ceres
;
in {
fileSystems = let
storageDrives = [
"storage0"
];
in
{
fileSystems =
let
storageDrives = [
"storage0"
];
storageMounts = storage: {
name = "${server.${storage}.mount}";
value = {
device = server.${storage}.device;
fsType = "ext4";
options = server.${storage}.options;
storageMounts = storage: {
name = "${ceres.${storage}.mount}";
value = {
device = ceres.${storage}.device;
fsType = "ext4";
options = ceres.${storage}.options;
};
};
};
in
in
{
"/" = {
device = "/dev/disk/by-uuid/de4e681b-0667-4bf8-8d6e-c50894aa41cd";
@ -39,12 +40,12 @@ in {
// (builtins.listToAttrs (map storageMounts storageDrives));
swapDevices = [
{device = "/dev/disk/by-uuid/259fcc06-912c-4bd3-b781-8f77449e935a";}
{ device = "/dev/disk/by-uuid/259fcc06-912c-4bd3-b781-8f77449e935a"; }
];
systemd.tmpfiles.rules = [
"Z ${config.home-manager.users.${user0}.home.homeDirectory} 0755 ${user0} users -"
"Z ${server.storage0.mount} 2775 root root -"
"Z ${ceres.storage0.mount} 2775 root root -"
];
services.udisks2.enable = true;

View file

@ -1,20 +1,18 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
hardware = {
graphics = {
enable = true;
extraPackages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
amdvlk
;
inherit
(pkgs.rocmPackages.clr)
inherit (pkgs.rocmPackages.clr)
icd
;
};
extraPackages32 = builtins.attrValues {
inherit
(pkgs.driversi686Linux)
inherit (pkgs.driversi686Linux)
amdvlk
;
};

View file

@ -3,7 +3,8 @@
lib,
pkgs,
...
}: {
}:
{
hardware = {
firmware = [
pkgs.rtl8761b-firmware

View file

@ -4,11 +4,11 @@
...
}:
let
inherit (flake.config.machines.devices) server;
inherit (flake.config.machines.devices) ceres;
in
{
networking = {
hostName = server.name;
hostName = ceres.name;
networkmanager.enable = true;
nftables.enable = true;
useDHCP = lib.mkDefault true;

View file

@ -1,9 +1,10 @@
{flake, ...}: let
inherit
(flake.config.people)
{ flake, ... }:
let
inherit (flake.config.people)
user0
;
in {
in
{
sops = {
secrets = {
"discord-token" = {

17
systems/ceres/default.nix Executable file
View file

@ -0,0 +1,17 @@
{ lib, ... }:
let
configPath = ./config;
ceresImports =
let
files = builtins.attrNames (builtins.readDir configPath);
in
map (name: configPath + "/${name}") (
builtins.filter (name: builtins.match ".*\\.nix$" name != null) files
);
in
{
imports = ceresImports;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
system.stateVersion = lib.mkForce "24.05";
}

View file

@ -1,14 +0,0 @@
{lib, ...}: let
configPath = ./config;
desktopImports = let
files = builtins.attrNames (builtins.readDir configPath);
in
map
(name: configPath + "/${name}")
(builtins.filter (name: builtins.match ".*\\.nix$" name != null) files);
in {
imports = desktopImports;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
system.stateVersion = lib.mkForce "24.05";
}

View file

@ -5,7 +5,7 @@
}:
let
inherit (flake.config.people) user2;
inherit (flake.config.machines.devices) fallaryn;
inherit (flake.config.machines.devices) saturn;
in
{
imports = [ ];
@ -18,11 +18,11 @@ in
];
storageMounts = storage: {
name = "${fallaryn.${storage}.mount}";
name = "${saturn.${storage}.mount}";
value = {
device = fallaryn.${storage}.device;
device = saturn.${storage}.device;
fsType = "ext4";
options = fallaryn.${storage}.options;
options = saturn.${storage}.options;
};
};
in
@ -34,7 +34,7 @@ in
"/boot" = {
device = "/dev/disk/by-uuid/22BD-5A25";
fsType = "vfat";
options = fallaryn.boot.options;
options = saturn.boot.options;
};
}
// (builtins.listToAttrs (map storageMounts storageDrives));
@ -45,8 +45,8 @@ in
systemd.tmpfiles.rules = [
"Z ${config.home-manager.users.${user2}.home.homeDirectory} 0755 ${user2} users -"
"Z ${fallaryn.storage0.mount} 0755 ${user2} users -"
"Z ${fallaryn.storage1.mount} 0755 ${user2} users -"
"Z ${saturn.storage0.mount} 0755 ${user2} users -"
"Z ${saturn.storage1.mount} 0755 ${user2} users -"
];
services.udisks2.enable = true;

View file

@ -4,11 +4,11 @@
...
}:
let
inherit (flake.config.machines.devices) fallaryn;
inherit (flake.config.machines.devices) saturn;
in
{
networking = {
hostName = fallaryn.name;
hostName = saturn.name;
networkmanager.enable = true;
useDHCP = lib.mkDefault true;
firewall = {

View file

@ -5,7 +5,7 @@
let
configPath = ./config;
fallarynImports =
saturnImports =
let
files = builtins.attrNames (builtins.readDir configPath);
in
@ -14,7 +14,7 @@ let
);
in
{
imports = fallarynImports;
imports = saturnImports;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
system.stateVersion = lib.mkForce "24.05";
}

View file

@ -2,7 +2,8 @@
pkgs,
config,
...
}: {
}:
{
boot = {
extraModulePackages = [
config.boot.kernelPackages.v4l2loopback.out

View file

@ -0,0 +1,82 @@
{
flake,
config,
...
}:
let
inherit (flake.config.people)
user0
user1
;
inherit (flake.config.machines.devices)
ganymede
synology
ceres
;
inherit (flake.config.services.instances)
samba
;
synologySecrets = config.sops.secrets."network/synology".path;
ceresSecrets = config.sops.secrets."network/server".path;
in
{
fileSystems =
let
synologyDrives = [
"folder0"
"folder1"
"folder2"
];
sambaDrives = [
"samba0"
];
synologyMounts = synologyDrive: {
name = "${synology.${synologyDrive}.mount}";
value = {
device = synology.${synologyDrive}.device;
fsType = "cifs";
options = synology.${synologyDrive}.options ++ [
"credentials=${synologySecrets}"
];
};
};
sambaMounts = sambaDrive: {
name = "${ceres.${sambaDrive}.mount}/${samba.paths.path1}";
value = {
device = "${ceres.${sambaDrive}.device}/${samba.paths.path1}";
fsType = "cifs";
options = ceres.${sambaDrive}.options ++ [
"credentials=${ceresSecrets}"
];
};
};
in
{
"/" = {
device = "/dev/disk/by-uuid/aae33e00-125e-4f1c-b9aa-9fc512335b7f";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/C506-9E18";
fsType = "vfat";
options = ganymede.boot.options;
};
}
// (builtins.listToAttrs (map synologyMounts synologyDrives))
// (builtins.listToAttrs (map sambaMounts sambaDrives));
swapDevices = [
{ device = "/dev/disk/by-uuid/68d6072a-e21b-4d11-88fd-22c5b9932a50"; }
];
systemd.tmpfiles.rules = [
"Z ${config.home-manager.users.${user0}.home.homeDirectory} 0755 ${user0} users -"
"Z ${config.home-manager.users.${user1}.home.homeDirectory} 0755 ${user1} users -"
];
services.udisks2.enable = true;
}

View file

@ -1,20 +1,18 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
hardware = {
graphics = {
enable = true;
extraPackages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
amdvlk
;
inherit
(pkgs.rocmPackages.clr)
inherit (pkgs.rocmPackages.clr)
icd
;
};
extraPackages32 = builtins.attrValues {
inherit
(pkgs.driversi686Linux)
inherit (pkgs.driversi686Linux)
amdvlk
;
};

View file

@ -3,7 +3,8 @@
lib,
pkgs,
...
}: {
}:
{
hardware = {
firmware = [
pkgs.rtl8761b-firmware

View file

@ -2,14 +2,15 @@
lib,
flake,
...
}: let
inherit
(flake.config.machines.devices)
laptop
}:
let
inherit (flake.config.machines.devices)
ganymede
;
in {
in
{
networking = {
hostName = laptop.name;
hostName = ganymede.name;
networkmanager.enable = true;
nftables.enable = true;
useDHCP = lib.mkDefault true;

View file

@ -1,9 +1,10 @@
{flake, ...}: let
inherit
(flake.config.people)
{ flake, ... }:
let
inherit (flake.config.people)
user1
;
in {
in
{
sops = {
secrets = {
"network/synology" = {

17
systems/ganymede/default.nix Executable file
View file

@ -0,0 +1,17 @@
{ lib, ... }:
let
configPath = ./config;
ganymedeImports =
let
files = builtins.attrNames (builtins.readDir configPath);
in
map (name: configPath + "/${name}") (
builtins.filter (name: builtins.match ".*\\.nix$" name != null) files
);
in
{
imports = ganymedeImports;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
system.stateVersion = lib.mkForce "24.05";
}

View file

@ -9,8 +9,8 @@ let
user1
;
inherit (flake.config.machines.devices)
desktop
server
jupiter
ceres
synology
;
inherit (flake.config.services.instances)
@ -18,7 +18,7 @@ let
;
synologySecrets = config.sops.secrets."network/synology".path;
serverSecrets = config.sops.secrets."network/server".path;
ceresSecrets = config.sops.secrets."network/server".path;
in
{
fileSystems =
@ -50,21 +50,21 @@ in
};
storageMounts = storageDrive: {
name = "${desktop.${storageDrive}.mount}";
name = "${jupiter.${storageDrive}.mount}";
value = {
device = desktop.${storageDrive}.device;
device = jupiter.${storageDrive}.device;
fsType = "ext4";
options = desktop.${storageDrive}.options;
options = jupiter.${storageDrive}.options;
};
};
sambaMounts = sambaDrive: {
name = "${server.${sambaDrive}.mount}/${samba.paths.path1}";
name = "${ceres.${sambaDrive}.mount}/${samba.paths.path1}";
value = {
device = "${server.${sambaDrive}.device}/${samba.paths.path1}";
device = "${ceres.${sambaDrive}.device}/${samba.paths.path1}";
fsType = "cifs";
options = server.${sambaDrive}.options ++ [
"credentials=${serverSecrets}"
options = ceres.${sambaDrive}.options ++ [
"credentials=${ceresSecrets}"
];
};
};
@ -77,7 +77,7 @@ in
"/boot" = {
device = "/dev/disk/by-uuid/73E2-4DC1";
fsType = "vfat";
options = desktop.boot.options;
options = jupiter.boot.options;
};
}
// (builtins.listToAttrs (map synologyMounts synologyDrives))
@ -91,8 +91,8 @@ in
systemd.tmpfiles.rules = [
"Z ${config.home-manager.users.${user0}.home.homeDirectory} 0755 ${user0} users -"
"Z ${config.home-manager.users.${user1}.home.homeDirectory} 0755 ${user1} users -"
"Z ${desktop.storage0.mount} 0755 ${user0} users -"
"Z ${desktop.storage1.mount} 0755 ${user0} users -"
"Z ${jupiter.storage0.mount} 0755 ${user0} users -"
"Z ${jupiter.storage1.mount} 0755 ${user0} users -"
];
services.udisks2.enable = true;

View file

@ -3,11 +3,11 @@
lib,
pkgs,
...
}: {
}:
{
hardware = {
firmware = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
rtl8761b-firmware
;
};

View file

@ -2,14 +2,15 @@
lib,
flake,
...
}: let
inherit
(flake.config.machines.devices)
desktop
}:
let
inherit (flake.config.machines.devices)
jupiter
;
in {
in
{
networking = {
hostName = desktop.name;
hostName = jupiter.name;
networkmanager.enable = true;
nftables.enable = true;
useDHCP = lib.mkDefault true;

View file

@ -1,13 +1,13 @@
{flake, ...}: let
inherit
(flake.config.people)
{ flake, ... }:
let
inherit (flake.config.people)
user0
;
inherit
(flake.config.people.users.${user0})
inherit (flake.config.people.users.${user0})
paths
;
in {
in
{
sops = {
secrets = {
"network/synology" = {

17
systems/jupiter/default.nix Executable file
View file

@ -0,0 +1,17 @@
{ lib, ... }:
let
configPath = ./config;
jupiterImports =
let
files = builtins.attrNames (builtins.readDir configPath);
in
map (name: configPath + "/${name}") (
builtins.filter (name: builtins.match ".*\\.nix$" name != null) files
);
in
{
imports = jupiterImports;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
system.stateVersion = lib.mkForce "24.05";
}

View file

@ -1,86 +0,0 @@
{
flake,
config,
...
}: let
inherit
(flake.config.people)
user0
user1
;
inherit
(flake.config.machines.devices)
laptop
synology
server
;
inherit
(flake.config.services.instances)
samba
;
synologySecrets = config.sops.secrets."network/synology".path;
serverSecrets = config.sops.secrets."network/server".path;
in {
fileSystems = let
synologyDrives = [
"folder0"
"folder1"
"folder2"
];
sambaDrives = [
"samba0"
];
synologyMounts = synologyDrive: {
name = "${synology.${synologyDrive}.mount}";
value = {
device = synology.${synologyDrive}.device;
fsType = "cifs";
options =
synology.${synologyDrive}.options
++ [
"credentials=${synologySecrets}"
];
};
};
sambaMounts = sambaDrive: {
name = "${server.${sambaDrive}.mount}/${samba.paths.path1}";
value = {
device = "${server.${sambaDrive}.device}/${samba.paths.path1}";
fsType = "cifs";
options =
server.${sambaDrive}.options
++ [
"credentials=${serverSecrets}"
];
};
};
in
{
"/" = {
device = "/dev/disk/by-uuid/aae33e00-125e-4f1c-b9aa-9fc512335b7f";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/C506-9E18";
fsType = "vfat";
options = laptop.boot.options;
};
}
// (builtins.listToAttrs (map synologyMounts synologyDrives))
// (builtins.listToAttrs (map sambaMounts sambaDrives));
swapDevices = [
{device = "/dev/disk/by-uuid/68d6072a-e21b-4d11-88fd-22c5b9932a50";}
];
systemd.tmpfiles.rules = [
"Z ${config.home-manager.users.${user0}.home.homeDirectory} 0755 ${user0} users -"
"Z ${config.home-manager.users.${user1}.home.homeDirectory} 0755 ${user1} users -"
];
services.udisks2.enable = true;
}

View file

@ -1,14 +0,0 @@
{lib, ...}: let
configPath = ./config;
laptopImports = let
files = builtins.attrNames (builtins.readDir configPath);
in
map
(name: configPath + "/${name}")
(builtins.filter (name: builtins.match ".*\\.nix$" name != null) files);
in {
imports = laptopImports;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
system.stateVersion = lib.mkForce "24.05";
}

View file

@ -1,14 +0,0 @@
{lib, ...}: let
configPath = ./config;
serverImports = let
files = builtins.attrNames (builtins.readDir configPath);
in
map
(name: configPath + "/${name}")
(builtins.filter (name: builtins.match ".*\\.nix$" name != null) files);
in {
imports = serverImports;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
system.stateVersion = lib.mkForce "24.05";
}