Add back lacros

This commit is contained in:
Jimbo 2025-01-31 22:44:14 -05:00
parent b404b62564
commit 379d737c18
11 changed files with 186 additions and 29 deletions

View file

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

25
hosts/lacros/default.nix Normal file
View file

@ -0,0 +1,25 @@
{ ... }:
{
imports = [
./boot
./disko
./filesystems
./hardware
./users
../../modules/system
];
networking = {
hostName = "lacros";
hostId = "eb3a2dd3";
wg-quick.interfaces.wgc.address = [ "10.100.0.26/24" ];
};
system = {
desktop.enable = true;
lanzaboote.enable = true;
wireguard.client.enable = true;
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" ];
};
"/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 = "4G";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
};
# Needed for impermanence
fileSystems."/persist".neededForBoot = true;
}

View file

@ -0,0 +1,11 @@
{ config, ... }:
{
fileSystems = {
# Network mounts
"/home/${config.sysusers.main}/KittyNFS" = {
device = "10.100.0.1:/export/KittyNFS";
fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];
};
};
}

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 = [ "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.kernelModules = [ "kvm-intel" "dm-snapshot" ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,4 @@
{ ... }:
{
imports = [ ./main ];
}

View file

@ -0,0 +1,10 @@
{ config, lib, ... }:
{
home-manager.users."${config.sysusers.main}" = {
home = {
desktop.enable = true;
remote-desktop.enable = true;
stateVersion = lib.mkForce "24.11";
};
};
}