From 37ff9e91ff41f3f51c6477ee4f6509e2c634ee94 Mon Sep 17 00:00:00 2001 From: 4DBug <4DBug@github.com> Date: Wed, 4 Feb 2026 16:43:38 -0600 Subject: [PATCH] push --- new/device.nix | 1 + new/devices/desktop.nix | 8 + new/devices/laptop.nix | 8 + new/devices/server.nix | 22 +++ new/flake.nix | 48 +++++ new/main.nix | 101 ++++++++++ new/modules/audio.nix | 24 +++ new/modules/boot.nix | 37 ++++ new/modules/cosmic.nix | 62 ++++++ new/modules/graphics.nix | 83 ++++++++ new/modules/home-manager.nix | 4 + new/modules/locale.nix | 21 ++ new/modules/mailserver.nix | 45 +++++ new/modules/mpd.nix | 37 ++++ new/modules/network.nix | 25 +++ new/modules/packages.nix | 344 +++++++++++++++++++++++++++++++++ new/modules/security.nix | 12 ++ new/modules/swap.nix | 17 ++ new/modules/users.nix | 19 ++ new/modules/virtualisation.nix | 9 + new/modules/vscode-server.nix | 7 + 21 files changed, 934 insertions(+) create mode 100644 new/device.nix create mode 100644 new/devices/desktop.nix create mode 100644 new/devices/laptop.nix create mode 100644 new/devices/server.nix create mode 100644 new/flake.nix create mode 100644 new/main.nix create mode 100644 new/modules/audio.nix create mode 100644 new/modules/boot.nix create mode 100644 new/modules/cosmic.nix create mode 100644 new/modules/graphics.nix create mode 100644 new/modules/home-manager.nix create mode 100644 new/modules/locale.nix create mode 100644 new/modules/mailserver.nix create mode 100644 new/modules/mpd.nix create mode 100644 new/modules/network.nix create mode 100644 new/modules/packages.nix create mode 100644 new/modules/security.nix create mode 100644 new/modules/swap.nix create mode 100644 new/modules/users.nix create mode 100644 new/modules/virtualisation.nix create mode 100644 new/modules/vscode-server.nix diff --git a/new/device.nix b/new/device.nix new file mode 100644 index 0000000..5a0213e --- /dev/null +++ b/new/device.nix @@ -0,0 +1 @@ +{ device = "laptop"; } # Possible values: "desktop", "laptop", "server" \ No newline at end of file diff --git a/new/devices/desktop.nix b/new/devices/desktop.nix new file mode 100644 index 0000000..0446f5a --- /dev/null +++ b/new/devices/desktop.nix @@ -0,0 +1,8 @@ +{ lib, config, inputs, pkgs, options, desktop, ... }: + +{ + imports = [ + ../modules/cosmic.nix + ../modules/graphics.nix + ] +} \ No newline at end of file diff --git a/new/devices/laptop.nix b/new/devices/laptop.nix new file mode 100644 index 0000000..b97dcc5 --- /dev/null +++ b/new/devices/laptop.nix @@ -0,0 +1,8 @@ +{ config, pkgs, device, ... }: + +{ + services.logind.settings.Login = { + HandleLidSwitch = "ignore"; + HandleLidSwitchDocked = "ignore"; + }; +} \ No newline at end of file diff --git a/new/devices/server.nix b/new/devices/server.nix new file mode 100644 index 0000000..47a6993 --- /dev/null +++ b/new/devices/server.nix @@ -0,0 +1,22 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ../modules/vscode-server.nix + ../modules/mailserver.nix + ]; + + environment.systemPackages = with pkgs; [ + nh + comma + nix-index + + home-manager + + micro + wget + git + + fastfetch + ]; +} \ No newline at end of file diff --git a/new/flake.nix b/new/flake.nix new file mode 100644 index 0000000..55e67ae --- /dev/null +++ b/new/flake.nix @@ -0,0 +1,48 @@ +{ + inputs = { + # nixpkgs.follows = "nixos-cosmic/nixpkgs"; + + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + flatpaks.url = "github:gmodena/nix-flatpak/?ref=latest"; + + nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic"; + + hytale-launcher.url = "github:JPyke3/hytale-launcher-nix"; + + stylix = { + url = "github:nix-community/stylix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + vscode-server.url = "github:nix-community/nixos-vscode-server"; + }; + + outputs = inputs@{ self, nixpkgs, stylix, home-manager, flatpaks, hytale-launcher, vscode-server, ... }: + let + deviceType = import /etc/nixos/device.nix; + system = "x86_64-linux"; + in + { + nixosConfigurations.nix = nixpkgs.lib.nixosSystem { + inherit system; + + specialArgs = { inherit inputs; inherit (deviceType) desktop; }; + + modules = [ + { + nix.settings = { + substituters = [ "https://cosmic.cachix.org/" ]; + trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; + }; + } + + flatpaks.nixosModules.nix-flatpak + + vscode-server.nixosModules.default + + ./configuration.nix + ]; + }; + }; +} diff --git a/new/main.nix b/new/main.nix new file mode 100644 index 0000000..3617b5b --- /dev/null +++ b/new/main.nix @@ -0,0 +1,101 @@ +{ lib, config, inputs, pkgs, options, device, ... }: + +{ + imports = [ + /etc/nixos/hardware-configuration.nix + + ./modules/users.nix + ./modules/boot.nix + ./modules/network.nix + ./modules/locale.nix + ./modules/security.nix + ] ++ (if device == "server" then [ + ./modules/packages.nix + ./modules/vscode-server.nix + + ({ config, pkgs, ... }: { + environment.systemPackages = with pkgs; [ + nh comma nix-index home-manager micro wget git fastfetch + ]; + }) + ] else [ + ./modules/packages.nix + ./modules/cosmic.nix + ./modules/graphics.nix + ./modules/audio.nix + ./modules/home-manager.nix + ./modules/mpd.nix + ./modules/swap.nix + ./modules/virtualisation.nix + ]); + + system = { + stateVersion = "25.11"; + + autoUpgrade = { + enable = true; + allowReboot = true; + }; + }; + + nix = { + optimise.automatic = true; + settings.experimental-features = [ "nix-command" "flakes" ]; + }; + + nixpkgs = { + config = { + allowUnfree = true; + + cudaSupport = (device == "desktop"); + nvidia.acceptLicense = (device == "desktop"); + }; + + overlays = [ + + ]; + }; + + environment.sessionVariables.NIXPKGS_ALLOW_UNFREE = 1; + + systemd = { + user.extraConfig = '' + DefaultEnvironment="PATH=/run/current-system/sw/bin" + ''; + + services.monitord.wantedBy = [ "multi-user.target" ]; + }; + + services.fstrim.enable = true; + + programs = { + bash.shellAliases = { + fetch = "fastfetch --file ~/nix/nix.ans"; + + rebuild = "ns os switch ~/nix"; #"sudo nixos-rebuild switch --impure"; # home-manager switch --impure + + #pissh = "ssh -t $(avahi-resolve-host-name -4 pi.home | awk '{print $2}')"; + #pi = "pissh \"cd $(pwd) && bash\""; + #pi = "ssh pi.bug.tools"; + box = "ssh box.bug.tools"; + + pico = "ssh pico.sh"; + + # tuns name port + tuns = "bash -c '\''if [ \"$#\" -ne 2 ]; then echo \"Usage: tun name port\"; exit 1; fi; +if [[ \"$1\" =~ ^[0-9]+$ ]]; then port=\"$1\"; name=\"$2\"; +elif [[ \"$2\" =~ ^[0-9]+$ ]]; then port=\"$2\"; name=\"$1\"; +else echo \"Error: One argument must be a number (port)\"; exit 1; fi; +ssh -R \"$\{name}:80:localhost:$\{port}\" tuns.sh'\'' _"; + + # pgs name directory + pgs = "bash -c '\''if [ \"$#\" -ne 2 ]; then echo \"Usage: pgs NAME DIRECTORY\"; exit 1; fi; rsync -rv \"$2\" pgs.sh:/\"$1\"'\'' _"; + + bambu = "env -u WAYLAND_DISPLAY XDG_SESSION_TYPE=x11 WEBKIT_FORCE_COMPOSITING_MODE=1 WEBKIT_DISABLE_COMPOSITING_MODE=1 GBM_BACKEND=dri bambu-studio"; + + scale = "env GDK_BACKEND=x11 GDK_SCALE=1 GDK_DPI_SCALE=1"; + + hytale = "env -u WAYLAND_DISPLAY -u EGL_PLATFORM -u ELECTRON_ENABLE_WAYLAND DISPLAY=:0 XDG_SESSION_TYPE=x11 __GLX_VENDOR_LIBRARY_NAME=nvidia LD_LIBRARY_PATH=/run/opengl-driver/lib hytale-launcher"; + }; + }; +} diff --git a/new/modules/audio.nix b/new/modules/audio.nix new file mode 100644 index 0000000..a27f3c0 --- /dev/null +++ b/new/modules/audio.nix @@ -0,0 +1,24 @@ +{ config, pkgs, device, ... }: + +{ + security.rtkit.enable = true; + + services = { + pulseaudio.enable = false; + + pipewire = { + enable = true; + + wireplumber.enable = true; + + alsa.enable = true; + alsa.support32Bit = true; + + pulse.enable = true; + + lowLatency.enable = false; + + jack.enable = true; + }; + } +} \ No newline at end of file diff --git a/new/modules/boot.nix b/new/modules/boot.nix new file mode 100644 index 0000000..8eebc51 --- /dev/null +++ b/new/modules/boot.nix @@ -0,0 +1,37 @@ +{ config, pkgs, device, ... }: + +{ + boot = { + kernelModules = if (device == "desktop") then ["nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" "uinput"] else []; + kernelParams = if (device == "desktop") then ["nvidia-drm.modeset=1" "nvidia_drm.fbdev=1"] else []; + + kernelPackages = pkgs.linuxPackages_zen; + + kernel.sysctl = { + "fs.file-max" = 524288; + }; + + initrd.checkJournalingFS = false; + + loader = { + grub.splashImage = null; + + systemd-boot = { + enable = true; + configurationLimit = 25; + }; + + efi.canTouchEfiVariables = true; + }; + }; + + swapDevices = [{ + device = "/var/lib/swapfile"; + size = 8 * 1024; + }]; + + zramSwap = { + enable = true; + memoryMax = 64 * 1024 * 1024 * 1024; + }; +} \ No newline at end of file diff --git a/new/modules/cosmic.nix b/new/modules/cosmic.nix new file mode 100644 index 0000000..5d53d54 --- /dev/null +++ b/new/modules/cosmic.nix @@ -0,0 +1,62 @@ +{ config, pkgs, device, ... }: + +{ + services = { + greetd.enable = true; + + system76-scheduler.enable = true; + + displayManager = { + cosmic-greeter.enable = true; + + autoLogin = { + enable = (device == "desktop"); + user = "bug"; + }; + }; + + desktopManager.cosmic.enable = true; + }; + + environment.sessionVariables = { + COSMIC_DATA_CONTROL_ENABLED = 1; + }; + + xdg = { + portal = { + enable = true; + xdgOpenUsePortal = true; + + config.common.default = ["gtk"]; + + extraPortals = [pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-cosmic]; + }; + + mime = { + enable = true; + + defaultApplications = { + "text/html" = "firefox.desktop"; + "x-scheme-handler/http" = "firefox.desktop"; + "x-scheme-handler/https" = "firefox.desktop"; + "x-scheme-handler/about" = "firefox.desktop"; + "x-scheme-handler/unknown" = "firefox.desktop"; + "application/pdf" = "firefox.desktop"; + + "inode/directory" = "com.system76.CosmicFiles.desktop"; + + "text/plain" = "com.system76.CosmicEdit.desktop"; + "text/markdown" = "com.system76.CosmicEdit.desktop"; + + "application/zip" = "org.gnome.FileRoller.desktop"; + "application/x-7z-compressed" = "org.gnome.FileRoller.desktop"; + "application/x-tar" = "org.gnome.FileRoller.desktop"; + "application/gzip" = "org.gnome.FileRoller.desktop"; + "application/x-xz" = "org.gnome.FileRoller.desktop"; + "application/x-zip-compressed" = "org.gnome.FileRoller.desktop"; + + "application/x-ms-dos-executable" = "wine.desktop"; + }; + }; + }; +} \ No newline at end of file diff --git a/new/modules/graphics.nix b/new/modules/graphics.nix new file mode 100644 index 0000000..ca9df7d --- /dev/null +++ b/new/modules/graphics.nix @@ -0,0 +1,83 @@ +{ config, pkgs, device, ... }: + +{ + services = { + xserver = { + enable = true; + + videoDrivers = if (device == "desktop") then ["nvidia"] else ["amdgpu"]; + excludePackages = [pkgs.xterm]; + + xkb = { + layout = "us"; + variant = ""; + }; + }; + }; + + hardware = { + graphics = { + enable = true; + enable32Bit = true; + + extraPackages = with pkgs; [ + libva-vdpau-driver + libvdpau + libvdpau-va-gl + vdpauinfo + libva + libva-utils + libglvnd + mesa + ] ++ (if desktop then [ + nvidia-vaapi-driver + ] else [ + + ]); + }; + + nvidia = if desktop then { + modesetting.enable = true; + + powerManagement.enable = false; + powerManagement.finegrained = false; + + open = false; + + nvidiaSettings = true; + + package = config.boot.kernelPackages.nvidiaPackages.beta; + + nvidiaPersistenced = true; + } else {}; + + enableRedistributableFirmware = true; + }; + + + environment = { + variables = { + + } // (if (device == "desktop") then { + WGPU_BACKEND = "gl"; + GBM_BACKEND = "nvidia-drm"; + LIBVA_DRIVER_NAME = "nvidia"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + EGL_PLATFORM = "wayland"; + } else { + + }); + + sessionVariables = { + WEBKIT_DISABLE_COMPOSITING_MODE = "1"; + } // (if (device == "desktop") then { + WGPU_BACKEND = "gl"; + GBM_BACKEND = "nvidia-drm"; + LIBVA_DRIVER_NAME = "nvidia"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + EGL_PLATFORM = "wayland"; + } else { + + }); + }; +} \ No newline at end of file diff --git a/new/modules/home-manager.nix b/new/modules/home-manager.nix new file mode 100644 index 0000000..692937f --- /dev/null +++ b/new/modules/home-manager.nix @@ -0,0 +1,4 @@ +{ config, pkgs, device, ... }: + +{ +} \ No newline at end of file diff --git a/new/modules/locale.nix b/new/modules/locale.nix new file mode 100644 index 0000000..a7802f0 --- /dev/null +++ b/new/modules/locale.nix @@ -0,0 +1,21 @@ +{ config, pkgs, device, ... }: + +{ + time.timeZone = "America/Chicago"; + + i18n = { + defaultLocale = "en_US.UTF-8"; + + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + }; +} \ No newline at end of file diff --git a/new/modules/mailserver.nix b/new/modules/mailserver.nix new file mode 100644 index 0000000..5adc563 --- /dev/null +++ b/new/modules/mailserver.nix @@ -0,0 +1,45 @@ +{ config, pkgs, device, ... }: + +{ + imports = [ + (builtins.fetchTarball { + url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/master.tar.gz"; + + sha256 = "0xlhl8zhcz5c6hvmpkfw9ay2lfnk6nhax8pphvbv3vzxf1p9dhw9"; + }) + ]; + + security.acme = { + acceptTerms = true; + defaults.email = "security@bug.tools"; + + certs."mail.bug.tools" = { + listenHTTP = "1360"; + }; + }; + + mailserver = { + enable = true; + + stateVersion = 3; + + fqdn = "mail.bug.tools"; + domains = [ "bug.tools" ]; + + x509.useACMEHost = "mail.bug.tools"; + + loginAccounts = { + "bug@bug.tools" = { + hashedPasswordFile = "/home/bug/mailserver/bug.passwd"; + aliases = [ + "admin@bug.tools" + "google@bug.tools" + ]; + }; + + "pare@bug.tools" = { + hashedPasswordFile = "/home/bug/mailserver/pare.passwd"; + }; + }; + }; +} \ No newline at end of file diff --git a/new/modules/mpd.nix b/new/modules/mpd.nix new file mode 100644 index 0000000..7502a2f --- /dev/null +++ b/new/modules/mpd.nix @@ -0,0 +1,37 @@ +{ config, pkgs, device, ... }: + +{ + services = { + mpd = { + enable = (device == "laptop"); + + settings = { + music_directory = "/run/media/bug/Music/"; + + decoder = [ + { + plugin = "ffmpeg"; + enabled = "yes"; + } + { + plugin = "opus"; + enabled = "no"; + } + ]; + + audio_output = [{ + type = "pipewire"; + name = "PipeWire Sound Server"; + }]; + }; + + user = "bug"; + }; + }; + + systemd.services = { + mpd.environment = { + XDG_RUNTIME_DIR = "/run/user/1000"; + }; + }; +} \ No newline at end of file diff --git a/new/modules/network.nix b/new/modules/network.nix new file mode 100644 index 0000000..d212af2 --- /dev/null +++ b/new/modules/network.nix @@ -0,0 +1,25 @@ +{ config, pkgs, device, ... }: + +{ + networking = { + hostName = if (device == "server") then "box" else "nix"; + + networkmanager.enable = true; + + nameservers = ["1.1.1.1" "1.0.0.1"]; + }; + + services = { + cloudflare-warp.enable = (device == "laptop"); + + openssh = { + enable = true; + + settings = { + PrintMotd = true; + X11Forwarding = true; + AllowTcpForwarding = true; + }; + }; + }; +} \ No newline at end of file diff --git a/new/modules/packages.nix b/new/modules/packages.nix new file mode 100644 index 0000000..ecaafab --- /dev/null +++ b/new/modules/packages.nix @@ -0,0 +1,344 @@ +{ lib, config, inputs, pkgs, options, desktop, ... }: + +let + nix-gaming = import (builtins.fetchTarball "https://github.com/fufexan/nix-gaming/archive/master.tar.gz"); + + nix-alien = import ( + builtins.fetchTarball "https://github.com/thiagokokada/nix-alien/tarball/master" + ) {}; +in +{ + imports = [ + nix-gaming.nixosModules.platformOptimizations + nix-gaming.nixosModules.pipewireLowLatency + ]; + + nixpkgs = { + config = { + allowUnfree = true; + + cudaSupport = (device == "desktop"); + nvidia.acceptLicense = (device == "desktop"); + }; + + overlays = [ + + ]; + }; + + environment.sessionVariables = { + BROWSER = "firefox"; + NIXPKGS_ALLOW_UNFREE = 1; + }; + + users.users.bug.packages = with pkgs; [ + vscode + + (luajit.withPackages (ps: with ps; [ + luasocket + bit32 + ])) + + go + + (python3.withPackages (ps: with ps; [ + unidecode + discordpy + setuptools + + pip + pynput + python-uinput + + mido + + pyautogui + pygobject3 + pycairo + + tkinter + + numpy + scipy + imageio + + evdev + ])) + + nodejs + + (blender.withPackages (ps: with ps; [ + libGLU + gcc + zlib + xorg.libX11 + fontconfig + pcre2 + xorg.libXext + xorg.libxcb + glib + ])) + + plasticity + obsidian + vesktop + nicotine-plus + fastfetch + tree + gh + scanmem + samrewritten + impression + + mission-center + + authenticator + + steamtinkerlaunch + + obs-studio + + #prismlauncher + + euphonica + + kooha + + loupe + + arduino-ide + + geary + ]; + + environment.systemPackages = with pkgs; [ + home-manager + comma + nix-index + + git + wget + + gcc + gnumake + + nmap + inetutils + + nix-prefetch + nix-output-monitor + nvd + + nixfmt + nixd + nil + + nh + + gnome-boxes + + openjdk + zlib + glfw + glew + + wine64 + wineWow64Packages.full + + lug-helper + + appimage-run + + vulkan-tools + vulkan-validation-layers + vulkan-loader + + pulseaudioFull + + gamemode + + winetricks + + steam-run + + firmware-updater + + cosmic-applets + cosmic-edit + cosmic-ext-calculator + cosmic-ext-tweaks + cosmic-screenshot + quick-webapps + + nix-alien.nix-alien + + file-roller + unzip + + xdg-desktop-portal-gtk + xdg-desktop-portal-cosmic + + mangohud + mesa-demos + + lutris + + gnome-software + + neovim + + micro + + inputs.hytale-launcher.packages.${pkgs.system}.default + + baobab + ] ++ (if desktop then [ + (nix-gaming.packages.${pkgs.stdenv.hostPlatform.system}.star-citizen.override { + tricks = [ "arial" "vcrun2019" "win10" "sound=alsa" ]; + }) + + libxshmfence + + (appimage-run.override { + extraPkgs = pkgs: [ pkgs.xorg.libxshmfence pkgs.linuxPackages.nvidia_x11 ]; + }) + ] else [ + bambu-studio + ]); + + services = { + flatpak = { + enable = true; + + remotes = lib.mkOptionDefault [{ + name = "flathub-beta"; + location = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo"; + }]; + + update.auto.enable = true; + uninstallUnmanaged = true; + + packages = [ + "org.vinegarhq.Sober" + "org.vinegarhq.Vinegar" + "org.gnome.Decibels" + "org.pipewire.Helvum" + "community.pathofbuilding.PathOfBuilding" + + { + appId = "com.hytale.Launcher"; + sha256 = "sha256-SUxfyovC2umZmsOj5bOTZ8WfGCpnWcz7svOESwNekV0="; + bundle = "${pkgs.fetchurl { + url = "https://launcher.hytale.com/builds/release/linux/amd64/hytale-launcher-latest.flatpak"; + sha256 = "sha256-SUxfyovC2umZmsOj5bOTZ8WfGCpnWcz7svOESwNekV0="; + }}"; + } + + # add Polytoria client + # https://cdn.polytoria.com/releases/installer/linux/Polytoria%20Setup%204.12.0.flatpak + + { + appId = "com.polytoria.launcher"; + sha256 = "sha256-VjhNiJfSdCtlH2SuP3Mn8jjOrx5xcOqhtDKaWYIwxYg="; + bundle = "${pkgs.fetchurl { + url = "https://github.com/4DBug/poly/releases/download/poly/poly.flatpak"; + sha256 = "sha256-VjhNiJfSdCtlH2SuP3Mn8jjOrx5xcOqhtDKaWYIwxYg="; + }}"; + } + ]; + + overrides = { + global = { + Context.sockets = ["wayland" "!x11" "!fallback-x11"]; + }; + }; + }; + + ollama = { + enable = false; + + loadModels = [ "llama3.2:3b" "deepseek-r1:1.5b" "deepseek-r1:8b"]; + }; + }; + + fonts = { + fontDir.enable = true; + enableDefaultPackages = true; + + packages = with pkgs; [ + twitter-color-emoji + nerd-fonts.fira-code + nerd-fonts.droid-sans-mono + ]; + + fontconfig = { + enable = true; + useEmbeddedBitmaps = true; + + defaultFonts = { + emoji = [ "Twitter Color Emoji" ]; + }; + }; + }; + + programs = { + appimage = { + enable = true; + binfmt = true; + }; + + firefox = { + enable = true; + + package = pkgs.firefox-bin; + }; + + steam = { + enable = true; + + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = false; + + localNetworkGameTransfers.openFirewall = true; + + gamescopeSession.enable = true; + + extraCompatPackages = with pkgs; [ + proton-ge-bin + ]; + + platformOptimizations.enable = true; + }; + + ydotool.enable = true; + + gamescope = { + enable = true; + capSysNice = true; + args = [ + "--rt" + "--expose-wayland" + ]; + }; + + virt-manager.enable = true; + + nix-ld = { + enable = true; + + libraries = options.programs.nix-ld.libraries.default ++ (with pkgs; [ + libxml2 + udev + gcc + egl-wayland + mesa + libglvnd + wayland + xorg.libX11 + xorg.libXcursor + xorg.libXrandr + xorg.libXi + ]); + }; + }; +} \ No newline at end of file diff --git a/new/modules/security.nix b/new/modules/security.nix new file mode 100644 index 0000000..cb53492 --- /dev/null +++ b/new/modules/security.nix @@ -0,0 +1,12 @@ +{ config, pkgs, device, ... }: + +{ + security = { + polkit.enable = true; + + sudo = { + enable = true; + wheelNeedsPassword = false; + }; + }; +} \ No newline at end of file diff --git a/new/modules/swap.nix b/new/modules/swap.nix new file mode 100644 index 0000000..c7c0f3f --- /dev/null +++ b/new/modules/swap.nix @@ -0,0 +1,17 @@ +{ config, pkgs, device, ... }: + +{ + boot.kernel.sysctl = { + "fs.file-max" = 524288; + }; + + swapDevices = [{ + device = "/var/lib/swapfile"; + size = 8 * 1024; + }]; + + zramSwap = { + enable = true; + memoryMax = 64 * 1024 * 1024 * 1024; + }; +} \ No newline at end of file diff --git a/new/modules/users.nix b/new/modules/users.nix new file mode 100644 index 0000000..dc1dd15 --- /dev/null +++ b/new/modules/users.nix @@ -0,0 +1,19 @@ +{ config, pkgs, device, ... }: + +{ + users.users = { + bug = { + isNormalUser = true; + description = "bug"; + extraGroups = [ "networkmanager" "wheel" "audio" "video" "libvirtd" "ydotool" "dialout" ]; + }; + } // (if (device == "server") then { + levi = { + isNormalUser = true; + description = "levi"; + extraGroups = [ "wheel"]; + + hashedPassword = "$6$AqsDy7oxFOpjKZLM$kD0y3sc1b9xPTveqThhv2EyyhDh0WELrznYwCOQmZzVqEVWs6iG8PmLMstWSfpdloljciEW09u8vTRi1h0EBw1"; + }; + } else {}); +} \ No newline at end of file diff --git a/new/modules/virtualisation.nix b/new/modules/virtualisation.nix new file mode 100644 index 0000000..e64709e --- /dev/null +++ b/new/modules/virtualisation.nix @@ -0,0 +1,9 @@ +{ config, pkgs, device, ... }: + +{ + virtualisation = { + libvirtd.enable = true; + + spiceUSBRedirection.enable = true; + }; +} \ No newline at end of file diff --git a/new/modules/vscode-server.nix b/new/modules/vscode-server.nix new file mode 100644 index 0000000..4af3615 --- /dev/null +++ b/new/modules/vscode-server.nix @@ -0,0 +1,7 @@ +{ config, pkgs, device, ... }: + +{ + services = { + vscode-server.enable = true; + }; +} \ No newline at end of file