commit 455af8b45e27b8f95524f2ac1c30e215196b0f28 Author: KYS Date: Tue Sep 23 16:37:32 2025 +0200 Max best skibidi config base diff --git a/conf/desks/.default/configuration.nix b/conf/desks/.default/configuration.nix new file mode 100644 index 0000000..156a710 --- /dev/null +++ b/conf/desks/.default/configuration.nix @@ -0,0 +1 @@ +{...}:{} diff --git a/conf/desks/.default/hardware-configuration.nix b/conf/desks/.default/hardware-configuration.nix new file mode 100644 index 0000000..156a710 --- /dev/null +++ b/conf/desks/.default/hardware-configuration.nix @@ -0,0 +1 @@ +{...}:{} diff --git a/conf/desks/.default/users.nix b/conf/desks/.default/users.nix new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/conf/desks/.default/users.nix @@ -0,0 +1 @@ +[] diff --git a/conf/desks/max-desktop/.system b/conf/desks/max-desktop/.system new file mode 100644 index 0000000..1877bdc --- /dev/null +++ b/conf/desks/max-desktop/.system @@ -0,0 +1 @@ +x86_64-linux diff --git a/conf/desks/max-desktop/configuration.nix b/conf/desks/max-desktop/configuration.nix new file mode 100644 index 0000000..c506a83 --- /dev/null +++ b/conf/desks/max-desktop/configuration.nix @@ -0,0 +1,96 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + networking.networkmanager.enable = true; + + ## Time & Locale + time.timeZone = "Europe/Prague"; + + i18n = { + defaultLocale = "en_US.UTF-8"; + supportedLocales = [ + "en_US.UTF-8/UTF-8" + "cs_CZ.UTF-8/UTF-8" + ]; + }; + + ## Font rendering + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + + fonts = { + fontconfig.enable = true; + packages = with pkgs; [ + nerd-fonts.jetbrains-mono + noto-fonts + ]; + }; + + ## Shells + programs = { + bash.enable = true; + zsh.enable = true; + }; + + ## Hyprland + programs.hyprland.enable = true; + services.xserver.enable = false; # Pure Wayland, no X11 + + ## SDDM + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + + ## Graphics + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = with pkgs; [ vulkan-tools ]; + }; + + ## Audio + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + jack.enable = true; + }; + + ## System Packages + environment.systemPackages = with pkgs; [ + vesktop + unzip + + firefox # Browser + kitty # Terminal + waybar # Top bar + wofi # App launcher + alacritty # Wayland terminal + grim # Screenshots + slurp # Selection for screenshots + wl-clipboard # Clipboard integration + hyprpaper # Wallpaper manager + hyprlock # Lock screen + hyprsunset # Optional: Night light + pavucontrol # PulseAudio control + # NOT IN STABLE NIX YET => nix-sweep # Nix analyze and cleanup tool + ]; + + ## Auto nix GC + nix.gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + }; + + ## Security / Firewall + networking.firewall.enable = true; + networking.firewall.allowedTCPPorts = []; +} diff --git a/conf/desks/max-desktop/hardware-configuration.nix b/conf/desks/max-desktop/hardware-configuration.nix new file mode 100755 index 0000000..47c914a --- /dev/null +++ b/conf/desks/max-desktop/hardware-configuration.nix @@ -0,0 +1,41 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c9fa332d-e02e-4e7b-8e0e-6ef36899f4f2"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/725E-1771"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.docker0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wwp0s20f0u2c2.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/conf/desks/max-desktop/users.nix b/conf/desks/max-desktop/users.nix new file mode 100644 index 0000000..c86a838 --- /dev/null +++ b/conf/desks/max-desktop/users.nix @@ -0,0 +1 @@ +["maxmen11"] diff --git a/conf/users/.default/home.nix b/conf/users/.default/home.nix new file mode 100644 index 0000000..156a710 --- /dev/null +++ b/conf/users/.default/home.nix @@ -0,0 +1 @@ +{...}:{} diff --git a/conf/users/.default/hypr/settings.nix b/conf/users/.default/hypr/settings.nix new file mode 100644 index 0000000..9f3d2af --- /dev/null +++ b/conf/users/.default/hypr/settings.nix @@ -0,0 +1,16 @@ +{ + ... +}: +{ + monitor = [ + "eDP-1,1920x1080@60,0x0,1" + "HDMI-A-1,2560x1440@144,1920x0,1" + ]; + + misc = { + "vrr" = "0"; + #"disable_hyprland_logo" = "true"; + "disable_splash_rendering" = "true"; + "force_default_wallpaper" = "0"; + }; +} diff --git a/conf/users/.default/user.nix b/conf/users/.default/user.nix new file mode 100644 index 0000000..13cf788 --- /dev/null +++ b/conf/users/.default/user.nix @@ -0,0 +1,10 @@ +{ + pkgs, + ... +}: +{ + isNormalUser = true; + packages = with pkgs; [ + busybox + ]; +} diff --git a/conf/users/maxmen11/home.nix b/conf/users/maxmen11/home.nix new file mode 100644 index 0000000..69bba67 --- /dev/null +++ b/conf/users/maxmen11/home.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: +{ + home.packages = with pkgs; [ + waybar + vim + neovim + ncdu + ]; + + wayland.windowManager.hyprland.enable = true; +} + diff --git a/conf/users/maxmen11/hypr/settings.nix b/conf/users/maxmen11/hypr/settings.nix new file mode 100644 index 0000000..f0c02de --- /dev/null +++ b/conf/users/maxmen11/hypr/settings.nix @@ -0,0 +1,28 @@ +{ + pkgs, + ... +}: +let + sx = k: w: "$S, ${k}, exec, ${w}"; + ws = k: w: + ["$S+Alt, ${toString k}, movetoworkspacesilent, ${toString w}" + "$S+Shift, ${toString k}, movetoworkspace, ${toString w}" + "$S, ${toString k}, workspace, ${toString w}"]; + ws_mul = start: end: + if start > end then [] + else ws (if start == 10 then 0 else start) start + ++ ws_mul (start + 1) end; +in +{ + "$S" = "SUPER"; + "$T" = "${pkgs.alacritty}/bin/alacritty"; + "$B" = "${pkgs.librewolf}/bin/librewolf"; + "$L" = "${pkgs.rofi}/bin/rofi -show drun"; + bind = [ + "$S, Q, killactive" + (sx "T" "$T") + (sx "A" "$L") + (sx "F" "$B") + ] + ++ (ws_mul 1 10); +} diff --git a/conf/users/maxmen11/user.nix b/conf/users/maxmen11/user.nix new file mode 100644 index 0000000..287002a --- /dev/null +++ b/conf/users/maxmen11/user.nix @@ -0,0 +1,17 @@ +{ + pkgs, + ... +}: +{ + extraGroups = ["wheel" "networkmanager" "audio" "video"]; + hashedPassword = "$6$rnX2VsB4m/aUEIci$jkVmLKyAIIZKs8CP1jMBA58fSjCk7WefF/avpqIxeMIccGBGqJ.q/84z1BCgkxSMBilAATnQrSvpNGKvswNIk/"; + packages = with pkgs; [ + tree + vim + git + neofetch + neovim + htop + ncdu + ]; +} diff --git a/coreConfiguration.nix b/coreConfiguration.nix new file mode 100755 index 0000000..ff4fc32 --- /dev/null +++ b/coreConfiguration.nix @@ -0,0 +1,72 @@ +{ + config, + pkgs, + lib, + self, + ... +}: +let + desktop = builtins.head (builtins.attrNames (self.nixosConfigurations or {})); + nixLoadwArgsElse = path: args: _else: + if builtins.pathExists path + then import path args + else _else; + nixLoadElse = path: _else: + if builtins.pathExists path + then import path + else _else; + nixLoadwArgs = path: args: nixLoadwArgsElse path args {}; + nixLoadDefArgs = path: nixLoadwArgs path {inherit config pkgs lib;}; + nixLoad = path: nixLoadElse path {}; + + confDesksDir = ./conf/desks; + confUsersDir = ./conf/users; + confUserNames = import "${confDesksDir}/${desktop}/users.nix" + ++ nixLoadElse "${confDesksDir}/.default/users.nix" []; + confUserDefDir = "${confUsersDir}/.default/"; + defUserConfig = nixLoadDefArgs "${confUserDefDir}user.nix"; + defHomeConfig = nixLoadDefArgs "${confUserDefDir}home.nix"; + defHyprSettings = nixLoadDefArgs "${confUserDefDir}hypr/settings.nix"; + + sysUser = name: { + inherit name; + value = let + userConfig = nixLoadDefArgs "${confUsersDir}/${name}/user.nix"; + in + lib.mkMerge [ + { + home = "/home/${name}"; + } + defUserConfig + userConfig + ]; + }; + + homeUser = name: { + inherit name; + value = let + homeConfig = nixLoadDefArgs ("${confUsersDir}/${name}/home.nix"); + hyprSettings = nixLoadDefArgs ("${confUsersDir}/${name}/hypr/settings.nix"); + in + lib.mkMerge [ + { + home.username = name; + home.homeDirectory = "/home/${name}"; + home.stateVersion = "25.05"; + programs.home-manager.enable = true; + wayland.windowManager.hyprland.settings = lib.mkMerge [ defHyprSettings hyprSettings ]; + } + defHomeConfig + homeConfig + ]; + }; +in +{ + nix.settings.experimental-features = ["nix-command" "flakes"]; + users.users = builtins.listToAttrs (map sysUser confUserNames); + home-manager.users = builtins.listToAttrs (map homeUser confUserNames); + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + networking.hostName = desktop; + system.stateVersion = "25.05"; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4b89855 --- /dev/null +++ b/flake.lock @@ -0,0 +1,62 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1758464306, + "narHash": "sha256-i56XRXqjwJRdVYmpzVUQ0ktqBBHqNzQHQMQvFRF/acQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "939e91e1cff1f99736c5b02529658218ed819a2a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1758277210, + "narHash": "sha256-iCGWf/LTy+aY0zFu8q12lK8KuZp7yvdhStehhyX1v8w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8eaee110344796db060382e15d3af0a9fc396e0e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1758277210, + "narHash": "sha256-iCGWf/LTy+aY0zFu8q12lK8KuZp7yvdhStehhyX1v8w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8eaee110344796db060382e15d3af0a9fc396e0e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..a76ee30 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "KYS"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager"; + }; + + outputs = { self, nixpkgs, home-manager }: { + + nixosConfigurations = let + confDesksDir = ./conf/desks; + confDesks = builtins.filter (n: n != ".default") (builtins.attrNames (builtins.readDir confDesksDir)); + deskBase = desk: { + name = desk; + value = nixpkgs.lib.nixosSystem { + system = builtins.readFile "${confDesksDir}/${desk}/.system"; + modules = [ + ./coreConfiguration.nix + "${confDesksDir}/.default/configuration.nix" + "${confDesksDir}/.default/hardware-configuration.nix" + "${confDesksDir}/${desk}/configuration.nix" + "${confDesksDir}/${desk}/hardware-configuration.nix" + home-manager.nixosModules.home-manager + ]; + specialArgs = { + inherit self; + }; + }; + }; + in builtins.listToAttrs (map deskBase confDesks); + }; +}