From bffc03201b69aa232fd5c78ee70e68c4c1e54ddb Mon Sep 17 00:00:00 2001 From: coast Date: Fri, 31 Oct 2025 22:14:15 +0330 Subject: [PATCH] repush --- config/foot/foot.ini | 4 + config/waybar/config.jsonc | 99 ++++++++++++++++ config/waybar/style.css | 88 ++++++++++++++ etc/nixos/configuration.nix | 127 +++++++++++++++++++++ etc/nixos/flake.lock | 16 +++ etc/nixos/flake.nix | 28 +++++ etc/nixos/home-configuration/apps/sway.nix | 91 +++++++++++++++ etc/nixos/home-configuration/home.nix | 127 +++++++++++++++++++++ local/bin/setwall.py | 20 ++++ 9 files changed, 600 insertions(+) create mode 100644 etc/nixos/configuration.nix create mode 100644 etc/nixos/home-configuration/apps/sway.nix create mode 100644 etc/nixos/home-configuration/home.nix create mode 100755 local/bin/setwall.py diff --git a/config/foot/foot.ini b/config/foot/foot.ini index 230f311..67b4a44 100644 --- a/config/foot/foot.ini +++ b/config/foot/foot.ini @@ -4,7 +4,11 @@ pad=8x8 [colors] #foreground=ebdbb2 # light foreground (text) alpha=0.9 +<<<<<<< HEAD background=000000 # dark background +======= +background=111111 # dark background +>>>>>>> bd52954 (repush) # ### Normal/regular colors (color palette 0-7) #regular0=1d2021 # black diff --git a/config/waybar/config.jsonc b/config/waybar/config.jsonc index 50e4e7b..85915af 100644 --- a/config/waybar/config.jsonc +++ b/config/waybar/config.jsonc @@ -1,3 +1,4 @@ +<<<<<<< HEAD // -*- mode: jsonc -*- { "layer": "bottom", @@ -85,5 +86,103 @@ "custom/sep": { "format" : " ", "interval" : 0 +======= +{ + "layer": "top", + "modules-left": [ + "sway/workspaces", + "sway/mode", + "sway/window" + ], + "modules-right": [ + "pulseaudio", + "clock", + "bluetooth" + ], + "pulseaudio": { + "tooltip": false, + "scroll-step": 5, + "format": "VOL {volume}%", + "format-muted": "muted", + "format-icons": { + "default": [ + "", + "", + "" + ] + } + }, + "sway/mode": { + "format": "{mode}", + "tooltip": false + }, + "privacy": { + "icon-spacing": 10, + "icon-size": 18, + "transition-duration": 250, + "tooltip": false, + "modules": [ + { + "type": "screenshare", + "tooltip": true, + "tooltip-icon-size": 24 + }, + { + "type": "audio-out", + "tooltip": true, + "tooltip-icon-size": 24 + }, + { + "type": "audio-in", + "tooltip": true, + "tooltip-icon-size": 24 + } + ] + }, + "bluetooth": { + "format": " {status}", + "format-connected": " conn", + "tooltip": true, + "tooltip-format-connected": "{device_alias}" + }, + "clock": { + "format": "TIME {:%I:%M %p}", + "tooltip": true, + "tooltip-format": "{:%a, %b %d}" + }, + "sway/workspaces": { + "format": "●" + }, + "sway/window": { + "icon": false, + "icon-size": 20 + }, + "network": { + "interface": "wlo1", + "format-wifi": "+ {essid}", + "format-ethernet": " {ipaddr}/{cidr}", + "format-disconnected": "disconnected", + "tooltip": false, + "max-length": 50 + }, + "battery": { + "format": "{icon}: {capacity}%", + "interval": 10, + "states": { + "warning": 20, + "critical": 10 + }, + "format-time": "{H}:{m}", + "format-icons": [ + "", + "", + "", + "", + "" + ], + "format-charging": "{icon} +: {capacity}%", + "format-discharging": "{icon} -: {capacity}%", + "tooltip-format": "{power}W, {cycles} cycles" +>>>>>>> bd52954 (repush) } } diff --git a/config/waybar/style.css b/config/waybar/style.css index 2df29ac..e3a061a 100644 --- a/config/waybar/style.css +++ b/config/waybar/style.css @@ -1,3 +1,4 @@ +<<<<<<< HEAD @define-color bg #1c1c1c; @define-color fg #B0B0B0; @define-color blk #000000; @@ -115,3 +116,90 @@ button:hover, background-color: @bg; } +======= +@define-color border #6f3913; + +* { + border: none; + font-family: "MapleMono"; + font-size: 15px; + min-height: 10px; +} + +window#waybar { + background: transparent; +} + +#disk, +#pulseaudio, +#window, +#clock, +#network, +#battery, +#privacy, +#memory, +#cpu, +#workspaces, +#tray, +#bluetooth, +#tray menu { + padding: 8px 10px 8px 10px; + margin: 5px 0 0 10px; + background: #111111; + color: #cccccc; + transition: 0.3s; + border: 2px solid @border; + border-radius: 0px; +} + +#window { + transition: none; +} + +window#waybar.empty #window { + background: transparent; + box-shadow: none; + border: none; +} + +#clock { + margin: 5px 0 0 15px; +} + +#bluetooth { + margin: 5px 15px 0 10px; +} + +#workspaces { + padding-top: 0; + padding-bottom: 0; +} + +#workspaces button { + margin: 0; + padding: 2px; + color: #cccccc; + transition: color 0.3s; +} + +#workspaces button.empty { + color: #2e2e2e; +} + +#workspaces button.active { + color: #ffffff; +} + +#workspaces button.urgent { + color: #000000; +} + +#workspaces button:hover { + background: transparent; + color: transparent; +} + +* { + transition: none; +} +>>>>>>> bd52954 (repush) diff --git a/etc/nixos/configuration.nix b/etc/nixos/configuration.nix new file mode 100644 index 0000000..68f0fb6 --- /dev/null +++ b/etc/nixos/configuration.nix @@ -0,0 +1,127 @@ +{ + pkgs, + pkgsUnstable, + ... +}: let + unstable = pkgsUnstable; +in +{ + + services = { + xserver = { + enable = true; + videoDrivers = ["modesetting" "nvidia"]; + }; + + displayManager.ly.enable = true; + blueman.enable = false; + printing.enable = false; + pipewire = { + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + }; + security.rtkit.enable = true; + + boot = { + readOnlyNixStore = true; + initrd.compressor = "zstd"; + loader = { + systemd-boot = { + enable = true; + editor = false; + configurationLimit = 25; + }; + efi.canTouchEfiVariables = true; + }; + kernelParams = [ + "nvidia_drm" + "nvidia_modeset" + "nvidia_uvm" + "nvidia-drm.fbdev=1" + "nvidia" + ]; + }; + + networking.hostName = "gloria"; + networking.enableIPv6 = false; + networking.networkmanager.enable = true; + time.timeZone = "Asia/Tehran"; + + hardware = { + 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; + }; + + security.sudo.enable = false; + security.sudo-rs.enable = true; + + virtualisation.waydroid.enable = true; + + environment.systemPackages = with pkgs; [ + (lib.hiPrio unstable.uutils-coreutils-noprefix) + (lib.hiPrio unstable.uutils-findutils) + (lib.hiPrio unstable.uutils-diffutils) + (pkgs.runCommand "vim-wrapper" { } '' + mkdir -p $out/bin + ln -s ${pkgs.neovim}/bin/nvim $out/bin/vim + '') + unstable.firefox + unstable.git + unstable.adwaita-icon-theme + unstable.nil + jmtpfs + android-tools + unstable.qbittorrent + unstable.zathura + unstable.rofi + ]; + + nixpkgs.config.allowUnfree = true; + + users.users.coast = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + shell = pkgs.zsh; + }; + + programs = { + zsh.enable = true; + zsh.syntaxHighlighting.enable = true; + foot.enable = true; + nano.enable = false; + nekoray.enable = true; + nekoray.tunMode.enable = true; + sway.enable = true; + }; + + fonts.packages = with pkgs; [ + ubuntu-sans + ubuntu_font_family + nerd-fonts._0xproto + nerd-fonts.droid-sans-mono + nerd-fonts.jetbrains-mono + vazir-fonts + ]; + + 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 index 22613ed..64a9ee2 100644 --- a/etc/nixos/flake.lock +++ b/etc/nixos/flake.lock @@ -23,11 +23,19 @@ }, "nixpkgs": { "locked": { +<<<<<<< HEAD "lastModified": 1759439645, "narHash": "sha256-oiAyQaRilPk525Z5aTtTNWNzSrcdJ7IXM0/PL3CGlbI=", "owner": "NixOS", "repo": "nixpkgs", "rev": "879bd460b3d3e8571354ce172128fbcbac1ed633", +======= + "lastModified": 1761597516, + "narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "daf6dc47aa4b44791372d6139ab7b25269184d55", +>>>>>>> bd52954 (repush) "type": "github" }, "original": { @@ -39,11 +47,19 @@ }, "nixpkgs-unstable": { "locked": { +<<<<<<< HEAD "lastModified": 1759381078, "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", "owner": "NixOS", "repo": "nixpkgs", "rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee", +======= + "lastModified": 1761672384, + "narHash": "sha256-o9KF3DJL7g7iYMZq9SWgfS1BFlNbsm6xplRjVlOCkXI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "08dacfca559e1d7da38f3cf05f1f45ee9bfd213c", +>>>>>>> bd52954 (repush) "type": "github" }, "original": { diff --git a/etc/nixos/flake.nix b/etc/nixos/flake.nix index a3e4bbc..f296368 100644 --- a/etc/nixos/flake.nix +++ b/etc/nixos/flake.nix @@ -1,5 +1,9 @@ { +<<<<<<< HEAD description = "Flakes once again"; +======= + description = "Flake"; +>>>>>>> bd52954 (repush) inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; @@ -8,8 +12,12 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; +<<<<<<< HEAD outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }: let +======= + outputs = { nixpkgs, nixpkgs-unstable, home-manager, ... }: let +>>>>>>> bd52954 (repush) system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; @@ -18,6 +26,7 @@ pkgsUnstable = import nixpkgs-unstable { inherit system; }; in { +<<<<<<< HEAD nixosConfigurations.core = nixpkgs.lib.nixosSystem { inherit system; modules = [ @@ -28,6 +37,25 @@ home-manager.useUserPackages = true; home-manager.users.coast = import ./home.nix; home-manager.backupFileExtension = "home-backup"; +======= + nixosConfigurations.gloria = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + (import ./configuration.nix { inherit pkgs pkgsUnstable; }) + ./hardware-configuration.nix + home-manager.nixosModules.home-manager { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "home-backup"; + users.coast = { ... }: { + imports = [ + ./home-configuration/home.nix + ./home-configuration/apps/sway.nix + ]; + }; + }; +>>>>>>> bd52954 (repush) } ]; }; diff --git a/etc/nixos/home-configuration/apps/sway.nix b/etc/nixos/home-configuration/apps/sway.nix new file mode 100644 index 0000000..26bfebd --- /dev/null +++ b/etc/nixos/home-configuration/apps/sway.nix @@ -0,0 +1,91 @@ +{ + pkgs, + ... +}: let + left = "h"; + down = "j"; + up = "k"; + right = "l"; + + modifier = "Mod4"; + terminal = "${pkgs.foot}/bin/footclient"; + menu = "${pkgs.wmenu}/bin/wmenu-run"; +in +{ + wayland.windowManager.sway = { + enable = true; + wrapperFeatures.gtk = true; + extraConfig = '' + exec swaymsg workspace 1 + default_border pixel 2 + default_floating_border pixel 2 + for_window [class=".*"] border pixel 2 + + client.focused #6f3913 #6f3913 #cccccc #6f3913 #6f3913 + client.focused_inactive #1c1c1c #111111 #cccccc #1c1c1c #111111 + client.unfocused #1c1c1c #111111 #888888 #1c1c1c #111111 + client.urgent #6f3913 #111111 #ffffff #6f3913 #111111 + ''; + config = { + modifier = "Mod4"; + gaps = { + inner = 5; + outer = 5; + }; + bars = []; + output.eDP-1.disable = ""; + keybindings = { + "${modifier}+Return" = "exec ${terminal}"; + "${modifier}+Shift+Return" = "exec rofi -show drun"; + "${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}+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"; + "${modifier}+Shift+q" = "exit"; + "${modifier}+Shift+v" = "exec vesktop --ozone-platform=wayland"; + "${modifier}+Shift+p" = "exec /home/coast/.local/src/local/bin/setwall.py"; + "${modifier}+Shift+d" = "mode 'resize'"; + }; + modes = { + resize = { + ${left} = "resize shrink width 10 px"; + ${down} = "resize grow height 10 px"; + ${up} = "resize shrink height 10 px"; + ${right} = "resize grow width 10 px"; + + "Escape" = "mode default"; + "Return" = "mode default"; + }; + }; + startup = [ + { command = "autotiling"; } + { command = "/home/coast/.local/src/local/bin/setwall.py/"; always = true; } + { command = "waybar"; } + { command = "foot -s"; always = true; } + ]; + }; + }; +} diff --git a/etc/nixos/home-configuration/home.nix b/etc/nixos/home-configuration/home.nix new file mode 100644 index 0000000..dd50b06 --- /dev/null +++ b/etc/nixos/home-configuration/home.nix @@ -0,0 +1,127 @@ +{ + config, + pkgs, + ... +}: let + 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"; + waybar = "waybar"; + }; +in { + xdg.configFile = builtins.mapAttrs (name: subpath: { + source = mkSl "${dotDir}/${subpath}"; + recursive = true; + }) configs; + + + home = { + username = "coast"; + homeDirectory = "/home/coast"; + stateVersion = "25.05"; + packages = with pkgs; [ + alsa-utils + nix-search-cli + neofetch + dysk + 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_multi + gnumake + clang-tools + ruby_3_4 + pkg-config + dmd + dtools + rustup + python3 + python313Packages.pip + unzip + zip + go + tauon + gimp + waybar + ]; + }; + + programs.git = { + enable = true; + userEmail = "coasteen@proton.me"; + userName = "coast"; + }; + + programs.zsh = { + enable = true; + history = { + path = "/home/coast/.cache/zsh/history"; + size = 100000000; + save = 100000000; + append = true; + }; + enableCompletion = true; + shellAliases = { + nf = "neofetch"; + nrs = "sudo 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"; + delgen = "sudo nix-env --delete-generations old --profile /nix/var/nix/profiles/system"; + alsamixer = "alsamixer -c 0 --no-color"; + la = "ls --color=auto -la"; + sidp = "sudo"; + suod = "sudo"; + sduo = "sudo"; + sd = "sudo"; + }; + 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 + source ~/.local/src/zsh.d/zsh-autosuggestions.zsh + export PATH="/usr/bin:$PATH" + export PATH="$HOME/.local/bin:$PATH" + EDITOR=vim + PS1="[%n in %m %~] " + ''; + }; +} diff --git a/local/bin/setwall.py b/local/bin/setwall.py new file mode 100755 index 0000000..0126288 --- /dev/null +++ b/local/bin/setwall.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +import os +import secrets +import subprocess + +BASE_DIR = "/home/coast/.local/src/wall" + +wallpapers = [] +for root, dirs, files in os.walk(BASE_DIR): + for file in files: + if file.lower().endswith(('.png', '.jpg', '.jpeg', '.bmp', '.gif')): + wallpapers.append(os.path.join(root, file)) + +if not wallpapers: + print("No wallpapers found!") + exit(1) + +chosen_wallpaper = secrets.choice(wallpapers) +print(chosen_wallpaper) +subprocess.run(["swaybg", "-i", chosen_wallpaper, "-m", "fill"])