wanda: new host (NixOS-WSL)

Signed-off-by: s0me1newithhand7s <git+me@hand7s.org>
This commit is contained in:
s0me1newithhand7s 2026-02-08 22:23:05 +03:00
parent d3588098ee
commit e3e1612691
66 changed files with 914 additions and 0 deletions

View file

@ -0,0 +1,5 @@
_: {
console = {
useXkbConfig = true;
};
}

89
wanda/default.nix Normal file
View file

@ -0,0 +1,89 @@
{self, ...}: {
imports = [
"${self}/wanda/console/console.nix"
"${self}/wanda/environment/systemPackages.nix"
"${self}/wanda/environment/variables.nix"
"${self}/wanda/hardware/zram.nix"
"${self}/wanda/hardware/"
"${self}/wanda/home-manager/users.nix"
"${self}/wanda/i18n/locales.nix"
"${self}/wanda/networking/dhcp.nix"
"${self}/wanda/networking/firewall.nix"
"${self}/wanda/networking/hostname.nix"
"${self}/wanda/networking/networkmanager.nix"
"${self}/wanda/networking/wireguard.nix"
"${self}/wanda/networking/nameservers.nix"
"${self}/wanda/networking/hosts.nix"
"${self}/wanda/networking/hostId.nix"
"${self}/wanda/nix/package.nix"
"${self}/wanda/nix/settings/allowed-users.nix"
"${self}/wanda/nix/settings/experimental-features.nix"
"${self}/wanda/nix/settings/substituters.nix"
"${self}/wanda/nix/settings/trusted-public-keys.nix"
"${self}/wanda/nix/settings/trusted-substituters.nix"
"${self}/wanda/nix/settings/trusted-users.nix"
"${self}/wanda/nix/settings/auto-optimise-store.nix"
"${self}/wanda/nixpkgs/config.nix"
"${self}/wanda/nixpkgs/system.nix"
"${self}/wanda/programs/nh.nix"
"${self}/wanda/programs/ssh.nix"
"${self}/wanda/security/polkit.nix"
"${self}/wanda/security/rtkit.nix"
"${self}/wanda/security/sudo.nix"
"${self}/wanda/security/sudo-rs.nix"
"${self}/wanda/security/pam/yubico.nix"
"${self}/wanda/services/greetd.nix"
"${self}/wanda/services/libinput.nix"
"${self}/wanda/services/openssh.nix"
"${self}/wanda/services/pipewire.nix"
"${self}/wanda/services/netbird.nix"
"${self}/wanda/services/qmk.nix"
"${self}/wanda/services/scx.nix"
"${self}/wanda/services/xserver.nix"
"${self}/wanda/services/sunshine.nix"
"${self}/wanda/services/usbmuxd.nix"
"${self}/wanda/services/irqbalance.nix"
"${self}/wanda/services/yubikey-agent.nix"
"${self}/wanda/services/resolved.nix"
"${self}/wanda/sops/defaults.nix"
"${self}/wanda/sops/secrets.nix"
"${self}/hand7s/stylix/base16Scheme.nix"
"${self}/hand7s/stylix/cursor.nix"
"${self}/hand7s/stylix/defaults.nix"
"${self}/hand7s/stylix/fonts.nix"
"${self}/hand7s/stylix/image.nix"
"${self}/wanda/system/name.nix"
"${self}/wanda/system/stateVersion.nix"
"${self}/wanda/systemd/oomd.nix"
"${self}/wanda/systemd/slices/system-slice.nix"
"${self}/wanda/systemd/slices/user-slice.nix"
"${self}/wanda/systemd/slices/root-slice.nix"
"${self}/wanda/time/timeZone.nix"
"${self}/wanda/users/users/hand7s.nix"
"${self}/wanda/users/users/root.nix"
"${self}/wanda/users/mutableUsers.nix"
"${self}/wanda/wsl/"
"${self}/wanda/wsl/wslConf.nix"
"${self}/wanda/xdg/icons.nix"
"${self}/wanda/xdg/mime.nix"
"${self}/wanda/xdg/portal.nix"
];
}

View file

@ -0,0 +1,17 @@
{
pkgs,
lib,
...
}: {
environment = {
systemPackages = with pkgs; [
(lib.hiPrio uutils-coreutils-noprefix)
uutils-findutils
uutils-diffutils
xdg-desktop-portal
xdg-desktop-portal-gtk
xdg-desktop-portal-hyprland
home-manager
];
};
}

