Add new puter, Midas

This commit is contained in:
Jimbo 2025-02-14 16:34:45 -05:00
parent 998fc526e7
commit 1c10a598e9
8 changed files with 194 additions and 0 deletions

View file

@ -63,6 +63,7 @@
extern = mkNix [ ./hosts/extern ]; # External Drive/USB
kitty = mkNix [ ./hosts/kitty ]; # Dell Optiplex 7010
midas = mkNix [ ./hosts/midas ]; # Dell Optiplex 5040
prophet = mkNix [ ./hosts/prophet ]; # Oracle Neoverse-N1
};

View file

@ -0,0 +1,4 @@
{ pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
}

24
hosts/midas/default.nix Normal file
View file

@ -0,0 +1,24 @@
{ pkgs, ... }:
{
imports = [
#./boot
./disko
#./filesystems
./hardware
./users
../../modules/system
];
networking = {
hostName = "midas";
hostId = "462433de";
};
system = {
desktop.enable = true;
#lanzaboote.enable = true;
wireless.enable = false;
libvirtd.enable = true;
stateVersion = "24.11";
};
}

View file

@ -0,0 +1,90 @@
{ disko, config, ... }:
{
imports = [ disko.nixosModules.disko ];
disko.devices = {
disk = {
"${config.networking.hostName}" = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "${config.networking.hostName}-disk";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
type = "lvm_pv";
vg = "${config.networking.hostName}";
};
};
};
};
};
};
};
lvm_vg = {
"${config.networking.hostName}" = {
type = "lvm_vg";
lvs = {
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/prev" = {
mountpoint = "/prev";
mountOptions = [ "compress=zstd" "noatime" "ssd" "noexec" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/persist/.snapshots" = { };
"/persist/home/${config.sysusers.main}" = { };
"/persist/home/${config.sysusers.main}/.snapshots" = { };
};
};
};
swap = {
size = "8G";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
};
# Needed for impermanence
fileSystems."/persist".neededForBoot = true;
}

View file

@ -0,0 +1,48 @@
{ config, ... }:
{
fileSystems = {
# Games and such
"/mnt/Linux1" = {
device = "/dev/disk/by-uuid/b2901f8c-ffda-4b88-bb63-a9ea0c96ccb4";
fsType = "ext4";
options = [ "nosuid" "nodev" "nofail" "x-gvfs-show" ];
};
"/mnt/Linux2" = {
device = "/dev/disk/by-uuid/f08e4f38-162c-402f-ba2a-5925151b78bf";
fsType = "ext4";
options = [ "nosuid" "nodev" "nofail" "x-gvfs-show" ];
};
"/mnt/Linux3" = {
device = "/dev/disk/by-uuid/e7bc75bd-c371-4b28-b212-7be9b1fad339";
fsType = "ext4";
options = [ "nosuid" "nodev" "nofail" "x-gvfs-show" ];
};
"/mnt/Windows1" = {
device = "/dev/disk/by-uuid/48F5C6E06416229C";
options = [ "nosuid" "nodev" "noauto" ];
};
"/mnt/Windows2" = {
device = "/dev/disk/by-uuid/0A5A3420237C863A";
options = [ "nosuid" "nodev" "noauto" ];
};
# Bulk storage mounts
"/persist/var/lib/libvirt" = {
device = "/dev/disk/by-uuid/abf78669-de2a-4afa-8e62-604f4e4cb355";
fsType = "btrfs";
options = [ "subvol=libvirt" "nosuid" "nodev" "nofail" ];
};
"/persist/home/${config.sysusers.main}/VMs" = {
device = "/dev/disk/by-uuid/abf78669-de2a-4afa-8e62-604f4e4cb355";
fsType = "btrfs";
options = [ "subvol=images" "nosuid" "nodev" "nofail" ];
};
# Network mounts
"/home/${config.sysusers.main}/KittyNFS" = {
device = "${config.ips.server}:/export/KittyNFS";
fsType = "nfs4";
options = [ "x-systemd.automount" "noauto" "soft" "_netdev" ];
};
};
}

View file

@ -0,0 +1,12 @@
# nixos-generate-config --root ./ --no-filesystems
{ config, lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
networking.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,4 @@
{ ... }:
{
imports = [ ./main ];
}

View file

@ -0,0 +1,11 @@
{ config, lib, ... }:
{
home-manager.users."${config.sysusers.main}" = {
home = {
desktop.enable = true;
gaming.enable = true;
production.enable = true;
stateVersion = lib.mkForce config.system.stateVersion;
};
};
}