diff --git a/.envrc b/.envrc index 49bacf7..e483044 100644 --- a/.envrc +++ b/.envrc @@ -1,10 +1,11 @@ # update repo if has jj; then - jj git fetch --all-remotes + jj git fetch --all-remotes elif has gix; then - gix fetch + gix fetch elif has git; then - git fetch + git fetch fi +watch_file ./flake.{nix,lock} ./flake-modules/{default,devshells,overlays,nixvim-modules}.nix use flake diff --git a/example-vm/vm-config.nix b/example-vm/vm-config.nix index 1b2b4d0..67e38a7 100644 --- a/example-vm/vm-config.nix +++ b/example-vm/vm-config.nix @@ -31,4 +31,6 @@ # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "24.11"; # Did you read the comment? + + nixpkgs.hostPlatform = "x86_64-linux"; } diff --git a/flake-modules/default.nix b/flake-modules/default.nix index ce3e3c5..d793f21 100644 --- a/flake-modules/default.nix +++ b/flake-modules/default.nix @@ -1,7 +1,4 @@ { inputs, ... }: -let - overlays = builtins.attrValues inputs.self.overlays; -in { imports = [ inputs.treefmt-nix.flakeModule @@ -13,14 +10,12 @@ in ./home-modules.nix ./nixvim-modules.nix ./overlays.nix - ./scripts.nix + ../scripts ]; perSystem = { system, ... }: { - _module.args.pkgs = import inputs.nixpkgs { inherit system overlays; }; - # Setup formatters treefmt = { projectRootFile = "flake.nix"; diff --git a/flake-modules/example-vm.nix b/flake-modules/example-vm.nix index b21085d..e941b37 100644 --- a/flake-modules/example-vm.nix +++ b/flake-modules/example-vm.nix @@ -1,19 +1,18 @@ { inputs, lib, ... }: -let - system = "x86_64-linux"; - overlays = builtins.attrValues inputs.self.overlays; - config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam-unwrapped" ]; - pkgs = import inputs.nixpkgs { inherit system overlays config; }; -in { # Example vm configuration flake.nixosConfigurations.vm = lib.nixosSystem { - inherit pkgs; modules = [ inputs.self.nixosModules.default ../example-vm # import vm configuration - { nix.registry.nixpkgs.flake = inputs.nixpkgs; } # pin nixpkgs to the one used by the system + { + nixpkgs = { + overlays = builtins.attrValues inputs.self.overlays; + config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam-unwrapped" ]; + }; + # pin nixpkgs to the one used by the system + nix.registry.nixpkgs.flake = inputs.nixpkgs; + } ]; }; - } diff --git a/flake-modules/nixvim-modules.nix b/flake-modules/nixvim-modules.nix index 1f8a395..b40b0dd 100644 --- a/flake-modules/nixvim-modules.nix +++ b/flake-modules/nixvim-modules.nix @@ -23,7 +23,8 @@ inherit system; modules = [ self.nixvimModules.standalone - { performance.combinePlugins.enable = true; } + # FIXME: borked due to https://github.com/nix-community/nixvim/issues/3140 + # { performance.combinePlugins.enable = true; } extraConfig ]; }; diff --git a/flake-modules/scripts.nix b/flake-modules/scripts.nix deleted file mode 100644 index 590f6a1..0000000 --- a/flake-modules/scripts.nix +++ /dev/null @@ -1,14 +0,0 @@ -let - scripts = import ../scripts; -in -{ - # Add scripts to overlay - flake.overlays.scripts = final: prev: scripts final; - - # Add scripts to packages - perSystem = - { pkgs, ... }: - { - packages = scripts pkgs; - }; -} diff --git a/flake.lock b/flake.lock index 0ebe228..cf943be 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1732200724, - "narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=", + "lastModified": 1745523430, + "narHash": "sha256-EAYWV+kXbwsH+8G/8UtmcunDeKwLwSOyfcmzZUkWE/c=", "owner": "SenchoPens", "repo": "base16.nix", - "rev": "153d52373b0fb2d343592871009a286ec8837aec", + "rev": "58bfe2553d937d8af0564f79d5b950afbef69717", "type": "github" }, "original": { @@ -70,11 +70,11 @@ "firefox-gnome-theme": { "flake": false, "locked": { - "lastModified": 1741628778, - "narHash": "sha256-RsvHGNTmO2e/eVfgYK7g+eYEdwwh7SbZa+gZkT24MEA=", + "lastModified": 1743774811, + "narHash": "sha256-oiHLDHXq7ymsMVYSg92dD1OLnKLQoU/Gf2F1GoONLCE=", "owner": "rafaelmardojai", "repo": "firefox-gnome-theme", - "rev": "5a81d390bb64afd4e81221749ec4bffcbeb5fa80", + "rev": "df53a7a31872faf5ca53dd0730038a62ec63ca9e", "type": "github" }, "original": { @@ -90,11 +90,11 @@ ] }, "locked": { - "lastModified": 1741352980, - "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { @@ -167,11 +167,11 @@ ] }, "locked": { - "lastModified": 1741379162, - "narHash": "sha256-srpAbmJapkaqGRE3ytf3bj4XshspVR5964OX5LfjDWc=", + "lastModified": 1742649964, + "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "b5a62751225b2f62ff3147d0a334055ebadcd5cc", + "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", "type": "github" }, "original": { @@ -226,11 +226,11 @@ ] }, "locked": { - "lastModified": 1742655702, - "narHash": "sha256-jbqlw4sPArFtNtA1s3kLg7/A4fzP4GLk9bGbtUJg0JQ=", + "lastModified": 1746171682, + "narHash": "sha256-EyXUNSa+H+YvGVuQJP1nZskXAowxKYp79RNUsNdQTj4=", "owner": "nix-community", "repo": "home-manager", - "rev": "0948aeedc296f964140d9429223c7e4a0702a1ff", + "rev": "50eee705bbdbac942074a8c120e8194185633675", "type": "github" }, "original": { @@ -252,16 +252,16 @@ ] }, "locked": { - "lastModified": 1729958008, - "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=", + "lastModified": 1737371634, + "narHash": "sha256-fTVAWzT1UMm1lT+YxHuVPtH+DATrhYfea3B0MxG/cGw=", "owner": "NuschtOS", "repo": "ixx", - "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb", + "rev": "a1176e2a10ce745ff8f63e4af124ece8fe0b1648", "type": "github" }, "original": { "owner": "NuschtOS", - "ref": "v0.0.6", + "ref": "v0.0.7", "repo": "ixx", "type": "github" } @@ -270,14 +270,14 @@ "flake": false, "locked": { "lastModified": 1737234286, - "narHash": "sha256-CCKIAE84dzkrnlxJCKFyffAxP3yfsOAbdvydUGqq24g=", - "rev": "2837da71ec1588c1187d2e554719b15904a46c8b", + "narHash": "sha256-pgDJZjj4jpzkFxsqBTI/9Yb0n3gW+DvDtuv9SwQZZcs=", + "rev": "079528098f5998ba13c88821a2eca1005c1695de", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/2837da71ec1588c1187d2e554719b15904a46c8b.tar.gz?rev=2837da71ec1588c1187d2e554719b15904a46c8b" + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/079528098f5998ba13c88821a2eca1005c1695de.tar.gz?rev=079528098f5998ba13c88821a2eca1005c1695de" }, "original": { "type": "tarball", - "url": "https://git.lix.systems/lix-project/lix/archive/2.92.0.tar.gz" + "url": "https://git.lix.systems/lix-project/lix/archive/release-2.92.tar.gz" } }, "lix-module": { @@ -290,24 +290,24 @@ ] }, "locked": { - "lastModified": 1737237494, - "narHash": "sha256-YMLrcBpf0TR5r/eaqm8lxzFPap2TxCor0ZGcK3a7+b8=", - "rev": "b90bf629bbd835e61f1317b99e12f8c831017006", + "lastModified": 1742943028, + "narHash": "sha256-fprwZKE1uMzO9tiWWOrmLWBW3GPkMayQfb0xOvVFIno=", + "rev": "3fae818597ca2f1474de62022f850c23be50528d", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/b90bf629bbd835e61f1317b99e12f8c831017006.tar.gz?rev=b90bf629bbd835e61f1317b99e12f8c831017006" + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/3fae818597ca2f1474de62022f850c23be50528d.tar.gz?rev=3fae818597ca2f1474de62022f850c23be50528d" }, "original": { "type": "tarball", - "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz" + "url": "https://git.lix.systems/lix-project/nixos-module/archive/release-2.92.tar.gz" } }, "nixpkgs": { "locked": { - "lastModified": 1742751704, - "narHash": "sha256-rBfc+H1dDBUQ2mgVITMGBPI1PGuCznf9rcWX/XIULyE=", + "lastModified": 1746183838, + "narHash": "sha256-kwaaguGkAqTZ1oK0yXeQ3ayYjs8u/W7eEfrFpFfIDFA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f0946fa5f1fb876a9dc2e1850d9d3a4e3f914092", + "rev": "bf3287dac860542719fe7554e21e686108716879", "type": "github" }, "original": { @@ -319,11 +319,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1742800061, - "narHash": "sha256-oDJGK1UMArK52vcW9S5S2apeec4rbfNELgc50LqiPNs=", + "lastModified": 1746152631, + "narHash": "sha256-zBuvmL6+CUsk2J8GINpyy8Hs1Zp4PP6iBWSmZ4SCQ/s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1750f3c1c89488e2ffdd47cab9d05454dddfb734", + "rev": "032bc6539bd5f14e9d0c51bd79cfe9a055b094c3", "type": "github" }, "original": { @@ -342,11 +342,11 @@ "nuschtosSearch": [] }, "locked": { - "lastModified": 1742991302, - "narHash": "sha256-5S+qnc5ijgFWlAWS9+L7uAgpDnL0RtVEDhVpHWGoavA=", + "lastModified": 1746221140, + "narHash": "sha256-lXFXddrfTY47kF3IGmUQHgJssvGnYY5T4luL+1UmCkc=", "owner": "nix-community", "repo": "nixvim", - "rev": "1c0dd320d9c4f250ac33382e11d370b7abe97622", + "rev": "4b27678512c4b8a3c16676fd6d5d885f2fb84cb3", "type": "github" }, "original": { @@ -367,11 +367,11 @@ ] }, "locked": { - "lastModified": 1742659553, - "narHash": "sha256-i/JCrr/jApVorI9GkSV5to+USrRCa0rWuQDH8JSlK2A=", + "lastModified": 1745046075, + "narHash": "sha256-8v4y6k16Ra/fiecb4DxhsoOGtzLKgKlS+9/XJ9z0T2I=", "owner": "NuschtOS", "repo": "search", - "rev": "508752835128a3977985a4d5225ff241f7756181", + "rev": "066afe8643274470f4a294442aadd988356a478f", "type": "github" }, "original": { @@ -425,11 +425,11 @@ "tinted-tmux": "tinted-tmux" }, "locked": { - "lastModified": 1741961698, - "narHash": "sha256-utsgC6H3ja6sLAXMd8//I2D7yjyScFqVDRX0wpbqPZo=", + "lastModified": 1746143246, + "narHash": "sha256-O8rZjqJUIkUva66XTOZy0wcgfBP2eaxU9+Xt7ZHtfhI=", "owner": "danth", "repo": "stylix", - "rev": "9bfc74f330ead111e8ea354b2220a431b0cfaa26", + "rev": "20ace60f9cb5e179cb2256abaee505780df8e804", "type": "github" }, "original": { @@ -491,11 +491,11 @@ "tinted-tmux": { "flake": false, "locked": { - "lastModified": 1740877430, - "narHash": "sha256-zWcCXgdC4/owfH/eEXx26y5BLzTrefjtSLFHWVD5KxU=", + "lastModified": 1743296873, + "narHash": "sha256-8IQulrb1OBSxMwdKijO9fB70ON//V32dpK9Uioy7FzY=", "owner": "tinted-theming", "repo": "tinted-tmux", - "rev": "d48ee86394cbe45b112ba23ab63e33656090edb4", + "rev": "af5152c8d7546dfb4ff6df94080bf5ff54f64e3a", "type": "github" }, "original": { @@ -511,11 +511,11 @@ ] }, "locked": { - "lastModified": 1742982148, - "narHash": "sha256-aRA6LSxjlbMI6MmMzi/M5WH/ynd8pK+vACD9za3MKLQ=", + "lastModified": 1746216483, + "narHash": "sha256-4h3s1L/kKqt3gMDcVfN8/4v2jqHrgLIe4qok4ApH5x4=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "61c88349bf6dff49fa52d7dfc39b21026c2a8881", + "rev": "29ec5026372e0dec56f890e50dbe4f45930320fd", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 70fa1ee..04aaea2 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,7 @@ unstable.follows = "nixvim/nixpkgs"; # Lix lix-module = { - url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz"; + url = "https://git.lix.systems/lix-project/nixos-module/archive/release-2.92.tar.gz"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.inputs.systems.follows = "systems"; diff --git a/justfile b/justfile index 4021089..483e46c 100644 --- a/justfile +++ b/justfile @@ -3,10 +3,10 @@ default: # Update a specific flake input update input: - nix flake lock --update-input {{input}} --commit-lock-file + nix flake lock --update-input "{{input}}" --commit-lock-file build-vm: - nixos-rebuild build-vm --flake .#vm --print-build-logs + nixos-rebuild build-vm --fallback --flake .#vm --print-build-logs run-vm: build-vm QEMU_OPTS="$QEMU_OPTS_WL" result/bin/run-nixos-vm diff --git a/modules/hm/default.nix b/modules/hm/default.nix index 3f31f26..98de725 100644 --- a/modules/hm/default.nix +++ b/modules/hm/default.nix @@ -59,6 +59,7 @@ in icons = "auto"; }; # Shell + bash.enable = true; # ensure HM variables are passed to `bash` too (otherwise `jpassmenu` doesn't work) fish = { enable = true; preferAbbrs = true; # when defining an alias, prefer instead to define an abbreviation diff --git a/modules/hm/dev.nix b/modules/hm/dev.nix index 5e58c72..2c2d898 100644 --- a/modules/hm/dev.nix +++ b/modules/hm/dev.nix @@ -17,17 +17,6 @@ in [ (lib.mkIf cfg.rust.enable { home.packages = [ pkgs.rustup ] ++ cfg.rust.extraPackages; - # Background code checker (for Rust) - programs.bacon = { - enable = true; - settings = { - export = { - enabled = true; - path = ".bacon-locations"; - line_format = "{kind} {path}:{line}:{column} {message}"; - }; - }; - }; }) { home = { @@ -83,13 +72,14 @@ in templates.draft_commit_description = '' concat( description, + "\n", surround( "\nJJ: This commit contains the following changes:\n", "", - indent("JJ: ", diff.stat(72)), + indent("JJ: ", diff.summary()), ), surround( - "\nJJ: Diff:\n", "", - indent("JJ: ", diff.git()), + "JJ: ignore-rest\n", "", + diff.git(), ), ) ''; diff --git a/modules/hm/gui/default.nix b/modules/hm/gui/default.nix index d885697..75d6cea 100644 --- a/modules/hm/gui/default.nix +++ b/modules/hm/gui/default.nix @@ -21,6 +21,11 @@ let }; in { + imports = [ + ./sway.nix + ./waybar.nix + ]; + config = lib.mkIf (jhome.enable && cfg.enable) { home.packages = (with pkgs; [ @@ -73,30 +78,6 @@ in }; # Text editor nixvim.clipboard.providers.wl-copy.enable = lib.mkDefault true; - # Status bar - waybar = { - enable = true; - systemd.enable = true; - settings = lib.mkIf config.jhome.styling.enable ( - import ./waybar-settings.nix { inherit config lib; } - ); - # Style overrides to highlight workspaces with windows - style = - lib.pipe - # css - '' - .modules-left #workspaces button { - border-bottom: 3px solid @base01; - } - .modules-left #workspaces button.persistent { - border-bottom: 3px solid transparent; - } - '' - [ - (lib.optionalString config.jhome.styling.enable) - lib.mkAfter - ]; - }; # Terminal wezterm = { enable = cfg.terminal == "wezterm"; @@ -125,7 +106,17 @@ in }; }; }; - zellij.enable = cfg.terminal == "alacritty"; # alacritty has no terminal multiplexer built-in + zellij = { + enable = cfg.terminal == "alacritty"; # alacritty has no terminal multiplexer built-in + # Set default shell + settings.default_shell = + if config.programs.fish.enable then + "fish" + else if config.programs.zsh.enable then + "zsh" + else + "bash"; + }; # PDF reader zathura.enable = true; # Auto start sway @@ -163,17 +154,6 @@ in }; }; - # Window Manager - wayland.windowManager.sway = { - inherit (cfg.sway) enable; - package = swayPkg; # no sway package if it comes from the OS - config = import ./sway-config.nix { inherit config pkgs; }; - systemd = { - enable = true; - xdgAutostart = true; - }; - }; - # Set cursor style stylix = lib.mkIf config.jhome.styling.enable { inherit cursor; }; home.pointerCursor = lib.mkIf config.jhome.styling.enable ( diff --git a/modules/hm/gui/keybindings.nix b/modules/hm/gui/keybindings.nix deleted file mode 100644 index cfc8788..0000000 --- a/modules/hm/gui/keybindings.nix +++ /dev/null @@ -1,118 +0,0 @@ -{ pkgs, config }: -let - cfg = config.jhome.gui.sway; - passmenu = "${pkgs.jpassmenu}/bin/jpassmenu"; - selectAudio = "${pkgs.audiomenu}/bin/audiomenu"; - swayconf = config.wayland.windowManager.sway.config; - mod = swayconf.modifier; - workspaces = map toString [ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - ]; - dirs = - map - (dir: { - key = swayconf.${dir}; - arrow = dir; - direction = dir; - }) - [ - "up" - "down" - "left" - "right" - ]; - joinKeys = builtins.concatStringsSep "+"; - # Generate a keybind from a modifier prefix and a key - keycombo = prefix: key: joinKeys (prefix ++ [ key ]); - modKeybind = keycombo [ mod ]; - modCtrlKeybind = keycombo [ - mod - "Ctrl" - ]; - modShiftKeybind = keycombo [ - mod - "Shift" - ]; - modCtrlShiftKeybind = keycombo [ - mod - "Ctrl" - "Shift" - ]; - dir2resize.up = "resize grow height"; - dir2resize.down = "resize shrink height"; - dir2resize.right = "resize grow width"; - dir2resize.left = "resize shrink width"; - # Bind a key combo to an action - genKeybind = prefix: action: key: { "${prefix key}" = "${action key}"; }; - genKey = - prefix: action: genKeybind ({ key, ... }: prefix key) ({ direction, ... }: action direction); - genArrow = - prefix: action: genKeybind ({ arrow, ... }: prefix arrow) ({ direction, ... }: action direction); - genArrowAndKey = - prefix: action: key: - (genKey prefix action key) // (genArrow prefix action key); - # Move window - moveWindowKeybinds = map (genArrowAndKey modShiftKeybind (dir: "move ${dir}")) dirs; - # Focus window - focusWindowKeybinds = map (genArrowAndKey modKeybind (dir: "focus ${dir}")) dirs; - # Resize window - resizeWindowKeybinds = map (genArrowAndKey modCtrlKeybind (dir: dir2resize.${dir})) dirs; - # Move container to workspace - moveWorkspaceKeybindings = map (genKeybind modShiftKeybind ( - number: "move container to workspace number ${number}" - )) workspaces; - # Focus workspace - focusWorkspaceKeybindings = map (genKeybind modKeybind ( - number: "workspace number ${number}" - )) workspaces; - # Move container to Workspace and focus on it - moveFocusWorkspaceKeybindings = map (genKeybind modCtrlShiftKeybind ( - number: "move container to workspace number ${number}; workspace number ${number}" - )) workspaces; -in -builtins.foldl' (l: r: l // r) - { - "${mod}+Return" = "exec ${swayconf.terminal}"; - "${mod}+D" = "exec ${swayconf.menu}"; - "${mod}+P" = "exec ${passmenu}"; - "${mod}+Shift+P" = "exec ${passmenu} --type"; - "${mod}+F2" = "exec qutebrowser"; - "${mod}+Shift+Q" = "kill"; - "${mod}+F" = "fullscreen toggle"; - # Media Controls - "${mod}+F10" = "exec ${selectAudio} select-sink"; - "${mod}+Shift+F10" = "exec ${selectAudio} select-source"; - "XF86AudioRaiseVolume" = "exec ${pkgs.avizo}/bin/volumectl up"; - "XF86AudioLowerVolume" = "exec ${pkgs.avizo}/bin/volumectl down"; - "XF86AudioMute" = "exec ${pkgs.avizo}/bin/volumectl toggle-mute"; - "XF86ScreenSaver" = "exec ${pkgs.swaylock}/bin/swaylock --image ${cfg.background}"; - "XF86MonBrightnessUp" = "exec ${pkgs.avizo}/bin/lightctl up"; - "XF86MonBrightnessDown" = "exec ${pkgs.avizo}/bin/lightctl down"; - # Floating - "${mod}+Space" = "floating toggle"; - "${mod}+Shift+Space" = "focus mode_toggle"; - # Scratchpad - "${mod}+Minus" = "scratchpad show"; - "${mod}+Shift+Minus" = "move scratchpad"; - # Layout - "${mod}+e" = "layout toggle split"; - # Session control - "${mod}+r" = "reload"; - "${mod}+Shift+m" = "exit"; - } - ( - focusWindowKeybinds - ++ moveWindowKeybinds - ++ resizeWindowKeybinds - ++ focusWorkspaceKeybindings - ++ moveWorkspaceKeybindings - ++ moveFocusWorkspaceKeybindings - ) diff --git a/modules/hm/gui/sway-config.nix b/modules/hm/gui/sway-config.nix deleted file mode 100644 index e20e8aa..0000000 --- a/modules/hm/gui/sway-config.nix +++ /dev/null @@ -1,101 +0,0 @@ -{ config, pkgs }: -let - cfg = config.jhome.gui.sway; - modifier = "Mod4"; - inherit (config.jhome.gui) terminal; - termCmd = - if terminal == "wezterm" then - "wezterm start" - else if terminal == "alacritty" then - "alacritty -e" - else - builtins.abort "no command configured for ${terminal}"; - menu = "${pkgs.fuzzel}/bin/fuzzel --terminal '${termCmd}'"; - # currently, there is some friction between sway and gtk: - # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland - # the suggested way to set gtk settings is with gsettings - # for gsettings to work, we need to tell it where the schemas are - # using the XDG_DATA_DIR environment variable - # run at the end of sway config - configure-gtk = - let - schema = pkgs.gsettings-desktop-schemas; - datadir = "${schema}/share/gsettings-schemas/${schema.name}"; - in - pkgs.writers.writeDashBin "configure-gtk" '' - export XDG_DATA_DIRS="${datadir}:$XDG_DATA_DIRS" - - gnome_schema=org.gnome.desktop.interface - config="${config.xdg.configHome}/gtk-3.0/settings.ini" - if [ ! -f "$config" ]; then exit 1; fi - # Read settings from gtk3 - gtk_theme="$(${pkgs.gnugrep}/bin/grep 'gtk-theme-name' "$config" | ${pkgs.gnused}/bin/sed 's/.*\s*=\s*//')" - icon_theme="$(${pkgs.gnugrep}/bin/grep 'gtk-icon-theme-name' "$config" | ${pkgs.gnused}/bin/sed 's/.*\s*=\s*//')" - cursor_theme="$(${pkgs.gnugrep}/bin/grep 'gtk-cursor-theme-name' "$config" | ${pkgs.gnused}/bin/sed 's/.*\s*=\s*//')" - font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')" - ${pkgs.glib}/bin/gsettings set "$gnome_schema" gtk-theme "$gtk_theme" - ${pkgs.glib}/bin/gsettings set "$gnome_schema" icon-theme "$icon_theme" - ${pkgs.glib}/bin/gsettings set "$gnome_schema" cursor-theme "$cursor_theme" - ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name" - ${pkgs.glib}/bin/gsettings set "$gnome_schema" color-scheme prefer-dark - ''; - cmdOnce = command: { inherit command; }; - cmdAlways = command: { - inherit command; - always = true; - }; -in -{ - inherit modifier terminal menu; - keybindings = import ./keybindings.nix { inherit config pkgs; }; - # Appearance - bars = [ ]; # Waybar is started as a systemd service - gaps = { - smartGaps = true; - smartBorders = "on"; - inner = 4; - }; - output."*".bg = "${cfg.background} fill"; - # Window Appearance - window = { - border = 2; - titlebar = false; - # Make certain windows floating - commands = [ - { - command = "floating enable"; - criteria.title = "zoom"; - } - { - command = "floating enable"; - criteria.class = "floating"; - } - { - command = "floating enable"; - criteria.app_id = "floating"; - } - ]; - }; - # Startup scripts - startup = - [ - (cmdAlways "${configure-gtk}/bin/configure-gtk") - ] - ++ (builtins.map cmdAlways cfg.exec.always) - ++ (builtins.map cmdOnce cfg.exec.once); - # Keyboard configuration - input."type:keyboard" = { - repeat_delay = "300"; - repeat_rate = "50"; - xkb_options = "caps:swapescape,compose:ralt"; - xkb_numlock = "enabled"; - }; - # Touchpad - input."type:touchpad" = { - click_method = "clickfinger"; - natural_scroll = "enabled"; - scroll_method = "two_finger"; - tap = "enabled"; - tap_button_map = "lrm"; - }; -} diff --git a/modules/hm/gui/sway.nix b/modules/hm/gui/sway.nix new file mode 100644 index 0000000..5ed2293 --- /dev/null +++ b/modules/hm/gui/sway.nix @@ -0,0 +1,226 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.jhome.gui.sway; +in +{ + config = lib.mkIf (config.jhome.enable && config.jhome.gui.enable && cfg.enable) { + # Window Manager + wayland.windowManager.sway = { + inherit (cfg) enable; + config = + let + inherit (config.jhome.gui) terminal; + termCmd = + if terminal == "wezterm" then + "wezterm start" + else if terminal == "alacritty" then + "alacritty -e" + else + builtins.abort "no command configured for ${terminal}"; + menu = "${pkgs.fuzzel}/bin/fuzzel --terminal '${termCmd}'"; + cmdOnce = command: { inherit command; }; + cmdAlways = command: { + inherit command; + always = true; + }; + in + { + modifier = "Mod4"; + inherit terminal menu; + # Appearance + bars = [ ]; # Waybar is started as a systemd service + gaps = { + smartGaps = true; + smartBorders = "on"; + inner = 4; + }; + output."*".bg = "${cfg.background} fill"; + # Window Appearance + window = { + border = 2; + titlebar = false; + # Make certain windows floating + commands = [ + { + command = "floating enable"; + criteria.title = "zoom"; + } + { + command = "floating enable"; + criteria.class = "floating"; + } + { + command = "floating enable"; + criteria.app_id = "floating"; + } + ]; + }; + # Startup scripts + startup = + let + # currently, there is some friction between sway and gtk: + # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland + # the suggested way to set gtk settings is with gsettings + # for gsettings to work, we need to tell it where the schemas are + # using the XDG_DATA_DIR environment variable + # run at the end of sway config + schema = pkgs.gsettings-desktop-schemas; + datadir = "${schema}/share/gsettings-schemas/${schema.name}"; + in + [ + (cmdAlways "${pkgs.writers.writeDash "configure-gtk" '' + export XDG_DATA_DIRS="${datadir}:$XDG_DATA_DIRS" + + gnome_schema=org.gnome.desktop.interface + config="${config.xdg.configHome}/gtk-3.0/settings.ini" + if [ ! -f "$config" ]; then exit 1; fi + # Read settings from gtk3 + gtk_theme="$(${pkgs.gnugrep}/bin/grep 'gtk-theme-name' "$config" | ${pkgs.gnused}/bin/sed 's/.*\s*=\s*//')" + icon_theme="$(${pkgs.gnugrep}/bin/grep 'gtk-icon-theme-name' "$config" | ${pkgs.gnused}/bin/sed 's/.*\s*=\s*//')" + cursor_theme="$(${pkgs.gnugrep}/bin/grep 'gtk-cursor-theme-name' "$config" | ${pkgs.gnused}/bin/sed 's/.*\s*=\s*//')" + font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')" + ${pkgs.glib}/bin/gsettings set "$gnome_schema" gtk-theme "$gtk_theme" + ${pkgs.glib}/bin/gsettings set "$gnome_schema" icon-theme "$icon_theme" + ${pkgs.glib}/bin/gsettings set "$gnome_schema" cursor-theme "$cursor_theme" + ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name" + ${pkgs.glib}/bin/gsettings set "$gnome_schema" color-scheme prefer-dark + ''}") + ] + ++ (builtins.map cmdAlways cfg.exec.always) + ++ (builtins.map cmdOnce cfg.exec.once); + # Keyboard configuration + input."type:keyboard" = { + repeat_delay = "300"; + repeat_rate = "50"; + xkb_options = "caps:swapescape,compose:ralt"; + xkb_numlock = "enabled"; + }; + # Touchpad + input."type:touchpad" = { + click_method = "clickfinger"; + natural_scroll = "enabled"; + scroll_method = "two_finger"; + tap = "enabled"; + tap_button_map = "lrm"; + }; + # Keybinds + keybindings = + let + passmenu = "${pkgs.jpassmenu}/bin/jpassmenu"; + selectAudio = "${pkgs.audiomenu}/bin/audiomenu"; + swayconf = config.wayland.windowManager.sway.config; + mod = swayconf.modifier; + workspaces = map toString (lib.lists.range 1 9); + dirs = + map + (dir: { + key = swayconf.${dir}; + arrow = dir; + direction = dir; + }) + [ + "up" + "down" + "left" + "right" + ]; + joinKeys = builtins.concatStringsSep "+"; + # Generate a keybind from a modifier prefix and a key + keycombo = prefix: key: joinKeys (prefix ++ [ key ]); + modKeybind = keycombo [ mod ]; + modCtrlKeybind = keycombo [ + mod + "Ctrl" + ]; + modShiftKeybind = keycombo [ + mod + "Shift" + ]; + modCtrlShiftKeybind = keycombo [ + mod + "Ctrl" + "Shift" + ]; + dir2resize.up = "resize grow height"; + dir2resize.down = "resize shrink height"; + dir2resize.right = "resize grow width"; + dir2resize.left = "resize shrink width"; + # Bind a key combo to an action + genKeybind = prefix: action: key: { "${prefix key}" = "${action key}"; }; + genKey = + prefix: action: genKeybind ({ key, ... }: prefix key) ({ direction, ... }: action direction); + genArrow = + prefix: action: genKeybind ({ arrow, ... }: prefix arrow) ({ direction, ... }: action direction); + genArrowAndKey = + prefix: action: key: + (genKey prefix action key) // (genArrow prefix action key); + # Move window + moveWindowKeybinds = map (genArrowAndKey modShiftKeybind (dir: "move ${dir}")) dirs; + # Focus window + focusWindowKeybinds = map (genArrowAndKey modKeybind (dir: "focus ${dir}")) dirs; + # Resize window + resizeWindowKeybinds = map (genArrowAndKey modCtrlKeybind (dir: dir2resize.${dir})) dirs; + # Move container to workspace + moveWorkspaceKeybindings = map (genKeybind modShiftKeybind ( + number: "move container to workspace number ${number}" + )) workspaces; + # Focus workspace + focusWorkspaceKeybindings = map (genKeybind modKeybind ( + number: "workspace number ${number}" + )) workspaces; + # Move container to Workspace and focus on it + moveFocusWorkspaceKeybindings = map (genKeybind modCtrlShiftKeybind ( + number: "move container to workspace number ${number}; workspace number ${number}" + )) workspaces; + in + builtins.foldl' (l: r: l // r) + { + "${mod}+Return" = "exec ${swayconf.terminal}"; + "${mod}+D" = "exec ${swayconf.menu}"; + "${mod}+P" = "exec ${passmenu}"; + "${mod}+Shift+P" = "exec ${passmenu} --type"; + "${mod}+F2" = "exec qutebrowser"; + "${mod}+Shift+Q" = "kill"; + "${mod}+F" = "fullscreen toggle"; + # Media Controls + "${mod}+F10" = "exec ${selectAudio} select-sink"; + "${mod}+Shift+F10" = "exec ${selectAudio} select-source"; + "XF86AudioRaiseVolume" = "exec ${pkgs.avizo}/bin/volumectl up"; + "XF86AudioLowerVolume" = "exec ${pkgs.avizo}/bin/volumectl down"; + "XF86AudioMute" = "exec ${pkgs.avizo}/bin/volumectl toggle-mute"; + "XF86ScreenSaver" = "exec ${pkgs.swaylock}/bin/swaylock --image ${cfg.background}"; + "XF86MonBrightnessUp" = "exec ${pkgs.avizo}/bin/lightctl up"; + "XF86MonBrightnessDown" = "exec ${pkgs.avizo}/bin/lightctl down"; + # Floating + "${mod}+Space" = "floating toggle"; + "${mod}+Shift+Space" = "focus mode_toggle"; + # Scratchpad + "${mod}+Minus" = "scratchpad show"; + "${mod}+Shift+Minus" = "move scratchpad"; + # Layout + "${mod}+e" = "layout toggle split"; + # Session control + "${mod}+r" = "reload"; + "${mod}+Shift+m" = "exit"; + } + ( + focusWindowKeybinds + ++ moveWindowKeybinds + ++ resizeWindowKeybinds + ++ focusWorkspaceKeybindings + ++ moveWorkspaceKeybindings + ++ moveFocusWorkspaceKeybindings + ); + }; + systemd = { + enable = true; + xdgAutostart = true; + }; + }; + }; +} diff --git a/modules/hm/gui/waybar-settings.nix b/modules/hm/gui/waybar-settings.nix deleted file mode 100644 index 3fcf58c..0000000 --- a/modules/hm/gui/waybar-settings.nix +++ /dev/null @@ -1,127 +0,0 @@ -{ config, lib }: -let - cfg = config.jhome.gui; -in -{ - mainBar = { - layer = "top"; - position = "top"; - margin = "2 2 2 2"; - # Choose the order of the modules - modules-left = [ "sway/workspaces" ]; - modules-center = [ "clock" ]; - modules-right = - [ - "pulseaudio" - "backlight" - "battery" - "sway/language" - "memory" - ] - ++ lib.optional (cfg.tempInfo != null) "temperature" - ++ [ "tray" ]; - "sway/workspaces" = { - disable-scroll = true; - persistent-workspaces = { - "1" = [ ]; - "2" = [ ]; - "3" = [ ]; - "4" = [ ]; - "5" = [ ]; - "6" = [ ]; - "7" = [ ]; - "8" = [ ]; - "9" = [ ]; - }; - }; - "sway/language" = { - format = "{} "; - min-length = 5; - tooltip = false; - }; - memory = { - format = "{used:0.1f}/{total:0.1f}GiB "; - interval = 3; - }; - clock = { - timezone = "Europe/Berlin"; - tooltip-format = "{:%Y %B}\n{calendar}"; - format = "{:%a, %d %b, %H:%M}"; - }; - pulseaudio = { - reverse-scrolling = 1; - format = "{volume}% {icon} {format_source}"; - format-bluetooth = "{volume}% {icon} {format_source}"; - format-bluetooth-muted = "{volume}% 󰖁 {icon} {format_source}"; - format-muted = "{volume}% 󰖁 {format_source}"; - format-source = "{volume}% "; - format-source-muted = "{volume}% 󰍭"; - format-icons = { - headphone = "󰋋"; - hands-free = ""; - headset = "󰋎"; - phone = "󰘂"; - portable = ""; - car = ""; - default = [ - "󰕿" - "󰖀" - "󰕾" - ]; - }; - on-click = "pavucontrol"; - min-length = 13; - }; - temperature = lib.optionalAttrs (cfg.tempInfo != null) { - inherit (cfg.tempInfo) hwmon-path; - critical-threshold = 80; - format = "{temperatureC}°C {icon}"; - format-icons = [ - "" - "" - "" - "" - "" - ]; - tooltip = false; - }; - backlight = { - device = "intel_backlight"; - format = "{percent}% {icon}"; - format-icons = [ - "󰃚" - "󰃛" - "󰃜" - "󰃝" - "󰃞" - "󰃟" - "󰃠" - ]; - min-length = 7; - }; - battery = { - states.warning = 30; - states.critical = 15; - format = "{capacity}% {icon}"; - format-charging = "{capacity}% 󰂄"; - format-plugged = "{capacity}% 󰚥"; - format-alt = "{time} {icon}"; - format-icons = [ - "󰁺" - "󰁻" - "󰁼" - "󰁽" - "󰁾" - "󰁿" - "󰂀" - "󰂁" - "󰂂" - "󰁹" - ]; - }; - tray = { - icon-size = 16; - spacing = 0; - }; - }; -} diff --git a/modules/hm/gui/waybar.nix b/modules/hm/gui/waybar.nix new file mode 100644 index 0000000..eefdab4 --- /dev/null +++ b/modules/hm/gui/waybar.nix @@ -0,0 +1,159 @@ +{ + config, + pkgs, + lib, + ... +}: +let + inherit (config) jhome; + cfg = jhome.gui; + swayconf = config.wayland.windowManager.sway; +in +{ + config = lib.mkIf (config.jhome.enable && cfg.enable) { + # Status bar + programs.waybar = { + enable = true; + systemd.enable = true; + settings = lib.mkIf config.jhome.styling.enable { + mainBar = { + layer = "top"; + position = "top"; + margin = "2 2 2 2"; + # Choose the order of the modules + modules-left = [ "sway/workspaces" ]; + modules-center = [ "clock" ]; + modules-right = + [ + "pulseaudio" + "backlight" + "battery" + "sway/language" + "memory" + ] + ++ lib.optional (cfg.tempInfo != null) "temperature" + ++ [ "tray" ]; + "sway/workspaces" = lib.mkIf swayconf.enable { + disable-scroll = true; + persistent-workspaces = { + "1" = [ ]; + "2" = [ ]; + "3" = [ ]; + "4" = [ ]; + "5" = [ ]; + "6" = [ ]; + "7" = [ ]; + "8" = [ ]; + "9" = [ ]; + }; + }; + "sway/language" = lib.mkIf swayconf.enable { + format = "{} "; + min-length = 5; + tooltip = false; + }; + memory = { + format = "{used:0.1f}/{total:0.1f}GiB "; + interval = 3; + }; + clock = { + timezone = "Europe/Berlin"; + tooltip-format = "{:%Y %B}\n{calendar}"; + format = "{:%a, %d %b, %H:%M}"; + }; + wireplumber = { + reverse-scrolling = 1; + format = "{volume}% {icon} {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = "{volume}% 󰖁 {icon} {format_source}"; + format-muted = "{volume}% 󰖁 {format_source}"; + format-source = "{volume}% "; + format-source-muted = "{volume}% 󰍭"; + format-icons = { + headphone = "󰋋"; + hands-free = ""; + headset = "󰋎"; + phone = "󰘂"; + portable = ""; + car = ""; + default = [ + "󰕿" + "󰖀" + "󰕾" + ]; + }; + on-click = lib.getExe pkgs.helvum; + min-length = 13; + }; + temperature = lib.optionalAttrs (cfg.tempInfo != null) { + inherit (cfg.tempInfo) hwmon-path; + critical-threshold = 80; + format = "{temperatureC}°C {icon}"; + format-icons = [ + "" + "" + "" + "" + "" + ]; + tooltip = false; + }; + backlight = { + device = "intel_backlight"; + format = "{percent}% {icon}"; + format-icons = [ + "󰃚" + "󰃛" + "󰃜" + "󰃝" + "󰃞" + "󰃟" + "󰃠" + ]; + min-length = 7; + }; + battery = { + states.warning = 30; + states.critical = 15; + format = "{capacity}% {icon}"; + format-charging = "{capacity}% 󰂄"; + format-plugged = "{capacity}% 󰚥"; + format-alt = "{time} {icon}"; + format-icons = [ + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + }; + tray = { + icon-size = 16; + spacing = 0; + }; + }; + }; + # Style overrides to highlight workspaces with windows + style = + lib.pipe + # css + '' + .modules-left #workspaces button { + border-bottom: 3px solid @base01; + } + .modules-left #workspaces button.persistent { + border-bottom: 3px solid transparent; + } + '' + [ + (lib.optionalString config.jhome.styling.enable) + lib.mkAfter + ]; + }; + }; +} diff --git a/modules/hm/options.nix b/modules/hm/options.nix index 2f65337..e274f52 100644 --- a/modules/hm/options.nix +++ b/modules/hm/options.nix @@ -198,8 +198,6 @@ in [ "just" ] # just a command runner [ "typos" ] # low false positive rate typo checker [ "gcc" ] # GNU Compiler Collection - [ "git-absorb" ] # fixup! but automatic - [ "gitoxide" ] # git but RiiR [ "man-pages" ] # gimme the man pages [ "man-pages-posix" ] # I said gimme the man pages!!! ]; diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index d6eeff7..e2e4370 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -17,6 +17,7 @@ in ./options.nix ./dev.nix ./gui.nix + ./starship.nix ./styling.nix ]; @@ -34,42 +35,7 @@ in pkgs.unzip ]; - programs = { - # Launch fish if shell is interactive (from https://wiki.nixos.org/wiki/Fish) - bash.interactiveShellInit = # bash - '' - if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] - then - shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" - exec ${pkgs.fish}/bin/fish $LOGIN_OPTION - fi - ''; - # Default shell - fish.enable = true; - # Shell prompt - starship = { - enable = true; - settings = lib.mkMerge [ - { - format = "$time$all"; - add_newline = false; - cmd_duration.min_time = 500; - cmd_duration.show_milliseconds = true; - time.disabled = false; - status = { - format = "[$signal_name$common_meaning$maybe_int](red)"; - symbol = "[✗](bold red)"; - disabled = false; - }; - sudo.disabled = false; - } - # Add nerdfont symbols - (lib.mkIf cfg.styling.enable (import ./starship-nerdfont-symbols.nix)) - # Remove the `in`s and `on`s from the prompt - (import ./starship-shorter-text.nix) - ]; - }; - }; + programs.fish.enable = true; environment.etc = keysFromGithub; services = { diff --git a/modules/nixos/starship-nerdfont-symbols.nix b/modules/nixos/starship-nerdfont-symbols.nix deleted file mode 100644 index 2032150..0000000 --- a/modules/nixos/starship-nerdfont-symbols.nix +++ /dev/null @@ -1,89 +0,0 @@ -{ - aws.symbol = " "; - buf.symbol = " "; - c.symbol = " "; - conda.symbol = " "; - crystal.symbol = " "; - dart.symbol = " "; - directory.read_only = " 󰌾"; - docker_context.symbol = " "; - elixir.symbol = " "; - elm.symbol = " "; - fennel.symbol = " "; - fossil_branch.symbol = " "; - git_branch.symbol = " "; - git_commit.tag_symbol = "  "; - golang.symbol = " "; - gradle.symbol = " "; - guix_shell.symbol = " "; - haskell.symbol = " "; - haxe.symbol = " "; - hg_branch.symbol = " "; - hostname.ssh_symbol = " "; - java.symbol = " "; - julia.symbol = " "; - kotlin.symbol = " "; - lua.symbol = " "; - memory_usage.symbol = "󰍛 "; - meson.symbol = "󰔷 "; - nim.symbol = "󰆥 "; - nix_shell.symbol = " "; - nodejs.symbol = " "; - ocaml.symbol = " "; - package.symbol = "󰏗 "; - perl.symbol = " "; - php.symbol = " "; - pijul_channel.symbol = " "; - python.symbol = " "; - rlang.symbol = "󰟔 "; - ruby.symbol = " "; - rust.symbol = "󱘗 "; - scala.symbol = " "; - swift.symbol = " "; - zig.symbol = " "; - os.symbols = { - Alpaquita = " "; - Alpine = " "; - AlmaLinux = " "; - Amazon = " "; - Android = " "; - Arch = " "; - Artix = " "; - CentOS = " "; - Debian = " "; - DragonFly = " "; - Emscripten = " "; - EndeavourOS = " "; - Fedora = " "; - FreeBSD = " "; - Garuda = "󰛓 "; - Gentoo = " "; - HardenedBSD = "󰞌 "; - Illumos = "󰈸 "; - Kali = " "; - Linux = " "; - Mabox = " "; - Macos = " "; - Manjaro = " "; - Mariner = " "; - MidnightBSD = " "; - Mint = " "; - NetBSD = " "; - NixOS = " "; - OpenBSD = "󰈺 "; - openSUSE = " "; - OracleLinux = "󰌷 "; - Pop = " "; - Raspbian = " "; - Redhat = " "; - RedHatEnterprise = " "; - RockyLinux = " "; - Redox = "󰀘 "; - Solus = "󰠳 "; - SUSE = " "; - Ubuntu = " "; - Unknown = " "; - Void = " "; - Windows = "󰍲 "; - }; -} diff --git a/modules/nixos/starship-shorter-text.nix b/modules/nixos/starship-shorter-text.nix deleted file mode 100644 index 605a53a..0000000 --- a/modules/nixos/starship-shorter-text.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ - aws.format = "[$symbol($profile)(\\($region\\))(\\[$duration\\])]($style) "; - bun.format = "[$symbol($version)]($style) "; - c.format = "[$symbol($version(-$name))]($style) "; - cmake.format = "[$symbol($version)]($style) "; - cmd_duration.format = "[⏱ $duration]($style) "; - cobol.format = "[$symbol($version)]($style) "; - conda.format = "[$symbol$environment]($style) "; - crystal.format = "[$symbol($version)]($style) "; - daml.format = "[$symbol($version)]($style) "; - dart.format = "[$symbol($version)]($style) "; - deno.format = "[$symbol($version)]($style) "; - docker_context.format = "[$symbol$context]($style) "; - dotnet.format = "[$symbol($version)(🎯 $tfm)]($style) "; - elixir.format = "[$symbol($version \\(OTP $otp_version\\))]($style) "; - elm.format = "[$symbol($version)]($style) "; - erlang.format = "[$symbol($version)]($style) "; - fennel.format = "[$symbol($version)]($style) "; - fossil_branch.format = "[$symbol$branch]($style) "; - gcloud.format = "[$symbol$account(@$domain)(\\($region\\))]($style) "; - git_branch.format = "[$symbol$branch]($style) "; - git_status.format = "[$all_status$ahead_behind]($style) "; - golang.format = "[$symbol($version)]($style) "; - gradle.format = "[$symbol($version)]($style) "; - guix_shell.format = "[$symbol]($style) "; - haskell.format = "[$symbol($version)]($style) "; - haxe.format = "[$symbol($version)]($style) "; - helm.format = "[$symbol($version)]($style) "; - hg_branch.format = "[$symbol$branch]($style) "; - java.format = "[$symbol($version)]($style) "; - julia.format = "[$symbol($version)]($style) "; - kotlin.format = "[$symbol($version)]($style) "; - kubernetes.format = "[$symbol$context( \\($namespace\\))]($style) "; - lua.format = "[$symbol($version)]($style) "; - memory_usage.format = "$symbol[$ram( | $swap)]($style) "; - meson.format = "[$symbol$project]($style) "; - nim.format = "[$symbol($version)]($style) "; - nix_shell.format = "[$symbol$state( \\($name\\))]($style) "; - nodejs.format = "[$symbol($version)]($style) "; - ocaml.format = "[$symbol($version)(\\($switch_indicator$switch_name\\))]($style) "; - opa.format = "[$symbol($version)]($style) "; - openstack.format = "[$symbol$cloud(\\($project\\))]($style) "; - os.format = "[$symbol]($style) "; - package.format = "[$symbol$version]($style) "; - perl.format = "[$symbol($version)]($style) "; - php.format = "[$symbol($version)]($style) "; - pijul_channel.format = "[$symbol$channel]($style) "; - pulumi.format = "[$symbol$stack]($style) "; - purescript.format = "[$symbol($version)]($style) "; - python.format = "[\${symbol}\${pyenv_prefix}(\${version})(\\($virtualenv\\))]($style) "; - raku.format = "[$symbol($version-$vm_version)]($style) "; - red.format = "[$symbol($version)]($style) "; - ruby.format = "[$symbol($version)]($style) "; - rust.format = "[$symbol($version)]($style) "; - scala.format = "[$symbol($version)]($style) "; - spack.format = "[$symbol$environment]($style) "; - sudo.format = "[as $symbol]($style) "; - swift.format = "[$symbol($version)]($style) "; - terraform.format = "[$symbol$workspace]($style) "; - time.format = "[$time]($style) "; - username.format = "[$user]($style) "; - vagrant.format = "[$symbol($version)]($style) "; - vlang.format = "[$symbol($version)]($style) "; - zig.format = "[$symbol($version)]($style) "; - solidity.format = "[$symbol($version)]($style) "; -} diff --git a/modules/nixos/starship.nix b/modules/nixos/starship.nix new file mode 100644 index 0000000..3ab8d8b --- /dev/null +++ b/modules/nixos/starship.nix @@ -0,0 +1,183 @@ +{ pkgs, lib, ... }@args: +let + cfg = args.config.jconfig; +in +{ + config = lib.mkIf cfg.enable { + programs.starship = { + enable = true; + settings = lib.mkMerge [ + { + format = "$time$all"; + add_newline = false; + cmd_duration.min_time = 500; + cmd_duration.show_milliseconds = true; + time.disabled = false; + status = { + format = "[$signal_name$common_meaning$maybe_int](red)"; + symbol = "[✗](bold red)"; + disabled = false; + }; + sudo.disabled = false; + } + # Add nerdfont symbols + (lib.mkIf cfg.styling.enable { + aws.symbol = " "; + buf.symbol = " "; + c.symbol = " "; + conda.symbol = " "; + crystal.symbol = " "; + dart.symbol = " "; + directory.read_only = " 󰌾"; + docker_context.symbol = " "; + elixir.symbol = " "; + elm.symbol = " "; + fennel.symbol = " "; + fossil_branch.symbol = " "; + git_branch.symbol = " "; + git_commit.tag_symbol = "  "; + golang.symbol = " "; + gradle.symbol = " "; + guix_shell.symbol = " "; + haskell.symbol = " "; + haxe.symbol = " "; + hg_branch.symbol = " "; + hostname.ssh_symbol = " "; + java.symbol = " "; + julia.symbol = " "; + kotlin.symbol = " "; + lua.symbol = " "; + memory_usage.symbol = "󰍛 "; + meson.symbol = "󰔷 "; + nim.symbol = "󰆥 "; + nix_shell.symbol = " "; + nodejs.symbol = " "; + ocaml.symbol = " "; + package.symbol = "󰏗 "; + perl.symbol = " "; + php.symbol = " "; + pijul_channel.symbol = " "; + python.symbol = " "; + rlang.symbol = "󰟔 "; + ruby.symbol = " "; + rust.symbol = "󱘗 "; + scala.symbol = " "; + swift.symbol = " "; + zig.symbol = " "; + os.symbols = { + Alpaquita = " "; + Alpine = " "; + AlmaLinux = " "; + Amazon = " "; + Android = " "; + Arch = " "; + Artix = " "; + CentOS = " "; + Debian = " "; + DragonFly = " "; + Emscripten = " "; + EndeavourOS = " "; + Fedora = " "; + FreeBSD = " "; + Garuda = "󰛓 "; + Gentoo = " "; + HardenedBSD = "󰞌 "; + Illumos = "󰈸 "; + Kali = " "; + Linux = " "; + Mabox = " "; + Macos = " "; + Manjaro = " "; + Mariner = " "; + MidnightBSD = " "; + Mint = " "; + NetBSD = " "; + NixOS = " "; + OpenBSD = "󰈺 "; + openSUSE = " "; + OracleLinux = "󰌷 "; + Pop = " "; + Raspbian = " "; + Redhat = " "; + RedHatEnterprise = " "; + RockyLinux = " "; + Redox = "󰀘 "; + Solus = "󰠳 "; + SUSE = " "; + Ubuntu = " "; + Unknown = " "; + Void = " "; + Windows = "󰍲 "; + }; + }) + # Remove the `in`s and `on`s from the prompt + { + aws.format = "[$symbol($profile)(\\($region\\))(\\[$duration\\])]($style) "; + bun.format = "[$symbol($version)]($style) "; + c.format = "[$symbol($version(-$name))]($style) "; + cmake.format = "[$symbol($version)]($style) "; + cmd_duration.format = "[⏱ $duration]($style) "; + cobol.format = "[$symbol($version)]($style) "; + conda.format = "[$symbol$environment]($style) "; + crystal.format = "[$symbol($version)]($style) "; + daml.format = "[$symbol($version)]($style) "; + dart.format = "[$symbol($version)]($style) "; + deno.format = "[$symbol($version)]($style) "; + docker_context.format = "[$symbol$context]($style) "; + dotnet.format = "[$symbol($version)(🎯 $tfm)]($style) "; + elixir.format = "[$symbol($version \\(OTP $otp_version\\))]($style) "; + elm.format = "[$symbol($version)]($style) "; + erlang.format = "[$symbol($version)]($style) "; + fennel.format = "[$symbol($version)]($style) "; + fossil_branch.format = "[$symbol$branch]($style) "; + gcloud.format = "[$symbol$account(@$domain)(\\($region\\))]($style) "; + git_branch.format = "[$symbol$branch]($style) "; + git_status.format = "[$all_status$ahead_behind]($style) "; + golang.format = "[$symbol($version)]($style) "; + gradle.format = "[$symbol($version)]($style) "; + guix_shell.format = "[$symbol]($style) "; + haskell.format = "[$symbol($version)]($style) "; + haxe.format = "[$symbol($version)]($style) "; + helm.format = "[$symbol($version)]($style) "; + hg_branch.format = "[$symbol$branch]($style) "; + java.format = "[$symbol($version)]($style) "; + julia.format = "[$symbol($version)]($style) "; + kotlin.format = "[$symbol($version)]($style) "; + kubernetes.format = "[$symbol$context( \\($namespace\\))]($style) "; + lua.format = "[$symbol($version)]($style) "; + memory_usage.format = "$symbol[$ram( | $swap)]($style) "; + meson.format = "[$symbol$project]($style) "; + nim.format = "[$symbol($version)]($style) "; + nix_shell.format = "[$symbol$state( \\($name\\))]($style) "; + nodejs.format = "[$symbol($version)]($style) "; + ocaml.format = "[$symbol($version)(\\($switch_indicator$switch_name\\))]($style) "; + opa.format = "[$symbol($version)]($style) "; + openstack.format = "[$symbol$cloud(\\($project\\))]($style) "; + os.format = "[$symbol]($style) "; + package.format = "[$symbol$version]($style) "; + perl.format = "[$symbol($version)]($style) "; + php.format = "[$symbol($version)]($style) "; + pijul_channel.format = "[$symbol$channel]($style) "; + pulumi.format = "[$symbol$stack]($style) "; + purescript.format = "[$symbol($version)]($style) "; + python.format = "[\${symbol}\${pyenv_prefix}(\${version})(\\($virtualenv\\))]($style) "; + raku.format = "[$symbol($version-$vm_version)]($style) "; + red.format = "[$symbol($version)]($style) "; + ruby.format = "[$symbol($version)]($style) "; + rust.format = "[$symbol($version)]($style) "; + scala.format = "[$symbol($version)]($style) "; + spack.format = "[$symbol$environment]($style) "; + sudo.format = "[as $symbol]($style) "; + swift.format = "[$symbol($version)]($style) "; + terraform.format = "[$symbol$workspace]($style) "; + time.format = "[$time]($style) "; + username.format = "[$user]($style) "; + vagrant.format = "[$symbol($version)]($style) "; + vlang.format = "[$symbol($version)]($style) "; + zig.format = "[$symbol($version)]($style) "; + solidity.format = "[$symbol($version)]($style) "; + } + ]; + }; + }; +} diff --git a/modules/nixvim/default.nix b/modules/nixvim/default.nix index afe1a05..6152af6 100644 --- a/modules/nixvim/default.nix +++ b/modules/nixvim/default.nix @@ -6,10 +6,9 @@ in imports = [ ./options.nix ]; config.programs.nixvim = lib.mkMerge [ - (import ./standalone.nix) + ./standalone.nix (lib.mkIf cfg.enable { enable = true; - nixpkgs.useGlobalPackages = true; defaultEditor = lib.mkDefault true; jhome.nvim = cfg; }) diff --git a/modules/nixvim/dev-plugins.nix b/modules/nixvim/dev-plugins.nix index f44c09b..4e3424e 100644 --- a/modules/nixvim/dev-plugins.nix +++ b/modules/nixvim/dev-plugins.nix @@ -7,6 +7,7 @@ }: let inherit (helpers) enableExceptInTests; + inherit (lib.trivial) const; cfg = config.jhome.nvim; enabledLSPs = [ "basedpyright" @@ -23,21 +24,18 @@ let "zls" "fish_lsp" ]; + + enableOpt.enable = true; + noPackage.package = null; in { config = lib.mkIf cfg.dev.enable ( lib.mkMerge [ # Enable LSPs - { - plugins.lsp.servers = lib.genAttrs enabledLSPs (_: { - enable = true; - }); - } + { plugins.lsp.servers = lib.genAttrs enabledLSPs (const enableOpt); } # Remove bundled LSPs (lib.mkIf (!cfg.dev.bundleLSPs) { - plugins.lsp.servers = lib.genAttrs enabledLSPs (_: { - package = null; - }); + plugins.lsp.servers = lib.genAttrs enabledLSPs (const noPackage); }) # Configure LSPs { @@ -46,17 +44,19 @@ in enable = true; servers = { # Pyright needs to have the project root set? - basedpyright.rootDir = # lua - '' - function() - return vim.fs.root(0, {'flake.nix', '.git', '.jj', 'pyproject.toml', 'setup.py'}) - end - ''; - bashls.package = lib.mkDefault pkgs.bash-language-server; - # Adds ~2 GiB, install in a devShell instead - clangd.package = lib.mkDefault null; - # zls & other zig tools are big, install in a devShell instead - zls.package = lib.mkDefault null; + basedpyright.rootMarkers = [ + "flake.nix" + ".git" + ".jj" + "pyproject.toml" + "setup.py" + ]; + # Big but infrequently used dependencies. + # + # Configure the LSPs, but don't install the packages. + # If you need to use them, add them to your project's devShell + clangd = noPackage; + zls = noPackage; }; }; lspkind = { @@ -82,10 +82,10 @@ in (lib.mkIf (!cfg.dev.bundleGrammars) { plugins.treesitter.grammarPackages = [ ]; }) # Remove tools for building gramars when bundling them (lib.mkIf cfg.dev.bundleGrammars { - plugins.treesitter = { - gccPackage = null; - nodejsPackage = null; - treesitterPackage = null; + dependencies = { + gcc.enable = false; + nodejs.enable = false; + tree-sitter.enable = false; }; }) # Configure Formatters @@ -159,17 +159,9 @@ in } # Rust plugins { - plugins = { - bacon = { - enable = true; - settings.quickfix.enabled = true; - }; - rustaceanvim = { - enable = true; - # Install through rustup - rustAnalyzerPackage = null; - }; - }; + plugins.rustaceanvim.enable = true; + # install through rustup + dependencies.rust-analyzer.enable = false; } # Other plugins { diff --git a/modules/nixvim/extraPlugins/default.nix b/modules/nixvim/extraPlugins/default.nix deleted file mode 100644 index 87e972c..0000000 --- a/modules/nixvim/extraPlugins/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs }: -let - overlay = pkgs.callPackage ./generated.nix { - inherit (pkgs.vimUtils) buildVimPlugin buildNeovimPlugin; - }; - plugins = overlay pkgs pkgs; -in -{ - inherit overlay; - inherit (plugins) nvim-silicon; -} diff --git a/modules/nixvim/standalone.nix b/modules/nixvim/standalone.nix index cec3117..f66d239 100644 --- a/modules/nixvim/standalone.nix +++ b/modules/nixvim/standalone.nix @@ -7,7 +7,12 @@ let cfg = config.jhome.nvim; plugins = pkgs.vimPlugins; - extraPlugins = import ./extraPlugins { inherit pkgs; }; + jExtraVimPlugins = pkgs.vimPlugins.extend ( + pkgs.callPackage ./extraPlugins/generated.nix { + inherit (pkgs.vimUtils) buildVimPlugin; + inherit (pkgs.neovimUtils) buildNeovimPlugin; + } + ); in { imports = [ @@ -55,7 +60,6 @@ in extraPlugins = [ plugins.nui-nvim plugins.nvim-web-devicons - plugins.vim-jjdescription # FIXME: included since neovim nightly ]; extraPackages = [ pkgs.luajitPackages.jsregexp ]; extraConfigLuaPre = @@ -79,7 +83,7 @@ in } # Big packages that are kinda unnecessary (lib.mkIf (!cfg.reduceSize) { - extraPlugins = [ extraPlugins.nvim-silicon ]; + extraPlugins = [ jExtraVimPlugins.nvim-silicon ]; extraPackages = [ pkgs.silicon ]; extraConfigLua = # lua diff --git a/scripts/audiomenu/Cargo.lock b/scripts/audiomenu/Cargo.lock index 3a7eda5..f395b59 100644 --- a/scripts/audiomenu/Cargo.lock +++ b/scripts/audiomenu/Cargo.lock @@ -116,9 +116,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.34" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff" +checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" dependencies = [ "clap_builder", "clap_derive", @@ -126,9 +126,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.34" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489" +checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" dependencies = [ "anstream", "anstyle", @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", "windows-sys", @@ -214,15 +214,15 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "memchr" @@ -232,9 +232,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.5.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a955165f87b37fd1862df2a59547ac542c77ef6d17c666f619d1ad22dd89484" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "backtrace", "backtrace-ext", @@ -246,15 +246,14 @@ dependencies = [ "supports-unicode", "terminal_size", "textwrap", - "thiserror", "unicode-width 0.1.14", ] [[package]] name = "miette-derive" -version = "7.5.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf45bf44ab49be92fd1227a3be6fc6f617f1a337c06af54981048574d8783147" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", @@ -263,9 +262,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] @@ -281,9 +280,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "os_pipe" @@ -303,9 +302,9 @@ checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564" [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -327,9 +326,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "1.0.3" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ "bitflags", "errno", @@ -378,9 +377,9 @@ dependencies = [ [[package]] name = "shared_child" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fa9338aed9a1df411814a5b2252f7cd206c55ae9bf2fa763f8de84603aa60c" +checksum = "7e297bd52991bbe0686c086957bee142f13df85d1e79b0b21630a99d374ae9dc" dependencies = [ "libc", "windows-sys", @@ -415,9 +414,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.100" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -444,26 +443,6 @@ dependencies = [ "unicode-width 0.2.0", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "unicode-ident" version = "1.0.18" diff --git a/scripts/default.nix b/scripts/default.nix index 23ec010..1894de7 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -1,23 +1,37 @@ -# Autodetects files with a package.nix and calls `callPackage` on them. -# -# Will add a package .#dirname to the flake if it finds a ./dirname/package.nix file. +{ lib, ... }: let - files = builtins.readDir ./.; + src = ./.; + # Autodetects files with a package.nix and calls `callPackage` on them. + # + # Will add a package .#dirname to the flake if it finds a ./dirname/package.nix file. + files = builtins.readDir src; isPackage = path: type: (type == "directory") && (builtins.readDir path) ? "package.nix"; toPackage = name: pkgs: { inherit name; - value = pkgs.callPackage (./. + "/${name}/package.nix") { }; + value = pkgs.callPackage "${src}/${name}/package.nix" { }; }; # call pkgs.callPackage on all ./*/package.nix makePackage = pkgs: name: let type = files.${name}; - path = ./. + "/${name}"; + path = "${src}/${name}"; package = toPackage name pkgs; in # if it is a package then return a package otherwise return no package c: if isPackage path type then [ package ] else [ ]; + # we have lib.filterMapAttrs at home + scripts = + pkgs: builtins.listToAttrs (builtins.concatMap (makePackage pkgs) (builtins.attrNames files)); in -# we have lib.filterMapAttrs at home -pkgs: builtins.listToAttrs (builtins.concatMap (makePackage pkgs) (builtins.attrNames files)) +{ + # Add scripts to overlay + flake.overlays.scripts = final: scripts; + + # Add scripts to packages + perSystem = + { pkgs, ... }: + { + packages = scripts pkgs; + }; +} diff --git a/scripts/jpassmenu/Cargo.lock b/scripts/jpassmenu/Cargo.lock index 7354614..a0bcccd 100644 --- a/scripts/jpassmenu/Cargo.lock +++ b/scripts/jpassmenu/Cargo.lock @@ -108,9 +108,9 @@ checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "bstr" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" dependencies = [ "memchr", "serde", @@ -124,9 +124,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.34" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff" +checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" dependencies = [ "clap_builder", "clap_derive", @@ -134,9 +134,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.34" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489" +checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" dependencies = [ "anstream", "anstyle", @@ -217,9 +217,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.7" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3716d7a920fb4fac5d84e9d4bce8ceb321e9414b4409da61b07b75c1e3d0697" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" dependencies = [ "anstream", "anstyle", @@ -230,9 +230,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", "windows-sys", @@ -293,9 +293,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "jiff" -version = "0.2.5" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c102670231191d07d37a35af3eb77f1f0dbf7a71be51a962dcd57ea607be7260" +checksum = "27e77966151130221b079bcec80f1f34a9e414fa489d99152a201c07fd2182bc" dependencies = [ "jiff-static", "log", @@ -306,9 +306,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.5" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cdde31a9d349f1b1f51a0b3714a5940ac022976f4b49485fc04be052b183b4c" +checksum = "97265751f8a9a4228476f2fc17874a9e7e70e96b893368e42619880fe143b48a" dependencies = [ "proc-macro2", "quote", @@ -329,15 +329,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.171" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "log" @@ -353,9 +353,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.5.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a955165f87b37fd1862df2a59547ac542c77ef6d17c666f619d1ad22dd89484" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "backtrace", "backtrace-ext", @@ -367,15 +367,14 @@ dependencies = [ "supports-unicode", "terminal_size", "textwrap", - "thiserror", "unicode-width 0.1.14", ] [[package]] name = "miette-derive" -version = "7.5.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf45bf44ab49be92fd1227a3be6fc6f617f1a337c06af54981048574d8783147" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", @@ -384,9 +383,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] @@ -402,9 +401,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "os_pipe" @@ -439,9 +438,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -492,9 +491,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "1.0.3" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ "bitflags", "errno", @@ -534,9 +533,9 @@ dependencies = [ [[package]] name = "shared_child" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fa9338aed9a1df411814a5b2252f7cd206c55ae9bf2fa763f8de84603aa60c" +checksum = "7e297bd52991bbe0686c086957bee142f13df85d1e79b0b21630a99d374ae9dc" dependencies = [ "libc", "windows-sys", @@ -571,9 +570,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.100" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -600,26 +599,6 @@ dependencies = [ "unicode-width 0.2.0", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "unicode-ident" version = "1.0.18"