My NixOS configurations + dotfiles

Inital commit

OCbwoy3 ff816aeb

+448
+6
.editorconfig
··· 1 + root = true 2 + 3 + [*] 4 + indent_style = tab 5 + insert_final_newline = true 6 + indent_size = 4
+7
README.md
··· 1 + # OCbwoy3's Dotfiles 2 + The second ones, because the first ones were too difficult to install. 3 + 4 + Commands you will most likely need: 5 + ```bash 6 + sudo nixos-rebuild switch --flake "~/config/#default" 7 + ```
+48
flake.lock
··· 1 + { 2 + "nodes": { 3 + "home-manager": { 4 + "inputs": { 5 + "nixpkgs": [ 6 + "nixpkgs" 7 + ] 8 + }, 9 + "locked": { 10 + "lastModified": 1730837930, 11 + "narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=", 12 + "owner": "nix-community", 13 + "repo": "home-manager", 14 + "rev": "2f607e07f3ac7e53541120536708e824acccfaa8", 15 + "type": "github" 16 + }, 17 + "original": { 18 + "owner": "nix-community", 19 + "repo": "home-manager", 20 + "type": "github" 21 + } 22 + }, 23 + "nixpkgs": { 24 + "locked": { 25 + "lastModified": 1730785428, 26 + "narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=", 27 + "owner": "nixos", 28 + "repo": "nixpkgs", 29 + "rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7", 30 + "type": "github" 31 + }, 32 + "original": { 33 + "owner": "nixos", 34 + "ref": "nixos-unstable", 35 + "repo": "nixpkgs", 36 + "type": "github" 37 + } 38 + }, 39 + "root": { 40 + "inputs": { 41 + "home-manager": "home-manager", 42 + "nixpkgs": "nixpkgs" 43 + } 44 + } 45 + }, 46 + "root": "root", 47 + "version": 7 48 + }
+35
flake.nix
··· 1 + { 2 + description = "OCbwoy3's Dotfiles"; 3 + 4 + inputs = { 5 + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 6 + catppuccin.url = "github:catppuccin/nix"; 7 + nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1"; 8 + 9 + home-manager = { 10 + url = "github:nix-community/home-manager"; 11 + inputs.nixpkgs.follows = "nixpkgs"; 12 + }; 13 + }; 14 + 15 + # Required by NixOS: 16 + # /etc/nixos/hardware-configuration.nix 17 + 18 + # inputs.home-manager.nixosModules.default 19 + # catppuccin.nixosModules.catppuccin 20 + # nix-flatpak.nixosModules.nix-flatpak 21 + 22 + outputs = { self, nixpkgs, ... }@inputs: { 23 + nixosConfigurations.default = nixpkgs.lib.nixosSystem { 24 + specialArgs = {inherit inputs;}; 25 + modules = [ 26 + inputs.home-manager.nixosModules.default 27 + catppuccin.nixosModules.catppuccin 28 + nix-flatpak.nixosModules.nix-flatpak 29 + /etc/nixos/hardware-configuration.nix 30 + ./hosts/default/configuration.nix 31 + 32 + ]; 33 + }; 34 + }; 35 + }
+58
hosts/default/configuration.nix
··· 1 + { config, pkgs, ... }: 2 + 3 + { 4 + 5 + imports = [ 6 + ../../modules/nixos/nixpkgs.nix 7 + ../../modules/nixos/bootloader.nix 8 + ../../modules/nixos/hardware.nix 9 + ../../modules/nixos/nvidia.nix 10 + ../../modules/nixos/i18n.nix 11 + ../../modules/nixos/main-user.nix 12 + ../../modules/nixos/network.nix 13 + ../../modules/nixos/programs.nix 14 + ./packages.nix 15 + ] 16 + 17 + programs.steam = { 18 + enable = true; 19 + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play 20 + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server 21 + localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers 22 + }; 23 + 24 + services.flatpak.enable = true; 25 + services.flatpak.remotes = [ 26 + { 27 + name = "flathub"; 28 + location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; 29 + }; 30 + { 31 + name = "sober"; 32 + location = "https://sober.vinegarhq.org/repo/" 33 + } 34 + ]; 35 + 36 + services.flatpak.packages = [ 37 + { appId = "org.vinegarhq.Sober"; origin = "sober"; } 38 + ]; 39 + 40 + programs.hyprland = { 41 + # Install the packages from nixpkgs 42 + enable = true; 43 + # Whether to enable XWayland 44 + xwayland.enable = true; 45 + }; 46 + 47 + main-user.userName = "ocbwoy3"; 48 + main-user.realName = "OCbwoy3"; 49 + main-user.packages = with pkgs; [ 50 + brave 51 + prismlauncher 52 + vesktop 53 + ]; 54 + 55 + catppuccin.enable = true; 56 + catppuccin.flavor = "mocha"; 57 + 58 + }
+88
hosts/default/packages.nix
··· 1 + { config, pkgs, ... }: 2 + 3 + { 4 + 5 + fonts.packages = with pkgs; [ 6 + noto-fonts 7 + noto-fonts-cjk-sans 8 + noto-fonts-emoji 9 + monaspace 10 + nerdfonts 11 + ]; 12 + 13 + environment.systemPackages = with pkgs; [ 14 + nix-direnv 15 + unzip 16 + ifuse 17 + w3m 18 + imagemagick 19 + alacritty 20 + libimobiledevice 21 + catppuccin-sddm 22 + vim 23 + microsoft-edge 24 + direnv 25 + gnome.nautilus 26 + kdePackages.dolphin 27 + kdePackages.kservice 28 + qpwgraph 29 + wget 30 + git 31 + neofetch 32 + vscode 33 + nodejs 34 + bun 35 + (python3.withPackages (subpkgs: with subpkgs; [ 36 + requests 37 + pypresence 38 + ])) 39 + wrangler 40 + thefuck 41 + fontforge 42 + xclip 43 + fontforge-gtk 44 + deno 45 + wofi 46 + waybar 47 + dunst 48 + hyprlock 49 + swww 50 + swappy 51 + slurp 52 + grim 53 + wl-clipboard 54 + github-cli 55 + cliphist 56 + pywal 57 + pavucontrol 58 + polkit 59 + polkit-kde-agent 60 + wlogout 61 + libnotify 62 + killall 63 + networkmanagerapplet 64 + blueman 65 + arrpc 66 + playerctl 67 + obs-studio 68 + mangohud 69 + jq 70 + github-cli 71 + file 72 + nwg-look 73 + rhythmbox 74 + hyprpolkitagent 75 + 76 + catppuccin-cursors.mochaLavender 77 + 78 + # important 79 + glib 80 + openssl 81 + nss 82 + glibc # C LIBRARY DO NOT REMOVE VERY IMPORTANT 83 + gobject-introspection 84 + gimp 85 + mpv 86 + ] 87 + } 88 +
+26
modules/nixos/bootloader.nix
··· 1 + { config, pkgs, ... }: 2 + 3 + { 4 + 5 + boot.binfmt.registrations.appimage = { 6 + wrapInterpreterInShell = false; 7 + interpreter = "${pkgs.appimage-run}/bin/appimage-run"; 8 + recognitionType = "magic"; 9 + offset = 0; 10 + mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff''; 11 + magicOrExtension = ''\x7fELF....AI\x02''; 12 + }; 13 + 14 + boot.supportedFilesystems = [ "ntfs" ]; 15 + 16 + boot.loader = { 17 + efi = { 18 + canTouchEfiVariables = true; 19 + }; 20 + grub = { 21 + efiSupport = true; 22 + device = "nodev"; 23 + }; 24 + }; 25 + 26 + }
+26
modules/nixos/hardware.nix
··· 1 + { config, pkgs, ... }: 2 + 3 + { 4 + 5 + hardware.bluetooth.enable = true; 6 + services.blueman.enable = true; 7 + 8 + hardware.bluetooth.settings = { 9 + General = { 10 + Experimental = true; 11 + ControllerMode = "bredr"; 12 + }; 13 + }; 14 + 15 + hardware.enableAllFirmware = true; 16 + 17 + security.rtkit.enable = true; 18 + 19 + services.pipewire = { 20 + enable = true; 21 + alsa.enable = true; 22 + alsa.support32Bit = true; 23 + pulse.enable = true; 24 + }; 25 + 26 + }
+26
modules/nixos/i18n.nix
··· 1 + { config, pkgs, ... }: 2 + 3 + { 4 + 5 + time.timeZone = "Europe/Riga"; 6 + 7 + i18n.defaultLocale = "lv_LV.UTF-8"; 8 + 9 + i18n.extraLocaleSettings = { 10 + LC_ADDRESS = "lv_LV.UTF-8"; 11 + LC_IDENTIFICATION = "lv_LV.UTF-8"; 12 + LC_MEASUREMENT = "lv_LV.UTF-8"; 13 + LC_MONETARY = "lv_LV.UTF-8"; 14 + LC_NAME = "lv_LV.UTF-8"; 15 + LC_NUMERIC = "lv_LV.UTF-8"; 16 + LC_PAPER = "lv_LV.UTF-8"; 17 + LC_TELEPHONE = "lv_LV.UTF-8"; 18 + LC_TIME = "lv_LV.UTF-8"; 19 + }; 20 + 21 + services.xserver.xkb = { 22 + layout = "us"; 23 + variant = ""; 24 + }; 25 + 26 + }
+43
modules/nixos/main-user.nix
··· 1 + { lib, config, pkgs, ... }: 2 + 3 + { 4 + options = { 5 + main-user.userName = lib.mkOption { 6 + default = "ocbwoy3"; 7 + description = '' 8 + Username 9 + ''; 10 + }; 11 + main-user.realName = lib.mkOption { 12 + default = "OCbwoy3"; 13 + description = '' 14 + User's Name 15 + ''; 16 + }; 17 + main-user.packages = lib.mkOption { 18 + default = []; 19 + description = '' 20 + User's Packages 21 + ''; 22 + }; 23 + }; 24 + 25 + config = { 26 + users.users.${config.main-user.userName} = { 27 + isNormalUser = true; 28 + initialPassword = "password"; 29 + description = "${config.main-user.realName}"; 30 + shell = pkgs.zsh; 31 + extraGroups = [ "networkmanager" "wheel" "input" ]; 32 + packages = ${config.main-user.packages}; 33 + # with pkgs; [ 34 + # brave 35 + # prismlauncher 36 + # gimp 37 + # mpv 38 + # vesktop 39 + # ]; 40 + }; 41 + }; 42 + 43 + }
+8
modules/nixos/network.nix
··· 1 + { config, pkgs, ... }: 2 + 3 + { 4 + 5 + networking.hostName = "nixos"; 6 + networking.networkmanager.enable = true; 7 + 8 + }
+10
modules/nixos/nixpkgs.nix
··· 1 + { config, pkgs, ... }: 2 + 3 + { 4 + 5 + nixpkgs.config.allowUnfree = true; 6 + nixpkgs.config.packageOverrides = pkgs: { 7 + vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; 8 + }; 9 + 10 + }
+39
modules/nixos/nvidia.nix
··· 1 + { config, pkgs, ... }: 2 + 3 + { 4 + 5 + boot.extraModprobeConfig = ''options nvidia_drm modeset=1 fbdev=1''; 6 + 7 + environment.variables = { 8 + LIBVA_DRIVER_NAME = "nvidia"; 9 + GBM_BACKEND = "nvidia-drm"; 10 + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; 11 + NVD_BACKEND = "direct"; 12 + EGL_PLATFORM = "wayland"; 13 + }; 14 + 15 + hardware.graphics = { 16 + enable = true; 17 + 18 + extraPackages = with pkgs; [ 19 + intel-media-driver 20 + vaapiIntel 21 + vaapiVdpau 22 + libvdpau-va-gl 23 + ]; 24 + }; 25 + 26 + environment.sessionVariables.NIXOS_OZONE_WL = "1"; 27 + 28 + hardware.nvidia = { 29 + modesetting.enable = true; 30 + powerManagement.enable = false; 31 + powerManagement.finegrained = false; 32 + open = false; 33 + package = config.boot.kernelPackages.nvidiaPackages.latest; 34 + }; 35 + 36 + services.xserver.enable = true; 37 + services.xserver.videoDrivers = ["nvidia"]; 38 + 39 + }
+28
modules/nixos/programs.nix
··· 1 + { config, pkgs, ... }: 2 + 3 + { 4 + 5 + programs.zsh.enable = true; 6 + 7 + programs.direnv = { 8 + enable = true; 9 + enableZshIntegration = true; 10 + }; 11 + 12 + programs.gamemode.enable = true; 13 + programs.gamemode.settings.general.renice = 0; 14 + programs.gamemode.settings.general.ioprio = 0; 15 + programs.gamemode.settings.general.softrealtime = "on"; 16 + services.usbmuxd.enable = true; 17 + 18 + programs.nix-ld.enable = true; 19 + programs.nix-ld.libraries = with pkgs; [ 20 + c-ares ffmpeg gtk3 http-parser libevent libvpx libxslt minizip nss re2 snappy libnotify libappindicator-gtk3 21 + ]; 22 + 23 + services.openssh = { 24 + enable = true; 25 + banner = "What the fuck do you think you're doing here?\n"; 26 + }; 27 + 28 + }