2023-12-08 16:39:57 +01:00
|
|
|
|
{ nixos-hardware, microvm, nix-ld-rs, ... }:
|
2023-08-03 10:38:54 +02:00
|
|
|
|
{ pkgs, config, ... }:
|
2022-11-11 11:54:21 +01:00
|
|
|
|
{
|
|
|
|
|
imports =
|
|
|
|
|
[
|
|
|
|
|
# Include the results of the hardware scan.
|
|
|
|
|
nixos-hardware.nixosModules.common-cpu-amd
|
|
|
|
|
nixos-hardware.nixosModules.common-cpu-amd-pstate
|
|
|
|
|
nixos-hardware.nixosModules.common-pc-ssd
|
|
|
|
|
|
2023-01-27 15:36:05 +01:00
|
|
|
|
microvm.nixosModules.host
|
|
|
|
|
|
2022-11-11 11:54:21 +01:00
|
|
|
|
../../users/erwin
|
|
|
|
|
../../users/root
|
|
|
|
|
];
|
|
|
|
|
|
2022-11-11 17:07:24 +01:00
|
|
|
|
# nixpkgs.config.allowUnfree = true;
|
2022-11-11 12:51:48 +01:00
|
|
|
|
|
2022-11-11 11:54:21 +01:00
|
|
|
|
eboskma = {
|
2022-11-14 18:49:06 +01:00
|
|
|
|
var.workSystem = true;
|
2022-11-11 11:54:21 +01:00
|
|
|
|
users = {
|
|
|
|
|
erwin = {
|
|
|
|
|
enable = true;
|
|
|
|
|
work = true;
|
2022-11-11 12:51:48 +01:00
|
|
|
|
terminal = "Alacritty";
|
2022-11-11 11:54:21 +01:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
base = {
|
|
|
|
|
plymouth.enable = true;
|
|
|
|
|
work = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
desktop = {
|
|
|
|
|
enable = true;
|
2023-09-29 11:52:45 +02:00
|
|
|
|
wayland = true;
|
2022-11-11 11:54:21 +01:00
|
|
|
|
};
|
2023-12-20 11:25:45 +01:00
|
|
|
|
podman = {
|
2022-12-09 10:40:13 +01:00
|
|
|
|
enable = true;
|
|
|
|
|
enableNvidia = true;
|
2023-03-10 12:57:16 +01:00
|
|
|
|
# enableTcpSocket = true;
|
2022-12-09 10:40:13 +01:00
|
|
|
|
};
|
2022-11-11 11:54:21 +01:00
|
|
|
|
fonts.enable = true;
|
|
|
|
|
gnome.enable = true;
|
2023-09-29 11:52:45 +02:00
|
|
|
|
greetd = {
|
|
|
|
|
enable = true;
|
|
|
|
|
sway = true;
|
|
|
|
|
wayvnc = true;
|
2023-10-05 14:58:46 +02:00
|
|
|
|
wallpaper = ../../wallpapers/river-3840.png;
|
2023-11-30 11:50:10 +01:00
|
|
|
|
output = {
|
|
|
|
|
"DP-1" = {
|
|
|
|
|
bg = "${../../wallpapers/river-3840.png} fill";
|
|
|
|
|
mode = "3840x2160@60Hz";
|
|
|
|
|
position = "0 0";
|
|
|
|
|
};
|
|
|
|
|
"DP-3" = {
|
|
|
|
|
bg = "${../../wallpapers/river-3840.png} fill";
|
|
|
|
|
mode = "3840x2160@60Hz";
|
|
|
|
|
position = "3840 0";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
input = {
|
|
|
|
|
"1241:662:USB-HID_Keyboard" = {
|
2023-12-08 16:39:57 +01:00
|
|
|
|
xkb_layout = "us";
|
|
|
|
|
xkb_variant = "";
|
|
|
|
|
xkb_options = "lv3:ralt_switch,eurosign:5,caps:backspace,ctrl:nocaps";
|
2023-11-30 11:50:10 +01:00
|
|
|
|
xkb_numlock = "enabled";
|
|
|
|
|
};
|
|
|
|
|
"1133:49257:Logitech_USB_Laser_Mouse" = {
|
|
|
|
|
natural_scroll = "enabled";
|
|
|
|
|
pointer_accel = "1";
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-09-29 11:52:45 +02:00
|
|
|
|
};
|
2023-05-17 08:06:05 +02:00
|
|
|
|
kanata = {
|
2023-12-08 16:39:57 +01:00
|
|
|
|
enable = true;
|
2023-05-17 08:06:05 +02:00
|
|
|
|
devices = [
|
|
|
|
|
"/dev/input/by-id/usb-04d9_USB-HID_Keyboard-event-kbd"
|
|
|
|
|
];
|
|
|
|
|
};
|
2023-09-29 11:52:45 +02:00
|
|
|
|
lightdm.enable = false;
|
2022-11-11 11:54:21 +01:00
|
|
|
|
networking.enable = true;
|
2022-12-09 10:40:13 +01:00
|
|
|
|
nix-common = {
|
|
|
|
|
enable = true;
|
|
|
|
|
cross-systems = [ "aarch64-linux" ];
|
|
|
|
|
};
|
2022-11-11 11:54:21 +01:00
|
|
|
|
sound.enable = true;
|
|
|
|
|
systemd.enable = true;
|
2023-12-20 11:34:47 +01:00
|
|
|
|
tailscale.enable = true;
|
2022-11-11 11:54:21 +01:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-13 14:50:03 +02:00
|
|
|
|
fileSystems = {
|
|
|
|
|
"/" = {
|
|
|
|
|
device = "/dev/disk/by-label/nixos";
|
|
|
|
|
fsType = "ext4";
|
|
|
|
|
};
|
2023-08-03 10:38:54 +02:00
|
|
|
|
|
2023-09-13 14:50:03 +02:00
|
|
|
|
"/boot" = {
|
|
|
|
|
device = "/dev/disk/by-label/boot";
|
|
|
|
|
fsType = "vfat";
|
|
|
|
|
};
|
2023-08-03 10:38:54 +02:00
|
|
|
|
|
2023-09-13 14:50:03 +02:00
|
|
|
|
"/home" = {
|
|
|
|
|
device = "/dev/disk/by-label/home";
|
|
|
|
|
fsType = "ext4";
|
|
|
|
|
};
|
2023-08-03 10:38:54 +02:00
|
|
|
|
|
2023-09-13 14:50:03 +02:00
|
|
|
|
"/yocto" = {
|
|
|
|
|
device = "/dev/disk/by-label/yocto";
|
|
|
|
|
fsType = "ext4";
|
|
|
|
|
};
|
2023-08-03 10:38:54 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
swapDevices =
|
|
|
|
|
[{ device = "/dev/disk/by-label/swap"; }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hardware = {
|
|
|
|
|
enableAllFirmware = true;
|
|
|
|
|
nvidia = {
|
|
|
|
|
modesetting.enable = true;
|
|
|
|
|
powerManagement.enable = true;
|
2023-09-29 11:52:45 +02:00
|
|
|
|
# forceFullCompositionPipeline = true;
|
2023-08-03 10:38:54 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
opengl = {
|
|
|
|
|
driSupport32Bit = true;
|
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
|
vaapiVdpau
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2022-11-11 11:54:21 +01:00
|
|
|
|
# Use the systemd-boot EFI boot loader.
|
2023-05-25 08:01:53 +02:00
|
|
|
|
boot = {
|
2023-08-30 12:28:04 +02:00
|
|
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
2023-08-03 10:38:54 +02:00
|
|
|
|
initrd = {
|
|
|
|
|
availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
|
|
|
|
kernelModules = [ "dm-snapshot" ];
|
|
|
|
|
};
|
|
|
|
|
kernelModules = [ "kvm-amd" "apple-mfi-fastcharge" "zenpower" ];
|
|
|
|
|
# boot.kernelParams = [ "amd_pstate.shared_mem=1" ];
|
2024-01-18 09:44:48 +01:00
|
|
|
|
extraModulePackages = with config.boot.kernelPackages; [ zenpower cpupower ];
|
2023-05-25 08:01:53 +02:00
|
|
|
|
loader = {
|
|
|
|
|
systemd-boot = {
|
|
|
|
|
enable = true;
|
|
|
|
|
configurationLimit = 15;
|
|
|
|
|
};
|
|
|
|
|
efi.canTouchEfiVariables = true;
|
2022-11-11 11:54:21 +01:00
|
|
|
|
};
|
2023-09-29 11:52:45 +02:00
|
|
|
|
# This triggers a warning on stateVersions < 23.11 if set to true
|
|
|
|
|
swraid.enable = false;
|
2022-11-11 11:54:21 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
time.timeZone = "Europe/Amsterdam";
|
|
|
|
|
|
2023-09-29 11:52:45 +02:00
|
|
|
|
console = {
|
|
|
|
|
font = "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz";
|
|
|
|
|
useXkbConfig = true;
|
|
|
|
|
};
|
2022-11-11 17:07:24 +01:00
|
|
|
|
|
2022-11-11 11:54:21 +01:00
|
|
|
|
networking = {
|
|
|
|
|
hostName = "mimir";
|
|
|
|
|
useDHCP = false;
|
2023-04-21 11:20:56 +02:00
|
|
|
|
networkmanager.enable = false;
|
2022-11-11 11:54:21 +01:00
|
|
|
|
useNetworkd = true;
|
|
|
|
|
|
2023-12-20 11:46:13 +01:00
|
|
|
|
nftables.enable = true;
|
|
|
|
|
|
2022-11-11 11:54:21 +01:00
|
|
|
|
firewall = {
|
2023-07-05 10:07:18 +02:00
|
|
|
|
trustedInterfaces = [ "lo" "tailscale0" ];
|
2022-11-11 11:54:21 +01:00
|
|
|
|
|
|
|
|
|
allowedTCPPorts = [
|
|
|
|
|
# Horus System V2
|
|
|
|
|
12345
|
|
|
|
|
5555
|
|
|
|
|
5556
|
2022-12-09 10:40:13 +01:00
|
|
|
|
|
|
|
|
|
# sccache server
|
|
|
|
|
10501
|
2022-12-22 11:35:17 +01:00
|
|
|
|
|
|
|
|
|
# Celantur
|
|
|
|
|
7000
|
2022-11-11 11:54:21 +01:00
|
|
|
|
];
|
|
|
|
|
};
|
2023-01-27 15:36:05 +01:00
|
|
|
|
|
|
|
|
|
nat = {
|
|
|
|
|
enable = true;
|
|
|
|
|
internalInterfaces = [ "microvm" ];
|
|
|
|
|
externalInterface = "enp4s0";
|
|
|
|
|
};
|
2022-11-11 11:54:21 +01:00
|
|
|
|
};
|
|
|
|
|
|
2023-01-27 15:36:05 +01:00
|
|
|
|
microvm.autostart = [
|
|
|
|
|
"miniflux"
|
|
|
|
|
];
|
|
|
|
|
|
2023-01-31 17:20:23 +01:00
|
|
|
|
powerManagement = {
|
|
|
|
|
cpuFreqGovernor = "ondemand";
|
|
|
|
|
};
|
|
|
|
|
|
2023-11-20 17:03:05 +01:00
|
|
|
|
security = {
|
|
|
|
|
sudo.enable = false;
|
|
|
|
|
sudo-rs.enable = true;
|
2023-12-20 11:46:59 +01:00
|
|
|
|
|
|
|
|
|
apparmor = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
2023-11-20 17:03:05 +01:00
|
|
|
|
};
|
|
|
|
|
|
2022-11-11 11:54:21 +01:00
|
|
|
|
systemd.network = {
|
|
|
|
|
enable = true;
|
|
|
|
|
|
2023-04-21 11:20:56 +02:00
|
|
|
|
# wait-online.extraArgs = [ "--interface=enp4s0" ];
|
|
|
|
|
wait-online.anyInterface = true;
|
2022-11-11 17:07:24 +01:00
|
|
|
|
|
2023-02-13 08:27:46 +01:00
|
|
|
|
links = {
|
|
|
|
|
"40-enp4s0" = {
|
|
|
|
|
matchConfig = {
|
|
|
|
|
Name = "enp4s0";
|
|
|
|
|
};
|
|
|
|
|
linkConfig = {
|
|
|
|
|
WakeOnLan = "magic";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-27 15:36:05 +01:00
|
|
|
|
netdevs = {
|
|
|
|
|
"10-microvm" = {
|
|
|
|
|
netdevConfig = {
|
|
|
|
|
Kind = "bridge";
|
|
|
|
|
Name = "microvm";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2022-11-11 11:54:21 +01:00
|
|
|
|
networks = {
|
|
|
|
|
"40-enp4s0" = {
|
2022-11-17 14:06:39 +01:00
|
|
|
|
enable = true;
|
2022-11-11 11:54:21 +01:00
|
|
|
|
DHCP = "yes";
|
2022-11-11 23:32:29 +01:00
|
|
|
|
|
2023-05-23 17:12:31 +02:00
|
|
|
|
domains = [
|
|
|
|
|
"internal.horus.nu"
|
|
|
|
|
"bedum.horus.nu"
|
|
|
|
|
];
|
|
|
|
|
|
2022-11-11 23:32:29 +01:00
|
|
|
|
matchConfig = {
|
|
|
|
|
Name = "enp4s0";
|
|
|
|
|
};
|
2022-11-11 11:54:21 +01:00
|
|
|
|
};
|
2022-11-11 17:07:24 +01:00
|
|
|
|
|
|
|
|
|
"40-enp5s0f1" = {
|
2022-11-17 14:06:39 +01:00
|
|
|
|
enable = true;
|
2022-11-11 17:07:24 +01:00
|
|
|
|
linkConfig = {
|
2022-11-17 14:06:39 +01:00
|
|
|
|
RequiredForOnline = "no";
|
2022-11-11 17:07:24 +01:00
|
|
|
|
};
|
2022-11-11 23:32:29 +01:00
|
|
|
|
matchConfig = {
|
|
|
|
|
Name = "enp5s0f1";
|
|
|
|
|
};
|
2022-11-11 17:07:24 +01:00
|
|
|
|
};
|
2023-01-27 15:36:05 +01:00
|
|
|
|
|
|
|
|
|
"10-microvm" = {
|
|
|
|
|
matchConfig = {
|
|
|
|
|
Name = "microvm";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
addresses = [
|
|
|
|
|
{ addressConfig.Address = "172.16.0.1/24"; }
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
"11-microvm" = {
|
|
|
|
|
matchConfig = {
|
|
|
|
|
Name = "vm-*";
|
|
|
|
|
};
|
|
|
|
|
networkConfig = {
|
|
|
|
|
Bridge = "microvm";
|
|
|
|
|
};
|
|
|
|
|
};
|
2022-11-11 11:54:21 +01:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-06-23 14:15:11 +02:00
|
|
|
|
# programs.ssh.startAgent = true;
|
2023-09-29 11:52:45 +02:00
|
|
|
|
programs = {
|
|
|
|
|
gnome-disks.enable = true;
|
2023-12-08 16:39:57 +01:00
|
|
|
|
nix-ld = {
|
|
|
|
|
enable = true;
|
|
|
|
|
package = nix-ld-rs.packages.${pkgs.hostPlatform.system}.nix-ld-rs;
|
|
|
|
|
libraries = with pkgs; [
|
|
|
|
|
alsa-lib
|
|
|
|
|
at-spi2-atk
|
|
|
|
|
at-spi2-core
|
|
|
|
|
atk
|
|
|
|
|
cairo
|
|
|
|
|
cups
|
|
|
|
|
curl
|
|
|
|
|
dbus
|
|
|
|
|
expat
|
|
|
|
|
fontconfig
|
|
|
|
|
freetype
|
|
|
|
|
fuse3
|
|
|
|
|
gdk-pixbuf
|
|
|
|
|
glib
|
|
|
|
|
gtk3
|
|
|
|
|
icu
|
|
|
|
|
libGL
|
|
|
|
|
libappindicator-gtk3
|
|
|
|
|
libdrm
|
|
|
|
|
libglvnd
|
|
|
|
|
libnotify
|
|
|
|
|
libpulseaudio
|
|
|
|
|
libunwind
|
|
|
|
|
libusb1
|
|
|
|
|
libuuid
|
|
|
|
|
libxkbcommon
|
|
|
|
|
mesa
|
|
|
|
|
nspr
|
|
|
|
|
nss
|
|
|
|
|
openssl
|
|
|
|
|
pango
|
|
|
|
|
pipewire
|
|
|
|
|
stdenv.cc.cc
|
|
|
|
|
systemd
|
|
|
|
|
vulkan-loader
|
|
|
|
|
xorg.libX11
|
|
|
|
|
xorg.libXScrnSaver
|
|
|
|
|
xorg.libXcomposite
|
|
|
|
|
xorg.libXcursor
|
|
|
|
|
xorg.libXdamage
|
|
|
|
|
xorg.libXext
|
|
|
|
|
xorg.libXfixes
|
|
|
|
|
xorg.libXi
|
|
|
|
|
xorg.libXrandr
|
|
|
|
|
xorg.libXrender
|
|
|
|
|
xorg.libXtst
|
|
|
|
|
xorg.libxcb
|
|
|
|
|
xorg.libxkbfile
|
|
|
|
|
xorg.libxshmfence
|
|
|
|
|
zlib
|
|
|
|
|
];
|
|
|
|
|
};
|
2023-09-29 11:52:45 +02:00
|
|
|
|
};
|
2022-11-11 11:54:21 +01:00
|
|
|
|
|
2023-09-13 14:50:03 +02:00
|
|
|
|
services = {
|
|
|
|
|
openssh.enable = true;
|
2023-01-26 11:36:08 +01:00
|
|
|
|
|
2023-11-10 16:46:12 +01:00
|
|
|
|
envfs.enable = false;
|
2023-09-13 14:50:03 +02:00
|
|
|
|
cpupower-gui.enable = true;
|
|
|
|
|
flatpak.enable = true;
|
2023-04-13 08:38:40 +02:00
|
|
|
|
|
2023-10-05 14:58:46 +02:00
|
|
|
|
teamviewer.enable = true;
|
2023-08-03 10:38:54 +02:00
|
|
|
|
|
2024-01-18 09:44:48 +01:00
|
|
|
|
ddccontrol.enable = true;
|
|
|
|
|
|
2023-09-29 11:52:45 +02:00
|
|
|
|
udisks2 = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
udev = {
|
|
|
|
|
extraRules = ''
|
|
|
|
|
ACTION=="add", ATTRS{idVendor}=="0781", ATTRS{idProduct}=="55b1", ATTRS{serial}=="A20033BEAC21B773", NAME="vault"
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2023-09-13 14:50:03 +02:00
|
|
|
|
xserver = {
|
|
|
|
|
videoDrivers = [ "nvidia" ];
|
2023-08-03 10:38:54 +02:00
|
|
|
|
|
2023-10-09 14:56:16 +02:00
|
|
|
|
# screenSection = ''
|
|
|
|
|
# Option "metamodes" "DP-0: nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On, AllowGSYNCCompatible=On}, DP-4: nvidia-auto-select +3840+0 {ForceFullCompositionPipeline=On, AllowGSYNCCompatible=On}"
|
|
|
|
|
# Option "TripleBuffer" "On"
|
|
|
|
|
# '';
|
|
|
|
|
|
|
|
|
|
# libinput = {
|
|
|
|
|
# enable = true;
|
|
|
|
|
# mouse = {
|
|
|
|
|
# naturalScrolling = true;
|
|
|
|
|
# accelSpeed = "1.0";
|
|
|
|
|
# };
|
|
|
|
|
# touchpad = {
|
|
|
|
|
# naturalScrolling = true;
|
|
|
|
|
# };
|
|
|
|
|
# };
|
2022-11-17 14:06:39 +01:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-13 14:50:03 +02:00
|
|
|
|
icecream.daemon = {
|
|
|
|
|
enable = true;
|
2022-12-22 11:34:55 +01:00
|
|
|
|
|
2023-09-13 14:50:03 +02:00
|
|
|
|
schedulerHost = "icecream.internal.horus.nu";
|
|
|
|
|
noRemote = true;
|
|
|
|
|
openFirewall = false;
|
|
|
|
|
openBroadcast = true;
|
|
|
|
|
};
|
2022-12-22 11:34:55 +01:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-29 11:52:45 +02:00
|
|
|
|
environment = {
|
|
|
|
|
systemPackages = with pkgs; [
|
|
|
|
|
appimage-run
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
sessionVariables = {
|
|
|
|
|
WLR_NO_HARDWARE_CURSORS = "1";
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-05-21 17:12:14 +02:00
|
|
|
|
|
2023-11-30 11:50:10 +01:00
|
|
|
|
sops = {
|
|
|
|
|
defaultSopsFile = ./secrets.yaml;
|
2022-11-11 11:54:21 +01:00
|
|
|
|
|
2023-11-30 11:50:10 +01:00
|
|
|
|
secrets = {
|
2023-12-08 16:39:57 +01:00
|
|
|
|
# outline-keycloak-secret = {
|
|
|
|
|
# owner = "outline";
|
|
|
|
|
# };
|
2023-11-30 11:50:10 +01:00
|
|
|
|
};
|
|
|
|
|
};
|
2022-11-11 11:54:21 +01:00
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "22.11"; # Did you read the comment?
|
|
|
|
|
|
|
|
|
|
}
|