Compare commits

...

13 commits

Author SHA1 Message Date
Simon Bruder f2ecb958ab
hitagi fixup 2024-03-22 20:00:09 +01:00
Simon Bruder 0c381b35ef
hitagi: Reinstall in VM 2024-03-19 18:41:10 +01:00
Simon Bruder 7cb1698467
fixup! fixup! fixup! WIP: hyper: Init 2024-03-19 17:10:34 +01:00
Simon Bruder 45b9cd304d
fixup! fixup! WIP: hyper: Init 2024-03-19 16:57:03 +01:00
Simon Bruder d23daad7c6
fixup! WIP: hyper: Init 2024-03-19 16:53:08 +01:00
Simon Bruder acb07155ad
WIP: hyper: Init 2024-03-19 16:53:07 +01:00
Simon Bruder 51e8dd4169
vueko/mail: Add alias 2024-03-15 14:05:28 +01:00
Simon Bruder fc7f0f8648
co2_exporter: Fix typo in doCheck 2024-03-15 14:01:32 +01:00
Simon Bruder 11d0870f5c
vueko/mail: Add alias 2024-03-14 10:59:43 +01:00
Simon Bruder a1645314f4
games: Drop yuzu
It is dead[1].

[1]: https://arstechnica.com/gaming/2024/03/switch-emulator-makers-agree-to-pay-2-4-million-to-settle-nintendo-lawsuit/
2024-03-07 11:59:36 +01:00
Simon Bruder 47cb7b4b32
flake.lock: Update
Flake lock file updates:

• Updated input 'flake-utils':
    'github:numtide/flake-utils/1ef2e671c3b0c19053962c07dbda38332dcebf26' (2024-01-15)
  → 'github:numtide/flake-utils/d465f4819400de7c8d874d50b982301f28a84605' (2024-02-28)
• Updated input 'home-manager-unstable':
    'github:nix-community/home-manager/043ba285c6dc20f36441d48525402bcb9743c498' (2024-02-14)
  → 'github:nix-community/home-manager/cf111d1a849ddfc38e9155be029519b0e2329615' (2024-03-06)
• Updated input 'nix-pre-commit-hooks':
    'github:cachix/pre-commit-hooks.nix/0db2e67ee49910adfa13010e7f012149660af7f0' (2024-02-07)
  → 'github:cachix/pre-commit-hooks.nix/5df5a70ad7575f6601d91f0efec95dd9bc619431' (2024-02-15)
• Updated input 'nixos-hardware':
    'github:nixos/nixos-hardware/f1b2f71c86a5b1941d20608db0b1e88a07d31303' (2024-02-13)
  → 'github:nixos/nixos-hardware/59e37017b9ed31dee303dbbd4531c594df95cfbc' (2024-03-02)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/01885a071465e223f8f68971f864b15829988504' (2024-02-13)
  → 'github:nixos/nixpkgs/880992dcc006a5e00dd0591446fdf723e6a51a64' (2024-03-05)
• Updated input 'nixpkgs-unstable':
    'github:nixos/nixpkgs/35ff7e87ee05199a8003f438ec11a174bcbd98ea' (2024-02-13)
  → 'github:nixos/nixpkgs/9df3e30ce24fd28c7b3e2de0d986769db5d6225d' (2024-03-06)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/48afd3264ec52bee85231a7122612e2c5202fa74' (2024-02-13)
  → 'github:Mic92/sops-nix/25dd60fdd08fcacee2567a26ba6b91fe098941dc' (2024-03-06)
• Updated input 'sops-nix/nixpkgs-stable':
    'github:NixOS/nixpkgs/d8cd80616c8800feec0cab64331d7c3d5a1a6d98' (2024-02-10)
  → 'github:NixOS/nixpkgs/66d65cb00b82ffa04ee03347595aa20e41fe3555' (2024-03-03)
2024-03-07 09:50:31 +01:00
Simon Bruder 07cac97bef
vueko/mail: Add alias 2024-03-02 11:47:52 +01:00
Simon Bruder 4c119f0b80
authoritative-dns: Drop INWX secondaries 2024-02-27 15:57:04 +01:00
11 changed files with 312 additions and 110 deletions

View file

@ -44,11 +44,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"lastModified": 1709126324,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
"type": "github"
},
"original": {
@ -106,11 +106,11 @@
]
},
"locked": {
"lastModified": 1707919853,
"narHash": "sha256-qxmBGDzutuJ/tsX4gp+Mr7fjxOZBbeT9ixhS5o4iFOw=",
"lastModified": 1709764752,
"narHash": "sha256-+lM4J4JoJeiN8V+3WSWndPHj1pJ9Jc1UMikGbXLqCTk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "043ba285c6dc20f36441d48525402bcb9743c498",
"rev": "cf111d1a849ddfc38e9155be029519b0e2329615",
"type": "github"
},
"original": {
@ -215,11 +215,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1707297608,
"narHash": "sha256-ADjo/5VySGlvtCW3qR+vdFF4xM9kJFlRDqcC9ZGI8EA=",
"lastModified": 1708018599,
"narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "0db2e67ee49910adfa13010e7f012149660af7f0",
"rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431",
"type": "github"
},
"original": {
@ -231,11 +231,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1707842204,
"narHash": "sha256-M+HAq1qWQBi/gywaMZwX0odU+Qb/XeqVeANGKRBDOwU=",
"lastModified": 1709410583,
"narHash": "sha256-esOSUoQ7mblwcsSea0K17McZuwAIjoS6dq/4b83+lvw=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "f1b2f71c86a5b1941d20608db0b1e88a07d31303",
"rev": "59e37017b9ed31dee303dbbd4531c594df95cfbc",
"type": "github"
},
"original": {
@ -247,11 +247,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1707786466,
"narHash": "sha256-yLPfrmW87M2qt+8bAmwopJawa+MJLh3M9rUbXtpUc1o=",
"lastModified": 1709677081,
"narHash": "sha256-tix36Y7u0rkn6mTm0lA45b45oab2cFLqAzDbJxeXS+c=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "01885a071465e223f8f68971f864b15829988504",
"rev": "880992dcc006a5e00dd0591446fdf723e6a51a64",
"type": "github"
},
"original": {
@ -306,11 +306,11 @@
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1707603439,
"narHash": "sha256-LodBVZ3+ehJP2azM5oj+JrhfNAAzmTJ/OwAIOn0RfZ0=",
"lastModified": 1709428628,
"narHash": "sha256-//ZCCnpVai/ShtO2vPjh3AWgo8riXCaret6V9s7Hew4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d8cd80616c8800feec0cab64331d7c3d5a1a6d98",
"rev": "66d65cb00b82ffa04ee03347595aa20e41fe3555",
"type": "github"
},
"original": {
@ -322,11 +322,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1707863367,
"narHash": "sha256-LdBbCSSP7VHaHA4KXcPGKqkvsowT2+7W4jlEHJj6rPg=",
"lastModified": 1709703039,
"narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "35ff7e87ee05199a8003f438ec11a174bcbd98ea",
"rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d",
"type": "github"
},
"original": {
@ -453,11 +453,11 @@
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1707842202,
"narHash": "sha256-3dTBbCzHJBinwhsisGJHW1HLBsLbj91+a5ZDXt7ttW0=",
"lastModified": 1709711091,
"narHash": "sha256-L0rSIU9IguTG4YqSj4B/02SyTEz55ACq5t8gXpzteYc=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "48afd3264ec52bee85231a7122612e2c5202fa74",
"rev": "25dd60fdd08fcacee2567a26ba6b91fe098941dc",
"type": "github"
},
"original": {

View file

@ -76,4 +76,9 @@ in
targetHost = "yuzuru.sbruder.de";
};
hyper = {
system = "x86_64-linux";
targetHost = "hyper.lan.shinonome-lab.de";
};
}

View file

@ -7,53 +7,43 @@
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/profiles/qemu-guest.nix")
];
sbruder.machine.isVm = true;
boot = {
# Intel arc
kernelPackages = pkgs.linuxPackages_latest;
# fan control configuration from https://gist.github.com/bakman2/e801f342aaa7cade62d7bd54fd3eabd8
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
'';
kernelParams = [ "console=ttyS0" ];
loader = {
grub.enable = false;
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
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" ];
luks.devices = {
root = {
name = "root";
device = "/dev/disk/by-uuid/63c6aa7c-47c5-43f5-b0eb-c32b0768327b";
preLVM = true;
allowDiscards = true;
};
};
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/3994f497-9848-459e-9642-cbc14a7d3c97";
device = "/dev/disk/by-uuid/db6c8826-ea3c-4bd6-bcb3-5a9ae3089519";
fsType = "btrfs";
options = [ "discard=async" "noatime" "compress=zstd" ];
options = [ "discard=async" "noatime" "compress=zstd" "ssd" ];
};
"/boot" = {
device = "/dev/disk/by-uuid/96B6-34BD";
device = "/dev/disk/by-uuid/77DB-CC39";
fsType = "vfat";
};
};
swapDevices = [
{ device = "/dev/disk/by-uuid/98de7ced-4d7c-4915-bf5b-1a0300458ea6"; }
];
"/data/steam" = {
device = "steam";
fsType = "virtiofs";
};
};
# GPU
hardware.opengl = {
@ -81,57 +71,4 @@
capabilities = "cap_perfmon+p";
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
View 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 500DXs (for better airflow).
* Motherboard: GIGABYTE B550 AORUS ELITE V2 (rev 1.0)
* CPU: AMD Ryzen 7 5800X
* RAM:
2×16GB G.Skill Aegis F4-3200C16-16GIS
\+ 2×32GB G.Skill Ripjaws V F4-3200C16-32GVK
(both DDR4 3200MHz 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 140mm (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*.

View 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
#'';
}

View 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";
};
};
}

View 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
];
};
}

View file

@ -67,12 +67,7 @@ in
id = host;
address = hostAddresses;
})
addresses) ++ lib.optional isPrimaryHost {
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";
};
addresses);
}
(lib.mkIf isPrimaryHost {
policy = lib.singleton {
@ -90,7 +85,7 @@ in
zonefile-load = "difference-no-serial";
journal-content = "all";
# secondary
notify = [ "inwx" ] ++ secondaryHosts;
notify = secondaryHosts;
# dnssec
dnssec-signing = true;
dnssec-policy = "default";

View file

@ -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
@ -19,7 +19,7 @@ buildGoModule rec {
vendorHash = "sha256-CMo6FBzw0/OMKEX12oNqhbF/0dRRFR6W3VRp+EU6Q68=";
oCheck = false; # no tests
doCheck = false; # no tests
meta = with lib; {
license = licenses.mit;

View file

@ -48,7 +48,6 @@ lib.mkIf cfg.enable {
pcsx2
] ++ lib.optionals (cfg.performanceIndex >= 8) [
unstable.ryujinx
unstable.yuzu-mainline
] ++ lib.optionals unfree.allowSoftware [
unstable.osu-lazer-sandbox
];