Compare commits
13 commits
Author | SHA1 | Date | |
---|---|---|---|
Simon Bruder | f2ecb958ab | ||
Simon Bruder | 0c381b35ef | ||
Simon Bruder | 7cb1698467 | ||
Simon Bruder | 45b9cd304d | ||
Simon Bruder | d23daad7c6 | ||
Simon Bruder | acb07155ad | ||
Simon Bruder | 51e8dd4169 | ||
Simon Bruder | fc7f0f8648 | ||
Simon Bruder | 11d0870f5c | ||
Simon Bruder | a1645314f4 | ||
Simon Bruder | 47cb7b4b32 | ||
Simon Bruder | 07cac97bef | ||
Simon Bruder | 4c119f0b80 |
48
flake.lock
48
flake.lock
|
@ -44,11 +44,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705309234,
|
"lastModified": 1709126324,
|
||||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -106,11 +106,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707919853,
|
"lastModified": 1709764752,
|
||||||
"narHash": "sha256-qxmBGDzutuJ/tsX4gp+Mr7fjxOZBbeT9ixhS5o4iFOw=",
|
"narHash": "sha256-+lM4J4JoJeiN8V+3WSWndPHj1pJ9Jc1UMikGbXLqCTk=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "043ba285c6dc20f36441d48525402bcb9743c498",
|
"rev": "cf111d1a849ddfc38e9155be029519b0e2329615",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -215,11 +215,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707297608,
|
"lastModified": 1708018599,
|
||||||
"narHash": "sha256-ADjo/5VySGlvtCW3qR+vdFF4xM9kJFlRDqcC9ZGI8EA=",
|
"narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "0db2e67ee49910adfa13010e7f012149660af7f0",
|
"rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -231,11 +231,11 @@
|
||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707842204,
|
"lastModified": 1709410583,
|
||||||
"narHash": "sha256-M+HAq1qWQBi/gywaMZwX0odU+Qb/XeqVeANGKRBDOwU=",
|
"narHash": "sha256-esOSUoQ7mblwcsSea0K17McZuwAIjoS6dq/4b83+lvw=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "f1b2f71c86a5b1941d20608db0b1e88a07d31303",
|
"rev": "59e37017b9ed31dee303dbbd4531c594df95cfbc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -247,11 +247,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707786466,
|
"lastModified": 1709677081,
|
||||||
"narHash": "sha256-yLPfrmW87M2qt+8bAmwopJawa+MJLh3M9rUbXtpUc1o=",
|
"narHash": "sha256-tix36Y7u0rkn6mTm0lA45b45oab2cFLqAzDbJxeXS+c=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "01885a071465e223f8f68971f864b15829988504",
|
"rev": "880992dcc006a5e00dd0591446fdf723e6a51a64",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -306,11 +306,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable_2": {
|
"nixpkgs-stable_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707603439,
|
"lastModified": 1709428628,
|
||||||
"narHash": "sha256-LodBVZ3+ehJP2azM5oj+JrhfNAAzmTJ/OwAIOn0RfZ0=",
|
"narHash": "sha256-//ZCCnpVai/ShtO2vPjh3AWgo8riXCaret6V9s7Hew4=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "d8cd80616c8800feec0cab64331d7c3d5a1a6d98",
|
"rev": "66d65cb00b82ffa04ee03347595aa20e41fe3555",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -322,11 +322,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707863367,
|
"lastModified": 1709703039,
|
||||||
"narHash": "sha256-LdBbCSSP7VHaHA4KXcPGKqkvsowT2+7W4jlEHJj6rPg=",
|
"narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "35ff7e87ee05199a8003f438ec11a174bcbd98ea",
|
"rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -453,11 +453,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable_2"
|
"nixpkgs-stable": "nixpkgs-stable_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1707842202,
|
"lastModified": 1709711091,
|
||||||
"narHash": "sha256-3dTBbCzHJBinwhsisGJHW1HLBsLbj91+a5ZDXt7ttW0=",
|
"narHash": "sha256-L0rSIU9IguTG4YqSj4B/02SyTEz55ACq5t8gXpzteYc=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "48afd3264ec52bee85231a7122612e2c5202fa74",
|
"rev": "25dd60fdd08fcacee2567a26ba6b91fe098941dc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -76,4 +76,9 @@ in
|
||||||
|
|
||||||
targetHost = "yuzuru.sbruder.de";
|
targetHost = "yuzuru.sbruder.de";
|
||||||
};
|
};
|
||||||
|
hyper = {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
targetHost = "hyper.lan.shinonome-lab.de";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,53 +7,43 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
(modulesPath + "/profiles/qemu-guest.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
|
sbruder.machine.isVm = true;
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
# Intel arc
|
# Intel arc
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
kernelPackages = pkgs.linuxPackages_latest;
|
||||||
# fan control configuration from https://gist.github.com/bakman2/e801f342aaa7cade62d7bd54fd3eabd8
|
kernelParams = [ "console=ttyS0" ];
|
||||||
kernelModules = [ "kvm-amd" "it87" ];
|
|
||||||
kernelParams = [ "acpi_enforce_resources=lax" ]; # allow it87 to load
|
|
||||||
extraModulePackages = with config.boot.kernelPackages; [ it87 ];
|
|
||||||
extraModprobeConfig = ''
|
|
||||||
options it87 force_id=0x8688
|
|
||||||
'';
|
|
||||||
loader = {
|
loader = {
|
||||||
grub.enable = false;
|
grub.enable = false;
|
||||||
systemd-boot.enable = true;
|
systemd-boot.enable = true;
|
||||||
efi.canTouchEfiVariables = true;
|
efi.canTouchEfiVariables = true;
|
||||||
};
|
};
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = [ "aesni_intel" "ahci" "ehci_pci" "nvme" "sd_mod" "sr_mod" "usb_storage" "usbhid" "xhci_pci" ];
|
availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "virtio_blk" ];
|
||||||
kernelModules = [ "dm-snapshot" ];
|
kernelModules = [ "dm-snapshot" ];
|
||||||
luks.devices = {
|
|
||||||
root = {
|
|
||||||
name = "root";
|
|
||||||
device = "/dev/disk/by-uuid/63c6aa7c-47c5-43f5-b0eb-c32b0768327b";
|
|
||||||
preLVM = true;
|
|
||||||
allowDiscards = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
"/" = {
|
"/" = {
|
||||||
device = "/dev/disk/by-uuid/3994f497-9848-459e-9642-cbc14a7d3c97";
|
device = "/dev/disk/by-uuid/db6c8826-ea3c-4bd6-bcb3-5a9ae3089519";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "discard=async" "noatime" "compress=zstd" ];
|
options = [ "discard=async" "noatime" "compress=zstd" "ssd" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
"/boot" = {
|
"/boot" = {
|
||||||
device = "/dev/disk/by-uuid/96B6-34BD";
|
device = "/dev/disk/by-uuid/77DB-CC39";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [
|
"/data/steam" = {
|
||||||
{ device = "/dev/disk/by-uuid/98de7ced-4d7c-4915-bf5b-1a0300458ea6"; }
|
device = "steam";
|
||||||
];
|
fsType = "virtiofs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# GPU
|
# GPU
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
|
@ -81,57 +71,4 @@
|
||||||
capabilities = "cap_perfmon+p";
|
capabilities = "cap_perfmon+p";
|
||||||
source = "${pkgs.intel-gpu-tools}/bin/intel_gpu_top";
|
source = "${pkgs.intel-gpu-tools}/bin/intel_gpu_top";
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://www.reddit.com/r/gigabyte/comments/p5ewjn/b550i_pro_ax_f13_bios_sleep_issue_on_linux/
|
|
||||||
systemd.services.suspend-fix = {
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
description = "Fix suspend";
|
|
||||||
|
|
||||||
script = ''
|
|
||||||
if grep -q "GPP0 .* \*enabled" /proc/acpi/wakeup; then
|
|
||||||
echo GPP0 > /proc/acpi/wakeup
|
|
||||||
echo "Disabled wakeup for GPP0"
|
|
||||||
else
|
|
||||||
echo "Wakeup for GPP0 already disabled"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
sbruder.fancontrol = {
|
|
||||||
enable = false; # no hwmon for intel arc (yet)
|
|
||||||
enableDefaultMapping = true;
|
|
||||||
fans = {
|
|
||||||
front = {
|
|
||||||
pwmFile = "/sys/class/hwmon/hwmon1/pwm4";
|
|
||||||
rpmFile = "/sys/class/hwmon/hwmon1/fan4_input";
|
|
||||||
pwmLineStart = 50;
|
|
||||||
neverStop = true;
|
|
||||||
};
|
|
||||||
back = {
|
|
||||||
pwmFile = "/sys/class/hwmon/hwmon1/pwm2";
|
|
||||||
rpmFile = "/sys/class/hwmon/hwmon1/fan2_input";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
sensors = {
|
|
||||||
cpu = {
|
|
||||||
file = "/sys/class/hwmon/hwmon2/temp3_input";
|
|
||||||
min = 50;
|
|
||||||
max = 80;
|
|
||||||
};
|
|
||||||
gpu = {
|
|
||||||
file = "/sys/class/hwmon/hwmon4/temp1_input";
|
|
||||||
min = 50;
|
|
||||||
max = 70;
|
|
||||||
};
|
|
||||||
nvme = {
|
|
||||||
file = "/sys/class/hwmon/hwmon0/temp1_input";
|
|
||||||
min = 40;
|
|
||||||
max = 70;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
39
machines/hyper/README.md
Normal file
39
machines/hyper/README.md
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
<!--
|
||||||
|
SPDX-FileCopyrightText: 2020-2024 Simon Bruder <simon@sbruder.de>
|
||||||
|
|
||||||
|
SPDX-License-Identifier: CC-BY-SA-4.0
|
||||||
|
-->
|
||||||
|
|
||||||
|
# hitagi
|
||||||
|
|
||||||
|
## Hardware
|
||||||
|
|
||||||
|
Custom build in a be quiet! Pure Base 500
|
||||||
|
with the front panel changed to a Pure Base 500DX’s (for better airflow).
|
||||||
|
|
||||||
|
* Motherboard: GIGABYTE B550 AORUS ELITE V2 (rev 1.0)
|
||||||
|
* CPU: AMD Ryzen 7 5800X
|
||||||
|
* RAM:
|
||||||
|
2×16 GB G.Skill Aegis F4-3200C16-16GIS
|
||||||
|
\+ 2×32 GB G.Skill Ripjaws V F4-3200C16-32GVK
|
||||||
|
(both DDR4 3200 MHz CL16-18-18-38)
|
||||||
|
* PSU: be quiet! System Power 10 750W
|
||||||
|
* SSD: 1TB Samsung 980 Pro NVMe
|
||||||
|
* GPU: Intel Arc A770 Limited Edition (16GB VRAM)
|
||||||
|
* Case fans: 2 be quiet! Pure Wings 2 140 mm (included in case), 3 more with PWM
|
||||||
|
* CPU Cooler: Noctua NH-U12S with an additional NF-F12 PWM
|
||||||
|
|
||||||
|
This replaces sayuri,
|
||||||
|
which features an enterprise HP firmware without fan control,
|
||||||
|
an ancient Intel platform that is only usable in YOLO mode (`mitigations=off`)
|
||||||
|
and proprietary case, motherboard and power supply.
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
Tasks that require large amounts of CPU power,
|
||||||
|
a high amount of GPU power
|
||||||
|
or have to run while I do other things (on my laptop).
|
||||||
|
|
||||||
|
## Name
|
||||||
|
|
||||||
|
Senjougahara Hitagi is a student from the *Monogatari Series*.
|
63
machines/hyper/configuration.nix
Normal file
63
machines/hyper/configuration.nix
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
# SPDX-FileCopyrightText: 2020-2024 Simon Bruder <simon@sbruder.de>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
./network.nix
|
||||||
|
../../modules
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.hostName = "hyper";
|
||||||
|
|
||||||
|
system.stateVersion = "23.11";
|
||||||
|
|
||||||
|
virtualisation.libvirtd = {
|
||||||
|
enable = true;
|
||||||
|
qemu = {
|
||||||
|
package = pkgs.qemu_kvm;
|
||||||
|
ovmf.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
virtiofsd
|
||||||
|
];
|
||||||
|
|
||||||
|
fileSystems = {
|
||||||
|
"/data/shared" = {
|
||||||
|
device = "/dev/hyper-vg/shared";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "discard=async" "noatime" "compress=zstd" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#environment.etc."libvirt/hooks/qemu".source = pkgs.writeShellScript "libvirt-qemu-hook" ''
|
||||||
|
# set -euo pipefail
|
||||||
|
|
||||||
|
# object="$1"
|
||||||
|
# operation="$2"
|
||||||
|
# sub_operation="$3"
|
||||||
|
# extra_arg="$4"
|
||||||
|
|
||||||
|
# intel_arc_reset_hack_guests=(
|
||||||
|
# "virtdows"
|
||||||
|
# )
|
||||||
|
|
||||||
|
# case "$operation" in
|
||||||
|
# start)
|
||||||
|
# if [ "$sub_operation" = "begin" ]; then
|
||||||
|
# for guest in "''${intel_arc_reset_hack_guests[@]}"; do
|
||||||
|
# if [ "$guest" = "$object" ]; then
|
||||||
|
# echo "Applied intel arc reset hack for guest $guest"
|
||||||
|
# echo > /sys/bus/pci/devices/0000:08:00.0/reset_method
|
||||||
|
# fi
|
||||||
|
# done
|
||||||
|
# fi
|
||||||
|
# ;;
|
||||||
|
# esac
|
||||||
|
#'';
|
||||||
|
}
|
81
machines/hyper/hardware-configuration.nix
Normal file
81
machines/hyper/hardware-configuration.nix
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
# SPDX-FileCopyrightText: 2020-2024 Simon Bruder <simon@sbruder.de>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
{ config, lib, modulesPath, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
# fan control configuration from https://gist.github.com/bakman2/e801f342aaa7cade62d7bd54fd3eabd8
|
||||||
|
kernelModules = [ "kvm-amd" "it87" ];
|
||||||
|
kernelParams = [
|
||||||
|
"acpi_enforce_resources=lax" # allow it87 to load
|
||||||
|
"ip=dhcp"
|
||||||
|
"iommu=pt"
|
||||||
|
"default_hugepagesz=1G"
|
||||||
|
"hugepagesz=1G"
|
||||||
|
"hugepages=90"
|
||||||
|
];
|
||||||
|
extraModulePackages = with config.boot.kernelPackages; [ it87 ];
|
||||||
|
extraModprobeConfig = ''
|
||||||
|
options it87 force_id=0x8688
|
||||||
|
options vfio-pci ids=8086:56a0,8086:4f90
|
||||||
|
softdep drm pre: vfio-pci
|
||||||
|
options kvm-amd nested=0 avic=1 npt=1
|
||||||
|
'';
|
||||||
|
loader = {
|
||||||
|
grub.enable = false;
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
initrd = {
|
||||||
|
availableKernelModules = [ "aesni_intel" "ahci" "ehci_pci" "nvme" "r8169" "sd_mod" "sr_mod" "usb_storage" "usbhid" "xhci_pci" ];
|
||||||
|
kernelModules = [ "dm-snapshot" ];
|
||||||
|
luks.devices = {
|
||||||
|
root = {
|
||||||
|
name = "root";
|
||||||
|
device = "/dev/disk/by-uuid/63d366bd-5453-46b5-89d5-a61cbb828102";
|
||||||
|
preLVM = true;
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# https://www.reddit.com/r/gigabyte/comments/p5ewjn/b550i_pro_ax_f13_bios_sleep_issue_on_linux/
|
||||||
|
systemd.services.suspend-fix = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
description = "Fix suspend";
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
if grep -q "GPP0 .* \*enabled" /proc/acpi/wakeup; then
|
||||||
|
echo GPP0 > /proc/acpi/wakeup
|
||||||
|
echo "Disabled wakeup for GPP0"
|
||||||
|
else
|
||||||
|
echo "Wakeup for GPP0 already disabled"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "/dev/disk/by-uuid/53f4e762-39fa-41a6-8b78-4999d38e6e88";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "discard=async" "noatime" "compress=zstd" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/boot" = {
|
||||||
|
device = "/dev/disk/by-uuid/403C-02C1";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
83
machines/hyper/network.nix
Normal file
83
machines/hyper/network.nix
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
# SPDX-FileCopyrightText: 2020-2024 Simon Bruder <simon@sbruder.de>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
vlans = {
|
||||||
|
lan = 10;
|
||||||
|
guest = 30;
|
||||||
|
};
|
||||||
|
dhcpVlans = [ "lan" ];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
networking.useDHCP = false;
|
||||||
|
|
||||||
|
systemd.network = {
|
||||||
|
enable = true;
|
||||||
|
wait-online.extraArgs = [ "--any" ];
|
||||||
|
netdevs =
|
||||||
|
let
|
||||||
|
vlanNetdevs = (lib.mapAttrs
|
||||||
|
(Name: Id: {
|
||||||
|
netdevConfig = {
|
||||||
|
inherit Name;
|
||||||
|
Kind = "vlan";
|
||||||
|
};
|
||||||
|
vlanConfig = {
|
||||||
|
inherit Id;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
vlans);
|
||||||
|
bridgeNetdevs = (lib.mapAttrs'
|
||||||
|
(name: _: lib.nameValuePair "br-${name}" {
|
||||||
|
netdevConfig = {
|
||||||
|
Name = "br-${name}";
|
||||||
|
Kind = "bridge";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
vlans);
|
||||||
|
in
|
||||||
|
lib.mkMerge [ vlanNetdevs bridgeNetdevs ];
|
||||||
|
networks =
|
||||||
|
let
|
||||||
|
vlanNetworks = (lib.mapAttrs
|
||||||
|
(name: _: {
|
||||||
|
inherit name;
|
||||||
|
matchConfig = {
|
||||||
|
Type = "vlan";
|
||||||
|
};
|
||||||
|
bridge = lib.singleton "br-${name}";
|
||||||
|
})
|
||||||
|
vlans);
|
||||||
|
bridgeNetworks = (lib.mapAttrs'
|
||||||
|
(name: _: lib.nameValuePair "br-${name}"
|
||||||
|
({
|
||||||
|
name = "br-${name}";
|
||||||
|
} // lib.optionalAttrs (lib.elem name dhcpVlans) {
|
||||||
|
DHCP = "ipv4";
|
||||||
|
networkConfig = {
|
||||||
|
IPv6AcceptRA = "yes";
|
||||||
|
};
|
||||||
|
}))
|
||||||
|
vlans);
|
||||||
|
in
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
physical-lan = {
|
||||||
|
name = "eno1";
|
||||||
|
vlan = [ "lan" "guest" ];
|
||||||
|
networkConfig = {
|
||||||
|
LinkLocalAddressing = "no";
|
||||||
|
LLDP = "no";
|
||||||
|
EmitLLDP = "no";
|
||||||
|
IPv6AcceptRA = "no";
|
||||||
|
IPv6SendRA = "no";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
vlanNetworks
|
||||||
|
bridgeNetworks
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Binary file not shown.
|
@ -67,12 +67,7 @@ in
|
||||||
id = host;
|
id = host;
|
||||||
address = hostAddresses;
|
address = hostAddresses;
|
||||||
})
|
})
|
||||||
addresses) ++ lib.optional isPrimaryHost {
|
addresses);
|
||||||
id = "inwx";
|
|
||||||
# INWX only allows the specification of one primary DNS,
|
|
||||||
# which limits the IP protocol usable for zone transfers to one.
|
|
||||||
address = lib.singleton "185.181.104.96";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
(lib.mkIf isPrimaryHost {
|
(lib.mkIf isPrimaryHost {
|
||||||
policy = lib.singleton {
|
policy = lib.singleton {
|
||||||
|
@ -90,7 +85,7 @@ in
|
||||||
zonefile-load = "difference-no-serial";
|
zonefile-load = "difference-no-serial";
|
||||||
journal-content = "all";
|
journal-content = "all";
|
||||||
# secondary
|
# secondary
|
||||||
notify = [ "inwx" ] ++ secondaryHosts;
|
notify = secondaryHosts;
|
||||||
# dnssec
|
# dnssec
|
||||||
dnssec-signing = true;
|
dnssec-signing = true;
|
||||||
dnssec-policy = "default";
|
dnssec-policy = "default";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# SPDX-FileCopyrightText: 2022-2023 Simon Bruder <simon@sbruder.de>
|
# SPDX-FileCopyrightText: 2022-2024 Simon Bruder <simon@sbruder.de>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ buildGoModule rec {
|
||||||
|
|
||||||
vendorHash = "sha256-CMo6FBzw0/OMKEX12oNqhbF/0dRRFR6W3VRp+EU6Q68=";
|
vendorHash = "sha256-CMo6FBzw0/OMKEX12oNqhbF/0dRRFR6W3VRp+EU6Q68=";
|
||||||
|
|
||||||
oCheck = false; # no tests
|
doCheck = false; # no tests
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
|
|
|
@ -48,7 +48,6 @@ lib.mkIf cfg.enable {
|
||||||
pcsx2
|
pcsx2
|
||||||
] ++ lib.optionals (cfg.performanceIndex >= 8) [
|
] ++ lib.optionals (cfg.performanceIndex >= 8) [
|
||||||
unstable.ryujinx
|
unstable.ryujinx
|
||||||
unstable.yuzu-mainline
|
|
||||||
] ++ lib.optionals unfree.allowSoftware [
|
] ++ lib.optionals unfree.allowSoftware [
|
||||||
unstable.osu-lazer-sandbox
|
unstable.osu-lazer-sandbox
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue