This commit is contained in:
2025-05-15 21:11:30 +03:00
commit b6cee5e832
43 changed files with 2652 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
{
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";
};
};
swap = {
size = "2G";
content = {
type = "swap";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}
+59
View File
@@ -0,0 +1,59 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd = {
availableKernelModules = [
"nvme"
"xhci_pci"
"usbhid"
"usb_storage"
"uas"
"sd_mod"
];
kernelModules = [ ];
};
kernelModules = [ "kvm-amd" ];
extraModulePackages = [ ];
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/5938c796-6ff5-49d9-a3a6-022b4c32beeb";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/61BF-3342";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
};
swapDevices = [
{ device = "/dev/disk/by-uuid/d89bccd2-0672-4855-9d87-40e2688cdec4"; }
];
# 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.enp2s0.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";
}
+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,
...
}:
{
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 = [
"fmask=0022"
"dmask=0022"
];
};
};
# fileSystems."/" =
# { device = "/dev/disk/by-uuid/8acccc34-edc6-4934-886c-ef4b778ca24a";
# fsType = "ext4";
# };
#
# fileSystems."/boot" =
# { device = "/dev/disk/by-uuid/DDF2-C940";
# fsType = "vfat";
# options = [ "fmask=0022" "dmask=0022" ];
# };
#
# fileSystems."/home/otreca/External" =
# { device = "/dev/disk/by-uuid/37e53ebc-5343-a94d-9fe2-0ca39e13a8de";
# fsType = "ext4";
# };
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.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;
}
+169
View File
@@ -0,0 +1,169 @@
{
inputs,
...
}@flakeContext:
let
nixosModule =
{
config,
lib,
pkgs,
...
}:
{
imports =
with inputs;
[
./hardware/laptop.nix
./hardware/logitech.nix
self.nixosModules.default
nixos-hardware.nixosModules.asus-fa506ic
self.nixosModules.software.wine
self.nixosModules.desktop
self.homeConfigurations.main.nixosModule
self.homeConfigurations.root.nixosModule
]
++ builtins.attrValues inputs.self.nixosModules.extra.self;
fileSystems = {
"${inputs.zeroq.dirs.therima-drive}" = {
device = "/dev/disk/by-uuid/C0A2DDEFA2DDEA44";
fsType = "ntfs3";
options = [
"defaults"
"uid=1000"
"gid=1000"
"fmask=0007"
"dmask=0007"
"nofail"
"x-systemd.device-timeout=0"
];
};
"${inputs.zeroq.dirs.vetymae-drive}" = {
device = "/dev/disk/by-uuid/6E04EA7F04EA49A3";
fsType = "ntfs3";
options = [
"defaults"
"uid=1000"
"gid=1000"
"fmask=0007"
"dmask=0007"
"nofail"
"x-systemd.device-timeout=0"
];
};
};
boot = {
kernelPackages = lib.mkDefault pkgs.linuxPackages_xanmod_stable;
loader = {
systemd-boot.enable = lib.mkDefault true;
efi.canTouchEfiVariables = lib.mkDefault true;
};
};
hardware = {
bluetooth.enable = true;
# nvidia = {
# open = true;
# dynamicBoost.enable = true;
# nvidiaSettings = true;
# powerManagement = {
# enable = false;
# finegrained = false; # maybe comment this out idk what it does
# };
# #package = config.boot.kernelPackages.nvidiaPackages.stable;
# nvidiaPersistenced = true;
# modesetting.enable = true;
# prime = {
# offload = {
# enable = true;
# enableOffloadCmd = true;
# };
# sync.enable = false;
# amdgpuBusId = "PCI:6:0:0";
# nvidiaBusId = "PCI:1:0:0";
# };
# };
};
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
networking = {
hostName = "${inputs.zeroq.devices.laptop.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 = [
"amdgpu"
"nvidia"
];
};
syncthing = {
enable = true;
systemService = true;
configDir = "${inputs.zeroq.dirs.user-storage}/Syncthing/${config.system.name}"; # ${inputs.zeroq.devices.laptop.hostname}
dataDir = "${inputs.zeroq.dirs.user-home}";
group = "users";
user = "${inputs.zeroq.devices.admin}";
};
pipewire = {
enable = lib.mkDefault true;
systemWide = true;
alsa.enable = true;
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" = 256;
"default.clock.min-quantum" = 64;
"default.clock.max-quantum" = 1024;
};
};
};
};
thermald.enable = true;
earlyoom.enable = true;
preload.enable = true;
};
security = {
rtkit.enable = true;
};
system.stateVersion = "25.05";
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = [
nixosModule
inputs.sops-nix.nixosModules.sops
];
system = "x86_64-linux";
}
+31
View File
@@ -0,0 +1,31 @@
{
inputs,
...
}@flakeContext:
let
nixosModule =
{
config,
lib,
pkgs,
...
}:
{
system.nixos.label = "stock";
imports = with inputs; [
self.nixosModules.default
nixos-hardware.nixosModules.chuwi-minibook-x
home-manager.nixosModules.home-manager # home-manager module
self.homeConfigurations.oqyude.nixosModule # home-manager configuration module
];
hardware.intel-gpu-tools.enable = true;
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = with inputs; [
nixosModule
];
system = "x86_64-linux";
}
+274
View File
@@ -0,0 +1,274 @@
{ inputs, ... }@flakeContext:
let
nixosModule =
{
config,
lib,
pkgs,
...
}:
{
imports = with inputs; [
./hardware/server.nix
self.nixosModules.default
self.homeConfigurations.server.nixosModule # home-manager configuration module
];
boot = {
kernelPackages = pkgs.linuxPackages_xanmod_stable;
hardwareScan = true;
loader = {
systemd-boot.enable = lib.mkDefault true;
efi.canTouchEfiVariables = lib.mkDefault true;
};
};
hardware = {
bluetooth.enable = false;
};
#swapDevices =
# [ { device = "/dev/disk/by-partlabel/disk-main-swap"; }
# ];
users = {
users = {
"${inputs.zeroq.devices.admin}" = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKduJia+unaQQdN6X5syaHvnpIutO+yZwvfiCP4qKQ/P root@sapphira"
];
};
};
};
fileSystems = {
# External drive
"${inputs.zeroq.dirs.server-home}" = {
device = "/dev/disk/by-uuid/37e53ebc-5343-a94d-9fe2-0ca39e13a8de";
fsType = "ext4";
options = [
"nofail"
"x-systemd.device-timeout=0"
];
};
};
services = {
nextcloud = {
enable = false;
package = pkgs.nextcloud30;
hostName = "localhost:10000";
database.createLocally = true;
config = {
dbtype = "mysql";
dbuser = "nextcloud";
#dbhost = "/run/postgresql";
dbname = "nextcloud";
adminuser = "root";
#adminpassFile = "${inputs.zeroq.dirs.credentials-target}/nextcloud/admin-pass.txt";
};
settings = {
appstoreEnable = false;
log_type = "file";
trusted_domains = [
"100.64.0.0"
"192.168.1.18"
"localhost"
];
};
extraAppsEnable = true;
extraApps = {
inherit (pkgs.nextcloud30Packages.apps)
bookmarks
calendar
contacts
cookbook
cospend
deck
end_to_end_encryption
forms
gpoddersync
groupfolders
impersonate
integration_paperless
mail
maps
memories
music
notes
notify_push
onlyoffice
polls
previewgenerator
richdocuments
spreed
tasks
user_oidc
user_saml
whiteboard
;
};
};
earlyoom.enable = true;
preload.enable = true;
auto-cpufreq.enable = true;
throttled.enable = true;
nginx = {
enable = false;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
"localhost:10000" = {
forceSSL = false;
enableACME = false;
listen = [
{
addr = "100.64.0.0";
port = 10000;
}
{
addr = "192.168.1.18";
port = 10000;
}
];
};
};
};
postgresql = {
enable = false;
# ensureDatabases = [ "nextcloud" ];
# ensureUsers = [
# {
# name = "nextcloud"; # Здесь не хватает строчек\\
# }
# ];
};
journald = {
extraConfig = ''
SystemMaxUse=128M
'';
};
samba = {
enable = 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" = "${inputs.zeroq.devices.admin}";
"guest ok" = "no";
"writable" = "yes";
"create mask" = 644;
"directory mask" = 644;
"force user" = "root";
"force group" = "root";
};
root = {
"path" = "/";
"browseable" = "yes";
"read only" = "no";
"valid users" = "${inputs.zeroq.devices.admin}";
"guest ok" = "no";
"writable" = "yes";
#"create mask" = 0644;
#"directory mask" = 0644;
"force user" = "root";
"force group" = "root";
};
"${inputs.zeroq.devices.admin}" = {
"path" = "${inputs.zeroq.dirs.server-home}";
"browseable" = "yes";
"read only" = "no";
"valid users" = "${inputs.zeroq.devices.admin}";
"guest ok" = "no";
"writable" = "yes";
"create mask" = 700;
"directory mask" = 700;
"force user" = "${inputs.zeroq.devices.admin}";
"force group" = "users";
};
};
};
calibre-web = {
enable = true;
group = "users";
user = "${inputs.zeroq.devices.admin}";
options = {
calibreLibrary = "${inputs.zeroq.dirs.calibre-library}";
enableBookUploading = true;
enableKepubify = false;
};
listen.ip = "0.0.0.0";
listen.port = 8083;
openFirewall = true;
};
openssh = {
enable = true;
allowSFTP = true;
#knownHosts.otreca.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJpMaD143EZqhRlpAgNINLrH/qXkN3zXmKgFJlhbhGwg";
hostKeys = [
{
path = "/etc/ssh/id_ed25519";
type = "ed25519";
}
];
settings = {
PasswordAuthentication = false;
PermitRootLogin = "yes";
UsePAM = true;
};
};
transmission = {
enable = true;
credentialsFile = "${inputs.zeroq.dirs.server-home}/server/transmission/settings.json";
openRPCPort = true;
package = pkgs.transmission_4;
user = "${inputs.zeroq.devices.admin}";
group = "users";
settings = {
download-dir = "${inputs.zeroq.dirs.server-home}/Downloads";
incomplete-dir = "${inputs.zeroq.dirs.server-home}/Downloads/Temp";
incomplete-dir-enabled = true;
rpc-bind-address = "0.0.0.0";
rpc-port = 9091;
rpc-whitelist-enabled = false;
umask = 0;
};
};
syncthing = {
enable = true;
systemService = true;
guiAddress = "0.0.0.0:8384";
configDir = "${inputs.zeroq.dirs.storage}/Syncthing/${inputs.zeroq.devices.server.hostname}";
dataDir = "${inputs.zeroq.dirs.server-home}";
group = "users";
user = "${inputs.zeroq.devices.admin}";
};
tailscale.enable = true;
};
networking = {
hostName = "${inputs.zeroq.devices.server.hostname}";
networkmanager.enable = true;
firewall.enable = false;
};
system = {
stateVersion = "25.05";
};
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = with inputs; [
nixosModule
];
system = "x86_64-linux";
}
+77
View File
@@ -0,0 +1,77 @@
{ inputs, ... }@flakeContext:
let
nixosModule =
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ <nixos-wsl/modules> ];
i18n = {
defaultLocale = "en_US.UTF-8";
supportedLocales = [
"ru_RU.UTF-8/UTF-8"
"en_US.UTF-8/UTF-8"
];
};
networking.hostName = "${inputs.zeroq.devices.wsl.username}";
users = {
defaultUserShell = pkgs.zsh;
};
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
environment.systemPackages = with pkgs; [
btop
fastfetch
yazi
];
programs = {
lazygit.enable = true;
git.enable = true;
nh.enable = true;
zsh = {
enable = true;
enableCompletion = true;
enableBashCompletion = true;
syntaxHighlighting.enable = true;
zsh-autoenv.enable = true;
loginShellInit = "clear && fastfetch";
ohMyZsh = {
enable = true;
theme = "robbyrussell";
};
};
};
zramSwap.enable = true;
services.earlyoom.enable = true;
wsl = {
enable = true;
startMenuLaunchers = true;
#useWindowsDriver = true;
defaultUser = "nixos";
};
system.stateVersion = "24.05";
};
in
inputs.nixpkgs.lib.nixosSystem {
modules = [
nixosModule
];
system = "x86_64-linux";
}