nixos-config/machines/zero.nix

90 lines
2.7 KiB
Nix
Raw Normal View History

{ my, ... }:
{
imports = [ ../system/desktop.nix ../system/ucode-amd.nix ];
nixpkgs.overlays = [
# Newer linux-firmware releases contain some firmware which has some firmware that is
# apparently not handled correctly by the amdgpu driver, at least for this IP version present
# on the iGPU.
# See https://github.com/torvalds/linux/blob/b5641a5d8b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c#L1591
(_: super: {
linux-firmware = super.linux-firmware.overrideAttrs (_: rec {
version = "20230404";
src = super.fetchzip {
url =
"https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${version}.tar.gz";
hash = "sha256-HZ2uU8BQKTkDup19mzhf67u48aFVyQfGQSVlCqFPWsk=";
};
outputHash = "sha256-CHD/MRut/0yjPuG+hH2gsbTR/Dhk4DbWfHsCbsg1oX8=";
});
})
];
system.stateVersion = "23.05";
boot.initrd.availableKernelModules =
[ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
boot.blacklistedKernelModules = [ "acpi_cpufreq" ];
boot.kernelParams = [ "amd_pstate=active" "amdgpu.sg_display=0" ];
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/B369-D2FE";
fsType = "vfat";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/5151f79a-fca4-45d4-8bd9-66f157a1d51f";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/5151f79a-fca4-45d4-8bd9-66f157a1d51f";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/5151f79a-fca4-45d4-8bd9-66f157a1d51f";
fsType = "btrfs";
options = [ "subvol=@nix" ];
};
fileSystems."/var/log" = {
device = "/dev/disk/by-uuid/5151f79a-fca4-45d4-8bd9-66f157a1d51f";
fsType = "btrfs";
options = [ "subvol=@log" ];
};
fileSystems."/storage/bunker" = my.homelab.nfsServers.tank.bunker;
networking = my.homelab.networking // {
interfaces.eno1 = my.machines.zero.eno1 // { wakeOnLan.enable = true; };
};
home-manager.users.christoph = {
my.emails.personal.enable = true;
wayland.windowManager.sway.config = let
inherit (my.machines.zero) displays;
# Assigns five workspaces, starting at `base`, to output `output`.
makeWorkspaceOutputAssignList = base: output:
builtins.genList (x: {
inherit output;
workspace = toString (base + x);
}) 5;
in {
workspaceOutputAssign =
(makeWorkspaceOutputAssignList 1 (builtins.elemAt displays 0))
++ (makeWorkspaceOutputAssignList 6 (builtins.elemAt displays 1));
assigns = {
"6" = [{ app_id = "firefox"; }];
"7" = [{ class = "Spotify"; }];
};
};
};
}