diff --git a/configuration.nix b/configuration.nix index 494bd2d..38ded5f 100755 --- a/configuration.nix +++ b/configuration.nix @@ -1,16 +1,15 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, inputs, ... -}: { +}: +{ imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix - ./system/gnome.nix + ./system/nvidia.nix + ./system/de/gdm.nix + ./system/de/hypr/hyprland.nix inputs.home-manager.nixosModules.default ]; @@ -49,6 +48,16 @@ # Enable CUPS to print documents. services.printing.enable = true; + # Flatpak (Basically just for discord) + services.flatpak.enable = true; + systemd.services.flatpak-repo = { + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.flatpak ]; + script = '' + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + ''; + }; + # Enable sound with pipewire. services.pulseaudio.enable = false; security.rtkit.enable = true; @@ -72,7 +81,10 @@ users.users.javi = { isNormalUser = true; description = "javi"; - extraGroups = ["networkmanager" "wheel"]; + extraGroups = [ + "networkmanager" + "wheel" + ]; packages = with pkgs; [ # thunderbird ]; @@ -94,10 +106,13 @@ system.stateVersion = "25.05"; # Did you read the comment? - nix.settings.experimental-features = ["nix-command" "flakes"]; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; home-manager = { - extraSpecialArgs = {inherit inputs;}; + extraSpecialArgs = { inherit inputs; }; users = { "javi" = import ./home.nix; }; diff --git a/flake.nix b/flake.nix index 06d3862..88127f9 100755 --- a/flake.nix +++ b/flake.nix @@ -9,20 +9,23 @@ }; }; - outputs = { - self, - nixpkgs, - ... - } @ inputs: let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in { - nixosConfigurations.default = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - inputs.home-manager.nixosModules.default - ./configuration.nix - ]; + outputs = + { + self, + nixpkgs, + ... + }@inputs: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in + { + nixosConfigurations.default = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + inputs.home-manager.nixosModules.default + ./configuration.nix + ]; + }; }; - }; } diff --git a/hardware-configuration.nix b/hardware-configuration.nix old mode 100755 new mode 100644 index 9f08042..077a87b --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -7,37 +7,66 @@ pkgs, modulesPath, ... -}: { +}: + +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; fileSystems."/" = { - device = "/dev/disk/by-uuid/0c063318-1531-475e-b3bc-00bdd225dd45"; + device = "/dev/disk/by-uuid/8f492948-4572-44d4-9da9-9394894320f4"; fsType = "ext4"; }; fileSystems."/boot" = { - device = "/dev/disk/by-uuid/029C-659E"; + device = "/dev/disk/by-uuid/EAA9-478C"; fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; - swapDevices = []; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/6646d409-6417-4410-b3a0-fe6bafb2b9f3"; + fsType = "ext4"; + }; + + fileSystems."/tmp" = { + device = "/dev/disk/by-uuid/9fe1009a-f604-40ff-a13d-e78d9041397f"; + fsType = "ext4"; + }; + + fileSystems."/var/log" = { + device = "/dev/disk/by-uuid/9d39eb6d-09ab-4d66-8864-c19f9d59f620"; + fsType = "ext4"; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/6fa52bf4-b1d9-468f-bc3a-f0c740e80c86"; } + ]; # 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.enp0s31f6.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + # networking.interfaces.enp7s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/home.nix b/home.nix index 277fac0..7fb69ad 100755 --- a/home.nix +++ b/home.nix @@ -2,13 +2,15 @@ config, pkgs, ... -}: { +}: +{ imports = [ ./home/kitty.nix ./home/shell.nix ./home/starship.nix - ./home/gnome.nix ./home/git.nix + ./home/hyprland.nix + ./home/util/darkmode.nix ]; nixpkgs.config.allowUnfree = true; # Home Manager needs a bit of information about you and the paths it should @@ -29,8 +31,8 @@ # environment. home.packages = with pkgs; [ # Basics - kitty starship + nautilus # Terminal tools yazi @@ -38,12 +40,13 @@ fzf bat eza + jq # Dev tools jetbrains.datagrip vscode neovim - alejandra # Nix formatting + nixfmt # Nix formatting # System tools btop @@ -55,44 +58,47 @@ # Media mpc - - # Apps - discord ]; - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; - - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; + # Environment variables + home.sessionVariables = { + EDITOR = "code"; + BROWSER = "brave"; + TERMINAL = "kitty"; }; - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. These will be explicitly sourced when using a - # shell provided by Home Manager. If you don't want to manage your shell - # through Home Manager then you have to manually source 'hm-session-vars.sh' - # located at either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/javi/etc/profile.d/hm-session-vars.sh - # - home.sessionVariables = { - # EDITOR = "emacs"; + # File associations + xdg.mimeApps = { + enable = true; + defaultApplications = { + "text/html" = "brave-browser.desktop"; + "x-scheme-handler/http" = "brave-browser.desktop"; + "x-scheme-handler/https" = "brave-browser.desktop"; + "x-scheme-handler/about" = "brave-browser.desktop"; + "x-scheme-handler/unknown" = "brave-browser.desktop"; + "application/pdf" = "org.gnome.Evince.desktop"; + "text/plain" = "code.desktop"; + "application/json" = "code.desktop"; + "application/javascript" = "code.desktop"; + "text/x-php" = "code.desktop"; + }; + }; + + # XDG directories + xdg = { + enable = true; + userDirs = { + enable = true; + createDirectories = true; + desktop = "${config.home.homeDirectory}/Desktop"; + documents = "${config.home.homeDirectory}/Documents"; + download = "${config.home.homeDirectory}/Downloads"; + music = "${config.home.homeDirectory}/Music"; + pictures = "${config.home.homeDirectory}/Pictures"; + videos = "${config.home.homeDirectory}/Videos"; + templates = "${config.home.homeDirectory}/Templates"; + publicShare = "${config.home.homeDirectory}/Public"; + }; }; # Let Home Manager install and manage itself. diff --git a/home/development.nix b/home/development.nix index ce81eea..d444e80 100755 --- a/home/development.nix +++ b/home/development.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ # Development-specific configurations and tools # Node.js development @@ -84,22 +85,22 @@ keymap = { manager.prepend_keymap = [ { - on = [""]; + on = [ "" ]; run = "escape"; desc = "Exit visual mode, clear selected, or cancel search"; } { - on = ["q"]; + on = [ "q" ]; run = "quit"; desc = "Exit the process"; } { - on = ["Q"]; + on = [ "Q" ]; run = "quit --no-cwd-file"; desc = "Exit the process without writing cwd-file"; } { - on = [""]; + on = [ "" ]; run = "close"; desc = "Close the current tab, or quit if it is last tab"; } diff --git a/home/git.nix b/home/git.nix index 9f7354f..6bf5211 100755 --- a/home/git.nix +++ b/home/git.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ home.packages = [ pkgs.git ]; diff --git a/home/gnome.nix b/home/gnome.nix index db7e7ad..fdc3b19 100755 --- a/home/gnome.nix +++ b/home/gnome.nix @@ -3,7 +3,8 @@ pkgs, lib, ... -}: { +}: +{ imports = [ ./gnome/keybinds.nix ]; diff --git a/home/gnome/keybinds.nix b/home/gnome/keybinds.nix index 1027b72..ccef23b 100644 --- a/home/gnome/keybinds.nix +++ b/home/gnome/keybinds.nix @@ -3,35 +3,44 @@ pkgs, lib, ... -}: let +}: +let # Helper function to create custom keybindings - mkCustomKeybinding = index: { - name, - command, - binding, - }: { - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString index}" = { - inherit name command binding; + mkCustomKeybinding = + index: + { + name, + command, + binding, + }: + { + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString index}" = { + inherit name command binding; + }; }; - }; # Helper function to generate custom keybinding paths - mkCustomKeybindingPaths = count: - lib.genList (i: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString i}/") count; + mkCustomKeybindingPaths = + count: + lib.genList ( + i: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString i}/" + ) count; # Helper function to generate workspace keybindings - mkWorkspaceKeybindings = count: - lib.genAttrs - (lib.genList (i: "switch-to-workspace-${toString (i + 1)}") count) - (name: let - num = lib.strings.removePrefix "switch-to-workspace-" name; - in ["${num}"]); + mkWorkspaceKeybindings = + count: + lib.genAttrs (lib.genList (i: "switch-to-workspace-${toString (i + 1)}") count) ( + name: + let + num = lib.strings.removePrefix "switch-to-workspace-" name; + in + [ "${num}" ] + ); # Helper function to disable application shortcuts - mkDisableAppShortcuts = count: - lib.genAttrs - (lib.genList (i: "switch-to-application-${toString (i + 1)}") count) - (name: []); + mkDisableAppShortcuts = + count: + lib.genAttrs (lib.genList (i: "switch-to-application-${toString (i + 1)}") count) (name: [ ]); # Define custom keybindings customKeybindings = [ @@ -65,6 +74,11 @@ command = "kitty --start-as=normal -- bash -ic 'proj'"; binding = "p"; } + { + name = "Open nix config"; + command = "kitty --start-as=normal -- bash -ic 'code ~/nix && exit'"; + binding = "n"; + } { name = "ChatGPT"; command = "brave --new-window --app=https://chatgpt.com"; @@ -83,37 +97,36 @@ ]; # Generate all custom keybinding settings - customKeybindingSettings = - lib.foldl lib.mergeAttrs {} - (lib.imap0 (index: keybind: mkCustomKeybinding index keybind) customKeybindings); -in { + customKeybindingSettings = lib.foldl lib.mergeAttrs { } ( + lib.imap0 (index: keybind: mkCustomKeybinding index keybind) customKeybindings + ); +in +{ # GNOME desktop configuration (equivalent to your scripts/gnome/ files) - dconf.settings = - lib.mergeAttrs { - # Window manager keybindings (from keybinds.sh) - "org/gnome/desktop/wm/keybindings" = lib.mergeAttrs { - close = ["c"]; - maximize = ["Up"]; - toggle-fullscreen = ["F11"]; - } (mkWorkspaceKeybindings 6); + dconf.settings = lib.mergeAttrs { + # Window manager keybindings (from keybinds.sh) + "org/gnome/desktop/wm/keybindings" = lib.mergeAttrs { + close = [ "c" ]; + maximize = [ "Up" ]; + toggle-fullscreen = [ "F11" ]; + } (mkWorkspaceKeybindings 6); - # Workspace settings - "org/gnome/mutter" = { - dynamic-workspaces = false; - }; + # Workspace settings + "org/gnome/mutter" = { + dynamic-workspaces = false; + }; - "org/gnome/desktop/wm/preferences" = { - num-workspaces = 6; - resize-with-right-button = true; - }; + "org/gnome/desktop/wm/preferences" = { + num-workspaces = 6; + resize-with-right-button = true; + }; - # Disable Super+number for applications (to use for workspaces) - "org/gnome/shell/keybindings" = mkDisableAppShortcuts 9; + # Disable Super+number for applications (to use for workspaces) + "org/gnome/shell/keybindings" = mkDisableAppShortcuts 9; - # Custom keybindings (from your keybinds.sh) - "org/gnome/settings-daemon/plugins/media-keys" = { - custom-keybindings = mkCustomKeybindingPaths (lib.length customKeybindings); - }; - } - customKeybindingSettings; + # Custom keybindings (from your keybinds.sh) + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = mkCustomKeybindingPaths (lib.length customKeybindings); + }; + } customKeybindingSettings; } diff --git a/home/home.nix b/home/home.nix deleted file mode 100755 index a486b57..0000000 --- a/home/home.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ - config, - pkgs, - inputs, - stable, - ... -}: { - imports = [ - ./modules/shell.nix - ./modules/git.nix - ./modules/gnome.nix - ./programs/vscode.nix - ./programs/starship.nix - ./programs/development.nix - ]; - - # Home Manager version - home.stateVersion = "24.05"; - - # User info - home = { - username = "javi"; - homeDirectory = "/home/javi"; - }; - - # Let Home Manager manage itself - programs.home-manager.enable = true; - - # User packages - home.packages = with pkgs; [ - # Terminal tools - yazi # File manager (replacing your yazi.sh script) - ripgrep # Better grep - fd # Better find - bat # Better cat - delta # Better git diff - - # Development tools - jetbrains.datagrip # Database IDE (from your Ansible config) - - # System monitoring - btop - neofetch - fastfetch - - # Utilities - xclip - wl-clipboard - flameshot - - # Archive tools - unzip - zip - p7zip - - # Network tools - curl - wget - - # Media - mpc - ]; - - # XDG directories - xdg = { - enable = true; - userDirs = { - enable = true; - createDirectories = true; - desktop = "${config.home.homeDirectory}/Desktop"; - documents = "${config.home.homeDirectory}/Documents"; - download = "${config.home.homeDirectory}/Downloads"; - music = "${config.home.homeDirectory}/Music"; - pictures = "${config.home.homeDirectory}/Pictures"; - videos = "${config.home.homeDirectory}/Videos"; - templates = "${config.home.homeDirectory}/Templates"; - publicShare = "${config.home.homeDirectory}/Public"; - }; - }; - - # Environment variables - home.sessionVariables = { - EDITOR = "code"; - BROWSER = "brave"; - TERMINAL = "kitty"; - }; - - # File associations - xdg.mimeApps = { - enable = true; - defaultApplications = { - "text/html" = "brave-browser.desktop"; - "x-scheme-handler/http" = "brave-browser.desktop"; - "x-scheme-handler/https" = "brave-browser.desktop"; - "x-scheme-handler/about" = "brave-browser.desktop"; - "x-scheme-handler/unknown" = "brave-browser.desktop"; - "application/pdf" = "org.gnome.Evince.desktop"; - "text/plain" = "code.desktop"; - "application/json" = "code.desktop"; - "application/javascript" = "code.desktop"; - "text/x-php" = "code.desktop"; - }; - }; -} diff --git a/home/hyprland.nix b/home/hyprland.nix new file mode 100644 index 0000000..0732d86 --- /dev/null +++ b/home/hyprland.nix @@ -0,0 +1,148 @@ +{ + config, + pkgs, + inputs, + ... +}: + +{ + home.packages = [ + pkgs.wofi + pkgs.hyprlock + pkgs.hyprpaper + ]; + + imports = [ + ./hyprland/hyprpaper.nix + ]; + + # Important for certain apps working + # and dark mode being respected + xdg.portal = { + enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-hyprland + ]; + }; + + wayland.windowManager.hyprland.enable = true; + + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + "$browser" = "brave"; + "$terminal" = "kitty"; + "$file_browser" = "nautilus"; + "$webapp" = "$browser --new-window --app="; + + monitor = [ + "DP-5, 3440x1440@179.99, 0x0, 1" + ]; + + general = { + layout = "master"; + gaps_out = 5; + gaps_in = 5; + }; + + bind = [ + # Start programs + "$mod, q, exec, $terminal" + "$mod SHIFT, o, exec, $browser" + "$mod SHIFT, p, exec, $browser --incognito" + "$mod, e, exec, $file_browser" + "$mod SHIFT, n, exec, kitty --start-as=normal -- bash -ic 'code ~/nix && exit'" + "$mod, RETURN, exec, $webapphttps://chatgpt.com" + + # Window and workspace navigation + # Move between windows with vim keys + "$mod, h, movefocus, l" + "$mod, l, movefocus, r" + "$mod, k, movefocus, u" + "$mod, j, movefocus, d" + "$mod, c, killactive" + # Move between workspaces + "$mod ALT, l, movetoworkspace, r+1" + "$mod ALT, h, movetoworkspace, r-1" + "$mod SHIFT, l, workspace, r+1" + "$mod SHIFT, h, workspace, r-1" + # Window management + "$mod, 0, layoutmsg, rollnext" + + "$mod, f, fullscreen, 0" + "$mod, v, togglefloating, active" + "$mod, SPACE, exec, wofi --show drun" + + # ", Print, exec, grimblast copy area" + + # "$mod, r, exec, kitty -- zsh -c 'exec yazi; exec zsh'" + # "$mod, b, exec, kitty -- zsh -c 'btop; exec zsh'" + # "$mod, y, exec, kitty --start-as=normal -- zsh -ic 'repos'" + # "$mod, i, exec, brave" + # "$mod, u, exec, kitty --start-as=normal -- zsh -ic 'home'" + + "$mod SHIFT, s, togglespecialworkspace, comms" + # "$mod, v, togglespecialworkspace, special2" + + # Log out + # "$mod, -, exec, hyprctl dispatch exit" + "$mod SHIFT ALT, x, exec, hyprctl dispatch exit" + + # Shift+Print → select area and copy + "SHIFT, Print, exec, grimblast copy area" + + # Ctrl+Print → select window and copy + "CTRL, Print, exec, grimblast copy active" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..9} to [move to] workspace {1..9} + builtins.concatLists ( + builtins.genList ( + i: + let + ws = i + 1; + in + [ + "$mod, code:1${toString i}, workspace, ${toString ws}" + "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" + ] + ) 9 + ) + ); + + workspace = [ + 1 + 2 + 3 + 4 + 5 + 6 + ]; + + # Window rules + windowrulev2 = [ + "opacity 0.85, class:^(Code)$" + ]; + + decoration = { + blur = { + enabled = false; + size = 8; + passes = 2; + }; + + active_opacity = 1.0; + inactive_opacity = 1.0; + }; + + exec-once = [ + "eval $(gnome-keyring-daemon --start --components=secrets,ssh,gpg)" + ]; + }; + + wayland.windowManager.hyprland.plugins = [ + # inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprbars + ]; + +} diff --git a/home/hyprland/background.png b/home/hyprland/background.png new file mode 100644 index 0000000..c868176 Binary files /dev/null and b/home/hyprland/background.png differ diff --git a/home/hyprland/hyprpaper.nix b/home/hyprland/hyprpaper.nix new file mode 100644 index 0000000..94a6ae7 --- /dev/null +++ b/home/hyprland/hyprpaper.nix @@ -0,0 +1,23 @@ +{ + config, + pkgs, + inputs, + ... +}: + +{ + services.hyprpaper = { + enable = true; + settings = { + ipc = "on"; + splash = false; + preload = [ + "/home/javi/Documents/wallpapers/Fantasy-Landscape2.png" + ]; + + wallpaper = [ + ", /home/javi/Documents/wallpapers/Fantasy-Landscape2.png" + ]; + }; + }; +} diff --git a/home/kitty.nix b/home/kitty.nix index 9f5ad94..aaacf70 100644 --- a/home/kitty.nix +++ b/home/kitty.nix @@ -3,7 +3,8 @@ lib, pkgs, ... -}: let +}: +let kittyConfig = '' include current-theme.conf @@ -16,16 +17,15 @@ map ctrl+shift+t new_tab_with_cwd ''; -in { +in +{ + home.packages = with pkgs; [ + kitty + ]; + programs.kitty = { enable = true; extraConfig = kittyConfig; - - # Optional: link extra files like `current-theme.conf` - # Add this if you have a custom theme file - # settings = { - # include = "~/.config/kitty/current-theme.conf"; - # }; }; } diff --git a/home/shell.nix b/home/shell.nix index 54a6953..844a1fe 100755 --- a/home/shell.nix +++ b/home/shell.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ # Bash configuration programs.bash = { enable = true; @@ -19,9 +20,10 @@ # Convenience rp = "source ~/.bashrc"; + co = "code ."; # Nix - rb = "sudo nixos-rebuild switch --flake $HOME/nixos-config#default"; + rb = "sudo nixos-rebuild switch --flake $HOME/nix#default"; # Git shortcuts gs = "git status"; diff --git a/home/starship.nix b/home/starship.nix index 177fb2d..6a26227 100755 --- a/home/starship.nix +++ b/home/starship.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ # Starship prompt configuration (equivalent to your starship-prompt.sh) programs.starship = { enable = true; diff --git a/home/util/darkmode.nix b/home/util/darkmode.nix new file mode 100644 index 0000000..0c486cd --- /dev/null +++ b/home/util/darkmode.nix @@ -0,0 +1,33 @@ +{ + inputs, + pkgs, + lib, + config, + ... +}: + +{ + gtk = { + enable = true; + theme = { + name = "Adwaita-dark"; + package = pkgs.gnome-themes-extra; + }; + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + }; + }; + + dconf.settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + }; + }; + + # Make Qt apps follow dark mode + home.sessionVariables = { + QT_QPA_PLATFORMTHEME = "gtk2"; + QT_STYLE_OVERRIDE = "Adwaita-dark"; + }; +} diff --git a/home/vscode.nix b/home/vscode.nix index ab49299..9099b75 100755 --- a/home/vscode.nix +++ b/home/vscode.nix @@ -2,181 +2,10 @@ config, pkgs, ... -}: { +}: +{ programs.vscode = { enable = true; package = pkgs.vscode; - - # Extensions (commonly used for development) - extensions = with pkgs.vscode-extensions; [ - # Language support - ms-vscode.vscode-typescript-next - bradlc.vscode-tailwindcss - ms-python.python - ms-vscode.vscode-json - redhat.vscode-yaml - ms-vscode.vscode-css - - # PHP - bmewburn.vscode-intelephense-client - xdebug.php-debug - - # Git - eamodio.gitlens - mhutchie.git-graph - - # Productivity - ms-vscode.vscode-eslint - esbenp.prettier-vscode - bradlc.vscode-tailwindcss - formulahendry.auto-rename-tag - ms-vscode.vscode-color-info - - # Themes and appearance - pkief.material-icon-theme - zhuangtongfa.material-theme - - # Docker - ms-azuretools.vscode-docker - - # Remote development - ms-vscode-remote.remote-ssh - ms-vscode-remote.remote-containers - - # Nix support - bbenoist.nix - jnoortheen.nix-ide - ]; - - # User settings - userSettings = { - # Editor settings - "editor.fontSize" = 14; - "editor.fontFamily" = "'FiraCode Nerd Font', 'Droid Sans Mono', monospace"; - "editor.fontLigatures" = true; - "editor.tabSize" = 2; - "editor.insertSpaces" = true; - "editor.wordWrap" = "on"; - "editor.minimap.enabled" = false; - "editor.renderWhitespace" = "boundary"; - "editor.rulers" = [80 120]; - "editor.formatOnSave" = true; - "editor.codeActionsOnSave" = { - "source.fixAll.eslint" = "explicit"; - "source.organizeImports" = "explicit"; - }; - - # Workbench - "workbench.colorTheme" = "Material Theme Darker High Contrast"; - "workbench.iconTheme" = "material-icon-theme"; - "workbench.startupEditor" = "newUntitledFile"; - "workbench.sideBar.location" = "left"; - - # Files - "files.autoSave" = "onFocusChange"; - "files.trimTrailingWhitespace" = true; - "files.insertFinalNewline" = true; - "files.exclude" = { - "**/node_modules" = true; - "**/vendor" = true; - "**/.git" = true; - "**/.svn" = true; - "**/.hg" = true; - "**/CVS" = true; - "**/.DS_Store" = true; - "**/Thumbs.db" = true; - }; - - # Terminal - "terminal.integrated.fontFamily" = "'FiraCode Nerd Font'"; - "terminal.integrated.fontSize" = 13; - "terminal.integrated.shell.linux" = "${pkgs.bash}/bin/bash"; - - # Git - "git.enableSmartCommit" = true; - "git.autofetch" = true; - "git.confirmSync" = false; - - # Language-specific settings - "[javascript]" = { - "editor.defaultFormatter" = "esbenp.prettier-vscode"; - }; - "[typescript]" = { - "editor.defaultFormatter" = "esbenp.prettier-vscode"; - }; - "[json]" = { - "editor.defaultFormatter" = "esbenp.prettier-vscode"; - }; - "[html]" = { - "editor.defaultFormatter" = "esbenp.prettier-vscode"; - }; - "[css]" = { - "editor.defaultFormatter" = "esbenp.prettier-vscode"; - }; - "[php]" = { - "editor.defaultFormatter" = "bmewburn.vscode-intelephense-client"; - }; - "[nix]" = { - "editor.defaultFormatter" = "jnoortheen.nix-ide"; - "editor.tabSize" = 2; - }; - - # PHP Intelephense - "intelephense.files.maxSize" = 5000000; - "intelephense.telemetry.enabled" = false; - - # ESLint - "eslint.validate" = [ - "javascript" - "javascriptreact" - "typescript" - "typescriptreact" - "vue" - ]; - - # Prettier - "prettier.singleQuote" = true; - "prettier.trailingComma" = "es5"; - "prettier.tabWidth" = 2; - "prettier.semi" = true; - - # Docker - "docker.showStartPage" = false; - - # Telemetry - "telemetry.telemetryLevel" = "off"; - "extensions.ignoreRecommendations" = true; - - # Security - "security.workspace.trust.enabled" = false; - - # Window - "window.titleBarStyle" = "custom"; - "window.menuBarVisibility" = "toggle"; - }; - - # Keybindings - keybindings = [ - { - key = "ctrl+shift+p"; - command = "workbench.action.showCommands"; - } - { - key = "ctrl+p"; - command = "workbench.action.quickOpen"; - } - { - key = "ctrl+shift+n"; - command = "workbench.action.files.newUntitledFile"; - } - { - key = "ctrl+shift+f"; - command = "workbench.action.findInFiles"; - } - { - key = "ctrl+`"; - command = "workbench.action.terminal.toggleTerminal"; - } - ]; }; } diff --git a/system/de/gdm.nix b/system/de/gdm.nix new file mode 100644 index 0000000..9572a6f --- /dev/null +++ b/system/de/gdm.nix @@ -0,0 +1,14 @@ +{ + config, + pkgs, + inputs, + ... +}: +{ + services.xserver = { + enable = true; + displayManager.gdm = { + enable = true; + }; + }; +} diff --git a/system/de/hypr/hyprland.nix b/system/de/hypr/hyprland.nix new file mode 100644 index 0000000..84f3760 --- /dev/null +++ b/system/de/hypr/hyprland.nix @@ -0,0 +1,17 @@ +{ + config, + pkgs, + inputs, + ... +}: + +{ + # Install hyprland and all the stuff it needs + programs.hyprland.enable = true; + programs.waybar.enable = true; + environment.sessionVariables.NIXOS_OZON_WL = "1"; + + environment.systemPackages = with pkgs; [ + hyprlock + ]; +} diff --git a/system/de/sddm.nix b/system/de/sddm.nix new file mode 100644 index 0000000..b7d79b0 --- /dev/null +++ b/system/de/sddm.nix @@ -0,0 +1,15 @@ +{ + config, + pkgs, + inputs, + ... +}: +{ + services.xserver = { + enable = true; + displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + }; +} diff --git a/system/gnome.nix b/system/gnome.nix index 0cdf89f..7b0862a 100644 --- a/system/gnome.nix +++ b/system/gnome.nix @@ -3,9 +3,9 @@ pkgs, inputs, ... -}: { +}: +{ services.xserver.enable = true; - services.displayManager.gdm.enable = true; services.desktopManager.gnome.enable = true; # Configure keymap in X11 diff --git a/system/nvidia.nix b/system/nvidia.nix new file mode 100644 index 0000000..70215c3 --- /dev/null +++ b/system/nvidia.nix @@ -0,0 +1,25 @@ +{ config, pkgs, ... }: + +{ + nixpkgs.config.allowUnfree = true; + + hardware.graphics = { + enable = true; + enable32Bit = true; # steam/wine + }; + + services.xserver.videoDrivers = [ "nvidia" ]; + + boot.blacklistedKernelModules = [ "nouveau" ]; + + hardware.nvidia = { + modesetting.enable = true; + nvidiaSettings = true; + open = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + powerManagement.enable = false; + powerManagement.finegrained = false; + }; + + boot.kernelParams = [ "nvidia_drm.modeset=1" ]; +}