Add host jalr-t520

This commit is contained in:
Jakob Lechner 2025-08-05 00:19:26 +02:00
parent 602cd350b9
commit 6414b7b79d
3 changed files with 107 additions and 0 deletions

View file

@ -7,6 +7,9 @@ in
targetHost = "jalr-k.duckdns.org";
system = "x86_64-linux";
};
jalr-t520 = {
system = "x86_64-linux";
};
cadmium = {
system = "x86_64-linux";
};

View file

@ -0,0 +1,39 @@
{ lib, pkgs, ... }:
{
imports = [
./disko.nix
../../users/jalr
];
networking = {
hostName = "jalr-t520";
useDHCP = false;
};
jalr = {
bootloader = "systemd-boot";
bluetooth.enable = true;
gui = {
enable = true;
sway.enable = true;
gnome.enable = true;
};
workstation.enable = true;
};
hardware.cpu.intel.updateMicrocode = true;
powerManagement.cpuFreqGovernor = "performance";
environment.systemPackages = with pkgs; [
intel-media-driver
libva
libva-utils
libva1
];
hardware.graphics.extraPackages = lib.singleton pkgs.vaapiIntel;
system.stateVersion = "25.05";
}

65
hosts/jalr-t520/disko.nix Normal file
View file

@ -0,0 +1,65 @@
{ config, ... }:
let
cfg = config.disko;
in
{
disko.devices = {
disk = {
system = {
type = "disk";
device = "/dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21UNSAG200527E";
content = {
type = "gpt";
partitions = {
esp = {
type = "EF00";
size = "1024M";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "uid=0" "gid=0" "fmask=0077" "dmask=0077" "nodev" "nosuid" "noexec" ];
};
};
nixos = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress-force=zstd:1" "noatime" ];
};
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress-force=zstd:1" "noatime" "nodev" "nosuid" ];
};
"/home/.snapshots" = {
mountOptions = [ "compress-force=zstd:1" "noatime" "nodev" "nosuid" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress-force=zstd:1" "noatime" "noatime" "nodev" ];
};
};
postCreateHook =
let
inherit (cfg.devices.disk.system.content.partitions.nixos) device;
in
''
mountpoint="$(mktemp -d)"
mount "${device}" "$mountpoint" -o subvol=/
trap 'umount "$mountpoint"; rmdir "$mountpoint"' EXIT
btrfs subvolume snapshot -r $mountpoint/root $mountpoint/root-blank
'';
};
};
};
};
};
};
};
}