View file

@ -0,0 +1,17 @@
{config, ...}: {
environment = {
variables = {
AMD_VULKAN_ICD = "AMDVLK";
HOSTNAME = config.networking.hostName;
QT_QPA_PLATFORM = "wayland";
SDL_VIDEODRIVER = "wayland";
CLUTTER_BACKEND = "wayland";
GDK_BACKEND = "wayland";
NIXPKGS_ALLOW_UNFREE = "1";
NIXPKGS_ALLOW_INSECURE = "1";
NIXOS_OZONE_WL = "1";
GRIMBLAST_HIDE_CURSOR = "0";
TERM = "xterm-256color";
};
};
}

View file

@ -0,0 +1,8 @@
_: {
hardware = {
enableAllFirmware = true;
enableAllHardware = true;
enableRedistributableFirmware = true;
firmwareCompression = "zstd";
};
}

8
wanda/hardware/zram.nix Normal file
View file

@ -0,0 +1,8 @@
_: {
zramSwap = {
enable = true;
algorithm = "zstd";
priority = 100;
memoryPercent = 100;
};
}

View file

@ -0,0 +1,28 @@
{self, ...}: {
home-manager = {
users = {
"hand7s" = {
imports = [
"${self}/hand7s/"
self.inputs.agenix.homeManagerModules.default
self.inputs.agenix.homeManagerModules.default
self.inputs.spicetify-nix.homeManagerModules.default
self.inputs.hyprland.homeManagerModules.default
self.inputs.chaotic.homeManagerModules.default
self.inputs.sops-nix.homeManagerModules.sops
self.inputs.nix-index-database.homeModules.nix-index
self.inputs.noctalia.homeModules.default
];
};
};
backupFileExtension = "force";
extraSpecialArgs = {
inherit
self
;
};
};
}

9
wanda/i18n/locales.nix Normal file
View file

@ -0,0 +1,9 @@
_: {
i18n = {
defaultLocale = "en_US.UTF-8";
supportedLocales = [
"en_US.UTF-8/UTF-8"
"ru_RU.UTF-8/UTF-8"
];
};
}

10
wanda/networking/dhcp.nix Normal file
View file

@ -0,0 +1,10 @@
{lib, ...}: {
networking = {
useDHCP = lib.mkDefault true;
dhcpcd = {
enable = true;
persistent = false;
wait = "any";
};
};
}

View file

@ -0,0 +1,8 @@
_: {
networking = {
firewall = {
allowPing = true;
enable = true;
};
};
}

View file

@ -0,0 +1,5 @@
_: {
networking = {
hostId = "5c79d468";
};
}

View file

@ -0,0 +1,5 @@
_: {
networking = {
hostName = "wanda";
};
}

View file

@ -0,0 +1,7 @@
_: {
networking = {
hosts = {
# nope.
};
};
}

View file

@ -0,0 +1,29 @@
_: {
networking = {
nameservers = [
# cf dns
"1.1.1.1"
"1.0.0.1"
"2606:4700:4700::1111"
"2606:4700:4700::1001"
# google dns
"8.8.8.8"
"8.8.4.4"
"2001:4860:4860::8888"
"2001:4860:4860::8844"
# q9 dns
"9.9.9.9"
"149.112.112.112"
"2620:fe::fe"
"2620:fe::9"
# open dns
"208.67.222.222"
"208.67.220.220"
"2620:119:35::35"
"2620:119:53::53"
];
};
}

View file

@ -0,0 +1,9 @@
_: {
networking = {
networkmanager = {
enable = false;
};
useNetworkd = true;
};
}

View file

@ -0,0 +1,10 @@
_: {
networking = {
timeServers = [
"0.nixos.pool.ntp.org"
"1.nixos.pool.ntp.org"
"2.nixos.pool.ntp.org"
"3.nixos.pool.ntp.org"
];
};
}

View file

@ -0,0 +1,7 @@
_: {
networking = {
wireguard = {
enable = true;
};
};
}

5
wanda/nix/package.nix Normal file
View file

@ -0,0 +1,5 @@
{pkgs, ...}: {
nix = {
package = pkgs.nixVersions.latest;
};
}

View file

