2022-03-22 18:22:35 +00:00
|
|
|
{ config, pkgs, modulesPath, lib, nixos-hardware, ... }: {
|
2022-01-18 10:23:54 +00:00
|
|
|
networking.hostName = "nutty-noon";
|
|
|
|
networking.hostId = "e77e1829";
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
(modulesPath + "/installer/scan/not-detected.nix")
|
|
|
|
./systemd-boot.nix
|
2022-01-18 13:55:16 +00:00
|
|
|
./desktop.nix
|
2022-02-18 14:49:19 +00:00
|
|
|
./services/tpm2.nix
|
|
|
|
./services/hydra.nix
|
2022-03-12 09:37:16 +00:00
|
|
|
./server.nix
|
2022-03-22 18:22:35 +00:00
|
|
|
nixos-hardware.nixosModules.common-cpu-amd
|
|
|
|
nixos-hardware.nixosModules.common-gpu-amd
|
|
|
|
nixos-hardware.nixosModules.common-pc-ssd
|
2022-01-18 10:23:54 +00:00
|
|
|
];
|
2022-01-19 19:56:15 +00:00
|
|
|
hardware.cpu.amd.updateMicrocode = true;
|
|
|
|
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" "k10temp" ];
|
2022-01-18 11:05:39 +00:00
|
|
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
2022-01-18 10:23:54 +00:00
|
|
|
boot.kernelModules = [ "kvm-amd" ];
|
2022-01-21 15:15:48 +00:00
|
|
|
boot.extraModulePackages = [
|
|
|
|
config.boot.kernelPackages.zenpower
|
|
|
|
];
|
2022-01-18 10:23:54 +00:00
|
|
|
|
2022-04-02 06:49:40 +00:00
|
|
|
boot.supportedFilesystems = [ "zfs" ];
|
2022-04-02 07:51:07 +00:00
|
|
|
boot.zfs.devNodes = "/dev/";
|
|
|
|
|
|
|
|
services.zfs.trim.enable = true;
|
|
|
|
services.zfs.autoScrub.enable = true;
|
2022-04-07 13:30:09 +00:00
|
|
|
services.zfs.autoScrub.pools = [ "ssd" "hdd" ];
|
2022-01-18 10:23:54 +00:00
|
|
|
|
|
|
|
boot.initrd.luks.devices = {
|
|
|
|
ssd = {
|
|
|
|
device = "/dev/disk/by-partuuid/53773b73-fb8a-4de8-ac58-d9d8ff1be430";
|
2022-01-18 19:13:49 +00:00
|
|
|
allowDiscards = true;
|
2022-01-18 10:23:54 +00:00
|
|
|
};
|
|
|
|
hdd = {
|
|
|
|
device = "/dev/disk/by-partuuid/d4c6a94f-2ae9-e446-9613-2596c564078c";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-03-26 12:52:53 +00:00
|
|
|
fileSystems."/" = {
|
2022-04-02 06:49:40 +00:00
|
|
|
device = "ssd/nixos";
|
|
|
|
fsType = "zfs";
|
2022-04-07 13:30:09 +00:00
|
|
|
options = [ "zfsutil" ];
|
2022-04-02 06:49:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/nix" = {
|
|
|
|
device = "ssd/nixos/nix";
|
|
|
|
fsType = "zfs";
|
2022-04-07 13:30:09 +00:00
|
|
|
options = [ "zfsutil" ];
|
2022-04-02 06:49:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/etc" = {
|
|
|
|
device = "ssd/nixos/etc";
|
|
|
|
fsType = "zfs";
|
2022-04-07 13:30:09 +00:00
|
|
|
options = [ "zfsutil" ];
|
2022-04-02 06:49:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/var" = {
|
|
|
|
device = "ssd/nixos/var";
|
|
|
|
fsType = "zfs";
|
2022-04-07 13:30:09 +00:00
|
|
|
options = [ "zfsutil" ];
|
2022-04-02 06:49:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/var/lib" = {
|
|
|
|
device = "ssd/nixos/var/lib";
|
|
|
|
fsType = "zfs";
|
2022-04-07 13:30:09 +00:00
|
|
|
options = [ "zfsutil" ];
|
2022-04-02 06:49:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/var/log" = {
|
|
|
|
device = "ssd/nixos/var/log";
|
|
|
|
fsType = "zfs";
|
2022-04-07 13:30:09 +00:00
|
|
|
options = [ "zfsutil" ];
|
2022-04-02 06:49:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/var/spool" = {
|
|
|
|
device = "ssd/nixos/var/spool";
|
|
|
|
fsType = "zfs";
|
2022-04-07 13:30:09 +00:00
|
|
|
options = [ "zfsutil" ];
|
2022-04-02 06:49:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/home" = {
|
|
|
|
device = "ssd/userdata/home";
|
|
|
|
fsType = "zfs";
|
2022-04-07 13:30:09 +00:00
|
|
|
options = [ "zfsutil" ];
|
2022-04-02 06:49:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/root" = {
|
|
|
|
device = "ssd/userdata/root";
|
|
|
|
fsType = "zfs";
|
2022-04-07 13:30:09 +00:00
|
|
|
options = [ "zfsutil" ];
|
2022-04-02 06:49:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/home/darkkirb" = {
|
|
|
|
device = "ssd/userdata/home/darkkirb";
|
|
|
|
fsType = "zfs";
|
2022-04-07 13:30:09 +00:00
|
|
|
options = [ "zfsutil" ];
|
2022-04-02 06:49:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/build" = {
|
|
|
|
device = "hdd/build";
|
|
|
|
fsType = "zfs";
|
2022-04-07 13:30:09 +00:00
|
|
|
options = [ "zfsutil" ];
|
2022-03-26 12:52:53 +00:00
|
|
|
};
|
2022-01-18 10:23:54 +00:00
|
|
|
|
2022-03-26 12:52:53 +00:00
|
|
|
fileSystems."/boot" = {
|
|
|
|
device = "/dev/disk/by-uuid/CA0B-E049";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
2022-01-18 10:23:54 +00:00
|
|
|
|
|
|
|
swapDevices = [
|
|
|
|
{
|
|
|
|
device = "/dev/disk/by-partuuid/110ae65d-8ea1-214d-bd7b-a6f3e1b5dc3a";
|
|
|
|
randomEncryption = true;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
networking.interfaces.enp34s0.useDHCP = true;
|
|
|
|
|
|
|
|
system.stateVersion = "21.11";
|
2022-01-18 10:33:32 +00:00
|
|
|
|
|
|
|
networking.wireguard.interfaces."wg0".ips = [ "fd0d:a262:1fa6:e621:47e6:24d4:2acb:9437/64" ];
|
2022-01-19 08:28:39 +00:00
|
|
|
networking.nameservers = [ "192.168.2.1" ];
|
2022-01-18 11:05:39 +00:00
|
|
|
|
|
|
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
2022-01-19 19:56:15 +00:00
|
|
|
|
|
|
|
environment.etc."sysconfig/lm_sensors".text = ''
|
|
|
|
# Generated by sensors-detect on Tue Aug 7 10:54:09 2018
|
|
|
|
# This file is sourced by /etc/init.d/lm_sensors and defines the modules to
|
|
|
|
# be loaded/unloaded.
|
|
|
|
#
|
|
|
|
# The format of this file is a shell script that simply defines variables:
|
|
|
|
# HWMON_MODULES for hardware monitoring driver modules, and optionally
|
|
|
|
# BUS_MODULES for any required bus driver module (for example for I2C or SPI).
|
|
|
|
|
|
|
|
HWMON_MODULES="nct6775"
|
|
|
|
'';
|
2022-01-21 15:15:48 +00:00
|
|
|
|
2022-02-08 08:55:28 +00:00
|
|
|
nix.settings.cores = 16;
|
2022-02-10 16:01:58 +00:00
|
|
|
boot.binfmt.emulatedSystems = [
|
|
|
|
"armv7l-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
"powerpc-linux"
|
|
|
|
"powerpc64-linux"
|
|
|
|
"powerpc64le-linux"
|
|
|
|
"riscv32-linux"
|
|
|
|
"riscv64-linux"
|
|
|
|
"wasm32-wasi"
|
|
|
|
];
|
2022-03-20 07:02:54 +00:00
|
|
|
nix.buildMachines = lib.mkForce [
|
2022-03-22 13:51:13 +00:00
|
|
|
{
|
2022-03-26 12:52:53 +00:00
|
|
|
hostName = "build-nas";
|
|
|
|
systems = [ "x86_64-linux" ];
|
|
|
|
maxJobs = 12;
|
|
|
|
speedFactor = 1;
|
|
|
|
supportedFeatures = [ "gccarch-znver1" "ca-derivations" ];
|
2022-03-22 13:51:13 +00:00
|
|
|
}
|
2022-02-18 14:58:36 +00:00
|
|
|
{
|
2022-02-18 15:09:32 +00:00
|
|
|
maxJobs = 16;
|
|
|
|
speedFactor = 2;
|
2022-02-18 14:58:36 +00:00
|
|
|
hostName = "localhost";
|
|
|
|
systems = [
|
|
|
|
"armv7l-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
"powerpc-linux"
|
|
|
|
"powerpc64-linux"
|
|
|
|
"powerpc64le-linux"
|
|
|
|
"riscv32-linux"
|
|
|
|
"riscv64-linux"
|
|
|
|
"wasm32-wasi"
|
2022-02-18 15:35:55 +00:00
|
|
|
"x86_64-linux"
|
|
|
|
"i686-linux"
|
2022-02-18 14:58:36 +00:00
|
|
|
];
|
2022-03-20 07:02:54 +00:00
|
|
|
supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" "gccarch-znver2" "ca-derivations" ];
|
2022-02-18 14:58:36 +00:00
|
|
|
}
|
|
|
|
];
|
2022-03-04 12:46:58 +00:00
|
|
|
hardware.enableRedistributableFirmware = true;
|
2022-03-09 14:05:47 +00:00
|
|
|
nix.settings.substituters = lib.mkForce [
|
|
|
|
"https://cache.nixos.org/"
|
|
|
|
];
|
2022-03-20 09:15:54 +00:00
|
|
|
nix.daemonCPUSchedPolicy = "idle";
|
|
|
|
nix.daemonIOSchedClass = "idle";
|
2022-04-07 13:30:09 +00:00
|
|
|
networking.wireguard.interfaces.wg0.peers = [
|
|
|
|
# Old infra: nas
|
|
|
|
{
|
|
|
|
publicKey = "X6IOz4q4zfPy34bRhAjsureLc6lLFOSwvyGDfxgp8n4=";
|
|
|
|
allowedIPs = [
|
|
|
|
"fd00:e621:e621:2::2/128"
|
|
|
|
];
|
|
|
|
endpoint = "192.168.2.1:51820";
|
|
|
|
}
|
|
|
|
];
|
2022-01-18 13:55:16 +00:00
|
|
|
}
|