From ac71ee252998b0a575f88d9e1162d6cfaa7d6d9b Mon Sep 17 00:00:00 2001 From: coast Date: Sat, 4 Oct 2025 17:47:25 +0330 Subject: [PATCH] updates --- config/foot/foot.ini | 2 +- config/nvim/init.vim | 9 ++++ config/nvim/vim-graft/config.rb | 2 + config/qtile/config.py | 27 +++++------- etc/nixos/configuration.nix | 44 ++++--------------- etc/nixos/flake.lock | 66 ++++++++++++++++++++++++++++ etc/nixos/flake.nix | 41 +++++++++++++++++ etc/nixos/hardware-configuration.nix | 33 ++++++++++++++ etc/nixos/home.nix | 30 +++++-------- local/bin/screenie-wl | 19 -------- local/bin/screenie-wlr | 9 ++++ local/bin/start_qtile.sh | 3 +- 12 files changed, 193 insertions(+), 92 deletions(-) create mode 100644 etc/nixos/flake.lock create mode 100644 etc/nixos/flake.nix create mode 100644 etc/nixos/hardware-configuration.nix delete mode 100755 local/bin/screenie-wl create mode 100755 local/bin/screenie-wlr diff --git a/config/foot/foot.ini b/config/foot/foot.ini index 1ffcd6d..0642eb4 100644 --- a/config/foot/foot.ini +++ b/config/foot/foot.ini @@ -1,4 +1,4 @@ -font=UbuntuMono:size=14 +font=JetBrains Mono NF:size=14 pad=8x8 [colors] diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 13e11d9..0e93ccb 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -25,3 +25,12 @@ if executable('nil') \ 'whitelist': ['nix'], \ }) endif + +if executable('clangd') + autocmd User lsp_setup call lsp#register_server({ + \ 'name': 'clangd', + \ 'cmd': {server_info-> ['clangd']}, + \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'], + \ 'root_markers': ['compile_commands.json', 'Makefile', '.git'], + \ }) +endif diff --git a/config/nvim/vim-graft/config.rb b/config/nvim/vim-graft/config.rb index 65bf3a4..1503530 100644 --- a/config/nvim/vim-graft/config.rb +++ b/config/nvim/vim-graft/config.rb @@ -14,5 +14,7 @@ CONFIG = { "lilydjwg/colorizer", "prabirshrestha/vim-lsp", "mattn/vim-lsp-settings", + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-nvim-lsp", ] } diff --git a/config/qtile/config.py b/config/qtile/config.py index 7fd9913..8766fa0 100644 --- a/config/qtile/config.py +++ b/config/qtile/config.py @@ -5,14 +5,11 @@ from libqtile.utils import guess_terminal from libqtile.bar import Bar, Gap import subprocess -#run commands on startup subprocess.run("/home/coast/.local/src/local/bin/start_qtile.sh") -#define terminal and super key mod = "mod4" terminal = "footclient" -#keybinds keys = [ Key([mod], "h", lazy.layout.left(), desc="Move focus to left"), Key([mod], "j", lazy.layout.right(), desc="Move focus to right"), @@ -44,8 +41,8 @@ keys = [ Key([mod], "space", lazy.window.toggle_floating(), desc="Toggle floating on the focused window"), Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"), Key([mod, "shift"], "q", lazy.shutdown(), desc="Shutdown Qtile"), - Key([mod], "r", lazy.spawn("wmenu-run -f \"Ubuntu 14\" -N #000000"), desc="Spawn a command using wmenu"), - Key([mod], "Print", lazy.spawn("/home/coast/.local/src/local/bin/screenie-wl")), + Key([mod], "r", lazy.spawn("wmenu-run -f \"JetBrainsMono NF 12\" -N #000000 -b"), desc="Spawn a command using wmenu"), + Key([mod], "Print", lazy.spawn("/home/coast/.local/src/local/bin/screenie-wlr")), ] for vt in range(1, 8): @@ -77,30 +74,25 @@ for i in groups: ) layouts = [ - layout.MonadTall( - font = "Ubuntu", fontsize = 10, margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]), + layout.MonadTall(font = "JetBrains Mono Nerd Font", fontsize = 10, margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]), # Try more layouts by unleashing below layouts. # layout.Stack(num_stacks=2), # layout.Bsp(), # layout.Matrix(), - layout.MonadWide(font = "Ubuntu", fontsize = 10, margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]), - # layout.RatioTile(), + layout.MonadWide(font = "JetBrains Mono Nerd Font", fontsize = 10, margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]), + layout.RatioTile(font = "JetBrains Mono Nerd Font", fontsize = 10, margin = 8, border_focus=["#454545"], border_width=4, border_normal=["#1c1c1c"]), # layout.Tile(), # layout.TreeTab(), # layout.VerticalTile(), # layout.Zoomy(), ] -widget_defaults = dict( - font="sans", - fontsize=12, - padding=3, -) +widget_defaults = dict(font="sans", fontsize=12, padding=3) extension_defaults = widget_defaults.copy() screens = [ Screen( - top=bar.Bar( + bottom=bar.Bar( [ widget.GroupBox(font = "JetBrains Mono Nerd Font", margin_y = 5, margin_x = 5, padding_y = 0, padding_x = 2, borderwidth = 3, rounded = False, highlight_method = "line", inactive = ["#ffffff"], ), widget.TextBox(text = '|', font = "JetBrains Mono Nerd Font", padding = 2,), @@ -114,8 +106,9 @@ screens = [ }, name_transform=lambda name: name.upper()), widget.StatusNotifier(), - widget.Clock(format="%I:%M %p"), - widget.QuickExit(), + widget.TextBox(text = '|', font = "JetBrains Mono Nerd Font", padding = 2,), + widget.Clock(format="%I:%M %p", font = "JetBrains Mono Nerd Font", fontsize = 14, padding = 2), + widget.QuickExit(font = "JetBrains Mono Nerd Font", padding = 2, rounded = False, fontsize = 14), ], 24, ), diff --git a/etc/nixos/configuration.nix b/etc/nixos/configuration.nix index c220880..1602390 100644 --- a/etc/nixos/configuration.nix +++ b/etc/nixos/configuration.nix @@ -1,37 +1,26 @@ -{ config, lib, pkgs, ... }: let - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-25.05.tar.gz"; -in { - imports = - [ - ./hardware-configuration.nix - (import "${home-manager}/nixos") - ]; - - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - backupFileExtension = "backup"; - users.coast = import ./home.nix; - }; +{ config, pkgs, ... }: { + imports = [ ./hardware-configuration.nix ]; boot = { loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = true; - kernelModules = ["kvm-intel"]; }; networking.hostName = "core"; networking.enableIPv6 = false; time.timeZone = "Asia/Tehran"; + xdg.portal.enable = true; + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-wlr ]; services = { xserver = { enable = true; videoDrivers = ["nvidia"]; + windowManager.qtile.enable = true; }; + flatpak.enable = true; displayManager.ly.enable = true; - blueman.enable = true; printing.enable = false; jellyfin.enable = true; @@ -52,36 +41,19 @@ in { hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; - virtualisation.virtualbox.host.enable = true; - users.extraGroups.vboxusers.members = [ "coast" ]; - virtualisation.virtualbox.host.enableExtensionPack = true; - security.sudo.enable = false; security.doas = { enable = true; extraRules = [{ users = [ "coast" ]; keepEnv = true; persist = true; }]; }; - environment.systemPackages = with pkgs; [ - neovim - wget - adwaita-icon-theme - qemu - nil - (pkgs.runCommand "vim-wrapper" { } '' - mkdir -p $out/bin - ln -s ${pkgs.neovim}/bin/nvim $out/bin/vim - '') - ]; - programs = { zsh.enable = true; zsh.syntaxHighlighting.enable = true; foot.enable = true; + nano.enable = false; nekoray.enable = true; nekoray.tunMode.enable = true; - nano.enable = false; - sway.enable = true; }; fonts.packages = with pkgs; [ @@ -89,6 +61,7 @@ in { ubuntu_font_family nerd-fonts._0xproto nerd-fonts.droid-sans-mono + nerd-fonts.jetbrains-mono ]; hardware.graphics.enable = true; @@ -100,6 +73,7 @@ in { package = config.boot.kernelPackages.nvidiaPackages.stable; }; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; services.openssh.enable = true; system.stateVersion = "25.05"; } diff --git a/etc/nixos/flake.lock b/etc/nixos/flake.lock new file mode 100644 index 0000000..1eee6c2 --- /dev/null +++ b/etc/nixos/flake.lock @@ -0,0 +1,66 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1758463745, + "narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.05", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1759281824, + "narHash": "sha256-FIBE1qXv9TKvSNwst6FumyHwCRH3BlWDpfsnqRDCll0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5b5be50345d4113d04ba58c444348849f5585b4a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1759381078, + "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/etc/nixos/flake.nix b/etc/nixos/flake.nix new file mode 100644 index 0000000..a4dce26 --- /dev/null +++ b/etc/nixos/flake.nix @@ -0,0 +1,41 @@ +{ + description = "Flakes once again"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager/release-25.05"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { nixpkgs, nixpkgs-unstable, home-manager, ... }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + pkgs-unstable = import nixpkgs-unstable { inherit system; }; + in { + nixosConfigurations.core = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ./configuration.nix + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.coast = import ./home.nix; + home-manager.backupFileExtension = "backup"; + } + { + environment.systemPackages = with pkgs; [ + git + (lib.hiPrio pkgs.uutils-coreutils-noprefix) + (pkgs.runCommand "vim-wrapper" { } '' + mkdir -p $out/bin + ln -s ${pkgs.neovim}/bin/nvim $out/bin/vim + '') + pkgs-unstable.firefox + ]; + } + ]; + }; + }; +} diff --git a/etc/nixos/hardware-configuration.nix b/etc/nixos/hardware-configuration.nix new file mode 100644 index 0000000..bee3e96 --- /dev/null +++ b/etc/nixos/hardware-configuration.nix @@ -0,0 +1,33 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/8a574ece-d362-484c-b72a-bd17ce935986"; + fsType = "ext4"; + }; + + 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.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/etc/nixos/home.nix b/etc/nixos/home.nix index b1e1ee1..dcc9240 100644 --- a/etc/nixos/home.nix +++ b/etc/nixos/home.nix @@ -1,35 +1,26 @@ { config, pkgs, ... }: let dotDir = "${config.home.homeDirectory}/.local/src/config/"; - mkSymlink = path: config.lib.file.mkOutOfStoreSymlink path; + mkSl = path: config.lib.file.mkOutOfStoreSymlink path; configs = { sway = "sway"; kitty = "kitty"; foot = "foot"; + qtile = "qtile"; mako = "mako"; + nvim = "nvim"; }; - utilPkgs = with pkgs; [ - alsa-utils nix-search-cli neofetch dysk nsxiv tree wl-clipboard appimage-run libnotify grim slurp yazi mate.caja htop - ]; - windowManagerPkgs = with pkgs; [ - mako nsxiv autotiling nwg-look - ]; - devPkgs = with pkgs; [ - gcc ruby_3_4 git nodejs - ]; + utilPkgs = with pkgs; [ alsa-utils nix-search-cli neofetch dysk nsxiv tree wl-clipboard appimage-run libnotify grim slurp yazi mate.caja htop nixpkgs-fmt ]; + windowManagerPkgs = with pkgs; [ wmenu mako nsxiv autotiling nwg-look xorg.xkill ]; + devPkgs = with pkgs; [ emacs-gtk gcc clang-tools ruby_3_4 nodejs ]; + otherPkgs = with pkgs; [ mpv vesktop wlr-randr swaybg ]; in { home.username = "coast"; home.homeDirectory = "/home/coast"; home.stateVersion = "25.05"; - xdg.configFile = builtins.mapAttrs (name: subpath: { - source = mkSymlink "${dotDir}/${subpath}"; - recursive = true; - }) configs; + xdg.configFile = builtins.mapAttrs (name: subpath: { source = mkSl "${dotDir}/${subpath}"; recursive = true; }) configs; - home.packages = windowManagerPkgs ++ devPkgs ++ utilPkgs; - - programs.firefox.enable = true; - programs.vesktop.enable = true; + home.packages = windowManagerPkgs ++ devPkgs ++ utilPkgs ++ otherPkgs; programs.zsh = { enable = true; @@ -70,11 +61,12 @@ in { zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=12" autoload -U colors && colors && setopt prompt_subst - PROMPT="[%n@%m %~]$ " + PROMPT="[%n@%m %~]%% " export LIBCLANG_PATH=/usr/lib/llvm/20/lib64 export PATH=$PATH:/home/coast/.spicetify source ~/.local/src/zsh.d/zsh-autosuggestions.zsh export PATH="/usr/bin:$PATH" + export PATH="$HOME/.local/bin:$PATH" ''; }; } diff --git a/local/bin/screenie-wl b/local/bin/screenie-wl deleted file mode 100755 index 9110ceb..0000000 --- a/local/bin/screenie-wl +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env zsh - -DIR=~/Pictures/Screenshots -mkdir -p "$DIR" - -TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S") -FILENAME="screenshot_${TIMESTAMP}.png" -FILEPATH="${DIR}/${FILENAME}" - -REGION=$(slurp) -if [[ -z "$REGION" ]]; then - notify-send "Screenshot canceled" "No region selected" - exit 1 -fi - -grim -g "$REGION" "$FILEPATH" -wl-copy < "$FILEPATH" -notify-send "Screenshot saved" "$FILEPATH" -echo "$FILEPATH" diff --git a/local/bin/screenie-wlr b/local/bin/screenie-wlr new file mode 100755 index 0000000..a5c8899 --- /dev/null +++ b/local/bin/screenie-wlr @@ -0,0 +1,9 @@ +#!/bin/sh +SAVEDIR="$HOME/Pictures/Screenshots" +mkdir -p "$SAVEDIR" +TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S") +SCREENSHOT_PATH="$SAVEDIR/screenshot_$TIMESTAMP.png" +grim -g "$(slurp)" "$SCREENSHOT_PATH" +wl-copy < "$SCREENSHOT_PATH" +echo "Screenshot saved to $SCREENSHOT_PATH" +notify-send -i "$SCREENSHOT_PATH" "Saved to $SCREENSHOT_PATH and copied to clipboard." diff --git a/local/bin/start_qtile.sh b/local/bin/start_qtile.sh index d500ba1..7137e12 100755 --- a/local/bin/start_qtile.sh +++ b/local/bin/start_qtile.sh @@ -1,4 +1,5 @@ #!/bin/sh wlr-randr --output eDP-1 --off & -swaybg -i ~/Pictures/nature4.png & foot -s & +sleep 1 & +swaybg -i ~/Pictures/nature4.png &