This commit is contained in:
2026-03-09 10:50:12 +03:00
commit f1a81a6408
119 changed files with 8378 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
{ inputs, ... }@flakeContext:
let
nixosModule =
{
config,
lib,
modulesPath,
pkgs,
xlib,
...
}:
{
imports = [
inputs.self.nixosModules.default
];
system = {
stateVersion = "26.05";
};
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = [
nixosModule
];
system = "x86_64-linux";
specialArgs = {
deviceType = "minimal";
};
}
+12
View File
@@ -0,0 +1,12 @@
{ inputs, ... }@flakeContext:
{
nixosConfigurations = {
default = import ./any.nix flakeContext; # default
atoridu = import ./mini-pc.nix flakeContext; # atoridu
rydiwo = import ./mini-laptop.nix flakeContext; # rydiwo
otreca = import ./vds.nix flakeContext; # vds
otreca-new = import ./vds-new.nix flakeContext; # vds-new
sapphira = import ./server.nix flakeContext; # sapphira
wsl = import ./wsl.nix flakeContext; # wsl
};
}
+27
View File
@@ -0,0 +1,27 @@
{ xlib, ... }:
{
disko.devices = {
disk = {
"${xlib.device.hostname}" = {
device = "/dev/nvme0n1p4";
type = "disk";
content = {
type = "gpt";
partitions = {
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
extraArgs = [
"-L ${xlib.device.hostname}" # Filesystem label
];
};
};
};
};
};
};
};
}
+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";
};
};
};
};
};
};
};
}
+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 = "1G";
content = {
type = "swap";
};
};
};
};
};
};
};
}
+14
View File
@@ -0,0 +1,14 @@
{
config,
...
}:
{
hardware = {
logitech = {
wireless = {
enable = true;
enableGraphical = true;
};
};
};
}
+69
View File
@@ -0,0 +1,69 @@
{
config,
lib,
pkgs,
modulesPath,
xlib,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd = {
supportedFilesystems = [
"nfs"
"nfsv4"
"overlay"
];
availableKernelModules = [
"nvme"
"xhci_pci"
"thunderbolt"
"usb_storage"
"uas"
"usbhid"
"sd_mod"
];
};
# kernelModules = [
# ];
extraModulePackages = [ ];
};
fileSystems = {
"/" = {
device = "/dev/disk/by-partlabel/disk-${xlib.device.hostname}-root";
# device = "/dev/disk/by-uuid/fe5364dc-a79c-458d-a0d0-b7ea32a56266";
fsType = "ext4";
};
"/boot" = {
# device = "/dev/disk/by-uuid/7ECA-F1EC";
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.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
+77
View File
@@ -0,0 +1,77 @@
{
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;
# };
# graphics.extraPackages = with pkgs; [
# mesa
# amf
# ];
# };
# systemd.tmpfiles.rules = [
# "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
# ];
fileSystems = {
"/" = {
device = lib.mkForce "/dev/disk/by-uuid/5d20c3e3-bd18-4c28-9b35-903eb8ae9881";
#device = lib.mkForce "/dev/disk/by-partlabel/disk-${xlib.device.hostname}-root";
fsType = "ext4";
};
"/boot" = {
device = lib.mkForce "/dev/disk/by-uuid/A431-B16A";
#device = lib.mkForce "/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;
}
+69
View File
@@ -0,0 +1,69 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd = {
# supportedFilesystems = [
# "nfs"
# "nfsv4"
# "overlay"
# ];
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 = [
"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;
}
+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;
}
+143
View File
@@ -0,0 +1,143 @@
{
inputs,
...
}@flakeContext:
let
nixosModule =
{
config,
lib,
pkgs,
xlib,
...
}:
{
xlib.device = {
type = "secondary";
hostname = "rydiwo";
};
imports = with inputs; [
nixos-hardware.nixosModules.chuwi-minibook-x
./hardware/mini-laptop.nix
self.nixosModules.default
];
boot = {
kernelPackages = lib.mkDefault pkgs.linuxPackages_xanmod_stable;
loader = {
systemd-boot.enable = lib.mkDefault true;
efi.canTouchEfiVariables = lib.mkDefault true;
};
};
fileSystems."${xlib.dirs.lamet-drive}" = {
device = "/dev/disk/by-uuid/DC76BD3576BD116E";
fsType = "ntfs3";
options = [
"defaults"
"uid=1000"
"gid=1000"
"fmask=0000"
"dmask=0000"
"nofail"
];
};
hardware = {
bluetooth.enable = true;
};
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 = {
xserver = {
videoDrivers = [
"nomodeset"
];
};
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;
openssh = {
enable = true;
allowSFTP = true;
hostKeys = [
{
path = "/etc/ssh/id_ed25519";
type = "ed25519";
}
];
settings = {
PasswordAuthentication = false;
PermitRootLogin = "yes";
UsePAM = true;
};
};
};
security = {
rtkit.enable = true;
};
hardware.intel-gpu-tools.enable = true;
system.stateVersion = "26.05";
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = with inputs; [
nixosModule
];
system = "x86_64-linux";
specialArgs = {
deviceType = "secondary";
};
}
+163
View File
@@ -0,0 +1,163 @@
{
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}" = {
enable = false;
device = "/dev/disk/by-uuid/C0A2DDEFA2DDEA44";
fsType = "ntfs3";
options = [
"defaults"
"uid=1000"
"gid=1000"
"fmask=0007"
"dmask=0007"
"nofail"
];
};
"${xlib.dirs.vetymae-drive}" = {
enable = false;
device = "/dev/disk/by-uuid/6408433908430A0E";
fsType = "ntfs3";
options = [
"defaults"
"uid=1000"
"gid=1000"
"fmask=0007"
"dmask=0007"
"nofail"
];
};
"${xlib.dirs.soptur-drive}" = {
enable = false;
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_stable;
#kernelParams = [ "usbcore.autosuspend=-1" ];
loader = {
systemd-boot.enable = lib.mkDefault true;
efi.canTouchEfiVariables = lib.mkDefault true;
};
};
hardware = {
bluetooth.enable = true;
};
# 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;
};
nixpkgs.config.pulseaudio = true;
security = {
rtkit.enable = true;
};
system.stateVersion = "26.05";
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = [
nixosModule
];
system = "x86_64-linux";
specialArgs = {
deviceType = "primary";
};
}
+137
View File
@@ -0,0 +1,137 @@
{ 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;
graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
intel-ocl
intel-vaapi-driver
];
};
intel-gpu-tools.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";
};
# Archive drive
"/mnt/archive" = {
device = "/dev/disk/by-label/archive";
fsType = "exfat";
options = [
"nofail"
"uid=1000"
"gid=1000"
];
};
# Mobile SD-Card
"/mnt/mobile" = {
device = "/dev/disk/by-uuid/7EB1-DC99";
fsType = "exfat";
options = [
"nofail"
"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;
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";
};
}
+177
View File
@@ -0,0 +1,177 @@
{ inputs, ... }@flakeContext:
let
nixosModule =
{
config,
lib,
modulesPath,
pkgs,
xlib,
...
}:
{
xlib.device = {
type = "vds-new";
hostname = "otreca-new";
};
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;
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 = {
nameservers = [
"1.1.1.1"
"8.8.8.8"
"2001:4860:4860::8844"
"2001:4860:4860::8888"
"2606:4700:4700::1111"
"2606:4700:4700::1001"
];
hostName = "${xlib.device.hostname}";
networkmanager.enable = true;
tempAddresses = "disabled";
dhcpcd = {
enable = true;
IPv6rs = true;
};
firewall = {
enable = true;
allowPing = true;
};
enableIPv6 = true;
interfaces.ens3 = {
useDHCP = true;
# ipv4.addresses = [
# {
# address = "31.57.158.109";
# prefixLength = 24;
# }
# ];
# ipv6.addresses = [
# {
# address = "2a13:7c00:6:102:f816:3eff:fe91:6b9e";
# prefixLength = 64;
# }
# ];
};
# defaultGateway = {
# address = "31.57.158.1";
# interface = "ens3";
# };
# defaultGateway6 = {
# address = "2a13:7c00:6:102::1";
# interface = "ens3";
# };
};
system = {
stateVersion = "25.05";
};
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = [
nixosModule
];
system = "x86_64-linux";
specialArgs = {
deviceType = "vds-new";
};
}
+177
View File
@@ -0,0 +1,177 @@
{ 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;
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 = {
nameservers = [
"1.1.1.1"
"8.8.8.8"
"2001:4860:4860::8844"
"2001:4860:4860::8888"
"2606:4700:4700::1111"
"2606:4700:4700::1001"
];
hostName = "${xlib.device.hostname}";
networkmanager.enable = true;
tempAddresses = "disabled";
dhcpcd = {
enable = true;
IPv6rs = true;
};
firewall = {
enable = true;
allowPing = true;
};
enableIPv6 = true;
interfaces.ens3 = {
useDHCP = true;
# ipv4.addresses = [
# {
# address = "31.57.158.109";
# prefixLength = 24;
# }
# ];
# ipv6.addresses = [
# {
# address = "2a13:7c00:6:102:f816:3eff:fe91:6b9e";
# prefixLength = 64;
# }
# ];
};
# defaultGateway = {
# address = "31.57.158.1";
# interface = "ens3";
# };
# defaultGateway6 = {
# address = "2a13:7c00:6:102::1";
# interface = "ens3";
# };
};
system = {
stateVersion = "25.05";
};
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = [
nixosModule
];
system = "x86_64-linux";
specialArgs = {
deviceType = "vds";
};
}
+103
View File
@@ -0,0 +1,103 @@
{ 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 = {
# nameservers = [
# "1.1.1.1"
# "8.8.8.8"
# "2001:4860:4860::8844"
# "2001:4860:4860::8888"
# "2606:4700:4700::1111"
# "2606:4700:4700::1001"
# ];
hostName = "${xlib.device.hostname}";
# networkmanager.enable = true;
# tempAddresses = "disabled";
# dhcpcd = {
# enable = true;
# IPv6rs = true;
# };
firewall = {
enable = false;
allowPing = true;
};
enableIPv6 = true;
# interfaces.ens3 = {
# useDHCP = true;
# # ipv4.addresses = [
# # {
# # address = "31.57.158.109";
# # prefixLength = 24;
# # }
# # ];
# ipv6.addresses = [
# {
# address = "2a13:7c00:10:6:f816:3eff:fe36:fe1b";
# prefixLength = 64;
# }
# ];
# };
# # defaultGateway = {
# # address = "31.57.158.1";
# # interface = "ens3";
# # };
# defaultGateway6 = {
# address = "2a13:7c00:10:6::1";
# interface = "ens3";
# };
};
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";
};
}