big great refactor

This commit is contained in:
elwrcl committed 2026-05-29 18:33:58 +03:00
1 parent 596bcb4a94
commit 5a7501eec0
73 files changed
+537 -644

No files matched your search

Vendored Executable
BIN
View File
Binary file not shown.
+33
View File
@@ -0,0 +1,33 @@
{
pkgs,
...
}:
{
imports = [
];
environment.systemPackages = [ pkgs.efibootmgr ];
boot.kernelPackages = pkgs.linuxPackages_cachyos-lto;
boot.kernelParams = [
"preempt=full"
"mitigations=off"
"usbcore.autosuspend=-1"
"transparent_hugepage=madvise"
];
boot.loader = {
timeout = 5;
efi = {
canTouchEfiVariables = false;
efiSysMountPoint = "/boot";
};
systemd-boot = {
enable = true;
configurationLimit = 5;
};
};
}
+16
View File
@@ -0,0 +1,16 @@
{ ... }:
{
imports = [
../home/git.nix
./boot
./desktop
./gaming
./hardware
./networking
./services
./system
./users
./virtualization
];
}
+7
View File
@@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./pipewire.nix
];
}
+39
View File
@@ -0,0 +1,39 @@
{ ... }:
{
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
extraConfig.pipewire."10-realtime" = {
"context.modules" = [
{
name = "libpipewire-module-rt";
args = {
"nice.level" = -15;
"rt.prio" = 88;
"rt.time.soft" = 200000;
"rt.time.hard" = 400000;
};
flags = [
"ifexists"
"nofail"
];
}
];
};
extraConfig.pipewire."92-quantum" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.allowed-rates" = [ 48000 ];
"default.clock.quantum" = 1024;
"default.clock.min-quantum" = 1024;
"default.clock.max-quantum" = 1024;
};
};
};
}
+50
View File
@@ -0,0 +1,50 @@
{ ... }:
{
imports = [
./display
./window-managers
./audio
];
xdg.mime = {
enable = true;
defaultApplications = {
# gui
"text/html" = "zen-beta.desktop";
"x-scheme-handler/http" = "zen-beta.desktop";
"x-scheme-handler/https" = "zen-beta.desktop";
"x-scheme-handler/about" = "zen-beta.desktop";
"x-scheme-handler/unknown" = "zen-beta.desktop";
"x-scheme-handler/steam" = "steam.desktop";
# media
"image/png" = "org.gnome.Loupe.desktop";
"image/jpeg" = "org.gnome.Loupe.desktop";
"image/gif" = "org.gnome.Loupe.desktop";
"image/bmp" = "org.gnome.Loupe.desktop";
"image/svg+xml" = "org.gnome.Loupe.desktop";
"image/webp" = "org.gnome.Loupe.desktop";
"image/tiff" = "org.gnome.Loupe.desktop";
"video/mp4" = "mpv.desktop";
"video/x-matroska" = "mpv.desktop";
"video/webm" = "mpv.desktop";
"video/avi" = "mpv.desktop";
"video/quicktime" = "mpv.desktop";
"audio/mpeg" = "mpv.desktop";
"audio/flac" = "mpv.desktop";
"audio/ogg" = "mpv.desktop";
# code
"text/plain" = "zeditor.desktop";
"text/x-rust" = "zeditor.desktop";
"text/x-nix" = "zeditor.desktop";
"text/x-csrc" = "zeditor.desktop";
"text/x-chdr" = "zeditor.desktop";
"text/x-python" = "zeditor.desktop";
"text/x-shellscript" = "zeditor.desktop";
"application/json" = "zeditor.desktop";
"application/x-shellscript" = "zeditor.desktop";
};
};
}
+29
View File
@@ -0,0 +1,29 @@
{ ... }:
{
services.xserver.enable = true;
services.displayManager.ly = {
enable = true;
settings = {
animation = "colormix";
colormix_col1 = "0x00FFFFFF";
colormix_col2 = "0x000000EE";
colormix_col3 = "0x00777799";
bigclock = "en";
bigclock_12hr = false;
fg = "0x00FFFFFF";
bg = "0x00000000";
border_fg = "0x00FFFFFF";
error_fg = "0x01FF0000";
blank_box = true;
hide_borders = false;
margin_box_h = 2;
margin_box_v = 1;
};
};
services.xserver.xkb = {
layout = "tr";
variant = "";
};
}
+7
View File
@@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./hyprland.nix
];
}
+38
View File
@@ -0,0 +1,38 @@
{
pkgs,
inputs,
...
}:
{
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
portalPackage =
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
xwayland.enable = true;
withUWSM = true;
};
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
config.hyprland.default = [
"hyprland"
"gtk"
];
};
services = {
dbus.enable = true;
};
security.polkit.enable = true;
environment.systemPackages = with pkgs; [
glib
dconf
dconf-editor
xdg-utils
xdg-user-dirs
];
}
+20
View File
@@ -0,0 +1,20 @@
{
pkgs,
...
}:
{
imports = [
./steam
];
programs.gamemode = {
enable = true;
enableRenice = true;
};
environment.systemPackages = with pkgs; [
protonup-qt
mangohud
];
}
+23
View File
@@ -0,0 +1,23 @@
{
pkgs,
...
}:
{
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
protontricks.enable = true;
extraCompatPackages = with pkgs; [
proton-ge-bin
];
};
programs.gamescope = {
enable = true;
capSysNice = false;
};
hardware.steam-hardware.enable = true;
}
+5
View File
@@ -0,0 +1,5 @@
{ ... }:
{
hardware.bluetooth.enable = true;
}
+9
View File
@@ -0,0 +1,9 @@
{ ... }:
{
imports = [
./bluetooth
./graphics
./udev
];
}
+13
View File
@@ -0,0 +1,13 @@
{
pkgs,
...
}:
{
hardware.graphics.extraPackages = with pkgs; [
amdvlk
rocmPackages.clr.icd
];
services.xserver.videoDrivers = [ "amdgpu" ];
}
+41
View File
@@ -0,0 +1,41 @@
{
config,
lib,
pkgs,
...
}:
let
driver = config.elars.hardware.graphics.driver;
in
{
options.elars.hardware.graphics.driver = lib.mkOption {
type = lib.types.enum [
"intel"
"amd"
"nvidia"
"hybrid-amd-nvidia"
];
default = "intel";
};
config = lib.mkMerge [
{
hardware.graphics = {
enable = true;
enable32Bit = true;
};
}
(lib.mkIf (driver == "intel") (import ./intel.nix { inherit config lib pkgs; }))
(lib.mkIf (driver == "amd") (import ./amd.nix { inherit config lib pkgs; }))
(lib.mkIf (driver == "nvidia") (import ./nvidia.nix { inherit config lib pkgs; }))
(lib.mkIf (driver == "hybrid-amd-nvidia") (
lib.mkMerge [
(import ./amd.nix { inherit config lib pkgs; })
(import ./nvidia.nix { inherit config lib pkgs; })
(import ./prime.nix { inherit config lib pkgs; })
]
))
];
}
+45
View File
@@ -0,0 +1,45 @@
{
pkgs,
...
}:
let
wayland-intel-vaapi-driver = pkgs.intel-vaapi-driver.overrideAttrs (oldAttrs: {
version = "2.4.4-wayland-fix";
src = pkgs.fetchFromGitHub {
owner = "irql-notlessorequal";
repo = "intel-vaapi-driver";
rev = "929e936ec1f451a5daa12b0c7367687b712b8c2c";
hash = "sha256-tZ1rZ+4bRxarcFQhP8V2Mfz0sJ5rBgHYLu2ulrQwL+U=";
};
});
wayland-intel-vaapi-driver-32 = pkgs.pkgsi686Linux.intel-vaapi-driver.overrideAttrs (oldAttrs: {
version = "2.4.4-wayland-fix";
src = pkgs.fetchFromGitHub {
owner = "irql-notlessorequal";
repo = "intel-vaapi-driver";
rev = "929e936ec1f451a5daa12b0c7367687b712b8c2c";
hash = "sha256-tZ1rZ+4bRxarcFQhP8V2Mfz0sJ5rBgHYLu2ulrQwL+U=";
};
});
in
{
hardware.graphics.extraPackages = [
wayland-intel-vaapi-driver
pkgs.libvdpau-va-gl
pkgs.mesa
];
hardware.graphics.extraPackages32 = [
wayland-intel-vaapi-driver-32
pkgs.pkgsi686Linux.libvdpau-va-gl
pkgs.pkgsi686Linux.mesa
];
services.xserver.videoDrivers = [ "modesetting" ];
environment.variables = {
LIBVA_DRIVER_NAME = "i965";
};
}
+15
View File
@@ -0,0 +1,15 @@
{
config,
...
}:
{
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
}
+9
View File
@@ -0,0 +1,9 @@
{ ... }:
{
hardware.nvidia.prime = {
offload.enable = true;
amdgpuBusId = "PCI:X:X:X";
nvidiaBusId = "PCI:X:X:X";
};
}
+20
View File
@@ -0,0 +1,20 @@
{ ... }:
{
services.udev.extraRules = ''
KERNEL=="ttyACM[0-9]*", MODE="0666"
KERNEL=="ttyUSB[0-9]*", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666", GROUP="plugdev"
'';
services.udisks2.enable = true;
services.tumbler.enable = true;
services.gvfs.enable = true;
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (action.id.match("org.freedesktop.udisks2.") &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});
'';
}
+8
View File
@@ -0,0 +1,8 @@
{ ... }:
{
imports = [
./vpn
./network-manager
];
}
+23
View File
@@ -0,0 +1,23 @@
{ ... }:
{
networking.hostName = "copland";
networking.networkmanager.enable = true;
services.resolved = {
enable = true;
settings = {
Resolve = {
DNS = "1.1.1.1";
DNSOverTLS = "yes";
DNSSEC = "false";
Domains = [ "~." ];
FallbackDNS = [
"1.1.1.1"
"8.8.8.8"
];
};
};
};
}
+36
View File
@@ -0,0 +1,36 @@
{ ... }:
{
services.zapret = {
enable = true;
params = [
"--filter-tcp=80"
"--dpi-desync=fake,multisplit"
"--dpi-desync-split-pos=method+2"
"--dpi-desync-fooling=md5sig"
"--new"
"--filter-tcp=443"
"--dpi-desync=fake,multidisorder"
"--dpi-desync-split-pos=1,midsld"
"--dpi-desync-fooling=badseq,md5sig"
"--new"
"--filter-udp=443"
"--dpi-desync=fake"
"--dpi-desync-repeats=6"
];
};
networking.enableIPv6 = false;
networking.firewall.extraCommands = ''
iptables -I OUTPUT -p tcp -m multiport --dports 80,443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass
iptables -I OUTPUT -p udp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass
iptables -I OUTPUT -m mark --mark 0x40000000/0x40000000 -j RETURN
'';
networking.firewall.extraStopCommands = ''
iptables -D OUTPUT -p tcp -m multiport --dports 80,443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass || true
iptables -D OUTPUT -p udp --dport 443 -m connbytes --connbytes-dir=original --connbytes-mode=packets --connbytes 1:9 -j NFQUEUE --queue-num 200 --queue-bypass || true
iptables -D OUTPUT -m mark --mark 0x40000000/0x40000000 -j RETURN || true
'';
}
+8
View File
@@ -0,0 +1,8 @@
{ ... }:
{
programs.appimage = {
enable = true;
binfmt = true;
};
}
+15
View File
@@ -0,0 +1,15 @@
{ ... }:
{
imports = [
./appimage
./flatpak
./fwupd
./kde_connect
./ollama
./performance
./printing
./security
./ssh
];
}
+5
View File
@@ -0,0 +1,5 @@
{ ... }:
{
services.flatpak.enable = true;
}
+5
View File
@@ -0,0 +1,5 @@
{ ... }:
{
services.fwupd.enable = true;
}
+5
View File
@@ -0,0 +1,5 @@
{ ... }:
{
programs.kdeconnect.enable = true;
}
+5
View File
@@ -0,0 +1,5 @@
{ ... }:
{
services.ollama.enable = true;
}
+11
View File
@@ -0,0 +1,11 @@
{ ... }:
{
services.scx = {
enable = false;
scheduler = "scx_rustland";
};
services.irqbalance.enable = true;
services.power-profiles-daemon.enable = true;
services.upower.enable = true;
}
+31
View File
@@ -0,0 +1,31 @@
{
pkgs,
...
}:
{
services.printing = {
enable = true;
drivers = [
pkgs.cnijfilter2
pkgs.gutenprint
pkgs.gutenprintBin
];
};
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
publish = {
enable = true;
addresses = true;
userServices = true;
};
};
hardware.sane = {
enable = true;
extraBackends = [ pkgs.sane-airscan ];
};
}
+23
View File
@@ -0,0 +1,23 @@
{
pkgs,
...
}:
{
programs.gnupg.agent = {
enable = true;
enableSSHSupport = false;
};
security.wrappers = {
gsr-kms-server = {
source = "${pkgs.gpu-screen-recorder}/bin/gsr-kms-server";
capabilities = "cap_sys_admin+ep";
owner = "root";
group = "root";
permissions = "u+rx,g+rx,o+rx";
};
};
services.gnome.gnome-keyring.enable = true;
}
+5
View File
@@ -0,0 +1,5 @@
{ ... }:
{
services.openssh.enable = true;
}
+10
View File
@@ -0,0 +1,10 @@
{ ... }:
{
imports = [
./locale
./nix
./fonts
./kmscon
];
}
+58
View File
@@ -0,0 +1,58 @@
{
pkgs,
...
}:
{
fonts = {
packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-color-emoji
ipaexfont
nerd-fonts.jetbrains-mono
nerd-fonts.caskaydia-cove
nerd-fonts.symbols-only
];
fontconfig = {
enable = true;
antialias = true;
hinting = {
enable = true;
style = "slight";
autohint = false;
};
subpixel = {
rgba = "rgb";
lcdfilter = "default";
};
defaultFonts = {
serif = [
"JetBrainsMono Nerd Font"
"Noto Serif CJK JP"
"Noto Serif"
"IPAexMincho"
];
sansSerif = [
"JetBrainsMono Nerd Font"
"Noto Sans CJK JP"
"Noto Sans"
"IPAexGothic"
];
monospace = [
"JetBrainsMono Nerd Font Mono"
"JetBrainsMono Nerd Font"
"Noto Sans Mono CJK JP"
"Noto Sans CJK JP"
"IPAexGothic"
];
emoji = [ "Noto Color Emoji" ];
};
};
};
}
+20
View File
@@ -0,0 +1,20 @@
{
pkgs,
...
}:
{
services.kmscon = {
enable = true;
hwRender = true;
fonts = [
{
name = "JetBrainsMono Nerd Font";
package = pkgs.nerd-fonts.jetbrains-mono;
}
];
extraConfig = ''
font-size=18
'';
};
}
+38
View File
@@ -0,0 +1,38 @@
{ ... }:
{
time.timeZone = "Europe/Istanbul";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "tr_TR.UTF-8";
LC_IDENTIFICATION = "tr_TR.UTF-8";
LC_MEASUREMENT = "tr_TR.UTF-8";
LC_MONETARY = "tr_TR.UTF-8";
LC_NAME = "tr_TR.UTF-8";
LC_NUMERIC = "tr_TR.UTF-8";
LC_PAPER = "tr_TR.UTF-8";
LC_TELEPHONE = "tr_TR.UTF-8";
LC_TIME = "tr_TR.UTF-8";
};
services.timesyncd.enable = false;
services.chrony = {
enable = true;
extraConfig = ''
makestep 1.0 -1
server 162.159.200.1 iburst
server 216.239.35.0 iburst
server time.cloudflare.com iburst
server time.google.com iburst
'';
};
systemd.services.chronyd = {
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
};
console.keyMap = "trq";
console.font = "LatArCyrHeb-16";
console.earlySetup = true;
system.stateVersion = "25.05";
}
+32
View File
@@ -0,0 +1,32 @@
{ ... }:
{
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
max-jobs = 1;
cores = 0;
substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
"https://ezkea.cachix.org"
"https://noctalia.cachix.org"
"https://hyprland.cachix.org"
"https://cache.garnix.io"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"ezkea.cachix.org-1:ioBmUbJTZIKsHmWWXPe1FSFbeVe+afhfgqgTSNd34eI="
"noctalia.cachix.org-1:pCOR47nnMEo5thcxNDtzWpOxNFQsBRglJzxWPp3dkU4="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
};
programs.nix-ld.enable = true;
}
+37
View File
@@ -0,0 +1,37 @@
{
pkgs,
...
}:
{
users.users.elars = {
isNormalUser = true;
description = "elars";
extraGroups = [
"networkmanager"
"wheel"
"docker"
"video"
"audio"
"lp"
"scanner"
"libvirtd"
"plugdev"
];
shell = pkgs.zsh;
};
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/elars/copland";
};
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
};
}
+8
View File
@@ -0,0 +1,8 @@
{ ... }:
{
imports = [
./docker
./virt-manager
];
}
+5
View File
@@ -0,0 +1,5 @@
{ ... }:
{
virtualisation.docker.enable = true;
}
+6
View File
@@ -0,0 +1,6 @@
{ ... }:
{
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
}