@ -0,0 +1,10 @@
_: {
nix = {
settings = {
sandbox = true;
allowed-users = [
"@wheel"
];
};
};
}

View file

@ -0,0 +1,7 @@
_: {
nix = {
settings = {
auto-optimise-store = true;
};
};
}

View file

@ -0,0 +1,10 @@
_: {
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
};
};
}

View file

@ -0,0 +1,19 @@
_: {
nix = {
settings = {
substituters = [
# cache.nixos.org
"https://cache.nixos.org"
# cache.garnix.org
"https://cache.garnix.io"
# cachix
"https://nix-community.cachix.org/"
"https://chaotic-nyx.cachix.org/"
"https://hyprland.cachix.org"
"https://chaotic-nyx.cachix.org/"
# nix-community
"https://hydra.nix-community.org/"
];
};
};
}

View file

@ -0,0 +1,19 @@
_: {
nix = {
settings = {
trusted-public-keys = [
# cache.nixos.org
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
# cache.garnix.io
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
# cachix.org
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"ags.cachix.org-1:naAvMrz0CuYqeyGNyLgE010iUiuf/qx6kYrUv3NwAJ8="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"colmena.cachix.org-1:7BzpDnjjH8ki2CT3f6GdOk7QAzPOl+1t3LvTLXqYcSg="
];
};
};
}

View file

@ -0,0 +1,19 @@
_: {
nix = {
settings = {
trusted-substituters = [
# cache.nixos.org
"https://nixos-cache-proxy.cofob.dev"
"https://cache.nixos.org"
# cache.garnix.org
"https://cache.garnix.io"
# cachix
"https://nix-community.cachix.org/"
"https://chaotic-nyx.cachix.org/"
"https://ags.cachix.org"
"https://hyprland.cachix.org"
"https://chaotic-nyx.cachix.org/"
];
};
};
}

View file

@ -0,0 +1,9 @@
_: {
nix = {
settings = {
trusted-users = [
"@wheel"
];
};
};
}

8
wanda/nixpkgs/config.nix Normal file
View file

@ -0,0 +1,8 @@
_: {
nixpkgs = {
config = {
allowUnfree = true;
allowBroken = true;
};
};
}

View file

@ -0,0 +1,6 @@
_: {
nixpkgs = {
overlays = [
];
};
}

6
wanda/nixpkgs/system.nix Normal file
View file

@ -0,0 +1,6 @@
_: {
nixpkgs = {
system = "x86_64-linux";
hostPlatform = "x86_64-linux";
};
}

12
wanda/programs/nh.nix Normal file
View file

@ -0,0 +1,12 @@
_: {
programs = {
nh = {
enable = true;
clean = {
enable = true;
dates = "weekly";
extraArgs = "--keep 2 --keep-since 2d";
};
};
};
}

8
wanda/programs/ssh.nix Normal file
View file

@ -0,0 +1,8 @@
_: {
programs = {
ssh = {
startAgent = true;
agentTimeout = "12h";
};
};
}

View file

@ -0,0 +1,15 @@
_: {
security = {
pam = {
yubico = {
enable = false;
debug = true;
mode = "challenge-response";
control = "sufficient";
id = [
"1873055870"
];
};
};
};
}

10
wanda/security/polkit.nix Normal file
View file

@ -0,0 +1,10 @@
_: {
security = {
polkit = {
enable = true;
adminIdentities = [
"unix-group:wheel"
];
};
};
}

7
wanda/security/rtkit.nix Normal file
View file

@ -0,0 +1,7 @@
_: {
security = {
rtkit = {
enable = true;
};
};
}

View file

@ -0,0 +1,9 @@
_: {
security = {
sudo-rs = {
enable = true;
wheelNeedsPassword = true;
execWheelOnly = true;
};
};
}

7
wanda/security/sudo.nix Normal file
View file

@ -0,0 +1,7 @@
{lib, ...}: {
security = {
sudo = {
enable = lib.mkDefault false;
};
};
}

18
wanda/services/greetd.nix Normal file
View file

@ -0,0 +1,18 @@
{
pkgs,
lib,
...
}: {
services = {
greetd = {
enable = true;
restart = false;
settings = {
default_session = {
command = "${lib.getExe pkgs.tuigreet} -r -t -c ${lib.getExe' pkgs.hyprland "start-hyprland"} --greet-align center";
user = "greeter";
};
};
};
};
}

View file

@ -0,0 +1,7 @@
_: {
services = {
irqbalance = {
enable = true;
};
};
}

View file

@ -0,0 +1,15 @@
_: {
services = {
libinput = {
enable = true;
mouse = {
accelProfile = "flat";
accelSpeed = "-1.0";
buttonMapping = "1 2 3 4 5 6 7 8 9";
horizontalScrolling = true;
leftHanded = false;
naturalScrolling = true;
};
};
};
}

View file

@ -0,0 +1,7 @@
_: {
services = {
netbird = {
enable = true;
};
};
}

View file

@ -0,0 +1,22 @@
{config, ...}: {
services = {
openssh = {
enable = true;
allowSFTP = true;
openFirewall = true;
ports = [
48630
];
settings = {
PrintMotd = false;
PermitRootLogin = "no";
PasswordAuthentication = false;
};
authorizedKeysFiles = [
config.sops.secrets.sshKey.path
];
};
};
}

View file

@ -0,0 +1,66 @@
_: {
services = {
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
audio = {
enable = true;
};
pulse = {
enable = true;
};
jack = {
enable = true;
};
wireplumber = {
enable = true;
};
extraConfig = {
pipewire = {
# PIPEWIRE_PROPS=node.force-rate=0
"92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.allowed-rates" = [
44100
48000
88200
96000
];
"default.clock.min-quantum" = 512;
"default.clock.quantum" = 4096;
"default.clock.max-quantum" = 8192;
};
};
"93-no-resampling" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.allowed-rates" = [
44100
48000
96000
192000
];
};
};
"94-no-upmixing" = {
"stream.properties" = {
"channelmix.upmix" = false;
};
};
};
};
};
};
}

9
wanda/services/qmk.nix Normal file
View file

@ -0,0 +1,9 @@
{pkgs, ...}: {
services = {
udev = {
packages = with pkgs; [
qmk-udev-rules
];
};
};
}

View file

@ -0,0 +1,39 @@
_: {
services = {
resolved = {
enable = true;
dnsovertls = "true";
dnssec = "true";
llmnr = "true";
domains = [
"~."
];
fallbackDns = [
# cf dns
"1.1.1.1"
"1.0.0.1"
"2606:4700:4700::1111"
"2606:4700:4700::1001"
# google dns
"8.8.8.8"
"8.8.4.4"
"2001:4860:4860::8888"
"2001:4860:4860::8844"
# q9 dns
"9.9.9.9"
"149.112.112.112"
"2620:fe::fe"
"2620:fe::9"
# open dns
"208.67.222.222"
"208.67.220.220"
"2620:119:35::35"
"2620:119:53::53"
];
};
};
}

8
wanda/services/scx.nix Normal file
View file

@ -0,0 +1,8 @@
_: {
services = {
scx = {
enable = true;
scheduler = "scx_cosmos";
};
};
}

View file

@ -0,0 +1,10 @@
_: {
services = {
sunshine = {
enable = true;
capSysAdmin = true;
openFirewall = true;
autoStart = true;
};
};
}

View file

@ -0,0 +1,8 @@
{pkgs, ...}: {
services = {
usbmuxd = {
enable = true;
package = pkgs.usbmuxd2;
};
};
}

View file

@ -0,0 +1,26 @@
{
lib,
pkgs,
...
}: {
services = {
xserver = {
display = lib.mkForce 0;
enable = true;
excludePackages = with pkgs; [
xterm
];
videoDrivers = [
"modesetting"
];
xkb = {
layout = "us, ru";
variant = "";
options = "grp:caps_toggle";
};
};
};
}

View file

@ -0,0 +1,8 @@
{pkgs, ...}: {
services = {
yubikey-agent = {
package = pkgs.yubikey-agent;
enable = false;
};
};
}

View file

@ -0,0 +1,10 @@
_: {
services = {
zerotierone = {
enable = true;
joinNetworks = [
#
];
};
};
}

5
wanda/system/name.nix Normal file
View file

@ -0,0 +1,5 @@
{config, ...}: {
system = {
name = config.networking.hostName;
};
}

View file

@ -0,0 +1,5 @@
{config, ...}: {
system = {
stateVersion = config.system.nixos.release;
};
}

