some clean

This commit is contained in:
2025-10-10 20:08:23 +03:00
parent 4c57551ff8
commit fced475e86
101 changed files with 19 additions and 286 deletions
+12
View File
@@ -0,0 +1,12 @@
{ ... }@flakeContext:
{
nixosConfigurations = {
atoridu = import ./mini-pc.nix flakeContext; # atoridu
lamet = import ./mini-laptop.nix flakeContext; # lamet
otreca = import ./vds.nix flakeContext; # vds
sapphira = import ./server.nix flakeContext; # sapphira
wsl = import ./wsl.nix flakeContext; # wsl
pub-vds = import ./pub-vds.nix flakeContext;
};
}
+43
View File
@@ -0,0 +1,43 @@
{ xlib, ... }:
{
disko.devices = {
disk = {
"${xlib.device.hostname}" = {
device = "/dev/sda";
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
# extraArgs = [
# "-L ${xlib.device.hostname}" # Filesystem label
# ];
};
};
swap = {
size = "2048M";
content = {
type = "swap";
};
};
};
};
};
};
};
}
+33
View File
@@ -0,0 +1,33 @@
{
disko.devices = {
disk = {
main = {
device = "/dev/vda";
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
type = "EF02";
size = "1M";
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
swap = {
size = "256M";
content = {
type = "swap";
};
};
};
};
};
};
};
}
+39
View File
@@ -0,0 +1,39 @@
{
disko.devices = {
disk = {
main = {
device = "/dev/mmcblk0";
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
type = "EF00";
size = "512M";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
swap = {
size = "2G";
content = {
type = "swap";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}
+33
View File
@@ -0,0 +1,33 @@
{
disko.devices = {
disk = {
main = {
device = "/dev/vda";
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
type = "EF02";
size = "1M";
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
swap = {
size = "256M";
content = {
type = "swap";
};
};
};
};
};
};
};
}
+14
View File
@@ -0,0 +1,14 @@
{
config,
...
}:
{
hardware = {
logitech = {
wireless = {
enable = true;
enableGraphical = true;
};
};
};
}
+78
View File
@@ -0,0 +1,78 @@
{
config,
lib,
pkgs,
modulesPath,
xlib,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"thunderbolt"
"usb_storage"
"uas"
"usbhid"
"sd_mod"
];
kernelModules = [
"kvm-amd"
"amdgpu"
];
extraModulePackages = [ ];
};
hardware = {
amdgpu = {
opencl.enable = true;
amdvlk = {
enable = true;
};
};
graphics.extraPackages = with pkgs; [
mesa
amf
];
};
# systemd.tmpfiles.rules = [
# "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
# ];
fileSystems = {
"/" = {
device = "/dev/disk/by-partlabel/disk-${xlib.device.hostname}-root";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-partlabel/disk-${xlib.device.hostname}-ESP";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
};
swapDevices = [
{ device = "/dev/disk/by-partlabel/disk-${xlib.device.hostname}-swap"; }
];
# 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.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.enp100s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp98s0.useDHCP = lib.mkDefault true;
#nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
+23
View File
@@ -0,0 +1,23 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
fileSystems = {
"/" = {
device = lib.mkForce "/dev/disk/by-partlabel/disk-main-root"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "ext4";
};
};
# swapDevices = [
# { device = "/dev/disk/by-partlabel/disk-main-swap"; }
# ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
+65
View File
@@ -0,0 +1,65 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd = {
availableKernelModules = [
"ahci"
"xhci_pci"
"usbhid"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
};
kernel = {
sysctl = {
"fs.inotify.max_user_watches" = "204800";
};
};
kernelModules = [
"kvm-intel"
"coretemp"
];
};
fileSystems = {
"/" = {
device = "/dev/disk/by-partlabel/disk-main-root";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-partlabel/disk-main-ESP";
fsType = "vfat";
options = [
# maybe 700?
"fmask=0022"
"dmask=0022"
];
};
};
swapDevices = [
{ device = "/dev/disk/by-partlabel/disk-main-swap"; }
];
# 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.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.tailscale0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
+23
View File
@@ -0,0 +1,23 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
fileSystems = {
"/" = {
device = lib.mkForce "/dev/disk/by-partlabel/disk-main-root"; # "/dev/disk/by-partlabel/disk-main-root";
fsType = "ext4";
};
};
# swapDevices = [
# { device = "/dev/disk/by-partlabel/disk-main-swap"; }
# ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
+35
View File
@@ -0,0 +1,35 @@
{
inputs,
...
}@flakeContext:
let
nixosModule =
{
config,
lib,
pkgs,
...
}:
{
xlib.device = {
type = "primary";
hostname = "lamet";
};
imports = [
inputs.nixos-hardware.nixosModules.chuwi-minibook-x
];
hardware.intel-gpu-tools.enable = true;
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = with inputs; [
nixosModule
self.nixosModules.default
];
system = "x86_64-linux";
specialArgs = {
deviceType = "primary";
};
}
+164
View File
@@ -0,0 +1,164 @@
{
inputs,
...
}@flakeContext:
let
nixosModule =
{
config,
lib,
pkgs,
xlib,
...
}:
{
xlib.device = {
type = "primary";
hostname = "atoridu";
};
imports = with inputs; [
./hardware/mini-pc.nix
./disko/mini-pc.nix
./hardware/logitech.nix
self.nixosModules.default
];
fileSystems = {
"${xlib.dirs.therima-drive}" = {
device = "/dev/disk/by-uuid/C0A2DDEFA2DDEA44";
fsType = "ntfs3";
options = [
"defaults"
"uid=1000"
"gid=1000"
"fmask=0007"
"dmask=0007"
"nofail"
];
};
"${xlib.dirs.vetymae-drive}" = {
device = "/dev/disk/by-uuid/6408433908430A0E";
fsType = "ntfs3";
options = [
"defaults"
"uid=1000"
"gid=1000"
"fmask=0007"
"dmask=0007"
"nofail"
];
};
"${xlib.dirs.soptur-drive}" = {
device = "/dev/disk/by-uuid/C00C56E40C56D54E";
fsType = "ntfs3";
options = [
"defaults"
"uid=1000"
"gid=1000"
"fmask=0007"
"dmask=0007"
"nofail"
];
};
};
boot = {
kernelPackages = lib.mkDefault pkgs.linuxPackages_xanmod_latest;
#kernelParams = [ "usbcore.autosuspend=-1" ];
loader = {
systemd-boot.enable = lib.mkDefault true;
efi.canTouchEfiVariables = lib.mkDefault true;
};
};
hardware = {
bluetooth.enable = true;
graphics.extraPackages = with pkgs; [
amdvlk
];
};
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
networking = {
hostName = "${xlib.device.hostname}";
networkmanager.enable = true;
firewall.enable = false;
};
i18n = {
extraLocaleSettings = {
LC_ADDRESS = "ru_RU.UTF-8";
LC_IDENTIFICATION = "ru_RU.UTF-8";
LC_MEASUREMENT = "ru_RU.UTF-8";
LC_MONETARY = "ru_RU.UTF-8";
LC_NAME = "ru_RU.UTF-8";
LC_NUMERIC = "ru_RU.UTF-8";
LC_PAPER = "ru_RU.UTF-8";
LC_TELEPHONE = "ru_RU.UTF-8";
LC_TIME = "ru_RU.UTF-8";
};
};
services = {
#logrotate.checkConfig = false;
#power-profiles-daemon.enable = false;
xserver = {
videoDrivers = [
"amdgpu"
];
};
syncthing = {
enable = true;
systemService = true;
configDir = "${xlib.dirs.user-storage}/Syncthing/${config.system.name}";
dataDir = "${xlib.dirs.user-home}";
group = "users";
user = "${xlib.device.username}";
};
pipewire = {
enable = lib.mkDefault true;
systemWide = true;
alsa.enable = false;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
extraConfig.pipewire = {
"99-default.conf" = {
"context.properties" = {
"default.clock.rate" = 96000;
"default.clock.allowed-rates" = [
44100
48000
96000
];
"default.clock.quantum" = 1024;
"default.clock.min-quantum" = 256;
"default.clock.max-quantum" = 2048;
};
};
};
};
thermald.enable = true;
earlyoom.enable = true;
preload.enable = true;
};
nixpkgs.config.pulseaudio = true;
security = {
rtkit.enable = true;
};
system.stateVersion = "25.11";
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = [
nixosModule
];
system = "x86_64-linux";
specialArgs = {
deviceType = "primary";
};
}
+124
View File
@@ -0,0 +1,124 @@
{ inputs, ... }@flakeContext:
let
nixosModule =
{
config,
lib,
pkgs,
xlib,
...
}:
{
xlib.device = {
type = "server";
hostname = "sapphira";
};
imports = [
./hardware/server.nix
inputs.self.nixosModules.default
];
boot = {
kernelPackages = pkgs.linuxPackages_xanmod_stable;
hardwareScan = true;
loader = {
systemd-boot.enable = lib.mkDefault true;
efi.canTouchEfiVariables = lib.mkDefault true;
};
};
hardware = {
bluetooth.enable = true;
};
# swapDevices = [
# { device = "/dev/disk/by-partlabel/disk-main-swap"; }
# ];
fileSystems = {
# External drive
"${xlib.dirs.server-home}" = {
device = "/dev/disk/by-uuid/37e53ebc-5343-a94d-9fe2-0ca39e13a8de";
fsType = "ext4";
# options = [
# #"nofail"
# #"x-systemd.device-timeout=0"
# ];
};
# Archive drive
"/mnt/archive" = {
device = "/dev/disk/by-label/archive";
fsType = "exfat";
options = [
"nofail"
#"x-systemd.device-timeout=0"
"uid=1000"
"gid=1000"
];
};
"${xlib.dirs.services-mnt-folder}" = {
device = "${xlib.dirs.services-folder}";
options = [
"bind"
"nofail"
# "uid=1000"
# "gid=1000"
# "fmask=0000"
# "dmask=0000"
];
};
};
systemd.tmpfiles.rules = [
"z ${xlib.dirs.services-mnt-folder} 0777 root root -"
];
services = {
power-profiles-daemon.enable = lib.mkForce false;
earlyoom.enable = true;
preload.enable = true;
auto-cpufreq.enable = false;
throttled.enable = true;
journald = {
extraConfig = ''
SystemMaxUse=512M
'';
};
openssh = {
enable = true;
allowSFTP = true;
hostKeys = [
{
path = "/etc/ssh/id_ed25519";
type = "ed25519";
}
];
settings = {
PasswordAuthentication = false;
PermitRootLogin = "yes";
UsePAM = true;
};
};
};
networking = {
hostName = "${xlib.device.hostname}";
networkmanager.enable = true;
firewall.enable = false;
};
system = {
stateVersion = "25.05";
};
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = [
nixosModule
];
system = "x86_64-linux";
specialArgs = {
deviceType = "server";
};
}
+138
View File
@@ -0,0 +1,138 @@
{ inputs, ... }@flakeContext:
let
nixosModule =
{
config,
lib,
modulesPath,
pkgs,
xlib,
...
}:
{
xlib.device = {
type = "vds";
hostname = "otreca";
};
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/profiles/qemu-guest.nix")
./disko/vds.nix
./hardware/vds.nix
inputs.self.nixosModules.default
];
boot = {
kernelPackages = pkgs.linuxPackages_xanmod_stable;
hardwareScan = true;
loader = {
grub = {
enable = true;
device = "nodev";
useOSProber = false;
efiSupport = false;
};
systemd-boot.enable = lib.mkDefault false;
};
};
services = {
earlyoom.enable = true;
preload.enable = true;
journald = {
extraConfig = ''
SystemMaxUse=512M
'';
};
samba = {
enable = true;
openFirewall = true;
settings = {
global = {
"invalid users" = [ ];
"passwd program" = "/run/wrappers/bin/passwd %u";
security = "user";
};
nixos = {
"path" = "/etc/nixos";
"browseable" = "yes";
"read only" = "no";
"valid users" = "${xlib.device.username}";
"guest ok" = "no";
"writable" = "yes";
"create mask" = 755;
"directory mask" = 755;
"force user" = "${xlib.device.username}";
"force group" = "users";
};
root = {
"path" = "/";
"browseable" = "yes";
"read only" = "no";
"valid users" = "${xlib.device.username}";
"guest ok" = "no";
"writable" = "yes";
#"create mask" = 0644;
#"directory mask" = 0644;
"force user" = "root";
"force group" = "root";
};
"${xlib.device.username}" = {
"path" = "/home/${xlib.device.username}";
"browseable" = "yes";
"read only" = "no";
"valid users" = "${xlib.device.username}";
"guest ok" = "no";
"writable" = "yes";
"create mask" = 700;
"directory mask" = 700;
"force user" = "${xlib.device.username}";
"force group" = "users";
};
};
};
openssh = {
enable = true;
allowSFTP = true;
openFirewall = true;
hostKeys = [
{
path = "/etc/ssh/id_ed25519";
type = "ed25519";
}
];
settings = {
PasswordAuthentication = false;
PermitRootLogin = "yes";
UsePAM = true;
};
};
tailscale = {
enable = true;
openFirewall = true;
};
};
networking = {
hostName = "${xlib.device.hostname}";
networkmanager.enable = true;
firewall.enable = true;
};
system = {
stateVersion = "25.05";
};
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = [
nixosModule
];
system = "x86_64-linux";
specialArgs = {
deviceType = "vds";
};
}
+62
View File
@@ -0,0 +1,62 @@
{ inputs, ... }@flakeContext:
let
nixosModule =
{
config,
lib,
pkgs,
modulesPath,
xlib,
...
}:
{
xlib.device = {
type = "wsl";
hostname = "wsl";
};
imports = [
inputs.nixos-wsl.nixosModules.default
inputs.self.nixosModules.default
];
#zramSwap.enable = true;
services = {
journald = {
extraConfig = ''
SystemMaxUse=512M
'';
};
earlyoom.enable = true;
};
hardware = {
graphics.enable = true;
# amdgpu.opencl.enable = true;
# amdgpu.amdvlk.enable = true;
};
networking = {
firewall.enable = false;
hostName = xlib.device.hostname;
};
wsl = {
enable = true;
startMenuLaunchers = true;
#useWindowsDriver = true;
defaultUser = config.xlib.device.username;
};
system.stateVersion = "24.11";
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = [
nixosModule
];
system = "x86_64-linux";
specialArgs = {
deviceType = "wsl";
};
}