From 9c3d012f9d0acd7a54b6a4d92d09bdd29c520bcb Mon Sep 17 00:00:00 2001 From: coast Date: Sat, 25 Oct 2025 16:16:41 +0330 Subject: [PATCH] init --- config/nvim/nvim | 1 + config/nvim/pack/graft/start/vim-lsp-settings | 2 +- etc/nixos/compose.nix | 26 ++- etc/nixos/create.nix | 20 +- etc/nixos/home.nix | 186 +++++++++++------- local/bin/screenie-wlr | 2 +- 6 files changed, 151 insertions(+), 86 deletions(-) create mode 120000 config/nvim/nvim diff --git a/config/nvim/nvim b/config/nvim/nvim new file mode 120000 index 0000000..b297066 --- /dev/null +++ b/config/nvim/nvim @@ -0,0 +1 @@ +/nix/store/5hcm30287f6kxb02yzr92lmqpx8npgjq-home-manager-files/.config/nvim \ No newline at end of file diff --git a/config/nvim/pack/graft/start/vim-lsp-settings b/config/nvim/pack/graft/start/vim-lsp-settings index 8860e8f..01d48cc 160000 --- a/config/nvim/pack/graft/start/vim-lsp-settings +++ b/config/nvim/pack/graft/start/vim-lsp-settings @@ -1 +1 @@ -Subproject commit 8860e8fbba6c77f7cb170c94f02b09cdf006fe6f +Subproject commit 01d48cc7c176b3efb72cf8835803cbe6c58b53b3 diff --git a/etc/nixos/compose.nix b/etc/nixos/compose.nix index e9b9d5b..d955dec 100644 --- a/etc/nixos/compose.nix +++ b/etc/nixos/compose.nix @@ -4,7 +4,7 @@ let unstable = pkgsUnstable; in { - imports = [ /etc/nixos/hardware-configuration.nix ]; + imports = [ ./hardware-configuration.nix ]; boot = { readOnlyNixStore = true; @@ -21,14 +21,22 @@ in time.timeZone = "Asia/Tehran"; hardware = { - graphics.enable = true; - nvidia = { - modesetting.enable = true; - powerManagement.enable = true; - open = false; - nvidiaSettings = true; - package = pkgs.linuxPackages.nvidiaPackages.beta; - }; + # graphics.enable = true; + # nvidia = { + # modesetting.enable = true; + # powerManagement.enable = true; + # open = false; + # nvidiaSettings = true; + # package = pkgs.linuxPackages.nvidiaPackages.beta; + # prime.offload = { + # enable = true; + # enableOffloadCmd = true; + # }; + # prime = { + # intelBusId = "PCI:0:2:0"; + # nvidiaBusId = "PCI:1:0:0"; + # }; + # }; bluetooth.enable = true; bluetooth.powerOnBoot = true; }; diff --git a/etc/nixos/create.nix b/etc/nixos/create.nix index 3195d06..96c1793 100644 --- a/etc/nixos/create.nix +++ b/etc/nixos/create.nix @@ -3,18 +3,21 @@ services = { xserver = { enable = true; - videoDrivers = ["nvidia"]; - windowManager.qtile.enable = true; + # videoDrivers = ["modesetting" "nvidia"]; + windowManager.qtile.enable = false; }; displayManager.ly.enable = true; - blueman.enable = true; + blueman.enable = false; printing.enable = false; - jellyfin.enable = true; - pipewire = { - enable = true; - pulse.enable = true; - }; + }; + + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; }; nixpkgs.config.allowUnfree = true; @@ -32,6 +35,7 @@ nano.enable = false; nekoray.enable = true; nekoray.tunMode.enable = true; + sway.enable = true; }; fonts.packages = with pkgs; [ diff --git a/etc/nixos/home.nix b/etc/nixos/home.nix index e3e0d7d..09ca00e 100644 --- a/etc/nixos/home.nix +++ b/etc/nixos/home.nix @@ -1,75 +1,127 @@ { config, pkgs, ... }: let - dotDir = "${config.home.homeDirectory}/.local/src/config/"; - mkSl = path: config.lib.file.mkOutOfStoreSymlink path; - configs = { - sway = "sway"; - kitty = "kitty"; - foot = "foot"; - qtile = "qtile"; - mako = "mako"; - nvim = "nvim"; - eww = "eww"; - }; + dotDir = "${config.home.homeDirectory}/.local/src/config/"; + mkSl = path: config.lib.file.mkOutOfStoreSymlink path; + configs = { + kitty = "kitty"; + foot = "foot"; + qtile = "qtile"; + mako = "mako"; + nvim = "nvim"; + eww = "eww"; + }; + modifier = "Mod4"; + terminal = "footclient"; + menu = "${pkgs.wmenu}/bin/wmenu-run"; in { - home.username = "coast"; - home.homeDirectory = "/home/coast"; - home.stateVersion = "25.05"; - - xdg.configFile = builtins.mapAttrs (name: subpath: { source = mkSl "${dotDir}/${subpath}"; recursive = true; }) configs; + home.username = "coast"; + home.homeDirectory = "/home/coast"; + home.stateVersion = "25.05"; + + xdg.configFile = builtins.mapAttrs (name: subpath: { source = mkSl "${dotDir}/${subpath}"; recursive = true; }) configs; - home.packages = with pkgs; [ - alsa-utils nix-search-cli neofetch dysk nsxiv tree wl-clipboard appimage-run libnotify grim slurp yazi mate.caja htop nixpkgs-fmt - swaybg wmenu mako nwg-look xorg.xkill - mpv vesktop wlr-randr rtorrent tor-browser - nodejs gcc gnumake clang-tools ruby_3_4 pkg-config - eww - ]; + home.packages = with pkgs; [ + alsa-utils nix-search-cli neofetch dysk nsxiv tree wl-clipboard appimage-run libnotify grim slurp yazi mate.caja htop nixpkgs-fmt + swaybg wmenu mako nwg-look xorg.xkill + mpv vesktop wlr-randr autotiling + nodejs gcc gnumake clang-tools ruby_3_4 pkg-config dmd dtools rustup + ]; - programs.zsh = { - enable = true; - history = { - path = "/home/coast/.cache/zsh/history"; - size = 100000000; - save = 100000000; - append = true; + wayland.windowManager.sway = { + enable = true; + wrapperFeatures.gtk = true; + config = { + modifier = "Mod4"; + gaps = { + inner = 5; + outer = 10; }; - enableCompletion = true; - shellAliases = { - nf = "neofetch"; - nrs = "doas nixos-rebuild switch"; - emoji = "cat ~/.local/src/local/share/emoji | grep"; - ls = "ls --color=auto"; - smi = "nvidia-smi"; - battery = "sb-battery"; - weather = "curl wttr.in/masjedsoleyman"; - las = "ls"; - c = "clear"; - cear = "clear"; - ".." = "cd .."; - hotp = "htop"; - main = "man"; - mian = "man"; - mna = "man"; - dias = "doas"; - delgen = "doas nix-env --delete-generations old --profile /nix/var/nix/profiles/system"; - alsamixer = "alsamixer -c 0 --no-color"; - la = "ls --color=auto -la"; + output.eDP-1.disable = ""; + keybindings = { + "${modifier}+Return" = "exec ${terminal}"; + "${modifier}+r" = "exec ${menu} -l 10"; + "${modifier}+s" = "kill"; + "${modifier}+Print" = "exec /home/coast/.local/src/local/bin/screenie-wlr"; + "${modifier}+1" = "workspace 1"; + "${modifier}+2" = "workspace 2"; + "${modifier}+3" = "workspace 3"; + "${modifier}+4" = "workspace 4"; + "${modifier}+5" = "workspace 5"; + "${modifier}+6" = "workspace 6"; + "${modifier}+7" = "workspace 7"; + "${modifier}+8" = "workspace 8"; + "${modifier}+9" = "workspace 9"; + "${modifier}+0" = "workspace 10"; + "${modifier}+Shift+1" = "move container to workspace 1"; + "${modifier}+Shift+2" = "move container to workspace 2"; + "${modifier}+Shift+3" = "move container to workspace 3"; + "${modifier}+Shift+4" = "move container to workspace 4"; + "${modifier}+Shift+5" = "move container to workspace 5"; + "${modifier}+Shift+6" = "move container to workspace 6"; + "${modifier}+Shift+7" = "move container to workspace 7"; + "${modifier}+Shift+8" = "move container to workspace 8"; + "${modifier}+Shift+9" = "move container to workspace 9"; + + "${modifier}+h" = "focus left"; + "${modifier}+j" = "focus down"; + "${modifier}+k" = "focus up"; + "${modifier}+l" = "focus right"; + + "${modifier}+Shift+i" = "exec caja"; + + "${modifier}+Shift+r" = "reload"; }; - initContent = '' - autoload -U compinit - zstyle ':completion:*' menu select - zmodload zsh/complist - compinit - comp_options+=(globdots) - 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 %~]%% " - 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" - ''; + startup = [ + { command = "autotiling"; } + { command = "foot -s"; } + ]; + }; + }; + + programs.zsh = { + enable = true; + history = { + path = "/home/coast/.cache/zsh/history"; + size = 100000000; + save = 100000000; + append = true; + }; + enableCompletion = true; + shellAliases = { + nf = "neofetch"; + nrs = "doas nixos-rebuild switch"; + emoji = "cat ~/.local/src/local/share/emoji | grep"; + ls = "ls --color=auto"; + smi = "nvidia-smi"; + battery = "sb-battery"; + weather = "curl wttr.in/masjedsoleyman"; + las = "ls"; + c = "clear"; + cear = "clear"; + ".." = "cd .."; + hotp = "htop"; + main = "man"; + mian = "man"; + mna = "man"; + dias = "doas"; + delgen = "doas nix-env --delete-generations old --profile /nix/var/nix/profiles/system"; + alsamixer = "alsamixer -c 0 --no-color"; + la = "ls --color=auto -la"; }; + initContent = '' + autoload -U compinit + zstyle ':completion:*' menu select + zmodload zsh/complist + compinit + comp_options+=(globdots) + 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 %~]%% " + 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-wlr b/local/bin/screenie-wlr index b2967f4..347529c 100755 --- a/local/bin/screenie-wlr +++ b/local/bin/screenie-wlr @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh TEMP_FULLSCREEN=$(mktemp /tmp/fullscreen_XXXXXX.png) grim "$TEMP_FULLSCREEN" TEMP_FILE=$(mktemp /tmp/screenshot_XXXXXX.png)