mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-07 05:27:13 -06:00
chore: init
This commit is contained in:
commit
1b2c1ea359
891 changed files with 37053 additions and 0 deletions
43
systems/deimos/config/boot.nix
Executable file
43
systems/deimos/config/boot.nix
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
boot = {
|
||||
extraModulePackages = [
|
||||
config.boot.kernelPackages.v4l2loopback.out
|
||||
];
|
||||
supportedFilesystems = [
|
||||
"ntfs"
|
||||
];
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"nvme"
|
||||
"ahci"
|
||||
"xhci_pci"
|
||||
"usb_storage"
|
||||
"usbhid"
|
||||
"sd_mod"
|
||||
];
|
||||
kernelModules = [
|
||||
];
|
||||
};
|
||||
|
||||
kernelModules = [
|
||||
"kvm-amd"
|
||||
"vfio-pci"
|
||||
"v4l2loopback"
|
||||
];
|
||||
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
loader = {
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot";
|
||||
};
|
||||
systemd-boot.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
105
systems/deimos/config/filesystem.nix
Executable file
105
systems/deimos/config/filesystem.nix
Executable file
|
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
flake,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (flake.config.people)
|
||||
user0
|
||||
;
|
||||
inherit (flake.config.machines.devices)
|
||||
deimos
|
||||
synology
|
||||
ceres
|
||||
;
|
||||
inherit (flake.config.services.instances)
|
||||
jellyfin
|
||||
audiobookshelf
|
||||
comfyui
|
||||
;
|
||||
|
||||
synologySecrets = config.sops.secrets."network/synology".path;
|
||||
ceresSecrets = config.sops.secrets."network/server".path;
|
||||
in
|
||||
{
|
||||
fileSystems =
|
||||
let
|
||||
synologyDrives = [
|
||||
"folder0"
|
||||
"folder1"
|
||||
];
|
||||
|
||||
sambaDrives = [
|
||||
"samba0"
|
||||
];
|
||||
|
||||
remoteDrives = [
|
||||
"remote0"
|
||||
];
|
||||
|
||||
remoteFolders = [
|
||||
audiobookshelf.name
|
||||
jellyfin.name
|
||||
comfyui.name
|
||||
];
|
||||
|
||||
synologyMounts = synologyDrive: {
|
||||
name = "${synology.${synologyDrive}.mount}";
|
||||
value = {
|
||||
device = synology.${synologyDrive}.device;
|
||||
fsType = "cifs";
|
||||
options = synology.${synologyDrive}.options ++ [
|
||||
"credentials=${synologySecrets}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
sambaMounts = sambaDrive: folder: {
|
||||
name = "${ceres.${sambaDrive}.mount}/${folder}";
|
||||
value = {
|
||||
device = "${ceres.${sambaDrive}.device}/${folder}";
|
||||
fsType = "cifs";
|
||||
options = ceres.${sambaDrive}.options ++ [
|
||||
"credentials=${ceresSecrets}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
sshfsMounts = sshfsDrive: folder: {
|
||||
name = "${ceres.${sshfsDrive}.mount}/${folder}";
|
||||
value = {
|
||||
device = "${ceres.${sshfsDrive}.device}/${folder}";
|
||||
fsType = "sshfs";
|
||||
options = ceres.${sshfsDrive}.options;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/c9a82c93-1da4-4cd1-a1fa-26483271a2bb";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/71CA-765A";
|
||||
fsType = "vfat";
|
||||
options = deimos.boot.options;
|
||||
};
|
||||
}
|
||||
// (builtins.listToAttrs (map synologyMounts synologyDrives))
|
||||
// (builtins.listToAttrs (
|
||||
builtins.concatMap (drive: map (folder: sambaMounts drive folder) remoteFolders) sambaDrives
|
||||
))
|
||||
// (builtins.listToAttrs (
|
||||
builtins.concatMap (drive: map (folder: sshfsMounts drive folder) remoteFolders) remoteDrives
|
||||
));
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/74007bf1-6e2f-425e-99fa-d35990f4ea37"; }
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"Z ${config.home-manager.users.${user0}.home.homeDirectory} 0755 ${user0} users -"
|
||||
];
|
||||
|
||||
services.udisks2.enable = true;
|
||||
}
|
||||
24
systems/deimos/config/graphics.nix
Executable file
24
systems/deimos/config/graphics.nix
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
hardware = {
|
||||
graphics = {
|
||||
enable = true;
|
||||
extraPackages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
amdvlk
|
||||
;
|
||||
inherit (pkgs.rocmPackages.clr)
|
||||
icd
|
||||
;
|
||||
};
|
||||
extraPackages32 = builtins.attrValues {
|
||||
inherit (pkgs.driversi686Linux)
|
||||
amdvlk
|
||||
;
|
||||
};
|
||||
};
|
||||
};
|
||||
boot.initrd.kernelModules = [
|
||||
"amdgpu"
|
||||
];
|
||||
}
|
||||
19
systems/deimos/config/hardware.nix
Executable file
19
systems/deimos/config/hardware.nix
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
hardware = {
|
||||
amdgpu.overdrive = {
|
||||
enable = true;
|
||||
ppfeaturemask = "0xffffffff";
|
||||
};
|
||||
firmware = [
|
||||
pkgs.rtl8761b-firmware
|
||||
];
|
||||
enableAllFirmware = true;
|
||||
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
};
|
||||
}
|
||||
38
systems/deimos/config/networking.nix
Executable file
38
systems/deimos/config/networking.nix
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
lib,
|
||||
flake,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (flake.config.machines.devices)
|
||||
deimos
|
||||
;
|
||||
in
|
||||
{
|
||||
networking = {
|
||||
hostName = deimos.name;
|
||||
networkmanager.enable = true;
|
||||
nftables.enable = true;
|
||||
useDHCP = lib.mkDefault true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [
|
||||
22 # SSH
|
||||
1234 # Elm Server
|
||||
55771
|
||||
];
|
||||
};
|
||||
};
|
||||
services = {
|
||||
avahi = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
nssmdns4 = true;
|
||||
};
|
||||
sshd.enable = true;
|
||||
openssh = {
|
||||
enable = true;
|
||||
settings.PasswordAuthentication = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
16
systems/deimos/config/sops.nix
Executable file
16
systems/deimos/config/sops.nix
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
sops = {
|
||||
secrets = {
|
||||
"network/synology" = {
|
||||
path = "/var/lib/secrets/synology";
|
||||
owner = "root";
|
||||
mode = "600";
|
||||
};
|
||||
"network/server" = {
|
||||
path = "/var/lib/secrets/server";
|
||||
owner = "root";
|
||||
mode = "600";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
38
systems/deimos/config/wireguard.nix
Executable file
38
systems/deimos/config/wireguard.nix
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
{ config, flake, ... }:
|
||||
let
|
||||
inherit (flake.config.services.instances) wireGuard;
|
||||
inherit (flake.config.machines.devices) deimos;
|
||||
service = wireGuard;
|
||||
in
|
||||
{
|
||||
networking = {
|
||||
wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = [ "${deimos.wireguard.ip0}/32" ];
|
||||
privateKeyFile = config.sops.secrets."${service.name}-deimos-private".path;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sops =
|
||||
let
|
||||
sopsPath = secret: {
|
||||
path = "${service.sops.path0}/${service.name}-${secret}-pass";
|
||||
owner = "root";
|
||||
mode = "600";
|
||||
};
|
||||
in
|
||||
{
|
||||
secrets = builtins.listToAttrs (
|
||||
map
|
||||
(secret: {
|
||||
name = "${service.name}-${secret}";
|
||||
value = sopsPath secret;
|
||||
})
|
||||
[
|
||||
"deimos-private"
|
||||
"deimos-public"
|
||||
]
|
||||
);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue