diff --git a/config/README.md b/config/README.md new file mode 100644 index 0000000..eabb60a --- /dev/null +++ b/config/README.md @@ -0,0 +1,99 @@ +## Focus-first minimalist desktop setup +### Overview +- wm: [`Hyprland`](https://hyprland.org/) +- shell: [`zsh`](https://www.zsh.org/) +- terminal: [`kitty`](https://github.com/kovidgoyal/kitty) +- theme: [`Rose Pine`](https://rosepinetheme.com/) +- editor: [`helix`](https://helix-editor.com/), [`neovim`](https://neovim.io/), [`vscode`](https://code.visualstudio.com/) +- menu: [`tofi`](https://github.com/philj56/tofi) + +### Keybinds +
+ Desktop + +- Mod + Enter Open terminal +- Mod + Print Make a screenshot +- Mod + Q Kill window +- Mod + D Open program +- Mod + E Open files +- Mod + N Open notifications +- Mod + F Toggle floating +- Mod + T Toggle split +- Mod + . Lock desktop +- Mod + Shift + . Exit session +- Mod + h / j / k / l Move around +- Mod + Shift + h / j / k / l Move window +
+ +
+ Shell + +### History + +- `ctrl-p` : Previous command in history +- `ctrl-n` : Next command in history +- `/` : Search backward in history +- `n` : Repeat the last `/` + +### Movement + +- `$` : To the end of the line +- `^` : To the first non-blank character of the line +- `0` : To the first character of the line +- `w` : [count] words forward +- `W` : [count] WORDS forward +- `e` : Forward to the end of word [count] inclusive +- `E` : Forward to the end of WORD [count] inclusive +- `b` : [count] words backward +- `B` : [count] WORDS backward +- `t{char}` : Till before [count]'th occurrence of {char} to the right +- `T{char}` : Till before [count]'th occurrence of {char} to the left +- `f{char}` : To [count]'th occurrence of {char} to the right +- `F{char}` : To [count]'th occurrence of {char} to the left +- `;` : Repeat latest f, t, F or T [count] times +- `,` : Repeat latest f, t, F or T in opposite direction + +### Insertion + +- `i` : Insert text before the cursor +- `I` : Insert text before the first character in the line +- `a` : Append text after the cursor +- `A` : Append text at the end of the line +- `o` : Insert new command line below the current one +- `O` : Insert new command line above the current one + +### Delete and Insert + +- `ctrl-h` : While in *Insert mode*: delete character before the cursor +- `ctrl-w` : While in *Insert mode*: delete word before the cursor +- `d{motion}` : Delete text that {motion} moves over +- `dd` : Delete line +- `D` : Delete characters under the cursor until the end of the line +- `c{motion}` : Delete {motion} text and start insert +- `cc` : Delete line and start insert +- `C` : Delete to the end of the line and start insert +- `r{char}` : Replace the character under the cursor with {char} +- `R` : Enter replace mode: Each character replaces existing one +- `x` : Delete `count` characters under and after the cursor +- `X` : Delete `count` characters before the cursor + +
+ + +### Installation +> Note: If using **Debian** as host, you'll have to compile most of the dependencies from source + +1. Install `Hyprland` as described [on wiki](https://wiki.hyprland.org/Getting-Started/Installation/) +2. Install the dependencies + +Arch : `yay -S zsh oh-my-zsh-git zsh-autosuggestions zsh-completions zsh-syntax-highlighting kitty grim slurp helix neovim swaybg swaync swayidle rose-pine-gtk-theme firefox-developer-edition nautilus swaylock-effects` + +Arch (QoL): `yay -S foliate discord telegram-desktop openvpn lld ttf-material-design-icons wireplumber pipewire-jack pipewire-pulse ttf-droid noto-fonts noto-fonts-emoji wqy-microhei docker docker-compose pipewire pipewire-pulse pipewire-also pipewire-audio wireplumber visual-studio-code-bin bluez-utils-compat blueman` + +4. ```git clone https://github.com/kualta/dots && mv dots/* ~/.config/``` +5. Customize wallpaper and utility commands at `~/.config/hypr/hyprland.conf` +6. You're amazing! (and so is your desktop) + +### Gallery +![](https://github.com/kualta/dots/assets/72769566/6a2ef24b-05da-44c5-946a-e6c927ef3022) +![](https://github.com/kualta/dots/assets/72769566/b333a976-b083-477b-b1f9-97174300d339) diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index c83c6b7..629fc4e 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -17,7 +17,7 @@ $suspend_cmd = systemctl suspend $mainMod = SUPER # wallpaper path -$wallpaper_path = ~/Pictures/yuri.jpg +$wallpaper_path = ~/Pictures/bg.png launch { env = XCURSOR_SIZE,12 @@ -58,6 +58,7 @@ general { col.inactive_border = rgba(1f1d2eff) } + decoration { blur { enabled = true @@ -98,8 +99,13 @@ gestures { } binds { + + binde =, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%+ + binde =, XF86AudioLowerVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%- + desktop { bind = $mainMod, Print, exec, grim -g "$(slurp)" + bind = $mainMod SHIFT, Print, exec, wf-recorder -g "$(slurp)" bind = $mainMod, Return, exec, $term_cmd bind = $mainMod, Period, exec, $lock_cmd bind = $mainMod SHIFT, Period, exit, @@ -130,41 +136,41 @@ binds { } workspaces { - switch { - bind = $mainMod, 1, workspace, 1 - bind = $mainMod, 2, workspace, 2 - bind = $mainMod, 3, workspace, 3 - bind = $mainMod, 4, workspace, 4 - bind = $mainMod, 5, workspace, 5 - bind = $mainMod, 6, workspace, 6 - bind = $mainMod, 7, workspace, 7 - bind = $mainMod, 8, workspace, 8 - bind = $mainMod, 9, workspace, 9 - bind = $mainMod, 0, workspace, 10 - } - - move { - bind = $mainMod SHIFT, 1, movetoworkspace, 1 - bind = $mainMod SHIFT, 2, movetoworkspace, 2 - bind = $mainMod SHIFT, 3, movetoworkspace, 3 - bind = $mainMod SHIFT, 4, movetoworkspace, 4 - bind = $mainMod SHIFT, 5, movetoworkspace, 5 - bind = $mainMod SHIFT, 6, movetoworkspace, 6 - bind = $mainMod SHIFT, 7, movetoworkspace, 7 - bind = $mainMod SHIFT, 8, movetoworkspace, 8 - bind = $mainMod SHIFT, 9, movetoworkspace, 9 - bind = $mainMod SHIFT, 0, movetoworkspace, 10 - } - - scroll { - bind = $mainMod, mouse_down, workspace, e+1 - bind = $mainMod, mouse_up, workspace, e-1 - } - - resize { - bindm = $mainMod, mouse:272, movewindow - bindm = $mainMod, mouse:273, resizewindow - } + switch { + bind = $mainMod, 1, workspace, 1 + bind = $mainMod, 2, workspace, 2 + bind = $mainMod, 3, workspace, 3 + bind = $mainMod, 4, workspace, 4 + bind = $mainMod, 5, workspace, 5 + bind = $mainMod, 6, workspace, 6 + bind = $mainMod, 7, workspace, 7 + bind = $mainMod, 8, workspace, 8 + bind = $mainMod, 9, workspace, 9 + bind = $mainMod, 0, workspace, 10 + } + + move { + bind = $mainMod SHIFT, 1, movetoworkspace, 1 + bind = $mainMod SHIFT, 2, movetoworkspace, 2 + bind = $mainMod SHIFT, 3, movetoworkspace, 3 + bind = $mainMod SHIFT, 4, movetoworkspace, 4 + bind = $mainMod SHIFT, 5, movetoworkspace, 5 + bind = $mainMod SHIFT, 6, movetoworkspace, 6 + bind = $mainMod SHIFT, 7, movetoworkspace, 7 + bind = $mainMod SHIFT, 8, movetoworkspace, 8 + bind = $mainMod SHIFT, 9, movetoworkspace, 9 + bind = $mainMod SHIFT, 0, movetoworkspace, 10 + } + + scroll { + bind = $mainMod, mouse_down, workspace, e+1 + bind = $mainMod, mouse_up, workspace, e-1 + } + + resize { + bindm = $mainMod, mouse:272, movewindow + bindm = $mainMod, mouse:273, resizewindow + } } } diff --git a/config/kitty/current-theme.conf b/config/kitty/current-theme.conf index 2533db7..2f261da 100644 --- a/config/kitty/current-theme.conf +++ b/config/kitty/current-theme.conf @@ -6,25 +6,23 @@ ## upstream: https://github.com/catppuccin/kitty/blob/main/mocha.conf ## blurb: Soothing pastel theme for the high-spirited! - - # The basic colors -foreground #CDD6F4 -background #1E1E2E -selection_foreground #1E1E2E -selection_background #F5E0DC +foreground #CDD6F4 +background #1E1E2E +selection_foreground #1E1E2E +selection_background #F5E0DC # Cursor colors -cursor #F5E0DC -cursor_text_color #1E1E2E +cursor #F5E0DC +cursor_text_color #1E1E2E # URL underline color when hovering with mouse -url_color #F5E0DC +url_color #F5E0DC # Kitty window border colors -active_border_color #B4BEFE -inactive_border_color #6C7086 -bell_border_color #F9E2AF +active_border_color #B4BEFE +inactive_border_color #6C7086 +bell_border_color #F9E2AF # OS Window titlebar colors wayland_titlebar_color system diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf index fe86912..e2e261d 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -3,7 +3,6 @@ include current-theme.conf # END_KITTY_THEME - # handled by hyprland background_blur 0 background_opacity 0.8 diff --git a/configuration.nix b/configuration.nix index 31b61ac..155a5ee 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,20 +1,87 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: -{ - imports = [ ./hardware-configuration.nix ]; +let + zed-fhs = pkgs.buildFHSUserEnv { + name = "zed"; + targetPkgs = pkgs: with pkgs; [ unstable.zed-editor ]; + runScript = "zed"; + }; +in { + imports = [ + ./hardware-configuration.nix + + + ]; nixpkgs = { config = { allowUnfree = true; packageOverrides = pkgs: { unstable = import (fetchTarball - "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz") { }; + "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz") { + config.allowUnfree = true; + }; }; - permittedInsecurePackages = [ "electron-25.9.0" ]; }; }; + environment.systemPackages = with pkgs; [ + unstable.bun + unstable.osu-lazer-bin + wget + ibus + htop + wine + unzip + kitty + biome + steam + cargo + rustup + nodejs + neovim + lutris + zed-fhs + xonotic + openssl + blanket + killall + blueman + firefox + vesktop + python3 + shotcut + obsidian + minetest + monaspace + musescore + wf-recorder + pop-launcher + google-chrome + nixfmt-classic + onlyoffice-bin + wireguard-tools + telegram-desktop + ibus-with-plugins + libsForQt5.kdenlive + ibus-engines.libpinyin + + gnome.gnome-tweaks + gnomeExtensions.zen + gnomeExtensions.super-key + gnomeExtensions.pop-shell + gnomeExtensions.kimpanel + gnomeExtensions.appindicator + gnomeExtensions.ibus-tweaker + gnomeExtensions.just-perfection + ]; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -32,26 +99,33 @@ LC_TIME = "en_US.UTF-8"; }; - fonts.packages = with pkgs; [ noto-fonts-cjk-sans noto-fonts-cjk-serif ]; + fonts.packages = with pkgs; [ + noto-fonts-cjk-sans + noto-fonts-cjk-serif + + (nerdfonts.override { + fonts = [ "FiraCode" "DroidSansMono" "Monaspace" "GeistMono" ]; + }) + + ]; + services.xserver.enable = true; services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome.enable = true; + time.timeZone = lib.mkForce null; # allow TZ to be set by desktop user - services.xserver = { + services.xserver.xkb = { layout = "us"; - xkbVariant = ""; + variant = ""; }; programs.hyprland = { enable = true; xwayland.enable = true; - enableNvidiaPatches = true; - }; - xdg.portal = { - enable = true; - # extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; }; + xdg.portal = { enable = true; }; services.printing.enable = true; sound.enable = true; + sound.mediaKeys.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { @@ -61,7 +135,7 @@ pulse.enable = true; }; - services.xserver.libinput.enable = true; + services.libinput.enable = true; i18n.inputMethod = { enabled = "ibus"; @@ -69,53 +143,25 @@ }; environment.interactiveShellInit = '' - alias gs='git status'; - alias gp='git push'; alias ga='git add .'; + alias gp='git push'; + alias gs='git status'; alias nx='sudo nixos-rebuild switch'; alias nxe='sudo nvim /etc/nixos/configuration.nix'; - alias hpe='sudo nvim /etc/nixos/config/hyprland.conf'; - ''; + alias hpe='sudo nvim /etc/nixos/config/hypr/hyprland.conf'; - environment.systemPackages = with pkgs; [ - unstable.bun - wget - ibus - htop - kitty - biome - steam - nodejs - nixfmt - neovim - openssl - killall - blueman - firefox - vesktop - obsidian - google-chrome - onlyoffice-bin - wireguard-tools - telegram-desktop - ibus-with-plugins - ibus-engines.libpinyin + alias bnuuy='bun i' + alias lgtm='function _lgtm(){ git add . && git commit -m "$1" && git push; }; _lgtm' - gnomeExtensions.zen - gnomeExtensions.paperwm - gnomeExtensions.kimpanel - gnomeExtensions.appindicator - gnomeExtensions.ibus-tweaker - gnomeExtensions.just-perfection - ]; + ''; - environment.variables = { EDITOR = "vim"; }; + environment.variables = { EDITOR = "zed"; }; programs.neovim = { vimAlias = true; configure = { customRC = '' - imap jk + inoremap jk ''; packages.myPlugins = with pkgs.vimPlugins; { start = [ vim-lastplace vim-nix ]; @@ -123,11 +169,8 @@ }; }; }; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - }; + + programs.steam.enable = true; hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; @@ -141,45 +184,42 @@ services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = { + open = true; + nvidiaSettings = true; modesetting.enable = true; powerManagement.enable = false; - powerManagement.finegrained = false; - open = false; - nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.production; + + package = config.boot.kernelPackages.nvidiaPackages.mkDriver { + version = "555.58.02"; + sha256_64bit = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM="; + sha256_aarch64 = "sha256-wb20isMrRg8PeQBU96lWJzBMkjfySAUaqt4EgZnhyF8="; + openSha256 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY="; + settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8="; + persistencedSha256 = + "sha256-a1D7ZZmcKFWfPjjH1REqPM5j/YLWKnbkP9qfRyIyxAw="; + }; + #package = config.boot.kernelPackages.nvidiaPackages.production; }; hardware.nvidia.prime = { sync.enable = true; - intelBusId = "PCI:0:2:0"; nvidiaBusId = "PCI:1:0:0"; }; system.autoUpgrade = { enable = true; - flags = [ - "--update-input" - "nixpkgs" - "-L" # print build logs - ]; + flags = [ "--update-input" "nixpkgs" "-L" ]; dates = "02:00"; randomizedDelaySec = "45min"; }; + boot.kernelPackages = pkgs.linuxPackages_latest; + zramSwap = { + enable = true; + algorithm = "lz4"; + }; services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ]; - environment.gnome.excludePackages = (with pkgs; [ gnome-photos gnome-tour ]) - ++ (with pkgs.gnome; [ - cheese - gedit - epiphany - geary - gnome-characters - tali - iagno - hitori - atomix - ]); networking = { networkmanager.enable = true; @@ -190,23 +230,51 @@ externalInterface = "eth0"; internalInterfaces = [ "wg0" ]; }; - - firewall.checkReversePath = "loose"; firewall.enable = true; - firewall = { - allowedTCPPorts = [ 53 ]; - allowedUDPPorts = [ 53 51820 59815 ]; - }; hostName = "kult"; }; + users.users.ku = { isNormalUser = true; extraGroups = [ "wheel" "networkmanager" ]; }; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.backupFileExtension = "hm-backup"; home-manager.users.ku = { config, pkgs, ... }: { + imports = [ ]; programs.bash = { enable = true; }; + programs.starship = { + enable = true; + catppuccin.enable = true; + settings = { + add_newline = false; + format = + "$shlvl$shell$username$hostname$nix_shell$git_branch$git_commit$git_state$git_status$directory$jobs$cmd_duration$character"; + shlvl = { + disabled = false; + symbol = ""; + style = "bright-red bold"; + }; + shell = { + disabled = false; + format = "$indicator"; + fish_indicator = ""; + bash_indicator = "(bright-white) "; + zsh_indicator = "(bright-white) "; + }; + username = { + style_user = "bright-white bold"; + style_root = "bright-red bold"; + }; + + }; + + }; + + catppuccin.flavor = "mocha"; home.packages = with pkgs; [ tofi @@ -214,7 +282,23 @@ swaynotificationcenter swaybg slurp + grim ]; + + gtk = { + enable = true; + + theme = { + name = "Rosé Pine"; + package = pkgs.rose-pine-gtk-theme; + }; + + cursorTheme = { + name = "breeze_cursors"; + package = pkgs.numix-cursor-theme; + }; + }; + home.homeDirectory = "/home/ku"; nixpkgs.config.allowUnfree = true; @@ -224,28 +308,6 @@ userEmail = "contact@kualta.dev"; }; - gtk = { - enable = true; - theme = { - name = "Catppuccin-Macchiato-Compact-Pink-Dark"; - package = pkgs.catppuccin-gtk.override { - accents = [ "pink" ]; - size = "compact"; - tweaks = [ "rimless" ]; - variant = "macchiato"; - }; - }; - }; - - xdg.configFile = { - "gtk-4.0/assets".source = - "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/assets"; - "gtk-4.0/gtk.css".source = - "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk.css"; - "gtk-4.0/gtk-dark.css".source = - "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk-dark.css"; - }; - programs.vscode = { enable = true; extensions = with pkgs.vscode-extensions; [ @@ -256,10 +318,90 @@ dconf = { enable = true; - settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; + settings = { + "org/gnome/desktop/datetime" = { automatic-timezone = true; }; + "org/gnome/system/location" = { enabled = true; }; + "org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; }; + "org/gnome/desktop/wm/keybindings" = { + close = [ "q" "F4" ]; + minimize = [ "comma" ]; + toggle-maximized = [ "m" ]; + move-to-monitor-left = [ ]; + move-to-monitor-right = [ ]; + move-to-monitor-up = [ ]; + move-to-monitor-down = [ ]; + move-to-workspace-down = [ ]; + move-to-workspace-up = [ ]; + switch-to-workspace-down = [ "Down" ]; + switch-to-workspace-up = [ "Up" ]; + switch-to-workspace-left = [ ]; + switch-to-workspace-right = [ ]; + move-to-workspace-1 = [ "1" ]; + move-to-workspace-2 = [ "2" ]; + move-to-workspace-3 = [ "3" ]; + move-to-workspace-4 = [ "4" ]; + move-to-workspace-5 = [ "5" ]; + move-to-workspace-6 = [ "6" ]; + move-to-workspace-7 = [ "7" ]; + move-to-workspace-8 = [ "8" ]; + move-to-workspace-9 = [ "9" ]; + switch-to-workspace-1 = [ "1" ]; + switch-to-workspace-2 = [ "2" ]; + switch-to-workspace-3 = [ "3" ]; + switch-to-workspace-4 = [ "4" ]; + switch-to-workspace-5 = [ "5" ]; + switch-to-workspace-6 = [ "6" ]; + switch-to-workspace-7 = [ "7" ]; + switch-to-workspace-8 = [ "8" ]; + switch-to-workspace-9 = [ "9" ]; + maximize = [ ]; + unmaximize = [ ]; + }; + "org/gnome/mutter" = { dynamic-workspaces = false; }; + "org/gnome/desktop/wm/preferences" = { num-workspaces = 9; }; + + "org/gnome/shell/keybindings" = { + open-application-menu = [ ]; + toggle-message-tray = [ "n" ]; + toggle-overview = [ ]; + }; + + "org/gnome/mutter/keybindings" = { + toggle-tiled-left = [ ]; + toggle-tiled-right = [ ]; + }; + + "org/gnome/mutter/wayland/keybindings" = { restore-shortcuts = [ ]; }; + + "org/gnome/settings-daemon/plugins/media-keys" = { + screensaver = [ "Escape ." ]; + home = [ "e" ]; + www = [ "b" ]; + rotate-video-lock-static = [ ]; + }; + + "org/gnome/shell/extensions/pop-shell" = { + toggle-tiling = [ "y" ]; + toggle-floating = [ "g" ]; + tile-enter = [ "t" ]; + tile-accept = [ "Return" ]; + tile-reject = [ "Escape" ]; + toggle-stacking-global = [ "s" ]; + pop-workspace-down = [ "Down" "j" ]; + pop-workspace-up = [ "Up" "k" ]; + pop-monitor-left = [ "Left" "h" ]; + pop-monitor-right = [ "Right" "l" ]; + pop-monitor-down = [ ]; + pop-monitor-up = [ ]; + focus-left = [ "Left" "h" ]; + focus-down = [ "Down" "j" ]; + focus-up = [ "Up" "k" ]; + focus-right = [ "Right" "l" ]; + }; + }; }; - home.stateVersion = "23.11"; + home.stateVersion = "24.05"; }; security.sudo.enable = true; @@ -280,6 +422,5 @@ echo "updated desktop configs" ''; - system.stateVersion = "23.11"; + system.stateVersion = "24.05"; } -