refactor: complete rewrite

This commit is contained in:
ooks-io 2024-10-23 23:46:25 +13:00
parent 19a4bbda3c
commit 8e81943cf9
399 changed files with 3396 additions and 8042 deletions

10
hosts/default.nix Normal file
View file

@ -0,0 +1,10 @@
{self, ...}: let
inherit (self.lib) mkWorkstation;
in {
flake.nixosConfigurations = {
grookin = mkWorkstation {
hostname = "grookin";
system = "x86-64-linux";
};
};
}

View file

@ -1,42 +0,0 @@
{
pkgs,
lib,
...
}: let
inherit (lib) mkDefault;
in {
imports = [
./hardware-configuration.nix
];
ooknet.host = {
name = "ooksnode";
type = "vm";
role = "server";
profiles = ["console-tools"];
admin = {
name = "ooks";
shell = "fish";
homeManager = true;
};
networking = {
tailscale = {
enable = true;
client = true;
autoconnect = true;
};
};
hardware = {
cpu.type = "intel";
features = [
"ssd"
];
};
};
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_zen;
};
system.stateVersion = mkDefault "23.11";
}

View file

@ -4,47 +4,34 @@
...
}: {
imports = [
./hardware-configuration.nix
./file-system.nix
./hardware.nix
];
ooknet.host = {
name = "ooksdesk";
type = "desktop";
role = "workstation";
profiles = ["gaming" "creative" "media" "console-tools"];
admin = {
name = "ooks";
shell = "fish";
homeManager = true;
};
networking = {
tailscale = {
enable = true;
client = true;
autoconnect = true;
ooknet = {
host = {
admin = {
name = "ooks";
shell = "fish";
homeManager = true;
};
};
hardware = {
cpu.type = "amd";
cpu.amd.pstate.enable = true;
gpu.type = "amd";
features = ["ssd" "audio" "video"];
monitors = [
{
name = "DP-3";
primary = true;
width = 1920;
height = 1080;
refreshRate = 180;
workspace = "1";
}
];
workstation = {
environment = "hyprland";
theme = "minimal";
profiles = ["gaming" "media" "communication" "productivity"];
default = {
browser = "firefox";
terminal = "foot";
};
};
console = {
profile = "standard";
editor = "nvim";
multiplexer = "zellij";
};
};
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
boot = {
kernelPackages = pkgs.linuxPackages_xanmod_latest;
};
system.stateVersion = lib.mkDefault "23.11";
system.stateVersion = lib.mkDefault "24.11";
}

View file

@ -0,0 +1,34 @@
{
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/b5d09a8b-54a9-4f72-828c-5cceea2ec287";
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d";
fsType = "btrfs";
options = ["subvol=root"];
};
"/nix" = {
device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d";
fsType = "btrfs";
options = ["subvol=nix"];
};
"/persist" = {
device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d";
fsType = "btrfs";
options = ["subvol=persist"];
};
"/swap" = {
device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d";
fsType = "btrfs";
options = ["subvol=swap"];
};
"/boot" = {
device = "/dev/disk/by-uuid/1D01-7040";
fsType = "vfat";
};
};
swapDevices = [];
}

View file

@ -1,61 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d";
fsType = "btrfs";
options = ["subvol=root"];
};
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/b5d09a8b-54a9-4f72-828c-5cceea2ec287";
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d";
fsType = "btrfs";
options = ["subvol=nix"];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d";
fsType = "btrfs";
options = ["subvol=persist"];
};
fileSystems."/swap" = {
device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d";
fsType = "btrfs";
options = ["subvol=swap"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/1D01-7040";
fsType = "vfat";
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp8s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,18 @@
{
ooknet.hardware = {
cpu.type = "amd";
cpu.amd.pstate.enable = true;
gpu.type = "amd";
features = ["ssd" "audio" "video"];
monitors = [
{
name = "DP-3";
primary = true;
width = 1920;
height = 1080;
refreshRate = 180;
workspace = "1";
}
];
};
}

View file

@ -1,54 +0,0 @@
{
lib,
pkgs,
...
}: {
imports = [
./hardware-configuration.nix
./modules
];
ooknet.host = {
name = "ooksmedia";
type = "desktop";
role = "workstation";
profiles = ["media-server" "console-tools"];
admin = {
name = "ooks";
shell = "fish";
homeManager = true;
};
networking = {
tailscale = {
enable = true;
server = true;
autoconnect = true;
};
};
hardware = {
cpu.type = "intel";
cpu.amd.pstate.enable = true;
gpu.type = "nvidia";
features = [
"audio"
"video"
"ssd"
];
monitors = [
{
name = "HDMI-A-1";
width = 1920;
height = 1080;
refreshRate = 60;
workspace = "1";
primary = true;
}
];
};
};
boot = {
kernelPackages = pkgs.linuxPackages_xanmod_latest;
};
system.stateVersion = lib.mkDefault "23.11";
}

View file

@ -1,59 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/50617edf-e788-49cc-9e0c-85a2f90a5550";
fsType = "btrfs";
options = ["subvol=root"];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/50617edf-e788-49cc-9e0c-85a2f90a5550";
fsType = "btrfs";
options = ["subvol=nix"];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/50617edf-e788-49cc-9e0c-85a2f90a5550";
fsType = "btrfs";
options = ["subvol=persist"];
};
fileSystems."/swap" = {
device = "/dev/disk/by-uuid/50617edf-e788-49cc-9e0c-85a2f90a5550";
fsType = "btrfs";
options = ["subvol=swap"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/B511-09E2";
fsType = "vfat";
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,5 +0,0 @@
{
imports = [
./nixarr.nix
];
}

View file

@ -1,32 +0,0 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf;
inherit (config.ooknet.host) admin;
cfg = config.ooknet.services.nixarr;
in {
config = mkIf cfg.enable {
nixarr = {
vpn.enable = false;
openssh.expose.vpn.enable = false;
enable = true;
mediaDir = "/jellyfin";
stateDir = "/var/lib/nixarr";
mediaUsers = ["${admin.name}"];
jellyfin.enable = true;
sonarr.enable = true;
radarr.enable = true;
prowlarr.enable = true;
transmission.enable = true;
readarr.enable = true;
bazarr.enable = true;
};
fileSystems."/jellyfin" = {
device = "/dev/disk/by-label/jellyfin";
fsType = "btrfs";
};
};
}

View file

@ -1,68 +0,0 @@
{
pkgs,
lib,
...
}: let
inherit (lib) mkDefault;
in {
imports = [
./hardware-configuration.nix
];
ooknet.host = {
name = "ooksmicro";
type = "laptop";
role = "workstation";
profiles = ["console-tools"];
admin = {
name = "ooks";
shell = "fish";
homeManager = true;
};
networking = {
tailscale = {
enable = true;
client = true;
autoconnect = true;
};
};
hardware = {
cpu.type = "intel";
gpu.type = "intel";
features = [
"bluetooth"
"backlight"
"battery"
"ssd"
"audio"
"video"
];
monitors = [
{
name = "DSI-1";
width = 720;
height = 1280;
workspace = "1";
primary = true;
transform = 3;
}
];
battery = {
powersave = {
minFreq = 500;
maxFreq = 800;
};
performance = {
minFreq = 1200;
maxFreq = 2400;
};
};
};
};
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_zen;
};
system.stateVersion = mkDefault "23.11";
}

View file

@ -1,56 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/385526ad-e263-495d-91eb-1f484985bd0f";
fsType = "btrfs";
options = ["subvol=root"];
};
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/fe7ea7fd-b531-4c00-8123-99f7ea855800";
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/385526ad-e263-495d-91eb-1f484985bd0f";
fsType = "btrfs";
options = ["subvol=nix"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/57C5-11E7";
fsType = "vfat";
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/385526ad-e263-495d-91eb-1f484985bd0f";
fsType = "btrfs";
options = ["subvol=persist"];
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,46 +0,0 @@
{
pkgs,
inputs,
outputs,
...
}: {
imports = [./modules];
environment.packages = with pkgs; [
killall
hostname
man
coreutils
];
environment.etcBackupExtension = ".bak";
system.stateVersion = "23.11";
nix = {
extraOptions = ''
experimental-features = nix-command flakes
'';
substituters = [
"https://cache.nixos.org?priority=10"
"https://helix.cachix.org"
"https://nix-community.cachix.org"
];
trustedPublicKeys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
time.timeZone = "Pacific/Auckland";
user = {
shell = "${pkgs.fish}/bin/fish";
};
home-manager = {
extraSpecialArgs = {inherit inputs outputs;};
config = import ../../../home/user/ooks/ooksphone;
};
}

View file

@ -1,6 +0,0 @@
{
imports = [
./theme.nix
# ./openssh.nix
];
}

View file

@ -1,6 +0,0 @@
_: {
programs.ssh = {
enable = true;
startAgent = true;
};
}

View file

@ -1,39 +0,0 @@
{pkgs, ...}: let
fontPackage = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];};
fontPath = "/share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFontMono-Regular.ttf";
in {
terminal = {
font = fontPackage + fontPath;
# Gruvbox Material Dark Soft
colors = {
background = "#32302F";
foreground = "#DDC7A1";
cursor = "#DDC7A1";
color0 = "#32302F"; # Black
color8 = "#7C6F64"; # Bright Black
color1 = "#EA6962"; # Red
color9 = "#EA6962"; # Bright Red
color2 = "#A9B665"; # Green
color10 = "#A9B665"; # Bright Green
color3 = "#D8A657"; # Yellow
color11 = "#D8A657"; # Bright Yellow
color4 = "#7DAEA3"; # Blue
color12 = "#7DAEA3"; # Bright Blue
color5 = "#D3869B"; # Magenta
color13 = "#D3869B"; # Bright Magenta
color6 = "#89B482"; # Cyan
color14 = "#89B482"; # Bright Cyan
color7 = "#DDC7A1"; # White
color15 = "#FBF1C7"; # Bright White
};
};
}

View file

@ -2,30 +2,24 @@
pkgs,
lib,
...
}: let
inherit (lib) mkDefault;
in {
imports = [
./hardware-configuration.nix
];
ooknet.host = {
name = "ookst480s";
type = "laptop";
role = "workstation";
profiles = ["console-tools" "media"];
admin = {
name = "ooks";
shell = "fish";
homeManager = true;
};
networking = {
tailscale = {
enable = true;
client = true;
autoconnect = true;
}: {
imports = [./file-system.nix];
ooknet = {
host = {
admin = {
name = "ooks";
shell = "fish";
homeManager = true;
};
};
workstation = {
profiles = ["media" "gaming" "communication"];
environment = "hyprland";
theme = "minimal";
};
console = {
profile = "standard";
};
hardware = {
cpu.type = "intel";
gpu.type = "intel";
@ -39,29 +33,15 @@ in {
];
monitors = [
{
primary = true;
name = "eDP-1";
width = 1920;
height = 1080;
workspace = "1";
primary = true;
}
];
battery = {
powersave = {
minFreq = 800;
maxFreq = 1800;
};
performance = {
minFreq = 1800;
maxFreq = 3600;
};
};
};
};
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_zen;
};
system.stateVersion = mkDefault "23.11";
boot.kernelPackages = pkgs.linuxKernel.packages.linux_zen;
system.stateVersion = lib.mkDefault "23.11";
}

View file

@ -58,7 +58,6 @@
# networking.interfaces.wlp61s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wwan0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,64 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/19e4cf0f-b5ac-4544-a44b-c017b23fd283";
fsType = "btrfs";
options = ["subvol=root"];
};
boot.initrd.luks.devices."cryptnix".device = "/dev/disk/by-uuid/014d725c-bf13-40a2-a9ab-0dd6185a95f6";
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/19e4cf0f-b5ac-4544-a44b-c017b23fd283";
fsType = "btrfs";
options = ["subvol=nix"];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/19e4cf0f-b5ac-4544-a44b-c017b23fd283";
fsType = "btrfs";
options = ["subvol=persist"];
};
fileSystems."/swap" = {
device = "/dev/disk/by-uuid/19e4cf0f-b5ac-4544-a44b-c017b23fd283";
fsType = "btrfs";
options = ["subvol=swap"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/F356-6F9C";
fsType = "vfat";
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp61s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wwan0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

0
hosts/ookst480s/host.nix Normal file
View file

View file

@ -0,0 +1,12 @@
{
config = {
ooknet.workstation = {
appearance = {
theme = "minimal";
};
desktop = {
environment = "hyprland";
};
};
};
}

View file

@ -1,60 +0,0 @@
{
pkgs,
lib,
...
}: let
inherit (lib) mkDefault;
in {
imports = [
./hardware-configuration.nix
];
ooknet.host = {
name = "ooksx1";
type = "laptop";
role = "workstation";
profiles = ["console-tools"];
admin = {
name = "ooks";
shell = "fish";
homeManager = true;
};
hardware = {
cpu.type = "intel";
gpu.type = "intel";
features = [
"bluetooth"
"backlight"
"battery"
"ssd"
"audio"
"video"
];
monitors = [
{
name = "eDP-1";
width = 1920;
height = 1080;
workspace = "1";
primary = true;
}
];
battery = {
powersave = {
minFreq = 800;
maxFreq = 1800;
};
performance = {
minFreq = 1800;
maxFreq = 3600;
};
};
};
};
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_zen;
};
system.stateVersion = mkDefault "23.11";
}

View file

@ -1,66 +0,0 @@
{
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/db84a41f-6094-46b1-b98a-26e03afc18e1";
fsType = "btrfs";
options = ["subvol=root"];
};
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/3ea21f10-f705-457c-8366-a8268f658ba6";
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/db84a41f-6094-46b1-b98a-26e03afc18e1";
fsType = "btrfs";
options = ["subvol=nix"];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/db84a41f-6094-46b1-b98a-26e03afc18e1";
fsType = "btrfs";
options = ["subvol=persist"];
};
fileSystems."/swap" = {
device = "/dev/disk/by-uuid/db84a41f-6094-46b1-b98a-26e03afc18e1";
fsType = "btrfs";
options = ["subvol=swap"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/45D8-8DC3";
fsType = "vfat";
};
swapDevices = [
{
device = "/swap/swapfile";
size = 8196;
}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wwp0s20f0u2c2.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}