feat(nix): add HALO system configuration and user setup
- Added system configuration for the HALO machine, including hardware, sound, and remapping settings. - Configured user-specific settings like session paths, favorite apps, and terminal customization. - Introduced zram swap, SSD TRIM, and PipeWire priority tuning for performance optimization.
This commit is contained in:
parent
536ad5a47a
commit
52e1276115
6 changed files with 326 additions and 0 deletions
88
homes/x86_64-linux/harald@halo/default.nix
Normal file
88
homes/x86_64-linux/harald@halo/default.nix
Normal file
|
|
@ -0,0 +1,88 @@
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
home.sessionPath = [
|
||||||
|
"$HOME/bin"
|
||||||
|
"$HOME/.local/share/JetBrains/Toolbox/scripts"
|
||||||
|
];
|
||||||
|
|
||||||
|
metacfg = {
|
||||||
|
user = {
|
||||||
|
enable = true;
|
||||||
|
name = config.snowfallorg.user.name;
|
||||||
|
};
|
||||||
|
cli-apps = {
|
||||||
|
bash.enable = true;
|
||||||
|
fish.enable = true;
|
||||||
|
neovim.enable = false;
|
||||||
|
bat.enable = true;
|
||||||
|
starship.enable = true;
|
||||||
|
home-manager.enable = true;
|
||||||
|
};
|
||||||
|
tools = {
|
||||||
|
git.enable = true;
|
||||||
|
};
|
||||||
|
gui.kbd.ellipsis = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
|
services.syncthing = {
|
||||||
|
enable = true;
|
||||||
|
tray.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
dconf.settings = {
|
||||||
|
# ...
|
||||||
|
"org/gnome/shell" = {
|
||||||
|
disable-user-extensions = false;
|
||||||
|
|
||||||
|
# `gnome-extensions list` for a list
|
||||||
|
enabled-extensions = [
|
||||||
|
"Vitals@CoreCoding.com"
|
||||||
|
"appindicatorsupport@rgcjonas.gmail.com"
|
||||||
|
"dash-to-panel@jderose9.github.com"
|
||||||
|
"hibernate-status@dromi"
|
||||||
|
"autohide-battery@sitnik.ru"
|
||||||
|
"clipboard-history@alexsaveau.dev"
|
||||||
|
];
|
||||||
|
|
||||||
|
# dconf watch /
|
||||||
|
favorite-apps = [
|
||||||
|
"org.wezfurlong.wezterm.desktop"
|
||||||
|
"jetbrains-toolbox.desktop"
|
||||||
|
"org.mozilla.firefox.desktop"
|
||||||
|
"firefox.desktop"
|
||||||
|
"thunderbird.desktop"
|
||||||
|
"org.mozilla.Thunderbird.desktop"
|
||||||
|
"slack.desktop"
|
||||||
|
"keybase.desktop"
|
||||||
|
"cider-2.desktop"
|
||||||
|
"org.gnome.Nautilus.desktop"
|
||||||
|
"virt-manager.desktop"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"org/virt-manager/virt-manager/connections" = {
|
||||||
|
autoconnect = [ "qemu:///system" ];
|
||||||
|
uris = [ "qemu:///system" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
dconf.settings."org/gnome/desktop/input-sources".xkb-options = [ "mod:ellipsis" ];
|
||||||
|
|
||||||
|
xdg.enable = true;
|
||||||
|
xdg.mime.enable = true;
|
||||||
|
|
||||||
|
xdg.configFile."wezterm/wezterm.lua".text = ''
|
||||||
|
local wezterm = require("wezterm")
|
||||||
|
local config = wezterm.config_builder()
|
||||||
|
local act = wezterm.action
|
||||||
|
|
||||||
|
config.enable_kitty_keyboard = true
|
||||||
|
config.enable_scroll_bar = true
|
||||||
|
config.window_background_image = '${./terminal-background.png}'
|
||||||
|
|
||||||
|
config.term = 'wezterm'
|
||||||
|
|
||||||
|
return config
|
||||||
|
'';
|
||||||
|
}
|
||||||
BIN
homes/x86_64-linux/harald@halo/terminal-background.png
Normal file
BIN
homes/x86_64-linux/harald@halo/terminal-background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 142 KiB |
123
systems/x86_64-linux/halo/default.nix
Normal file
123
systems/x86_64-linux/halo/default.nix
Normal file
|
|
@ -0,0 +1,123 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
with lib.metacfg;
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
./xremap.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
powerManagement.cpuFreqGovernor = "performance";
|
||||||
|
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.tailscale.enable = true;
|
||||||
|
services.resolved.enable = true;
|
||||||
|
|
||||||
|
metacfg = {
|
||||||
|
hardware.wooting.enable = true;
|
||||||
|
base.enable = true;
|
||||||
|
gui.enable = true;
|
||||||
|
nix-ld.enable = true;
|
||||||
|
nix.enable = true;
|
||||||
|
podman.enable = true;
|
||||||
|
secureboot.enable = true;
|
||||||
|
homeprinter.enable = true;
|
||||||
|
build.enable = true;
|
||||||
|
|
||||||
|
system = {
|
||||||
|
limits = {
|
||||||
|
enable = true;
|
||||||
|
nofileLimit = 32768;
|
||||||
|
memlockLimit = 32768;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# User configuration
|
||||||
|
tools = {
|
||||||
|
direnv.enable = true;
|
||||||
|
};
|
||||||
|
user.extraGroups = [
|
||||||
|
"docker"
|
||||||
|
"dialout"
|
||||||
|
"tss"
|
||||||
|
];
|
||||||
|
system.kernelTweaks.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
system.autoUpgrade = {
|
||||||
|
enable = true;
|
||||||
|
operation = "boot";
|
||||||
|
allowReboot = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.config.permittedInsecurePackages = [
|
||||||
|
"electron-27.3.11"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Additional kernel tuning beyond the module defaults
|
||||||
|
boot.kernel.sysctl = {
|
||||||
|
# Reduce swap usage (you have zram)
|
||||||
|
"vm.swappiness" = 10;
|
||||||
|
# Prefer keeping directory/inode caches
|
||||||
|
"vm.vfs_cache_pressure" = 50;
|
||||||
|
# Faster dirty page writeback
|
||||||
|
"vm.dirty_ratio" = 10;
|
||||||
|
"vm.dirty_background_ratio" = 5;
|
||||||
|
};
|
||||||
|
|
||||||
|
# SSD TRIM support
|
||||||
|
services.fstrim = {
|
||||||
|
enable = true;
|
||||||
|
interval = "weekly";
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.steam = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
attic-client
|
||||||
|
azure-cli
|
||||||
|
claude-code
|
||||||
|
claude-desktop-with-fhs
|
||||||
|
desktop-file-utils
|
||||||
|
gnome-terminal
|
||||||
|
gnome-remote-desktop
|
||||||
|
gtypist
|
||||||
|
k9s
|
||||||
|
klavaro
|
||||||
|
kubectl
|
||||||
|
kubectx
|
||||||
|
logseq
|
||||||
|
nvtopPackages.amd
|
||||||
|
obsidian
|
||||||
|
piper-tts
|
||||||
|
tipp10
|
||||||
|
uv
|
||||||
|
vscode
|
||||||
|
cider-2
|
||||||
|
];
|
||||||
|
|
||||||
|
# zram swap with zstd compression for better performance
|
||||||
|
zramSwap = {
|
||||||
|
algorithm = "zstd";
|
||||||
|
memoryPercent = 50;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.ratbagd.enable = true;
|
||||||
|
|
||||||
|
virtualisation = {
|
||||||
|
libvirtd.enable = true;
|
||||||
|
docker.enable = true;
|
||||||
|
podman.dockerCompat = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
system.stateVersion = "25.11";
|
||||||
|
}
|
||||||
54
systems/x86_64-linux/halo/hardware-configuration.nix
Normal file
54
systems/x86_64-linux/halo/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
# 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,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [
|
||||||
|
"nvme"
|
||||||
|
"xhci_pci"
|
||||||
|
"thunderbolt"
|
||||||
|
"usbhid"
|
||||||
|
"uas"
|
||||||
|
"sd_mod"
|
||||||
|
"sdhci_pci"
|
||||||
|
];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-uuid/d22a1052-f142-44c0-993c-76b15c27b2b3";
|
||||||
|
fsType = "ext4";
|
||||||
|
options = [ "noatime" ];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "/dev/disk/by-uuid/EDA8-FB8B";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [
|
||||||
|
"fmask=0077"
|
||||||
|
"dmask=0077"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
swapDevices = [
|
||||||
|
{ device = "/dev/disk/by-uuid/708a53d6-4e68-4587-96e4-aa5e2c1df51a"; }
|
||||||
|
];
|
||||||
|
*/
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
40
systems/x86_64-linux/halo/sound.nix
Normal file
40
systems/x86_64-linux/halo/sound.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.pipewire.wireplumber.extraConfig."51-audio-priorities" = {
|
||||||
|
"monitor.alsa.rules" = [
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{ "node.name" = "alsa_output.pci-0000_73_00.1.hdmi-stereo"; }
|
||||||
|
];
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
"priority.session" = 2000;
|
||||||
|
"priority.driver" = 2000;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{ "node.name" = "alsa_output.usb-R__DE_Microphones_R__DE_NT-USB_Mini_6893EA23-00.analog-stereo"; }
|
||||||
|
];
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
"priority.session" = 1500;
|
||||||
|
"priority.driver" = 1500;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{ "node.name" = "alsa_output.usb-Generic_USB_Audio-00.HiFi__SPDIF__sink"; }
|
||||||
|
];
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
"priority.session" = 1000;
|
||||||
|
"priority.driver" = 1000;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
21
systems/x86_64-linux/halo/xremap.nix
Normal file
21
systems/x86_64-linux/halo/xremap.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
metacfg.services.xremap = {
|
||||||
|
enable = true;
|
||||||
|
deviceNames = [
|
||||||
|
"Hangsheng MonsGeek Keyboard"
|
||||||
|
"HS Galaxy100 Keyboard"
|
||||||
|
];
|
||||||
|
config = {
|
||||||
|
keymap = [
|
||||||
|
{
|
||||||
|
remap = {
|
||||||
|
LeftAlt-C = "COPY";
|
||||||
|
LeftAlt-V = "PASTE";
|
||||||
|
LeftAlt-X = "CUT";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue