refactor(devices): place configs in order and delete oksys
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-07-14 22:59:33 -04:00
parent 89ebaa520f
commit 7941c8cf35
13 changed files with 138 additions and 262 deletions

View file

@ -82,14 +82,14 @@ I generate `.sops.yaml` from `.sops.nix`:
```nix ```nix
let let
wim = "somekey"; wim = "somekey";
oksys = "somekey2"; binto = "somekey2";
in { in {
creation_rules = [ creation_rules = [
{ {
path_regex = "secrets/[^/]+\\.(yaml|json|env|ini)$"; path_regex = "secrets/[^/]+\\.(yaml|json|env|ini)$";
key_groups = [ key_groups = [
{ {
age = [wim oksys]; age = [wim binto];
} }
]; ];
} }

View file

@ -11,7 +11,6 @@ This directory encompasses every device's main configuration file.
| `binto` | My desktop PC with a multi-monitor setup and an NVIDIA (cringe) 3070 | | `binto` | My desktop PC with a multi-monitor setup and an NVIDIA (cringe) 3070 |
| `cluster` | Two Lenovo mini PCs that make use of [NixOS-pcsd](https://github.com/matt1432/nixos-pcsd) to form a cluster | | `cluster` | Two Lenovo mini PCs that make use of [NixOS-pcsd](https://github.com/matt1432/nixos-pcsd) to form a cluster |
| `nos` | My custom built NAS | | `nos` | My custom built NAS |
| `oksys` | A very old Acer laptop that went from sailing the seas for years to becoming my web server and VPN host. It is now retired indefinitely. |
| `servivi` | A gaming PC in a previous life, it is now used as a build farm and hosts game servers | | `servivi` | A gaming PC in a previous life, it is now used as a build farm and hosts game servers |
| `wim` | My 2-1 Lenovo Laptop that I use for uni | | `wim` | My 2-1 Lenovo Laptop that I use for uni |

View file

@ -1,34 +1,37 @@
{ {
config, config,
jovian,
self, self,
... ...
}: let }: let
inherit (config.vars) mainUser hostName; inherit (config.vars) mainUser hostName;
in { in {
# ------------------------------------------------
# Imports
# ------------------------------------------------
imports = [ imports = [
jovian.nixosModules.default ./hardware-configuration.nix
../../modules/kmscon.nix ../../modules/kmscon.nix
../../modules/sshd.nix ../../modules/sshd.nix
./hardware-configuration.nix
./modules/desktop.nix ./modules/desktop.nix
self.nixosModules.plymouth self.nixosModules.plymouth
]; ];
# State Version: DO NOT CHANGE
system.stateVersion = "24.11";
home-manager.users.${mainUser}.home.stateVersion = "24.11";
# ------------------------------------------------
# User Settings
# ------------------------------------------------
vars = { vars = {
mainUser = "mariah"; mainUser = "mariah";
hostName = "bbsteamie"; hostName = "bbsteamie";
promptMainColor = "pink"; promptMainColor = "pink";
}; };
boot.plymouth = {
enable = true;
theme = "steamos";
};
users.users.${mainUser} = { users.users.${mainUser} = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ extraGroups = [
@ -42,16 +45,13 @@ in {
networkmanager.enable = true; networkmanager.enable = true;
}; };
home-manager.users.${mainUser} = {
imports = [];
# No touchy
home.stateVersion = "24.11";
};
# Set your time zone.
time.timeZone = "America/Montreal"; time.timeZone = "America/Montreal";
# No touchy # ------------------------------------------------
system.stateVersion = "24.11"; # `Self` Modules configuration
# ------------------------------------------------
boot.plymouth = {
enable = true;
theme = "steamos";
};
} }

View file

@ -1,11 +1,15 @@
{ {
config, config,
jovian,
lib, lib,
modulesPath, modulesPath,
... ...
}: { }: {
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
imports = [(modulesPath + "/installer/scan/not-detected.nix")]; imports = [
(modulesPath + "/installer/scan/not-detected.nix")
jovian.nixosModules.default
];
jovian = { jovian = {
steamos.useSteamOSConfig = true; steamos.useSteamOSConfig = true;

View file

@ -5,6 +5,9 @@
}: let }: let
inherit (config.vars) mainUser hostName; inherit (config.vars) mainUser hostName;
in { in {
# ------------------------------------------------
# Imports
# ------------------------------------------------
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@ -23,26 +26,26 @@ in {
self.nixosModules.desktop self.nixosModules.desktop
]; ];
home-manager.users.${mainUser} = {
imports = [
../../home/firefox
];
# State Version: DO NOT CHANGE
home.stateVersion = "23.11";
};
# State Version: DO NOT CHANGE
system.stateVersion = "23.11";
# ------------------------------------------------
# User Settings
# ------------------------------------------------
vars = { vars = {
mainUser = "matt"; mainUser = "matt";
hostName = "binto"; hostName = "binto";
promptMainColor = "purple"; promptMainColor = "purple";
}; };
roles.desktop = {
user = config.vars.mainUser;
mainMonitor = "desc:GIGA-BYTE TECHNOLOGY CO. LTD. G27QC 0x00000B1D";
displayManager.duplicateScreen = false;
fontSize = 12.5;
};
programs.adb = {
enable = true;
user = mainUser;
};
users.users.${mainUser} = { users.users.${mainUser} = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ extraGroups = [
@ -54,14 +57,6 @@ in {
"libvirtd" "libvirtd"
]; ];
}; };
home-manager.users.${mainUser} = {
imports = [
../../home/firefox
];
# No touchy
home.stateVersion = "23.11";
};
networking = { networking = {
inherit hostName; inherit hostName;
@ -69,9 +64,22 @@ in {
firewall.enable = false; firewall.enable = false;
}; };
# Set your time zone.
time.timeZone = "America/Montreal"; time.timeZone = "America/Montreal";
# No touchy # ------------------------------------------------
system.stateVersion = "23.11"; # `Self` Modules configuration
# ------------------------------------------------
roles.desktop = {
user = mainUser;
mainMonitor = "desc:GIGA-BYTE TECHNOLOGY CO. LTD. G27QC 0x00000B1D";
displayManager.duplicateScreen = false;
fontSize = 12.5;
};
programs.adb = {
enable = true;
user = mainUser;
};
} }

View file

@ -3,6 +3,9 @@ deviceName: {config, ...}: let
clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip; clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip;
in { in {
# ------------------------------------------------
# Imports
# ------------------------------------------------
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@ -13,6 +16,13 @@ in {
./modules/pcsd.nix ./modules/pcsd.nix
]; ];
# State Version: DO NOT CHANGE
system.stateVersion = "24.05";
home-manager.users.${mainUser}.home.stateVersion = "24.05";
# ------------------------------------------------
# User Settings
# ------------------------------------------------
vars = { vars = {
mainUser = "matt"; mainUser = "matt";
hostName = deviceName; hostName = deviceName;
@ -32,13 +42,6 @@ in {
]; ];
}; };
home-manager.users.${mainUser} = {
imports = [];
# No touchy
home.stateVersion = "24.05";
};
networking = { networking = {
inherit hostName; inherit hostName;
resolvconf.enable = true; resolvconf.enable = true;
@ -53,9 +56,5 @@ in {
firewall.enable = false; firewall.enable = false;
}; };
# Set your time zone.
time.timeZone = "America/Montreal"; time.timeZone = "America/Montreal";
# No touchy
system.stateVersion = "24.05";
} }

View file

@ -1,6 +1,9 @@
{config, ...}: let {config, ...}: let
inherit (config.vars) mainUser hostName; inherit (config.vars) mainUser hostName;
in { in {
# ------------------------------------------------
# Imports
# ------------------------------------------------
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@ -16,6 +19,13 @@ in {
./modules/subtitles ./modules/subtitles
]; ];
# State Version: DO NOT CHANGE
system.stateVersion = "24.05";
home-manager.users.${mainUser}.home.stateVersion = "24.05";
# ------------------------------------------------
# User Settings
# ------------------------------------------------
vars = { vars = {
mainUser = "matt"; mainUser = "matt";
hostName = "nos"; hostName = "nos";
@ -31,22 +41,11 @@ in {
]; ];
}; };
home-manager.users.${mainUser} = {
imports = [];
# No touchy
home.stateVersion = "24.05";
};
networking = { networking = {
inherit hostName; inherit hostName;
resolvconf.enable = true; resolvconf.enable = true;
firewall.enable = false; firewall.enable = false;
}; };
# Set your time zone.
time.timeZone = "America/Montreal"; time.timeZone = "America/Montreal";
# No touchy
system.stateVersion = "24.05";
} }

View file

@ -1,45 +0,0 @@
# Not currently operational
{config, ...}: let
inherit (config.vars) mainUser hostName;
in {
imports = [
./hardware-configuration.nix
../../modules/sshd.nix
../../modules/tailscale.nix
./modules/remote-builder.nix
];
vars = {
mainUser = "matt";
hostName = "oksys";
neovimIde = false;
};
users.users.${mainUser} = {
isNormalUser = true;
extraGroups = [
"wheel"
"adm"
];
};
home-manager.users.${mainUser} = {
imports = [];
# No touchy
home.stateVersion = "24.05";
};
networking = {
inherit hostName;
resolvconf.enable = true;
firewall.enable = false;
};
# Set your time zone.
time.timeZone = "America/Montreal";
# No touchy
system.stateVersion = "24.05";
}

View file

@ -1,55 +0,0 @@
{
config,
modulesPath,
...
}: {
nixpkgs.hostPlatform = "x86_64-linux";
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
services.logind = {
lidSwitchDocked = "ignore";
lidSwitchExternalPower = "ignore";
};
boot = {
loader = {
timeout = 2;
grub = {
enable = true;
device = "/dev/sda";
};
};
initrd.availableKernelModules = [
"uhci_hcd"
"ehci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXROOT";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
};
};
swapDevices = [
{
device = "/var/lib/swapfile";
size = 16 * 1024;
}
];
zramSwap.enable = true;
hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware;
}

View file

@ -1,42 +0,0 @@
{config, ...}: let
servivi = "100.64.0.7";
in {
# https://nixos.wiki/wiki/Distributed_build
home-manager.users.root = {
home.file.".ssh/config".text =
# ssh_config
''
Host ${servivi}
# Prevent using ssh-agent or another keyfile, useful for testing
IdentitiesOnly yes
IdentityFile ${config.sops.secrets.nixremote.path}
# The weakly privileged user on the remote builder if not set,
# 'root' is used which will hopefully fail
User nixremote
'';
};
programs.ssh.knownHosts = {
${servivi}.publicKey = "servivi ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkNW0H4Fl6NFgahlgGbSvglg1DrX4yl1ht9Lp+vHE2A";
};
nix = {
buildMachines = [
{
hostName = servivi;
system = "x86_64-linux";
protocol = "ssh-ng";
maxJobs = 1;
speedFactor = 2;
supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"];
mandatoryFeatures = [];
}
];
distributedBuilds = true;
# optional, useful when the builder has a faster internet connection than yours
extraOptions = ''
builders-use-substitutes = true
'';
};
}

View file

@ -1,10 +1,12 @@
{config, ...}: let {config, ...}: let
inherit (config.vars) mainUser hostName; inherit (config.vars) mainUser hostName;
in { in {
# ------------------------------------------------
# Imports
# ------------------------------------------------
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/arion
../../modules/kmscon.nix ../../modules/kmscon.nix
../../modules/sshd.nix ../../modules/sshd.nix
../../modules/tailscale.nix ../../modules/tailscale.nix
@ -15,6 +17,13 @@ in {
./modules/nfs.nix ./modules/nfs.nix
]; ];
# State Version: DO NOT CHANGE
system.stateVersion = "24.05";
home-manager.users.${mainUser}.home.stateVersion = "24.05";
# ------------------------------------------------
# User Settings
# ------------------------------------------------
vars = { vars = {
mainUser = "matt"; mainUser = "matt";
hostName = "servivi"; hostName = "servivi";
@ -43,24 +52,16 @@ in {
}; };
}; };
home-manager.users.${mainUser} = {
imports = [];
# No touchy
home.stateVersion = "24.05";
};
arion.enable = true;
networking = { networking = {
inherit hostName; inherit hostName;
resolvconf.enable = true; resolvconf.enable = true;
firewall.enable = false; firewall.enable = false;
}; };
# Set your time zone.
time.timeZone = "America/Montreal"; time.timeZone = "America/Montreal";
# No touchy # ------------------------------------------------
system.stateVersion = "24.05"; # `Self` Modules configuration
# ------------------------------------------------
arion.enable = true;
} }

View file

@ -5,6 +5,9 @@
}: let }: let
inherit (config.vars) mainUser hostName; inherit (config.vars) mainUser hostName;
in { in {
# ------------------------------------------------
# Imports
# ------------------------------------------------
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@ -21,14 +24,54 @@ in {
self.nixosModules.plymouth self.nixosModules.plymouth
]; ];
home-manager.users.${mainUser} = {
imports = [
../../home/firefox
];
# State Version: DO NOT CHANGE
home.stateVersion = "23.05";
};
# State Version: DO NOT CHANGE
system.stateVersion = "23.05";
# ------------------------------------------------
# User Settings
# ------------------------------------------------
vars = { vars = {
mainUser = "matt"; mainUser = "matt";
hostName = "wim"; hostName = "wim";
promptMainColor = "purple"; promptMainColor = "purple";
}; };
users.users.${mainUser} = {
isNormalUser = true;
extraGroups = [
"wheel"
"input"
"uinput"
"adm"
"video"
"libvirtd"
];
};
networking = {
inherit hostName;
networkmanager = {
enable = true;
wifi.backend = "wpa_supplicant";
};
firewall.enable = false;
};
time.timeZone = "America/Montreal";
# ------------------------------------------------
# `Self` Modules configuration
# ------------------------------------------------
roles.desktop = { roles.desktop = {
user = config.vars.mainUser; user = mainUser;
mainMonitor = "eDP-1"; mainMonitor = "eDP-1";
isLaptop = true; isLaptop = true;
@ -46,39 +89,4 @@ in {
enable = true; enable = true;
theme = "dracula"; theme = "dracula";
}; };
users.users.${mainUser} = {
isNormalUser = true;
extraGroups = [
"wheel"
"input"
"uinput"
"adm"
"video"
"libvirtd"
];
};
home-manager.users.${mainUser} = {
imports = [
../../home/firefox
];
# No touchy
home.stateVersion = "23.05";
};
networking = {
inherit hostName;
networkmanager = {
enable = true;
wifi.backend = "wpa_supplicant";
};
firewall.enable = false;
};
# Set your time zone.
time.timeZone = "America/Montreal";
# No touchy
system.stateVersion = "23.05";
} }

View file

@ -42,9 +42,9 @@
mainInputs // otherInputs; mainInputs // otherInputs;
outputs = inputs @ { outputs = inputs @ {
self,
nixpkgs, nixpkgs,
secrets, secrets,
self,
... ...
}: let }: let
inherit (import ./lib.nix inputs) mkVersion mkNixOS mkNixOnDroid mkPkgs; inherit (import ./lib.nix inputs) mkVersion mkNixOS mkNixOnDroid mkPkgs;