10
wanda/systemd/oomd.nix Normal file
View file

@ -0,0 +1,10 @@
_: {
systemd = {
oomd = {
enable = true;
enableUserSlices = true;
enableSystemSlice = true;
enableRootSlice = true;
};
};
}

View file

@ -0,0 +1,14 @@
_: {
systemd = {
slices = {
root = {
sliceConfig = {
ManagedOOMSwap = "kill";
ManagedOOMMemoryPressure = "kill";
ManagedOOMMemoryPressureLimit = "40%";
ManagedOOMMemoryPressureDurationSec = 0;
};
};
};
};
}

View file

@ -0,0 +1,14 @@
_: {
systemd = {
slices = {
system = {
sliceConfig = {
ManagedOOMSwap = "kill";
ManagedOOMMemoryPressure = "kill";
ManagedOOMMemoryPressureLimit = "40%";
ManagedOOMMemoryPressureDurationSec = 0;
};
};
};
};
}

View file

@ -0,0 +1,14 @@
_: {
systemd = {
slices = {
user = {
sliceConfig = {
ManagedOOMSwap = "kill";
ManagedOOMMemoryPressure = "kill";
ManagedOOMMemoryPressureLimit = "40%";
ManagedOOMMemoryPressureDurationSec = 0;
};
};
};
};
}

6
wanda/time/timeZone.nix Normal file
View file

@ -0,0 +1,6 @@
_: {
time = {
timeZone = "Europe/Moscow";
hardwareClockInLocalTime = true;
};
}

View file

@ -0,0 +1,5 @@
_: {
users = {
mutableUsers = false;
};
}

View file

@ -0,0 +1,15 @@
_: {
users = {
users = {
"hand7s" = {
description = "me";
isSystemUser = false;
isNormalUser = true;
initialHashedPassword = "$6$ckgRhNWmJgSwOUpJ$kfeAdokd5fa76HWbTmWN2YXx4M/PQVOTJku1ODbqbBhEkUFiLftdaJFRnNXfIM3Jtz0ShoRMSVCB7mDkxDrdi/";
extraGroups = [
"wheel"
];
};
};
};
}

View file

@ -0,0 +1,9 @@
_: {
users = {
users = {
"root" = {
initialHashedPassword = "$6$n4OLMvYHHStHvtmr$6OL0NV1dEM2b6oJRewkhuoFxM80lI67tfbJ6QkCg8WAA1gbeKrcwDAuJjm8zvpY4zcDR3Z5Zbo8uebfOi6XXF0";
};
};
};
}

View file

@ -0,0 +1,10 @@
_: {
virtualisation = {
docker = {
enable = true;
rootless = {
enable = true;
};
};
};
}

8
wanda/wsl/default.nix Normal file
View file

@ -0,0 +1,8 @@
_: {
wsl = {
enable = true;
defaultUser = "hand7s";
startMenuLaunchers = true;
useWindowsDriver = true;
};
}

13
wanda/wsl/wslConf.nix Normal file
View file

@ -0,0 +1,13 @@
_: {
wsl = {
wslConf = {
automount = {
enable = true;
};
user = {
default = "hand7s";
};
};
};
}

7
wanda/xdg/icons.nix Normal file
View file

@ -0,0 +1,7 @@
_: {
xdg = {
icons = {
enable = true;
};
};
}

11
wanda/xdg/mime.nix Normal file
View file

@ -0,0 +1,11 @@
_: {
xdg = {
mime = {
enable = true;
defaultApplications = {
"x-scheme-handler/http" = "google-chrome.desktop";
"x-scheme-handler/https" = "google-chrome.desktop";
};
};
};
}

35
wanda/xdg/portal.nix Normal file
View file

@ -0,0 +1,35 @@
{pkgs, ...}: {
xdg = {
portal = {
enable = true;
config = {
common = {
"org.freedesktop.impl.portal.FileChooser" = "termfilechooser";
default = [
"gtk"
];
};
hyprland = {
"org.freedesktop.impl.portal.FileChooser" = [
"termfilechooser"
];
preferred = [
"gtk"
"hyprland"
];
};
};
extraPortals = with pkgs; [
xdg-desktop-portal
xdg-desktop-portal-gtk
xdg-desktop-portal-hyprland
xdg-desktop-portal-termfilechooser
];
};
};
}