framework

This commit is contained in:
Henri Dohmen 2025-10-10 19:29:55 +02:00
parent 42099d49b4
commit aca4caf02c
17 changed files with 279 additions and 33 deletions

View file

@ -1,4 +1,4 @@
{ inputs, ... }:
{ inputs, pkgs, ... }:
{
networking.hostName = "c2";
@ -13,8 +13,24 @@
common-pc-laptop-ssd
];
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.resumeDevice = "/dev/disk/by-label/nixswap";
boot = {
loader = {
efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = "/boot/efi";
grub = {
enable = true;
efiSupport = true;
device = "nodev";
};
};
resumeDevice = "/dev/disk/by-label/nixswap";
kernelPackages = pkgs.linuxPackages_6_12;
kernel.sysctl."kernel.sysrq" = 1;
initrd.systemd.network.wait-online.enable = false;
};
# Fix for touchpad physical click not working
boot.kernelParams = [ "psmouse.synaptics_intertouch=0" ];

43
host/fw/default.nix Normal file
View file

@ -0,0 +1,43 @@
{ inputs, pkgs, ... }:
{
networking.hostName = "fw";
age.identityPaths = [
"/root/.ssh/id_ed25519"
];
imports = [
./hardware-configuration.nix
inputs.disko.nixosModules.disko
./disko.nix
];
boot = {
loader = {
efi.canTouchEfiVariables = true;
grub = {
enable = true;
efiSupport = true;
};
};
kernelPackages = pkgs.linuxPackages_6_12;
kernel.sysctl."kernel.sysrq" = 1;
initrd.systemd.network.wait-online.enable = false;
};
powerManagement = {
enable = true;
cpuFreqGovernor = "ondemand";
};
hd.desktop.enable = true;
networking.firewall = {
enable = true;
};
# ====== DON'T CHANGE ======
system.stateVersion = "25.05";
}

97
host/fw/disko.nix Normal file
View file

@ -0,0 +1,97 @@
let
rootfs = {
type = "btrfs";
extraArgs = [
"-f"
"-L"
"nixroot"
];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"/home" = {
mountpoint = "/home";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"noatime"
];
};
};
};
in
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02";
};
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
label = "crypt";
content = {
type = "luks";
name = "cryptlvm";
settings = {
allowDiscards = true;
};
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "100%";
content = rootfs;
};
swap = {
size = "48G";
content = {
extraArgs = [ "-L nixswap" ];
type = "swap";
resumeDevice = true;
};
};
};
};
};
};
}

View file

@ -0,0 +1,28 @@
# 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,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"thunderbolt"
];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,4 +1,5 @@
_: {
{ pkgs, ... }:
{
networking.hostName = "roam";
age.identityPaths = [
@ -14,6 +15,21 @@ _: {
./services.nix
];
boot = {
loader = {
efi.canTouchEfiVariables = true;
grub = {
enable = true;
efiSupport = true;
device = "nodev";
};
};
kernelPackages = pkgs.linuxPackages_6_12;
initrd.systemd.network.wait-online.enable = false;
};
security = {
acme = {
acceptTerms = true;

View file

@ -1,4 +1,4 @@
{ ... }:
{ pkgs, ... }:
{
networking = {
hostName = "solo";
@ -21,6 +21,22 @@
./nvidia-gpu.nix
];
boot = {
loader = {
efi.canTouchEfiVariables = true;
grub = {
enable = true;
efiSupport = true;
device = "nodev";
};
};
kernelPackages = pkgs.linuxPackages_6_12;
kernel.sysctl."kernel.sysrq" = 1;
initrd.systemd.network.wait-online.enable = false;
};
powerManagement = {
enable = true;
cpuFreqGovernor = "performance";