commit dc9c7c8461dc02631e45598cb6ed90235115df92 Author: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Mon Mar 11 19:36:05 2024 +0100 Init diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..14ce455 --- /dev/null +++ b/flake.lock @@ -0,0 +1,306 @@ +{ + "nodes": { + "devshell": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1708939976, + "narHash": "sha256-O5+nFozxz2Vubpdl1YZtPrilcIXPcRAjqNdNE8oCRoA=", + "owner": "numtide", + "repo": "devshell", + "rev": "5ddecd67edbd568ebe0a55905273e56cc82aabe3", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-compat": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709336216, + "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1710062421, + "narHash": "sha256-FiCNRfyUgJOLYIokLiFsfI7B+Zn9HDnOzFR3uVr5qsQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "36f873dfc8e2b6b89936ff3e2b74803d50447e0a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709988192, + "narHash": "sha256-qxwIkl85P0I1/EyTT+NJwzbXdOv86vgZxcv4UKicjK8=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "b0b0c3d94345050a7f86d1ebc6c56eea4389d030", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709771483, + "narHash": "sha256-Hjzu9nCknHLQvhdaRFfCEprH0o15KcaNu1QDr3J88DI=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "550340062c16d7ef8c2cc20a3d2b97bcd3c6b6f6", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1709961763, + "narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "devshell": "devshell", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "home-manager": "home-manager_2", + "nix-darwin": "nix-darwin", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1710016565, + "narHash": "sha256-GoNm8bTT2YjZwdS0jcF0u2mTb8TYDDVyl8vgGICaS8I=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "fb897e22e31f4d29766d94cea3df4aaf008c095e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1708018599, + "narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "nixvim": "nixvim" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..321c8d0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + description = "NixOS configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs@{ nixpkgs, home-manager, nixvim, ... }: { + nixosConfigurations = { + hadi = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./nixos/configuration.nix + ./hadi + ./hosts + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.hadi = import ./home/home.nix; + home-manager.extraSpecialArgs = { inherit inputs; }; + } + ]; + }; + }; + }; +} diff --git a/hadi/app.nix b/hadi/app.nix new file mode 100644 index 0000000..1fa95a3 --- /dev/null +++ b/hadi/app.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs; [ + firefox + nextcloud-client + obsidian + chromium + swappy + hyprpicker + discord + imv + spotify + ]; + + programs.thunar.enable = true; + nixpkgs.overlays = [ + (final: prev: { qutebrowser = prev.qutebrowser.override { enableWideVine = true; }; }) + ]; +} diff --git a/hadi/cli.nix b/hadi/cli.nix new file mode 100644 index 0000000..0a3a2fa --- /dev/null +++ b/hadi/cli.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs; [ + ranger + fd + lazygit + tree-sitter + btop + bitwarden-cli + ]; +} diff --git a/hadi/default.nix b/hadi/default.nix new file mode 100644 index 0000000..21591e6 --- /dev/null +++ b/hadi/default.nix @@ -0,0 +1,9 @@ +{ + imports = [ + ./app.nix + ./cli.nix + ./dev.nix + ./utils.nix + ./font.nix + ]; + } diff --git a/hadi/dev.nix b/hadi/dev.nix new file mode 100644 index 0000000..f832c00 --- /dev/null +++ b/hadi/dev.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs; [ + go + cargo + nodejs + python3 + ]; + + programs.nix-ld.enable = true; + programs.nix-ld.libraries = with pkgs; [ + stylua + lua-language-server + ]; +} diff --git a/hadi/font.nix b/hadi/font.nix new file mode 100644 index 0000000..ed6bcea --- /dev/null +++ b/hadi/font.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: { + + fonts.packages = with pkgs; [ + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + #inputs.apple-fonts.packages.${pkgs.system}.sf-pro-nerd + #inputs.apple-fonts.packages.${pkgs.system}.sf-mono-nerd + ]; + +} diff --git a/hadi/utils.nix b/hadi/utils.nix new file mode 100644 index 0000000..8a28942 --- /dev/null +++ b/hadi/utils.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs; [ + unzip + ripgrep + wget + libva + qt5ct + stow + blueman + gcc + peaclock + alejandra + libnotify + xdg_utils + tldr + ]; +} diff --git a/home/dunst/default.nix b/home/dunst/default.nix new file mode 100644 index 0000000..6264dc6 --- /dev/null +++ b/home/dunst/default.nix @@ -0,0 +1,76 @@ +{ config, lib, pkgs, ... }: + +{ +services.dunst = { + enable = true; + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + }; + settings = { + global = { + rounded = "yes"; + origin = "top-right"; + monitor = "0"; + alignment = "left"; + vertical_alignment = "center"; + width = "400"; + height = "400"; + scale = 0; + gap_size = 0; + progress_bar = true; + transparency = 0; + text_icon_padding = 0; + separator_color = "frame"; + sort = "yes"; + idle_threshold = 120; + line_height = 0; + markup = "full"; + show_age_threshold = 60; + ellipsize = "middle"; + ignore_newline = "no"; + stack_duplicates = true; + sticky_history = "yes"; + history_length = 20; + always_run_script = true; + corner_radius = 10; + follow = "mouse"; + font = "Source Sans Pro 10"; + format = "%s\\n%b"; #format = "%s %p\n%b" + frame_color = "#232323"; + frame_width = 1; + offset = "15x15"; + horizontal_padding = 10; + icon_position = "left"; + indicate_hidden = "yes"; + min_icon_size = 0; + max_icon_size = 64; + mouse_left_click = "do_action, close_current"; + mouse_middle_click = "close_current"; + mouse_right_click = "close_all"; + padding = 10; + plain_text = "no"; + separator_height = 2; + show_indicators = "yes"; + shrink = "no"; + word_wrap = "yes"; + browser = "/usr/bin/env librewolf -new-tab"; + }; + + fullscreen_delay_everything = {fullscreen = "delay";}; + + urgency_critical = { + background = "#d64e4e"; + foreground = "#f0e0e0"; + }; + urgency_low = { + background = "#232323"; + foreground = "#2596be"; + }; + urgency_normal = { + background = "#1e1e2a"; + foreground = "#2596be"; + }; + }; + }; +} diff --git a/home/git/default.nix b/home/git/default.nix new file mode 100644 index 0000000..b4555e8 --- /dev/null +++ b/home/git/default.nix @@ -0,0 +1,12 @@ +{ + programs.git = { + enable = true; + userName = "Hadi"; + userEmail = "112569860+anotherhadi@users.noreply.github.com"; + extraConfig = { + init.defaultBranch = "main"; + # Automatically track remote branch + push.autoSetupRemote = true; + }; + }; +} diff --git a/home/home.nix b/home/home.nix new file mode 100644 index 0000000..7466c97 --- /dev/null +++ b/home/home.nix @@ -0,0 +1,25 @@ +{ config, pkgs, ...}: { + home.username = "hadi"; + home.homeDirectory = "/home/hadi"; + + home.packages = with pkgs; [ + vscode + ]; + + home.stateVersion = "23.11"; + programs.home-manager.enable = true; + + imports = [ + ./hyprland + ./nvim + ./waybar + ./kitty + ./dunst + ./wlogout + ./wofi + ./qutebrowser + ./git + ./shell + ./misc + ]; +} diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix new file mode 100644 index 0000000..d0f1409 --- /dev/null +++ b/home/hyprland/default.nix @@ -0,0 +1,96 @@ +{pkgs, ...}:{ + + home.packages = with pkgs; [ + xdg-desktop-portal-hyprland + wlr-randr + swww + wl-clipboard + brightnessctl + gnome.gnome-themes-extra + adwaita-qt + adwaita-qt6 + gnome.adwaita-icon-theme + wlsunset + xwayland + xdg-desktop-portal-gtk + wlroots + wayland-utils + wayland-protocols + meson + ]; + + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + + settings = { + "$mod" = "SUPER"; + "$menu" = "~/scripts/menu.sh"; + "$powermenu" = "${pkgs.wlogout}/bin/wlogout"; + + monitor = [ + "eDP-2,highres,0x0,1" + "desc:AOC U34G2G1 0x00000E06,highrr,2560x0,1" + ",prefered,auto,1" + ]; + + bind = [ + "$mod, RETURN, exec, kitty" + "$mod, Q, killactive," + "$mod, E, exec, thunar" + "$mod, T, togglefloating," + "$mod, F, fullscreen" + "$mod, B, exec, firefox" + "$mod, C, exec, kitty --class floating peaclock" + "$mod, L, exec, hyprlock" + "$mod, SPACE, exec, $menu" + "$mod, X, exec, $powermenu" + ]++ ( + 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)); + + env = [ + + "XCURSOR_SIZE,24" + "LIBVA_DRIVER_NAME,nvidia" + "XDG_SESSION_TYPE,wayland" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + "WLR_NO_HARDWARE_CURSORS,1" + "QT_QPA_PLATFORMTHEME,qt5ct" + "SWWW_TRANSITION,wipe" + "XDG_CURRENT_DESKTOP,Hyprland" + "XDG_SESSION_TYPE,wayland" + "XDG_SESSION_DESKTOP,Hyprland" + "QT_AUTO_SCREEN_SCALE_FACTOR,1" + "QT_QPA_PLATFORM=wayland,xcb" + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "T_QPA_PLATFORMTHEME,qt5ct" + "WLR_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1" + "GTK_THEME,Adwaita:dark" + "GTK2_RC_FILES,/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc" + "QT_STYLE_OVERRIDE,Adwaita-Dark" + ]; + + input = { + kb_layout="fr"; + + kb_options = "caps:escape"; + follow_mouse = 1; + sensitivity = 0.5; + repeat_delay = 300; + repeat_rate = 50; + numlock_by_default=true; + + touchpad ={ + natural_scroll = true; + clickfinger_behavior= true; + }; + }; + + }; + }; +} diff --git a/home/kitty/default.nix b/home/kitty/default.nix new file mode 100644 index 0000000..6c9d8ec --- /dev/null +++ b/home/kitty/default.nix @@ -0,0 +1,67 @@ +{ + programs.kitty = { + enable = true; + settings = { + + scrollback_lines = 10000; + enable_audio_bell = false; + update_check_interval = 0; + font_family = "FiraCode Nerd Font"; + font_size = 13; + cursor_shape = "Underline"; + cursor_underline_thickness = 1; + window_padding_width = 10; + url_style = "curly"; + confirm_os_window_close = "0"; + remember_window_size = "no"; + disable_ligatures = "never"; + shell = "zsh"; + initial_window_width = 1000; + initial_window_height = 600; + + # Special + background = "#090914"; + url_color = "#9978F8"; + + # Black + color0 = "#414868"; + color8 = "#515878"; + + # Red + color1 = "#f7768e"; + color9 = "#f7869e"; + + # Green + color2 = "#73daca"; + color10 = "#83eada"; + + # Yellow + color3 = "#e0af68"; + color11 = "#f0bf78"; + + # Blue + color4 = "#7aa2f7"; + color12 = "#8ab2f7"; + + # Magenta + color5 = "#9978F8"; + color13 = "#A988F8"; + + # Cyan + color6 = "#7dcfff"; + color14 = "#8ddfff"; + + # White + color7 = "#E4E5E7"; + color15 = "#f4f5f7"; + + # Cursor + cursor = "#FBFBFB"; + cursor_text_color = "#090914"; + + # Selection highlight + selection_foreground = "#9978F8"; + selection_background = "#28344a"; + }; + }; +} diff --git a/home/misc/default.nix b/home/misc/default.nix new file mode 100644 index 0000000..34e6eb3 --- /dev/null +++ b/home/misc/default.nix @@ -0,0 +1,14 @@ +{ + home.file = { + ".ssh/config" = { + text = '' + Host github.com + User git + Hostname github.com + PreferredAuthentications publickey + IdentityFile ~/.ssh/github + ''; + executable = false; + }; + }; +} diff --git a/home/nvim/auto-pairs.nix b/home/nvim/auto-pairs.nix new file mode 100644 index 0000000..a347400 --- /dev/null +++ b/home/nvim/auto-pairs.nix @@ -0,0 +1 @@ +{ programs.nixvim.plugins.nvim-autopairs = { enable = true; }; } diff --git a/home/nvim/bufferline.nix b/home/nvim/bufferline.nix new file mode 100644 index 0000000..415e33d --- /dev/null +++ b/home/nvim/bufferline.nix @@ -0,0 +1 @@ +{ programs.nixvim.plugins.bufferline = { enable = true; }; } diff --git a/home/nvim/cmp.nix b/home/nvim/cmp.nix new file mode 100644 index 0000000..dee8cd5 --- /dev/null +++ b/home/nvim/cmp.nix @@ -0,0 +1,112 @@ +{ + programs.nixvim.plugins = { + luasnip.enable = true; + cmp-buffer = { enable = true; }; + cmp-emoji = { enable = true; }; + cmp-nvim-lsp = { enable = true; }; + cmp-path = { enable = true; }; + cmp_luasnip = { enable = true; }; + + cmp = { + enable = true; + settings = { + snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + sources = [ + { name = "nvim_lsp"; } + { name = "luasnip"; } + { name = "buffer"; } + { name = "nvim_lua"; } + { name = "path"; } + ]; + + formatting = { + fields = [ "abbr" "kind" "menu" ]; + format = +# lua + '' + function(_, item) + local icons = { + Namespace = "󰌗", + Text = "󰉿", + Method = "󰆧", + Function = "󰆧", + Constructor = "", + Field = "󰜢", + Variable = "󰀫", + Class = "󰠱", + Interface = "", + Module = "", + Property = "󰜢", + Unit = "󰑭", + Value = "󰎠", + Enum = "", + Keyword = "󰌋", + Snippet = "", + Color = "󰏘", + File = "󰈚", + Reference = "󰈇", + Folder = "󰉋", + EnumMember = "", + Constant = "󰏿", + Struct = "󰙅", + Event = "", + Operator = "󰆕", + TypeParameter = "󰊄", + Table = "", + Object = "󰅩", + Tag = "", + Array = "[]", + Boolean = "", + Number = "", + Null = "󰟢", + String = "󰉿", + Calendar = "", + Watch = "󰥔", + Package = "", + Copilot = "", + Codeium = "", + TabNine = "", + } + + local icon = icons[item.kind] or "" + item.kind = string.format("%s %s", icon, item.kind or "") + return item + end + ''; + }; + + window = { + completion = { + winhighlight = + "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; + scrollbar = false; + sidePadding = 0; + border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + }; + + documentation = { + border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + winhighlight = + "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; + }; + }; + + mapping = { + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.close()"; + "" = + "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })"; + }; + }; + }; + + }; +} diff --git a/home/nvim/default.nix b/home/nvim/default.nix new file mode 100644 index 0000000..05532b5 --- /dev/null +++ b/home/nvim/default.nix @@ -0,0 +1,51 @@ +{ pkgs, inputs, ... }: + +{ + imports = [ + inputs.nixvim.homeManagerModules.nixvim + ./auto-pairs.nix + ./options.nix + ./bufferline.nix + ./telescope.nix + ./nvim-tree.nix + ./lightline.nix + ./git.nix + ./cmp.nix + ./none-ls.nix + ./wilder.nix + ./lsp.nix + ./treesitter.nix + ./toggleterm.nix + ]; + + programs.nixvim = { + +enable = true; + + colorschemes.catppuccin.enable = true; + + keymaps = [ + # Global Mappings + # Default mode is "" which means normal-visual-op + { + # Toggle NvimTree + key = "e"; + action = "Neotree toggle"; + } + { + # Format file + key = "fm"; + action = "lua vim.lsp.buf.format()"; + } + + # Terminal Mappings + { + # Escape terminal mode using ESC + mode = "t"; + key = ""; + action = ""; + } + ]; + }; + +} diff --git a/home/nvim/git.nix b/home/nvim/git.nix new file mode 100644 index 0000000..df05090 --- /dev/null +++ b/home/nvim/git.nix @@ -0,0 +1,6 @@ +{ + programs.nixvim.plugins.gitsigns = { + enable = true; + currentLineBlame = true; + }; +} diff --git a/home/nvim/lightline.nix b/home/nvim/lightline.nix new file mode 100644 index 0000000..270a763 --- /dev/null +++ b/home/nvim/lightline.nix @@ -0,0 +1 @@ +{ programs.nixvim.plugins.lualine = { enable = true; }; } diff --git a/home/nvim/lsp.nix b/home/nvim/lsp.nix new file mode 100644 index 0000000..4544024 --- /dev/null +++ b/home/nvim/lsp.nix @@ -0,0 +1,18 @@ +{ + programs.nixvim.plugins.lsp = { + enable = true; + servers = { + bashls.enable = true; + clangd.enable = true; + gopls.enable = true; + nixd.enable = true; + }; + keymaps.lspBuf = { + "gd" = "definition"; + "gD" = "references"; + "gt" = "type_definition"; + "gi" = "implementation"; + "K" = "hover"; + }; + }; +} diff --git a/home/nvim/none-ls.nix b/home/nvim/none-ls.nix new file mode 100644 index 0000000..2d86744 --- /dev/null +++ b/home/nvim/none-ls.nix @@ -0,0 +1,18 @@ +{ + programs.nixvim.plugins.none-ls = { + enable = true; + sources = { + diagnostics = { + golangci_lint.enable = true; + statix.enable = true; + }; + formatting = { + fantomas.enable = true; + gofmt.enable = true; + goimports.enable = true; + nixfmt.enable = true; + markdownlint.enable = true; + }; + }; + }; +} diff --git a/home/nvim/nvim-tree.nix b/home/nvim/nvim-tree.nix new file mode 100644 index 0000000..ef41e5e --- /dev/null +++ b/home/nvim/nvim-tree.nix @@ -0,0 +1,5 @@ +{ + programs.nixvim.plugins.neo-tree = { + enable = true; + }; +} diff --git a/home/nvim/options.nix b/home/nvim/options.nix new file mode 100644 index 0000000..ef62225 --- /dev/null +++ b/home/nvim/options.nix @@ -0,0 +1,25 @@ +{ + + programs.nixvim.globals.mapleader = " "; + programs.nixvim.options = { + updatetime = 100; # Faster completion + + number = true; + relativenumber = true; + + autoindent = true; + clipboard = "unnamedplus"; + expandtab = true; + shiftwidth = 2; + smartindent = true; + tabstop = 2; + + ignorecase = true; + incsearch = true; + smartcase = true; + wildmode = "list:longest"; + + swapfile = false; + undofile = true; # Build-in persistent undo + }; +} diff --git a/home/nvim/telescope.nix b/home/nvim/telescope.nix new file mode 100644 index 0000000..95bfdfd --- /dev/null +++ b/home/nvim/telescope.nix @@ -0,0 +1,13 @@ +{ + programs.nixvim.plugins.telescope = { + enable = true; + keymaps = { + "fg" = "live_grep"; + "" = { + action = "git_files"; + desc = "Telescope Git Files"; + }; + }; + extensions.fzf-native = { enable = true; }; + }; +} diff --git a/home/nvim/toggleterm.nix b/home/nvim/toggleterm.nix new file mode 100644 index 0000000..49c0169 --- /dev/null +++ b/home/nvim/toggleterm.nix @@ -0,0 +1,7 @@ +{ + programs.nixvim.plugins.toggleterm = { + enable = true; + openMapping = ""; + direction = "horizontal"; + }; +} diff --git a/home/nvim/treesitter.nix b/home/nvim/treesitter.nix new file mode 100644 index 0000000..633e7bf --- /dev/null +++ b/home/nvim/treesitter.nix @@ -0,0 +1,11 @@ +{ + programs.nixvim.plugins = { + treesitter = { + enable = true; + nixGrammars = true; + indent = true; + }; + treesitter-context.enable = true; + rainbow-delimiters.enable = true; + }; +} diff --git a/home/nvim/wilder.nix b/home/nvim/wilder.nix new file mode 100644 index 0000000..d699fb9 --- /dev/null +++ b/home/nvim/wilder.nix @@ -0,0 +1,6 @@ +{ + programs.nixvim.plugins.wilder = { + enable = true; + modes = [ ":" "/" "?" ]; + }; +} diff --git a/home/qutebrowser/default.nix b/home/qutebrowser/default.nix new file mode 100644 index 0000000..e8e2497 --- /dev/null +++ b/home/qutebrowser/default.nix @@ -0,0 +1,269 @@ +{ + programs.qutebrowser = { + enable = true; + searchEngines = { + "DEFAULT" = "https://google.com/search?q={}"; + "yt" = "https://youtube.com/results?search_query={}"; + "nixo" = "https://search.nixos.org/options?channel=unstable&query={}"; + "nixp" = "https://search.nixos.org/packages?channel=unstable&query={}"; + }; + + settings = { + + colors = { + tabs = { + odd.bg = "#000000"; + odd.fg = "#FFFFFF"; + even.bg = "#000000"; + even.fg = "#FFFFFF"; + selected.odd.bg = "#101012"; + selected.odd.fg = "#FFFFFF"; + selected.even.bg = "#101012"; + selected.even.fg = "#FFFFFF"; + indicator.error = "#101012"; + indicator.start = "#101012"; + indicator.stop = "#101012"; + }; + + hints = { + bg = "#101012"; + fg = "#FFFFFF"; + match.fg = "#E2E2E2"; + }; + + completion = { + category.bg = "#101012"; + category.fg = "#FFFFFF"; + category.border.top = "#101012"; + category.border.bottom = "#101012"; + + odd.bg = "#101012"; + even.bg = "#101012"; + + fg = [ "#FFFFFF" "#FFFFFF" "#FFFFFF" ]; + + match.fg = "#FF0000"; + + item.selected.bg = "#FF0000"; + item.selected.border.top = "#FF0000"; + item.selected.border.bottom = "#FF0000"; + item.selected.fg = "#FBFBFB"; + item.selected.match.fg = "#FBFBFB"; + }; + + # statusbar = { + # normal.bg = colors.statusbar.bg; + # normal.fg = colors.statusbar.fg; + # private.bg = colors.statusbar.private.bg; + # private.fg = colors.statusbar.private.fg; + # command = { + # bg = colors.statusbar.bg; + # fg = colors.statusbar.fg; + # private.bg = colors.statusbar.private.bg; + # private.fg = colors.statusbar.private.fg; + # }; + # }; + # + # messages = { + # info = { + # bg = colors.statusbar.bg; + # fg = colors.statusbar.fg; + # border = colors.statusbar.bg; + # }; + # + # error = { + # bg = colors.messages.error.bg; + # fg = colors.messages.error.fg; + # border = colors.messages.error.bg; + # }; + # }; + }; + + completion = { + height = "30%"; + open_categories = [ "history" ]; + scrollbar = { + padding = 0; + width = 0; + }; + show = "always"; + shrink = true; + timestamp_format = ""; + web_history.max_items = 7; + }; + + content = { + autoplay = false; + javascript.clipboard = "access"; + pdfjs = true; + }; + + downloads = { + position = "bottom"; + remove_finished = 0; + }; + + fileselect = { + handler = "external"; + multiple_files.command = [ + "alacritty" + "--embed" + "$(xdotool getactivewindow)" + "-e" + "lf" + "-selection-path" + "{}" + ]; + single_file.command = [ + "alacritty" + "--embed" + "$(xdotool getactivewindow)" + "-e" + "lf" + "-selection-path" + "{}" + ]; + }; + + hints = { + border = "none"; + radius = 1; + }; + + scrolling = { + bar = "never"; + smooth = true; + }; + + statusbar = { + show = "never"; + widgets = [ ]; + }; + + tabs = { + show = "multiple"; + last_close = "close"; + mode_on_change = "restore"; + close_mouse_button = "right"; + }; + + url = { + default_page = "https://duckduckgo.com"; + start_pages = [ "https://duckduckgo.com" ]; + }; + + zoom.default = "130%"; + }; + + keyMappings = { + "" = "o"; + "" = "O"; + }; + + keyBindings = { + normal = { + ",p" = "tab-move -"; + ",n" = "tab-move +"; + + "" = "config-source"; + + "" = "fake-key "; + + "" = "scroll-to-perc 0"; + "" = "scroll-to-perc"; + "" = "back"; + "" = "forward"; + + "" = "open -w"; + "" = "open -p"; + + "" = "tab-close"; + "" = "tab-focus 1"; + "" = "tab-focus 2"; + "" = "tab-focus 3"; + "" = "tab-focus 4"; + "" = "tab-focus 5"; + "" = "tab-focus 6"; + "" = "tab-focus 7"; + "" = "tab-focus 8"; + "" = "tab-focus 9"; + "" = "tab-focus 10"; + + "gtb" = "open https://github.com/noib3"; + "ttb" = "open -t https://github.com/noib3"; + + "gma" = "open https://mail.protonmail.com/inbox"; + "tma" = "open -t https://mail.protonmail.com/inbox"; + + "gkp" = "open https://keep.google.com"; + "tkp" = "open -t https://keep.google.com"; + + "grhm" = + "open https://github.com/nix-community/home-manager/find/master"; + "trhm" = + "open -t https://github.com/nix-community/home-manager/find/master"; + + "gnv" = "open https://github.com/neovim/neovim/tree/master/src/nvim"; + "tnv" = "open -t https://github.com/neovim/neovim/tree/master/src/nvim"; + + "gbg" = "open https://rarbgunblocked.org/torrents.php"; + "tbg" = "open -t https://rarbgunblocked.org/torrents.php"; + + "g12ft" = "open https://12ft.io/"; + "t12ft" = "open -t https://12ft.io/"; + + "gtra" = "open http://localhost:9091/transmission/web/"; + "ttra" = "open -t http://localhost:9091/transmission/web/"; + }; + + command = { + "" = "tab-close"; + + "" = "completion-item-yank"; + "" = "fake-key --global "; + + "" = "rl-beginning-of-line"; + "" = "rl-end-of-line"; + "" = "rl-backward-kill-word"; + "" = "rl-unix-line-discard"; + }; + + insert = { + "" = "tab-close"; + + "" = "fake-key "; + "" = "fake-key "; + "" = "fake-key "; + "" = "fake-key "; + + "" = "fake-key "; + "" = "fake-key "; + "" = "fake-key "; + "" = "fake-key "; + + "" = "tab-focus 1"; + "" = "tab-focus 2"; + "" = "tab-focus 3"; + "" = "tab-focus 4"; + "" = "tab-focus 5"; + "" = "tab-focus 6"; + "" = "tab-focus 7"; + "" = "tab-focus 8"; + "" = "tab-focus 9"; + "" = "tab-focus 10"; + }; + }; + + extraConfig = '' + config.unbind("gm") + config.unbind("gd") + config.unbind("gb") + config.unbind("tl") + config.unbind("gt") + + c.tabs.padding = {"bottom": 0, "left": 7, "right": 7, "top": 0} + + config.load_autoconfig(True) + ''; + }; +} diff --git a/home/qutebrowser/duckduckgo_colorscheme.js b/home/qutebrowser/duckduckgo_colorscheme.js new file mode 100644 index 0000000..e69de29 diff --git a/home/shell/default.nix b/home/shell/default.nix new file mode 100644 index 0000000..d5de2bd --- /dev/null +++ b/home/shell/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./fzf.nix + ./zsh.nix + ./starship.nix + ./zoxide.nix + ]; +} diff --git a/home/shell/fzf.nix b/home/shell/fzf.nix new file mode 100644 index 0000000..983fc8d --- /dev/null +++ b/home/shell/fzf.nix @@ -0,0 +1,6 @@ +{ + programs.fzf = { + enable = true; + enableZshIntegration = true; + }; +} diff --git a/home/shell/starship.nix b/home/shell/starship.nix new file mode 100644 index 0000000..927ad3a --- /dev/null +++ b/home/shell/starship.nix @@ -0,0 +1,5 @@ +{ + programs.starship = { + enable = true; + }; +} diff --git a/home/shell/zoxide.nix b/home/shell/zoxide.nix new file mode 100644 index 0000000..12c084c --- /dev/null +++ b/home/shell/zoxide.nix @@ -0,0 +1,6 @@ +{ + programs.zoxide = { + enable= true; + enableZshIntegration = true; + }; +} diff --git a/home/shell/zsh.nix b/home/shell/zsh.nix new file mode 100644 index 0000000..8cc660e --- /dev/null +++ b/home/shell/zsh.nix @@ -0,0 +1,35 @@ +{ pkgs, lib, config, ... }: { + + home.packages = with pkgs; [ eza bat ripgrep tldr ]; + + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + + history = { + ignoreDups = true; + save = 1000000; + size = 1000000; + }; + + + profileExtra = lib.optionalString (config.home.sessionPath != [ ]) '' + export PATH="$PATH''${PATH:+:}${lib.concatStringsSep ":" config.home.sessionPath}" + ''; + + shellAliases = { + vim = "nvim"; + v = "nvim"; + c = "clear"; + clera = "clear"; + celar = "clear"; + e = "exit"; + cd = "z"; + ls = "eza --icons"; + open = "xdg-open"; + icat = "kitty +kitten icat"; + }; + }; +} diff --git a/home/waybar/default.nix b/home/waybar/default.nix new file mode 100644 index 0000000..d157c47 --- /dev/null +++ b/home/waybar/default.nix @@ -0,0 +1,244 @@ +{ + services = { + blueman-applet.enable = true; + network-manager-applet.enable = true; + }; + + programs.waybar = { + enable = true; + systemd.enable = true; + settings = { + mainBar = { + layer = "top"; + position = "top"; + spacing = 0; + "margin-top" = 15; + "margin-left" = 15; + "margin-right" = 15; + height = 40; + modules-left = [ "custom/logo" "hyprland/window" ]; + modules-center = [ "hyprland/workspaces" ]; + modules-right = + [ "tray" "backlight" "pulseaudio" "battery" "clock" "custom/power" ]; + + "wlr/taskbar" = { + format = "{icon}"; + "on-click" = "activate"; + "on-click-right" = "fullscreen"; + "icon-theme" = "WhiteSur"; + "icon-size" = 25; + "tooltip-format" = "{title}"; + }; + + "hyprland/workspaces" = { + "on-click" = "activate"; + format = "{icon}"; + "format-icons" = { + "default" = ""; + "1" = "1"; + "2" = "2"; + "3" = "3"; + "4" = "4"; + "5" = "5"; + "6" = "6"; + "7" = "7"; + "8" = "8"; + "9" = "9"; + "active" = "󱓻"; + "urgent" = "󱓻"; + }; + "persistent_workspaces" = { + "1" = [ ]; + "2" = [ ]; + "3" = [ ]; + "4" = [ ]; + "5" = [ ]; + }; + }; + + tray = { spacing = 16; }; + + clock = { + "tooltip-format" = "{calendar}"; + "format-alt" = " {:%a, %d %b %Y}"; + format = "󰥔 {:%I:%M %p}"; + }; + + pulseaudio = { + format = "{icon}"; + "format-bluetooth" = "󰂰"; + nospacing = 1; + "tooltip-format" = "Volume : {volume}%"; + "format-muted" = "󰝟"; + "format-icons" = { + "headphone" = ""; + "default" = [ "󰖀" "󰕾" "" ]; + }; + "on-click" = "pamixer -t"; + "scroll-step" = 1; + }; + + "custom/logo" = { + format = "  "; + tooltip = false; + "on-click" = "~/scripts/menu.sh"; + }; + + battery = { + format = "{capacity}% {icon}"; + "format-icons" = { + "charging" = [ "󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅" ]; + "default" = [ "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ]; + }; + "format-full" = "󰁹 "; + interval = 10; + states = { + warning = 20; + critical = 10; + }; + tooltip = false; + }; + + "custom/power" = { + format = "󰤆"; + tooltip = false; + "on-click" = "wlogout"; + }; + + backlight = { + device = "nvidia_0"; + format = "{icon}"; + "format-icons" = [ " " " " "" "" "" "" "" "" "" ]; + }; + }; + }; + style = '' + * { + border: none; + border-radius: 0; + min-height: 0; + font-family: "SFProDisplay Nerd Font Bold"; + } + + window#waybar { + background-color: #090914; + transition-property: background-color; + transition-duration: 0.5s; + border-radius: 15px; + font-size: 13px; + } + + window#waybar.hidden { + opacity: 0.5; + } + + #workspaces { + background-color: transparent; + } + + #workspaces button { + all: initial; /* Remove GTK theme values (waybar #1351) */ + min-width: 0; /* Fix weird spacing in materia (waybar #450) */ + box-shadow: inset 0 -3px transparent; /* Use box-shadow instead of border so the text isn't offset */ + padding: 6px 18px; + margin: 6px 3px; + border-radius: 4px; + background-color: #1e1e2e; + color: #cdd6f4; + } + + #workspaces button.active { + color: #1e1e2e; + background-color: #cdd6f4; + } + + #workspaces button:hover { + box-shadow: inherit; + text-shadow: inherit; + color: #1e1e2e; + background-color: #cdd6f4; + } + + #workspaces button.urgent { + background-color: #f38ba8; + } + + #memory, + #custom-power, + #battery, + #backlight, + #pulseaudio, + #network, + #clock, + #tray, + #backlight{ + border-radius: 9px; + margin: 6px 3px; + padding: 6px 12px; + background-color: #1e1e2e; + color: #FBFBFB; + } + + #tray menu { + background-color: #1e1e2e; + color: #FBFBFB; + } + + #custom-power { + margin-right: 6px; + } + + #custom-logo { + padding-right: 7px; + padding-left: 7px; + margin-left: 5px; + font-size: 15px; + border-radius: 8px 0px 0px 8px; + color: #9978F8; + } + + @keyframes blink { + to { + background-color: #f38ba8; + color: #181825; + } + } + + #battery.warning, + #battery.critical, + #battery.urgent { + background-color: #ff0048; + color: #181825; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + + #battery.charging { + background-color: #1E1E2E; + color: #FBFBFB; + animation: none; + } + + #custom-power { + background-color: #9978F8; + color: #0C0C0C; + margin-right: 7px; + } + + + tooltip { + border-radius: 8px; + padding: 15px; + background-color: #1E1E2E; + } + + tooltip label { + padding: 5px; + background-color: #1E1E2E; + } + ''; + }; +} diff --git a/home/wlogout/default.nix b/home/wlogout/default.nix new file mode 100644 index 0000000..d5c4f8d --- /dev/null +++ b/home/wlogout/default.nix @@ -0,0 +1,125 @@ +{ + programs.wlogout = { + enable = true; + layout = [ + { + label = "lock"; + action = "sleep 1; hyprlock"; + text = "Lock"; + keybind = "l"; + } + { + label = "hibernate"; + action = "sleep 1; systemctl hibernate"; + text = "Hibernate"; + keybind = "h"; + } + { + label = "logout"; + action = "sleep 1; killall -9 Hyprland sleep 2"; + text = "Exit"; + keybind = "e"; + } + { + label = "shutdown"; + action = "sleep 1; systemctl poweroff"; + text = "Shutdown"; + keybind = "s"; + } + { + label = "suspend"; + action = "sleep 1; systemctl suspend"; + text = "Suspend"; + keybind = "u"; + } + { + label = "reboot"; + action = "sleep 1; systemctl reboot"; + text = "Reboot"; + keybind = "r"; + } + ]; + + style = '' + * { + font-family: "Fira Sans Semibold"; + background-image: none; + transition: 20ms; + } + + window { + background-color: rgba(12, 12, 12, 0.5); + } + + button { + color: #FFFFFF; + font-size:20px; + + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + + border-style: solid; + background-color: rgba(12, 12, 12, 0.5); + border: 3px solid #FFFFFF; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + } + + button:focus, + button:active, + button:hover { + color: #9978F8; + background-color: rgba(12, 12, 12, 0.8); + border: 3px solid #9978F8; + } + + /* + ----------------------------------------------------- + Buttons + ----------------------------------------------------- + */ + + #lock { + margin: 10px; + border-radius: 20px; + background-image: image(url("icons/lock.png")); + } + + #logout { + margin: 10px; + border-radius: 20px; + background-image: image(url("icons/logout.png")); + } + + #suspend { + margin: 10px; + border-radius: 20px; + background-image: image(url("icons/suspend.png")); + } + + #hibernate { + margin: 10px; + border-radius: 20px; + background-image: image(url("icons/hibernate.png")); + } + + #shutdown { + margin: 10px; + border-radius: 20px; + background-image: image(url("icons/shutdown.png")); + } + + #reboot { + margin: 10px; + border-radius: 20px; + background-image: image(url("icons/reboot.png")); + } + ''; + }; + + xdg.configFile."wlogout/icons" = { + recursive = false; + source = ./icons; + }; + +} diff --git a/home/wlogout/icons/hibernate.png b/home/wlogout/icons/hibernate.png new file mode 100644 index 0000000..bf2b001 Binary files /dev/null and b/home/wlogout/icons/hibernate.png differ diff --git a/home/wlogout/icons/lock.png b/home/wlogout/icons/lock.png new file mode 100644 index 0000000..da59b10 Binary files /dev/null and b/home/wlogout/icons/lock.png differ diff --git a/home/wlogout/icons/logout.png b/home/wlogout/icons/logout.png new file mode 100644 index 0000000..8a25922 Binary files /dev/null and b/home/wlogout/icons/logout.png differ diff --git a/home/wlogout/icons/reboot.png b/home/wlogout/icons/reboot.png new file mode 100644 index 0000000..e5fd221 Binary files /dev/null and b/home/wlogout/icons/reboot.png differ diff --git a/home/wlogout/icons/shutdown.png b/home/wlogout/icons/shutdown.png new file mode 100644 index 0000000..663ca03 Binary files /dev/null and b/home/wlogout/icons/shutdown.png differ diff --git a/home/wlogout/icons/suspend.png b/home/wlogout/icons/suspend.png new file mode 100644 index 0000000..af099b9 Binary files /dev/null and b/home/wlogout/icons/suspend.png differ diff --git a/home/wofi/default.nix b/home/wofi/default.nix new file mode 100644 index 0000000..5cf0329 --- /dev/null +++ b/home/wofi/default.nix @@ -0,0 +1,95 @@ +{ + programs.wofi = { + enable = true; + + settings = { + allow_markup = true; + width = 250; + show = "drun"; + prompt = "Apps"; + normal_window = true; + layer = "top"; + term = "foot"; + height = "305px"; + orientation = "vertical"; + halign = "fill"; + line_wrap = "off"; + dynamic_lines = false; + allow_images = true; + image_size = 24; + exec_search = false; + hide_search = false; + parse_search = false; + insensitive = true; + hide_scroll = true; + no_actions = true; + sort_order = "default"; + gtk_dark = true; + filter_rate = 100; + key_expand = "Tab"; + key_exit = "Escape"; + }; + + style = '' + /** ********** Fonts ********** **/ + + * { + font-family: "SFProDisplay Nerd Font Bold", archcraft, sans-serif; + font-size: 12px; + } + + #window { + background-color: #0B0B13; + color: #D9E0EE; + border: 2px solid #1B1B23; + border-radius: 0px; + } + + #outer-box { + padding: 20px; + } + + #input { + background-color: #1B1B23; + border: 0px solid #B4BEFE; + padding: 8px 12px; + } + + #scroll { + margin-top: 20px; + } + + #inner-box {} + + #img { + padding-right: 8px; + } + + #text { + color: #D9E0EE; + } + + #text:selected { + color: #0B0B13; + } + + #entry { + padding: 6px; + } + + #entry:selected { + background-color: #B4BEFE; + color: #0B0B13; + } + + #unselected {} + + #selected {} + + #input, + #entry:selected { + border-radius: 4px; + } + ''; + }; +} diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 0000000..2c43ae3 --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,3 @@ +{ + imports = [ ./tuigreet ]; +} diff --git a/hosts/tuigreet/default.nix b/hosts/tuigreet/default.nix new file mode 100644 index 0000000..55688f4 --- /dev/null +++ b/hosts/tuigreet/default.nix @@ -0,0 +1,30 @@ +{pkgs, ...}: { + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --time --time-format '%I:%M %p | %a • %h | %F' --cmd Hyprland"; + user = "greeter"; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + greetd.tuigreet + ]; + + # this is a life saver. + # literally no documentation about this anywhere. + # might be good to write about this... + # https://www.reddit.com/r/NixOS/comments/u0cdpi/tuigreet_with_xmonad_how/ + systemd.services.greetd.serviceConfig = { + Type = "idle"; + StandardInput = "tty"; + StandardOutput = "tty"; + StandardError = "journal"; # Without this errors will spam on screen + # Without these bootlogs will spam on screen + TTYReset = true; + TTYVHangup = true; + TTYVTDisallocate = true; + }; +} diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..2a74a28 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,101 @@ +{ pkgs, ... }: { + imports = [ ./hardware-configuration.nix ]; + + # Bootloader. + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.systemd-boot = { + enable = true; + consoleMode = "auto"; + }; + + networking.hostName = "hadi"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Paris"; + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "fr_FR.UTF-8"; + LC_IDENTIFICATION = "fr_FR.UTF-8"; + LC_MEASUREMENT = "fr_FR.UTF-8"; + LC_MONETARY = "fr_FR.UTF-8"; + LC_NAME = "fr_FR.UTF-8"; + LC_NUMERIC = "fr_FR.UTF-8"; + LC_PAPER = "fr_FR.UTF-8"; + LC_TELEPHONE = "fr_FR.UTF-8"; + LC_TIME = "fr_FR.UTF-8"; + }; + + # Configure keymap in X11 + services.xserver = { + xkb.layout = "fr"; + xkb.variant = ""; + }; + console.keyMap = "fr"; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; + + users.users.hadi = { + isNormalUser = true; + description = "hadi"; + extraGroups = [ "networkmanager" "wheel" ]; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ networkmanagerapplet ]; + + nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" "nix-2.16.2" ]; + + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + + services.xserver.videoDrivers = [ "nvidia" ]; + + services.gnome.gnome-keyring.enable = true; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + powerManagement.finegrained = false; + open = false; + nvidiaSettings = true; + }; + hardware.bluetooth.enable = true; + + # Set environment variables + environment.variables = { + XDG_DATA_HOME = "$HOME/.local/share"; + PASSWORD_STORE_DIR = "$HOME/.local/share/password-store"; + MOZ_ENABLE_WAYLAND = "1"; + EDITOR = "nvim"; + ANKI_WAYLAND = "1"; + DISABLE_QT5_COMPAT = "0"; + NIXOS_OZONE_WL = "1"; + }; + + # Sound + sound = { enable = true; }; + + security.rtkit.enable = true; + hardware.pulseaudio.enable = false; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + wireplumber.enable = true; + }; + + system.stateVersion = "23.11"; +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..2b5308b --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,42 @@ +# 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 = ["nvme" "xhci_pci" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/6c2487ec-20ff-4ce3-9396-281c2094aba1"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/B4EA-C54F"; + fsType = "vfat"; + }; + + 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.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}