ft (wip): big initial config

This commit is contained in:
2026-09-26 01:45:42 +02:00
parent 4aead77c60
commit 7a07c37bc3
19 changed files with 1173 additions and 0 deletions

47
hosts/nixbook/default.nix Normal file
View File

@@ -0,0 +1,47 @@
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
../../modules
];
networking.hostName = "nixbook";
system.stateVersion = "26.05";
boot.initrd.luks.devices."luks-082cc474-c00a-46c5-b140-4b7ccc2e6958".device = "/dev/disk/by-uuid/082cc474-c00a-46c5-b140-4b7ccc2e6958";
services.power-profiles-daemon.enable = true;
hardware.bluetooth.powerOnBoot = false;
users.users.djai.packages = with pkgs; [
steam
];
# BELOW IS OLD!! remove as we make more modular
# custom certificates
# TODO: move certs to secrets, make this a module not a host based thing
security.pki.certificateFiles = [
./certs/npm-caddy-private.crt
./certs/npm-caddy-public.crt
./certs/npm-caddy-shared.crt
];
# TODO: move to secrets
# tunnel
networking.wg-quick.interfaces = {
npm = {
address = ["10.8.0.3/32"];
privateKeyFile = "/root/wireguard-keys/npm";
peers = [{
publicKey = "YlQfDLqOET0RCTfbeRTDUicF/RA6dic/ThHLy25w4nQ=";
presharedKeyFile = "/root/wireguard-keys/npm_preshared";
allowedIPs = ["10.9.11.0/24" "10.8.0.0/24"];
endpoint = "wg-easy.u.djairo.dev:51820";
persistentKeepalive = 25;
}];
};
};
}

View File

@@ -0,0 +1,35 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/mapper/luks-9902aae8-b296-4d67-8349-eab712cfefa4";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-9902aae8-b296-4d67-8349-eab712cfefa4".device = "/dev/disk/by-uuid/9902aae8-b296-4d67-8349-eab712cfefa4";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/2589-CE74";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/mapper/luks-082cc474-c00a-46c5-b140-4b7ccc2e6958"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

21
hosts/tuxcomp/default.nix Normal file
View File

@@ -0,0 +1,21 @@
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
../../modules
./gaming.nix
];
# TODO: literally this whole configuration lmao
# adds a `stretch_aspect` scaler (Valve/gamescope#927) and lets `--rt` use the
# rtprio limit from modules/gaming.nix instead of CAP_SYS_NICE.
nixpkgs.overlays = [
(_final: prev: {
gamescope = prev.gamescope.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [ ../../patches/gamescope-stretch-aspect.patch ];
});
})
];
}

73
hosts/tuxcomp/gaming.nix Normal file
View File

@@ -0,0 +1,73 @@
{ pkgs, ... }:
{
programs.gamemode.enable = true;
users.users.djai.extraGroups = [ "gamemode" ];
# capSysNice would make glibc strip LD_PRELOAD from gamescope, breaking steam's overlay.
# '--rt' works through the rtprio limit below instead (see the gamescope patch on tuxcomp).
programs.gamescope = {
enable = true;
capSysNice = false;
};
security.pam.loginLimits = [
{
domain = "@users";
type = "-";
item = "rtprio";
value = "99";
}
{
domain = "@users";
type = "-";
item = "nice";
value = "-19";
}
];
# Wine 10+ uses the kernel's ntsync when /dev/ntsync exists; far cheaper
# than esync/fsync under thread contention.
boot.kernelModules = [ "ntsync" ];
users.users.djai.packages = with pkgs; [
desmume
eden
libretro.citra
prismlauncher
steam
winetricks
]:
services.flatpak.packages = [
"org.vinegarhq.Sober"
];
# TODO: switch to home manager
# home-manager.users.djai =
# { config, ... }:
# {
# home.packages = with pkgs; [ ];
#
# xdg.desktopEntries.sims4 = {
# name = "The Sims 4";
# exec = ''xdg-open "PATHTOEXECHERE"'';
# icon = "${config.home.homeDirectory}/.icons/";
# categories = [ "Game" ];
# terminal = false;
# };
#
# # gamescope does fullscreen and scaling; setting content=game sets direct scnaout
# # requires this in hyprland config: render.direct_scanout = 2;
# wayland.windowManager.hyprland.settings.window_rule = [
# {
# match.class = "gamescope";
# fullscreen = true;
# content = "game";
# opaque = true;
# immediate = true;
# }
# ];
# };
}