[djamba][stitch] configs refactoring + multiple hosts

This commit is contained in:
2026-02-28 15:05:47 +03:00
parent b0d27af111
commit a03f7d48ad
10 changed files with 428 additions and 343 deletions

59
hosts/djamba.nix Normal file
View File

@@ -0,0 +1,59 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hw-djamba.nix
../defaults/default.nix
../apps/apps-list.nix
../apps/firefox.nix
../apps/flameshot.nix
../desktop-environments/gnome.nix
];
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = "djamba"; # Define your hostname.
# Enable networking
networking.networkmanager.enable = true;
environment.sessionVariables = rec {
# fixing disappering cursor in alacritty - https://github.com/NixOS/nixpkgs/issues/22652
XCURSOR_THEME = "Vimix-cursors";
# vscode wayland
NIXOS_OZONE_WL = 1;
};
services.sunshine = {
enable = true;
autoStart = true;
capSysAdmin = true; # only needed for Wayland -- omit this when using with Xorg
openFirewall = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.venya = {
isNormalUser = true;
description = "Dmitry Chumak";
extraGroups = [ "networkmanager" "wheel" ];
};
# 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. Its 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 = "25.11"; # Did you read the comment?
}

31
hosts/hw-djamba.nix Normal file
View File

@@ -0,0 +1,31 @@
# 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 = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/62e051d3-bc3d-440a-9d2b-076ac1dcc19f";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/1882-7312";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

42
hosts/hw-stitch.nix Normal file
View File

@@ -0,0 +1,42 @@
# 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 = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/6480e954-777a-4bb5-b974-f78884f72f85";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/4A7F-6452";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.amd.ryzen-smu.enable = true;
# to enable gamepads
hardware.steam-hardware.enable = true;
}

100
hosts/stitch.nix Normal file
View File

@@ -0,0 +1,100 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hw-stitch.nix
../defaults/default.nix
../apps/apps-list.nix
../apps/firefox.nix
../apps/flameshot.nix
../desktop-environments/gnome.nix
];
boot.kernelPackages = pkgs.linuxPackages_6_12;
# boot.kernelPatches = [
# {
# name = "amd-drm-glitch-fix";
# patch = (pkgs.fetchurl {
# url = "https://patchwork.freedesktop.org/patch/605900/raw/";
# hash = "sha256-WR537QGQak5pwm4BnLiQ/pc7gAkn2SdI3QRvGTRZSFE=";
# });
# }
# ];
boot.kernelParams = ["amd_pstate=active" "iommu=relaxed"];
boot.supportedFilesystems = ["ntfs"];
networking.hostName = "nixos"; # Define your hostname.
networking.hosts = {
"127.0.0.1" = [ "dev.tolma.ch" ];
};
networking.networkmanager.enable = true;
environment.sessionVariables = rec {
# fixing disappering cursor in alacritty - https://github.com/NixOS/nixpkgs/issues/22652
XCURSOR_THEME = "Vimix-cursors";
# vscode wayland
NIXOS_OZONE_WL = 1;
};
# xteink4 crosspoint env
services.udev.packages = with pkgs; [
platformio-core.udev
openocd
];
services.cpupower-gui.enable = true;
services.power-profiles-daemon.enable = false;
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 20;
USB_EXCLUDE_BTUSB = 1;
#Optional helps save long term battery health
START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
};
};
# Define a user account. Don't forget to set a password with passwd.
users.users.venya = {
isNormalUser = true;
description = "Dmitry Chumak";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
];
};
environment.systemPackages = with pkgs; [
cpupower-gui
ryzenadj
powertop
linuxKernel.packages.linux_6_12.cpupower
linuxKernel.packages.linux_6_12.ryzen-smu
];
# 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. Its 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 = "23.11"; # Did you read the comment?
}