From 4e4474f2552eeed69b03bd3dd49c2c6d0b49176b Mon Sep 17 00:00:00 2001 From: Varris Date: Tue, 4 Oct 2022 00:21:40 +0200 Subject: [PATCH] update --- flake.lock | 25 ++++- flake.nix | 107 ++++++++----------- system/configuration.nix | 46 ++++---- system/hardware-configuration.nix | 51 ++++----- user/configs/beets/beets.nix | 20 ++-- user/configs/dircolors.nix | 1 - user/configs/firefox/firefox.nix | 8 +- user/configs/fish/fish.nix | 45 ++++---- user/configs/kakoune/kakoune.nix | 35 +++--- user/configs/mpd/mpd.nix | 11 +- user/configs/mpv/mpv.nix | 21 ++-- user/configs/nnn/nnn.nix | 4 +- user/configs/sway/sway.nix | 170 ++++++++++++++++-------------- user/configs/sway/waybar.nix | 66 ++++++------ user/home.nix | 12 +-- 15 files changed, 300 insertions(+), 322 deletions(-) diff --git a/flake.lock b/flake.lock index 1c32736..5df9563 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "bobthefish": { + "flake": false, + "locked": { + "lastModified": 1659411664, + "narHash": "sha256-jBbm0wTNZ7jSoGFxRkTz96QHpc5ViAw9RGsRBkCQEIU=", + "owner": "oh-my-fish", + "repo": "theme-bobthefish", + "rev": "2dcfcab653ae69ae95ab57217fe64c97ae05d8de", + "type": "github" + }, + "original": { + "owner": "oh-my-fish", + "repo": "theme-bobthefish", + "type": "github" + } + }, "gamescope-git": { "flake": false, "locked": { @@ -92,11 +108,11 @@ "mesa-git": { "flake": false, "locked": { - "lastModified": 1664631406, - "narHash": "sha256-ouwR0GAYp/0BxSiI/KtcmiTuvPqfsF77pKemA0J0hbM=", + "lastModified": 1664825548, + "narHash": "sha256-bt3/6JLi+DeGLHJlteuViLUvP7lA1lyLLLhsCf43YqI=", "ref": "refs/heads/main", - "rev": "3246889fb047c54623795956a3b4890e672f05ef", - "revCount": 160795, + "rev": "e577bb18c8da40905ab2d4d56b9c6f96c619d96c", + "revCount": 160837, "type": "git", "url": "https://gitlab.freedesktop.org/mesa/mesa.git" }, @@ -138,6 +154,7 @@ }, "root": { "inputs": { + "bobthefish": "bobthefish", "gamescope-git": "gamescope-git", "grub2-themes": "grub2-themes", "home-manager": "home-manager", diff --git a/flake.nix b/flake.nix index dd149d6..d081340 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + # Fish Plugins + bobthefish = { + url = "github:oh-my-fish/theme-bobthefish"; + flake = false; + }; + # Kakoune Plugins kakoune-smarttab = { url = "github:andreyorst/smarttab.kak"; @@ -56,14 +62,9 @@ url = "github:vinceliuice/grub2-themes"; inputs.nixpkgs.follows = "nixpkgs"; }; - - veloren = { - url = "github:veloren/veloren"; - }; - }; - outputs = { self, nixpkgs, home-manager, veloren, ... }@inputs: + outputs = { self, nixpkgs, home-manager, ... }@inputs: let username = "manuel"; hostname = "terra"; @@ -80,34 +81,22 @@ }; in { - overlays.default = (final: prev: rec { - - nerdfonts = prev.nerdfonts.override { - fonts = [ - "JetBrainsMono" - ]; - }; + overlays.default = final: prev: rec { + nerdfonts = prev.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }; wlroots-git = prev.wlroots.overrideAttrs (old: { - version = "0.16.0"; + version = "git"; src = inputs.wlroots-git; }); sway-unwrapped = (prev.sway-unwrapped.overrideAttrs (old: { - version = "1.8"; - buildInputs = old.buildInputs ++ [ - prev.xorg.xcbutilwm - prev.pcre2 - ]; - nativeBuildInputs = old.nativeBuildInputs ++ [ - prev.cmake - ]; + version = "git"; + buildInputs = old.buildInputs ++ [ prev.xorg.xcbutilwm prev.pcre2 ]; + nativeBuildInputs = old.nativeBuildInputs ++ [ prev.cmake ]; src = inputs.sway-git; })).override { wlroots = wlroots-git; }; - waybar = prev.waybar.override { - wlroots = wlroots-git; - }; + waybar = prev.waybar.override { wlroots = wlroots-git; }; # xwayland = prev.xwayland.overrideAttrs (old: { # version = "22.2"; @@ -128,58 +117,52 @@ }; gamescope = prev.gamescope.overrideAttrs (old: { - version = "3.11.45"; + version = "git"; src = inputs.gamescope-git; }); mesa-git = (prev.mesa.overrideAttrs (old: { - version = "23.0"; + version = "git"; src = inputs.mesa-git; - buildInputs = old.buildInputs ++ [ - pkgs.glslang - ]; + buildInputs = old.buildInputs ++ [ pkgs.glslang ]; patches = [ ./pkgs/mesa-git/opencl.patch ./pkgs/mesa-git/disk_cache-include-dri-driver-path-in-cache-key.patch ]; + mesonFlags = pkgs.lib.lists.remove + "-Dxvmc-libs-path=${placeholder "drivers"}/lib" + old.mesonFlags; # xvmc was removed upstream })).override { galliumDrivers = [ "radeonsi" "swrast" ]; vulkanDrivers = [ "amd" ]; enableGalliumNine = false; # Replaced by DXVK }; - inherit (veloren.packages."${system}") veloren-voxygen; + fzf = prev.fzf.overrideAttrs (old: { version = "0.33.0"; }); + }; + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt; - }); - - nixosConfigurations.${hostname} = nixpkgs.lib.nixosSystem - { - inherit system; - inherit pkgs; - specialArgs = { inherit inputs; }; - modules = [ - { - #needed to get tools working that expect a nixpkgs channel to exist - nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; - nix.registry = { - nixpkgs.flake = nixpkgs; - }; - } - ./system/configuration.nix - home-manager.nixosModules.home-manager - { - home-manager = { - #useGlobalPkgs = true; - useUserPackages = true; - users.${username} = import ./user/home.nix; - extraSpecialArgs = { - inherit inputs pkgs; - }; - }; - } - inputs.grub2-themes.nixosModule - ]; - }; + nixosConfigurations.${hostname} = nixpkgs.lib.nixosSystem { + inherit system; + inherit pkgs; + specialArgs = { inherit inputs; }; + modules = [ + { + #needed to get tools working that expect a nixpkgs channel to exist + nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; + nix.registry = { nixpkgs.flake = nixpkgs; }; + } + ./system/configuration.nix + home-manager.nixosModules.home-manager + { + home-manager = { + useUserPackages = true; + users.${username} = import ./user/home.nix; + extraSpecialArgs = { inherit inputs pkgs; }; + }; + } + inputs.grub2-themes.nixosModule + ]; + }; }; } - diff --git a/system/configuration.nix b/system/configuration.nix index 9b230ce..8edc064 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -1,26 +1,19 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, lib, ... }: - -{ - imports = - [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; +{ config, pkgs, lib, inputs, ... }: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; nixpkgs.config.allowUnfree = true; boot = { consoleLogLevel = 3; - kernelParams = [ - "quiet" - "udev.log_level=3" - "amdgpu.ppfeaturemask=0xffffffff" - ]; + kernelParams = + [ "quiet" "udev.log_level=3" "amdgpu.ppfeaturemask=0xffffffff" ]; loader = { efi = { @@ -45,14 +38,13 @@ initrd.availableKernelModules = [ "amdgpu" ]; kernelPackages = pkgs.linuxPackages_latest; kernelModules = [ "i2c-dev" "i2c-piix4" ]; - }; + powerManagement = { cpuFreqGovernor = "schedutil"; }; + networking = { hostName = "terra"; # Define your hostname. - networkmanager = { - enable = true; - }; + networkmanager = { enable = true; }; firewall.checkReversePath = false; }; @@ -80,9 +72,7 @@ enable = true; package = pkgs.mesa-git.drivers; package32 = pkgs.pkgsi686Linux.mesa-git.drivers; - extraPackages = [ - pkgs.libvdpau-va-gl - ]; + extraPackages = [ pkgs.libvdpau-va-gl ]; driSupport = true; driSupport32Bit = true; @@ -105,8 +95,7 @@ enable = true; locate = pkgs.plocate; localuser = null; - prunePaths = lib.mkOptionDefault [ - ]; + prunePaths = lib.mkOptionDefault [ ]; interval = "hourly"; }; @@ -130,6 +119,11 @@ programs.fish.enable = true; + programs.ccache = { + enable = true; + packageNames = [ + ]; + }; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.manuel = { @@ -189,9 +183,7 @@ ]; }; - services.openssh = { - enable = true; - }; + services.openssh = { enable = true; }; services.printing = { enable = true; @@ -227,6 +219,4 @@ ''; system.stateVersion = "22.05"; # Did you read the comment? - } - diff --git a/system/hardware-configuration.nix b/system/hardware-configuration.nix index 1f1640f..40ed7f1 100644 --- a/system/hardware-configuration.nix +++ b/system/hardware-configuration.nix @@ -1,42 +1,34 @@ # 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, ... }: +{ config, lib, pkgs, modulesPath, ... }: { + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; -{ - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = + [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/5907e244-fda6-41d4-aff1-a2be7160a559"; - fsType = "xfs"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/5907e244-fda6-41d4-aff1-a2be7160a559"; + fsType = "xfs"; + }; - fileSystems."/boot/efi" = - { - device = "/dev/disk/by-uuid/D56E-61DC"; - fsType = "vfat"; - }; + fileSystems."/boot/efi" = { + device = "/dev/disk/by-uuid/D56E-61DC"; + fsType = "vfat"; + }; - fileSystems."/mnt/hdd" = - { - device = "/dev/disk/by-uuid/ecbbfb05-ada8-4044-81a6-9a280f93802f"; - fsType = "xfs"; - }; + fileSystems."/mnt/hdd" = { + device = "/dev/disk/by-uuid/ecbbfb05-ada8-4044-81a6-9a280f93802f"; + fsType = "xfs"; + }; - fileSystems."/home" = - { - device = "/dev/disk/by-uuid/4dd7a8ea-311a-458b-8839-1d92c7abab1f"; - fsType = "xfs"; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/4dd7a8ea-311a-458b-8839-1d92c7abab1f"; + fsType = "xfs"; + }; swapDevices = [{ device = "/dev/disk/by-uuid/e0d93baa-8a8f-4fb2-9a48-f37f5d397826"; }]; @@ -49,5 +41,6 @@ # networking.interfaces.enp8s0.useDHCP = lib.mkDefault true; # networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/user/configs/beets/beets.nix b/user/configs/beets/beets.nix index 9604639..fff4feb 100644 --- a/user/configs/beets/beets.nix +++ b/user/configs/beets/beets.nix @@ -1,5 +1,4 @@ { config, pkgs, ... }: { - programs.beets = { enable = true; @@ -16,22 +15,18 @@ }; paths = { - "default" = "%asciify{$albumartist}/$year - %asciify{$album}%aunique{}/$track %asciify{$title}"; + "default" = + "%asciify{$albumartist}/$year - %asciify{$album}%aunique{}/$track %asciify{$title}"; "singleton" = "Non-Album/%asciify{$artist}/%asciify{$title}"; - "comp" = "Compilations/%asciify{$album}%aunique{}/$track %asciify{$title}"; + "comp" = + "Compilations/%asciify{$album}%aunique{}/$track %asciify{$title}"; }; - ftintitle = { - "auto" = true; - }; + ftintitle = { "auto" = true; }; - fetchart = { - "auto" = true; - }; + fetchart = { "auto" = true; }; - chroma = { - auto = true; - }; + chroma = { auto = true; }; replaygain = { "backend" = "gstreamer"; @@ -40,4 +35,3 @@ }; }; } - diff --git a/user/configs/dircolors.nix b/user/configs/dircolors.nix index 6faee8f..488b79a 100644 --- a/user/configs/dircolors.nix +++ b/user/configs/dircolors.nix @@ -4,4 +4,3 @@ enableFishIntegration = true; }; } - diff --git a/user/configs/firefox/firefox.nix b/user/configs/firefox/firefox.nix index f2f1384..391663b 100644 --- a/user/configs/firefox/firefox.nix +++ b/user/configs/firefox/firefox.nix @@ -1,7 +1 @@ -{ config, pkgs, ... }: -{ - programs.firefox = { - enable = true; - }; -} - +{ config, pkgs, ... }: { programs.firefox = { enable = true; }; } diff --git a/user/configs/fish/fish.nix b/user/configs/fish/fish.nix index a7402bd..107b953 100644 --- a/user/configs/fish/fish.nix +++ b/user/configs/fish/fish.nix @@ -1,5 +1,4 @@ -{ config, pkgs, ... }: -{ +{ config, pkgs, inputs, ... }: { programs.exa = { enable = true; enableAliases = true; @@ -7,29 +6,38 @@ programs.fish = { enable = true; + + plugins = [ + { + name = "bobthefish"; + src = inputs.bobthefish; + } + ]; + interactiveShellInit = '' ${pkgs.any-nix-shell}/bin/any-nix-shell fish --info-right | source + set theme_color_scheme gruvbox ''; functions = { - fish_prompt = '' - set_color green - printf (prompt_pwd) - set_color cyan - printf " ► " - set_color normal - ''; + #fish_prompt = '' + # set_color green + # printf (prompt_pwd) + # set_color cyan + # printf " ► " + # set_color normal + #''; fish_greeting = ""; ec = '' - pushd &> /dev/null - cd "${config.home.homeDirectory}" - set "filename" (${pkgs.fd}/bin/fd -t f . ~/.dotfiles | \ - ${pkgs.fzf}/bin/fzf -q "$argv[1]" \ - --preview "${pkgs.python3Packages.pygments}/bin/pygmentize -g -O linenos=1 {}") - if test -f "$filename" - $EDITOR $filename - end - popd &> /dev/null + pushd &> /dev/null + cd "${config.home.homeDirectory}" + set "filename" (${pkgs.fd}/bin/fd -t f . ~/.dotfiles | \ + ${pkgs.fzf}/bin/fzf -q "$argv[1]" \ + --preview "${pkgs.python3Packages.pygments}/bin/pygmentize -g -O linenos=1 {}") + if test -f "$filename" + $EDITOR $filename + end + popd &> /dev/null ''; nor = '' @@ -53,4 +61,3 @@ }; }; } - diff --git a/user/configs/kakoune/kakoune.nix b/user/configs/kakoune/kakoune.nix index ffa9adb..6cf232d 100644 --- a/user/configs/kakoune/kakoune.nix +++ b/user/configs/kakoune/kakoune.nix @@ -9,9 +9,7 @@ let name = "sort-selections-kak"; src = inputs.kakoune-sort-selections; }; - -in -{ +in { programs.kakoune = { enable = true; plugins = with pkgs.kakounePlugins; [ @@ -27,26 +25,34 @@ in tabStop = 4; indentWidth = 4; showMatching = true; - showWhitespace = { - enable = false; - }; + showWhitespace = { enable = false; }; numberLines.enable = true; hooks = [ - { name = "WinSetOption"; option = "filetype=nix|sh"; commands = "hook window BufWritePre .* lsp-formatting-sync"; } + { + name = "WinSetOption"; + option = "filetype=nix|sh"; + commands = "hook window BufWritePre .* lsp-formatting-sync"; + } - { name = "WinCreate"; option = ".*"; commands = "kakboard-enable"; } - { name = "InsertChar"; option = "\\t"; commands = "exec -draft -itersel h@"; } + { + name = "WinCreate"; + option = ".*"; + commands = "kakboard-enable"; + } + { + name = "InsertChar"; + option = "\\t"; + commands = "exec -draft -itersel h@"; + } ]; - keyMappings = [ - ]; + keyMappings = [ ]; ui = { assistant = "none"; setTitle = true; }; - }; extraConfig = '' set global startup_info_version 99999999 @@ -64,8 +70,5 @@ in ''; }; - home.packages = [ - pkgs.rnix-lsp - ]; + home.packages = [ pkgs.rnix-lsp ]; } - diff --git a/user/configs/mpd/mpd.nix b/user/configs/mpd/mpd.nix index ffb147c..38b9cdd 100644 --- a/user/configs/mpd/mpd.nix +++ b/user/configs/mpd/mpd.nix @@ -1,5 +1,4 @@ -{ config, pkgs, ... }: -{ +{ config, pkgs, ... }: { services.mpd = { enable = true; musicDirectory = "/mnt/hdd/Music"; @@ -51,9 +50,7 @@ programs.ncmpcpp = { enable = true; - package = pkgs.ncmpcpp.override { - visualizerSupport = true; - }; + package = pkgs.ncmpcpp.override { visualizerSupport = true; }; settings = { visualizer_data_source = "/tmp/mpd.fifo"; visualizer_output_name = "my_fifo"; @@ -70,7 +67,8 @@ alternative_header_second_line_format = "$7{%t}|{%f}$0"; progressbar_look = "─╼ "; - song_columns_list_format = "(25)[5]{a:artist} (3f)[5]{n: } (50)[cyan]{t|f:title} (5)[cyan]{lr:duration}"; + song_columns_list_format = + "(25)[5]{a:artist} (3f)[5]{n: } (50)[cyan]{t|f:title} (5)[cyan]{lr:duration}"; playlist_display_mode = "columns"; browser_display_mode = "columns"; search_engine_display_mode = "columns"; @@ -90,4 +88,3 @@ multimediaKeys = false; }; } - diff --git a/user/configs/mpv/mpv.nix b/user/configs/mpv/mpv.nix index 0e8e8e8..b4ab89f 100644 --- a/user/configs/mpv/mpv.nix +++ b/user/configs/mpv/mpv.nix @@ -1,13 +1,12 @@ -{ config, pkgs, ... }: -{ - programs.mpv = { - enable = true; - config = { - profile = "gpu-hq"; - ytdl-format = "bestvideo+bestaudio"; - hwdec = "vaapi-copy"; - gpu-context = "wayland"; - force-window = "yes"; - }; +{ config, pkgs, ... }: { + programs.mpv = { + enable = true; + config = { + profile = "gpu-hq"; + ytdl-format = "bestvideo+bestaudio"; + hwdec = "vaapi-copy"; + gpu-context = "wayland"; + force-window = "yes"; }; + }; } diff --git a/user/configs/nnn/nnn.nix b/user/configs/nnn/nnn.nix index e424434..2851fa6 100644 --- a/user/configs/nnn/nnn.nix +++ b/user/configs/nnn/nnn.nix @@ -1,8 +1,6 @@ { configs, pkgs, ... }: { - programs.nnn = { enable = true; - package = pkgs.nnn.override ({ withNerdIcons = true; }); + package = pkgs.nnn.override { withNerdIcons = true; }; }; } - diff --git a/user/configs/sway/sway.nix b/user/configs/sway/sway.nix index db87cdd..75733c2 100644 --- a/user/configs/sway/sway.nix +++ b/user/configs/sway/sway.nix @@ -6,79 +6,74 @@ let left_monitor = "HDMI-A-1"; right_monitor = "DP-1"; - wob-voldaemon = pkgs.writeShellScriptBin "wob-volumedaemon.sh" - '' - if pgrep "wob"; then - killall wob &> /dev/null - fi + wob-voldaemon = pkgs.writeShellScriptBin "wob-volumedaemon.sh" '' + if pgrep "wob"; then + killall wob &> /dev/null + fi - if [[ -e "${wobsock}" ]]; then - rm "${wobsock}" - fi + if [[ -e "${wobsock}" ]]; then + rm "${wobsock}" + fi - mkfifo "${wobsock}" - tail -f "${wobsock}" | ${pkgs.wob}/bin/wob --border-color "#D65D0EFF" --background-color "#282828FF" --bar-color "#D65D0EFF" -b 2 -H 40 & - echo "wob: started" - ''; + mkfifo "${wobsock}" + tail -f "${wobsock}" | ${pkgs.wob}/bin/wob --border-color "#D65D0EFF" --background-color "#282828FF" --bar-color "#D65D0EFF" -b 2 -H 40 & + echo "wob: started" + ''; - passmenu = pkgs.writeShellScriptBin "passmenu.sh" - '' - shopt -s nullglob globstar + passmenu = pkgs.writeShellScriptBin "passmenu.sh" '' + shopt -s nullglob globstar - prefix=''${PASSWORD_STORE_DIR-~/.password-store} - password_files=( "$prefix"/**/*.gpg ) - password_files=( "''${password_files[@]#"$prefix"/}" ) - password_files=( "''${password_files[@]%.gpg}" ) + prefix=''${PASSWORD_STORE_DIR-~/.password-store} + password_files=( "$prefix"/**/*.gpg ) + password_files=( "''${password_files[@]#"$prefix"/}" ) + password_files=( "''${password_files[@]%.gpg}" ) - password=$(printf '%s\n' "''${password_files[@]}" | ${pkgs.rofi-wayland}/bin/rofi -dmenu -p "pass" "$@") + password=$(printf '%s\n' "''${password_files[@]}" | ${pkgs.rofi-wayland}/bin/rofi -dmenu -p "pass" "$@") - [[ -n $password ]] || exit + [[ -n $password ]] || exit - pass show -c "$password" 2>/dev/null - ''; + pass show -c "$password" 2>/dev/null + ''; - xwaylandSetPrimary = pkgs.writeShellScriptBin "xwayland-setprimary.sh" - '' - DSP=$(${pkgs.xorg.xrandr}/bin/xrandr | awk '/2560x1440/ {print $1}' | head -n 1) + xwaylandSetPrimary = pkgs.writeShellScriptBin "xwayland-setprimary.sh" '' + DSP=$(${pkgs.xorg.xrandr}/bin/xrandr | awk '/2560x1440/ {print $1}' | head -n 1) - ${pkgs.xorg.xrandr}/bin/xrandr --output "$DSP" --primary - echo "Xwayland: $DSP - Primary monitor set" - ''; + ${pkgs.xorg.xrandr}/bin/xrandr --output "$DSP" --primary + echo "Xwayland: $DSP - Primary monitor set" + ''; rofi-theme = inputs.rofi-theme + "/gruvbox-dark.rasi"; - killprocess = pkgs.writeShellScriptBin "killprocess.sh" - '' - ps -x -o pid=,comm= | column -t -o " " | rofi -dmenu -p "kill process" | awk '{print $1}' | uniq | xargs -r kill -9 - ''; - -in -{ + killprocess = pkgs.writeShellScriptBin "killprocess.sh" '' + ps -x -o pid=,comm= | column -t -o " " | rofi -dmenu -p "kill process" | awk '{print $1}' | uniq | xargs -r kill -9 + ''; +in { imports = [ ./waybar.nix ]; wayland.windowManager.sway = { enable = true; config = { modifier = "Mod4"; terminal = "${pkgs.foot}/bin/foot"; - gaps = { - inner = 20; - }; + gaps = { inner = 20; }; keybindings = - let - modifier = config.wayland.windowManager.sway.config.modifier; - in - lib.mkOptionDefault { - "XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 10 --get-volume > ${wobsock}"; - "XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 10 --get-volume > ${wobsock}"; + let modifier = config.wayland.windowManager.sway.config.modifier; + in lib.mkOptionDefault { + "XF86AudioRaiseVolume" = + "exec ${pkgs.pamixer}/bin/pamixer -i 10 --get-volume > ${wobsock}"; + "XF86AudioLowerVolume" = + "exec ${pkgs.pamixer}/bin/pamixer -d 10 --get-volume > ${wobsock}"; "Mod5+F9" = "exec ${pkgs.mpc-cli}/bin/mpc stop"; "Mod5+F11" = "exec ${pkgs.mpc-cli}/bin/mpc toggle"; "Mod5+F10" = "exec ${pkgs.mpc-cli}/bin/mpc prev"; "Mod5+F12" = "exec ${pkgs.mpc-cli}/bin/mpc next"; "XF86AudioMute" = "exec mpc toggle"; - "Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy screen"; - "${modifier}+Shift+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy area"; - "${modifier}+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy active"; + "Print" = + "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy screen"; + "${modifier}+Shift+Print" = + "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy area"; + "${modifier}+Print" = + "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot -c --notify copy active"; "${modifier}+d" = "exec ${pkgs.rofi-wayland}/bin/rofi -show drun"; "${modifier}+Shift+p" = "exec ${passmenu}/bin/passmenu.sh"; @@ -95,20 +90,15 @@ in xkb_layout = "us"; xkb_variant = "altgr-intl"; }; - "type:pointer" = { - accel_profile = "flat"; - }; + "type:pointer" = { accel_profile = "flat"; }; "type:touchpad" = { - events = "disabled"; #disable DualSense touchpad. Let Steam Input handle it + events = + "disabled"; # disable DualSense touchpad. Let Steam Input handle it }; }; output = { - "*" = { - bg = "${wallpaper} stretch"; - }; - "${left_monitor}" = { - position = "0 0"; - }; + "*" = { bg = "${wallpaper} stretch"; }; + "${left_monitor}" = { position = "0 0"; }; "${right_monitor}" = { position = "1920 0"; adaptive_sync = "on"; @@ -116,26 +106,53 @@ in }; workspaceOutputAssign = [ + { + workspace = "1"; + output = "${right_monitor}"; + } + { + workspace = "2"; + output = "${right_monitor}"; + } + { + workspace = "3"; + output = "${right_monitor}"; + } - { workspace = "1"; output = "${right_monitor}"; } - { workspace = "2"; output = "${right_monitor}"; } - { workspace = "3"; output = "${right_monitor}"; } - - { workspace = "4"; output = "${left_monitor}"; } - { workspace = "5"; output = "${left_monitor}"; } - { workspace = "6"; output = "${left_monitor}"; } + { + workspace = "4"; + output = "${left_monitor}"; + } + { + workspace = "5"; + output = "${left_monitor}"; + } + { + workspace = "6"; + output = "${left_monitor}"; + } ]; startup = [ - { command = "${wob-voldaemon}/bin/wob-volumedaemon.sh"; always = true; } - { command = "${xwaylandSetPrimary}/bin/xwayland-setprimary.sh"; always = true; } - { command = "${pkgs.autotiling}/bin/autotiling"; always = true; } - { command = "${pkgs.openrgb}/bin/openrgb --server --profile autorun.orp"; } + { + command = "${wob-voldaemon}/bin/wob-volumedaemon.sh"; + always = true; + } + { + command = "${xwaylandSetPrimary}/bin/xwayland-setprimary.sh"; + always = true; + } + { + command = "${pkgs.autotiling}/bin/autotiling"; + always = true; + } + { + command = + "${pkgs.openrgb}/bin/openrgb --server --profile autorun.orp"; + } { command = "${pkgs.networkmanagerapplet}/bin/nm-applet --indicator"; } ]; - bars = [{ - command = "${pkgs.waybar}/bin/waybar"; - }]; + bars = [{ command = "${pkgs.waybar}/bin/waybar"; }]; colors = { focused = { border = "#d65d0e"; @@ -173,9 +190,7 @@ in extraSessionCommands = '' export MOZ_ENABLE_WAYLAND=1 ''; - wrapperFeatures = { - gtk = true; - }; + wrapperFeatures = { gtk = true; }; }; programs.mako = { @@ -238,8 +253,5 @@ in }; }; - home.packages = [ - pkgs.wl-clipboard - ]; + home.packages = [ pkgs.wl-clipboard ]; } - diff --git a/user/configs/sway/waybar.nix b/user/configs/sway/waybar.nix index 2013432..554c0b7 100644 --- a/user/configs/sway/waybar.nix +++ b/user/configs/sway/waybar.nix @@ -1,28 +1,24 @@ { config, pkgs, ... }: let + ds-battery = pkgs.writeShellScriptBin "ds-battery.sh" '' + ds_capacity_file="/sys/class/power_supply/ps-controller-battery-4c:b9:9b:74:ae:31/capacity" + ds_status_file="/sys/class/power_supply/ps-controller-battery-4c:b9:9b:74:ae:31/status" - ds-battery = pkgs.writeShellScriptBin "ds-battery.sh" - '' - ds_capacity_file="/sys/class/power_supply/ps-controller-battery-4c:b9:9b:74:ae:31/capacity" - ds_status_file="/sys/class/power_supply/ps-controller-battery-4c:b9:9b:74:ae:31/status" - - while true; do - if [[ -f $ds_capacity_file ]]; then - charge=$(<"$ds_capacity_file") - if [[ $(<"$ds_status_file") == "Charging" ]]; then - echo "{\"class\":\"charging\",\"text\":\" Charging: $charge%\",\"tooltip\":\"Charging:\n$charge%\"}" - else - echo "{\"class\":\"discharging\",\"text\":\" $charge%\",\"tooltip\":\"Battery:\\n$charge%\"}" - fi - else - echo "{\"class\":\"not_connected\",\"text\":\"\"}" - fi - sleep 1 - done - ''; - -in -{ + while true; do + if [[ -f $ds_capacity_file ]]; then + charge=$(<"$ds_capacity_file") + if [[ $(<"$ds_status_file") == "Charging" ]]; then + echo "{\"class\":\"charging\",\"text\":\" Charging: $charge%\",\"tooltip\":\"Charging:\n$charge%\"}" + else + echo "{\"class\":\"discharging\",\"text\":\" $charge%\",\"tooltip\":\"Battery:\\n$charge%\"}" + fi + else + echo "{\"class\":\"not_connected\",\"text\":\"\"}" + fi + sleep 1 + done + ''; +in { programs.waybar = { enable = true; settings = [{ @@ -32,19 +28,23 @@ in modules-left = [ "custom/blank" "sway/workspaces" "sway/mode" ]; modules-center = [ "sway/window" ]; - modules-right = [ "custom/ds-battery" "pulseaudio" "mpd" "tray" "custom/blank" "clock" "custom/blank" ]; + modules-right = [ + "custom/ds-battery" + "pulseaudio" + "mpd" + "tray" + "custom/blank" + "clock" + "custom/blank" + ]; - "sway/mode" = { - format = " {}"; - }; + "sway/mode" = { format = " {}"; }; "sway/window" = { icon = false; icon-size = 16; }; - "clock" = { - format = "{:%a %d. %B %H:%M}"; - }; + "clock" = { format = "{:%a %d. %B %H:%M}"; }; "pulseaudio" = { scroll-step = 5; @@ -57,7 +57,8 @@ in spacing = 10; }; "mpd" = { - format = "{stateIcon} {artist} - {title} {elapsedTime:%M:%S}/{totalTime:%M:%S}"; + format = + "{stateIcon} {artist} - {title} {elapsedTime:%M:%S}/{totalTime:%M:%S}"; format-stopped = "栗 stopped"; state-icons = { playing = ""; @@ -70,10 +71,7 @@ in exec = "${ds-battery}/bin/ds-battery.sh"; escape = "true"; }; - "custom/blank" = { - format = " "; - }; - + "custom/blank" = { format = " "; }; }]; style = '' @define-color foreground #EBDBB2; diff --git a/user/home.nix b/user/home.nix index df7e5c1..ab57138 100644 --- a/user/home.nix +++ b/user/home.nix @@ -1,6 +1,4 @@ -{ config, pkgs, inputs, ... }: - -{ +{ config, pkgs, inputs, ... }: { imports = [ ./configs/beets/beets.nix ./configs/kakoune/kakoune.nix @@ -35,9 +33,9 @@ pkgs.sxiv pkgs.thunderbird pkgs.twemoji-color-font - pkgs.veloren-voxygen pkgs.wineWowPackages.stagingFull #pkgs.xivlauncher + pkgs.xarchiver ]; home.sessionVariables = { @@ -48,9 +46,7 @@ fonts.fontconfig.enable = true; - services.gpg-agent = { - enable = true; - }; + services.gpg-agent = { enable = true; }; services.udiskie.enable = true; @@ -86,7 +82,6 @@ name = "capitaine-cursors-white"; size = 32; }; - }; programs.git = { @@ -129,4 +124,3 @@ # changes in each release. home.stateVersion = "22.05"; } -