diff --git a/.envrc b/.envrc index e483044..49bacf7 100644 --- a/.envrc +++ b/.envrc @@ -1,11 +1,10 @@ # 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 67e38a7..1b2b4d0 100644 --- a/example-vm/vm-config.nix +++ b/example-vm/vm-config.nix @@ -31,6 +31,4 @@ # 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 d793f21..ce3e3c5 100644 --- a/flake-modules/default.nix +++ b/flake-modules/default.nix @@ -1,4 +1,7 @@ { inputs, ... }: +let + overlays = builtins.attrValues inputs.self.overlays; +in { imports = [ inputs.treefmt-nix.flakeModule @@ -10,12 +13,14 @@ ./home-modules.nix ./nixvim-modules.nix ./overlays.nix - ../scripts + ./scripts.nix ]; 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 e941b37..b21085d 100644 --- a/flake-modules/example-vm.nix +++ b/flake-modules/example-vm.nix @@ -1,18 +1,19 @@ { 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 - { - 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; - } + { nix.registry.nixpkgs.flake = inputs.nixpkgs; } # pin nixpkgs to the one used by the system ]; }; + } diff --git a/flake-modules/nixvim-modules.nix b/flake-modules/nixvim-modules.nix index b40b0dd..1f8a395 100644 --- a/flake-modules/nixvim-modules.nix +++ b/flake-modules/nixvim-modules.nix @@ -23,8 +23,7 @@ inherit system; modules = [ self.nixvimModules.standalone - # FIXME: borked due to https://github.com/nix-community/nixvim/issues/3140 - # { performance.combinePlugins.enable = true; } + { performance.combinePlugins.enable = true; } extraConfig ]; }; diff --git a/flake-modules/scripts.nix b/flake-modules/scripts.nix new file mode 100644 index 0000000..590f6a1 --- /dev/null +++ b/flake-modules/scripts.nix @@ -0,0 +1,14 @@ +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 d65ff16..0ebe228 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1745523430, - "narHash": "sha256-EAYWV+kXbwsH+8G/8UtmcunDeKwLwSOyfcmzZUkWE/c=", + "lastModified": 1732200724, + "narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=", "owner": "SenchoPens", "repo": "base16.nix", - "rev": "58bfe2553d937d8af0564f79d5b950afbef69717", + "rev": "153d52373b0fb2d343592871009a286ec8837aec", "type": "github" }, "original": { @@ -70,11 +70,11 @@ "firefox-gnome-theme": { "flake": false, "locked": { - "lastModified": 1743774811, - "narHash": "sha256-oiHLDHXq7ymsMVYSg92dD1OLnKLQoU/Gf2F1GoONLCE=", + "lastModified": 1741628778, + "narHash": "sha256-RsvHGNTmO2e/eVfgYK7g+eYEdwwh7SbZa+gZkT24MEA=", "owner": "rafaelmardojai", "repo": "firefox-gnome-theme", - "rev": "df53a7a31872faf5ca53dd0730038a62ec63ca9e", + "rev": "5a81d390bb64afd4e81221749ec4bffcbeb5fa80", "type": "github" }, "original": { @@ -90,11 +90,11 @@ ] }, "locked": { - "lastModified": 1743550720, - "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "lastModified": 1741352980, + "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9", "type": "github" }, "original": { @@ -167,11 +167,11 @@ ] }, "locked": { - "lastModified": 1742649964, - "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", + "lastModified": 1741379162, + "narHash": "sha256-srpAbmJapkaqGRE3ytf3bj4XshspVR5964OX5LfjDWc=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", + "rev": "b5a62751225b2f62ff3147d0a334055ebadcd5cc", "type": "github" }, "original": { @@ -226,11 +226,11 @@ ] }, "locked": { - "lastModified": 1746171682, - "narHash": "sha256-EyXUNSa+H+YvGVuQJP1nZskXAowxKYp79RNUsNdQTj4=", + "lastModified": 1742655702, + "narHash": "sha256-jbqlw4sPArFtNtA1s3kLg7/A4fzP4GLk9bGbtUJg0JQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "50eee705bbdbac942074a8c120e8194185633675", + "rev": "0948aeedc296f964140d9429223c7e4a0702a1ff", "type": "github" }, "original": { @@ -252,16 +252,16 @@ ] }, "locked": { - "lastModified": 1737371634, - "narHash": "sha256-fTVAWzT1UMm1lT+YxHuVPtH+DATrhYfea3B0MxG/cGw=", + "lastModified": 1729958008, + "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=", "owner": "NuschtOS", "repo": "ixx", - "rev": "a1176e2a10ce745ff8f63e4af124ece8fe0b1648", + "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb", "type": "github" }, "original": { "owner": "NuschtOS", - "ref": "v0.0.7", + "ref": "v0.0.6", "repo": "ixx", "type": "github" } @@ -270,14 +270,14 @@ "flake": false, "locked": { "lastModified": 1737234286, - "narHash": "sha256-pgDJZjj4jpzkFxsqBTI/9Yb0n3gW+DvDtuv9SwQZZcs=", - "rev": "079528098f5998ba13c88821a2eca1005c1695de", + "narHash": "sha256-CCKIAE84dzkrnlxJCKFyffAxP3yfsOAbdvydUGqq24g=", + "rev": "2837da71ec1588c1187d2e554719b15904a46c8b", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/079528098f5998ba13c88821a2eca1005c1695de.tar.gz?rev=079528098f5998ba13c88821a2eca1005c1695de" + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/2837da71ec1588c1187d2e554719b15904a46c8b.tar.gz?rev=2837da71ec1588c1187d2e554719b15904a46c8b" }, "original": { "type": "tarball", - "url": "https://git.lix.systems/lix-project/lix/archive/release-2.92.tar.gz" + "url": "https://git.lix.systems/lix-project/lix/archive/2.92.0.tar.gz" } }, "lix-module": { @@ -290,24 +290,24 @@ ] }, "locked": { - "lastModified": 1742943028, - "narHash": "sha256-fprwZKE1uMzO9tiWWOrmLWBW3GPkMayQfb0xOvVFIno=", - "rev": "3fae818597ca2f1474de62022f850c23be50528d", + "lastModified": 1737237494, + "narHash": "sha256-YMLrcBpf0TR5r/eaqm8lxzFPap2TxCor0ZGcK3a7+b8=", + "rev": "b90bf629bbd835e61f1317b99e12f8c831017006", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/3fae818597ca2f1474de62022f850c23be50528d.tar.gz?rev=3fae818597ca2f1474de62022f850c23be50528d" + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/b90bf629bbd835e61f1317b99e12f8c831017006.tar.gz?rev=b90bf629bbd835e61f1317b99e12f8c831017006" }, "original": { "type": "tarball", - "url": "https://git.lix.systems/lix-project/nixos-module/archive/release-2.92.tar.gz" + "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz" } }, "nixpkgs": { "locked": { - "lastModified": 1746183838, - "narHash": "sha256-kwaaguGkAqTZ1oK0yXeQ3ayYjs8u/W7eEfrFpFfIDFA=", + "lastModified": 1742751704, + "narHash": "sha256-rBfc+H1dDBUQ2mgVITMGBPI1PGuCznf9rcWX/XIULyE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bf3287dac860542719fe7554e21e686108716879", + "rev": "f0946fa5f1fb876a9dc2e1850d9d3a4e3f914092", "type": "github" }, "original": { @@ -319,11 +319,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1746206129, - "narHash": "sha256-JA4DynBKhY7t4DdJZTuomRLAiXFDUgCGGwxgt+XGiik=", + "lastModified": 1742800061, + "narHash": "sha256-oDJGK1UMArK52vcW9S5S2apeec4rbfNELgc50LqiPNs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9a7caecf30a0494c88b7daeeed29244cd9a52e7d", + "rev": "1750f3c1c89488e2ffdd47cab9d05454dddfb734", "type": "github" }, "original": { @@ -342,11 +342,11 @@ "nuschtosSearch": [] }, "locked": { - "lastModified": 1746309817, - "narHash": "sha256-oqOpTyjdeY+LP+WiU9LxGdZ/bZ9YK7MNzNMDUw98kPM=", + "lastModified": 1742991302, + "narHash": "sha256-5S+qnc5ijgFWlAWS9+L7uAgpDnL0RtVEDhVpHWGoavA=", "owner": "nix-community", "repo": "nixvim", - "rev": "c978122396a4208bf1965d346b7456e7256fe70c", + "rev": "1c0dd320d9c4f250ac33382e11d370b7abe97622", "type": "github" }, "original": { @@ -367,11 +367,11 @@ ] }, "locked": { - "lastModified": 1745046075, - "narHash": "sha256-8v4y6k16Ra/fiecb4DxhsoOGtzLKgKlS+9/XJ9z0T2I=", + "lastModified": 1742659553, + "narHash": "sha256-i/JCrr/jApVorI9GkSV5to+USrRCa0rWuQDH8JSlK2A=", "owner": "NuschtOS", "repo": "search", - "rev": "066afe8643274470f4a294442aadd988356a478f", + "rev": "508752835128a3977985a4d5225ff241f7756181", "type": "github" }, "original": { @@ -425,11 +425,11 @@ "tinted-tmux": "tinted-tmux" }, "locked": { - "lastModified": 1746143246, - "narHash": "sha256-O8rZjqJUIkUva66XTOZy0wcgfBP2eaxU9+Xt7ZHtfhI=", + "lastModified": 1741961698, + "narHash": "sha256-utsgC6H3ja6sLAXMd8//I2D7yjyScFqVDRX0wpbqPZo=", "owner": "danth", "repo": "stylix", - "rev": "20ace60f9cb5e179cb2256abaee505780df8e804", + "rev": "9bfc74f330ead111e8ea354b2220a431b0cfaa26", "type": "github" }, "original": { @@ -491,11 +491,11 @@ "tinted-tmux": { "flake": false, "locked": { - "lastModified": 1743296873, - "narHash": "sha256-8IQulrb1OBSxMwdKijO9fB70ON//V32dpK9Uioy7FzY=", + "lastModified": 1740877430, + "narHash": "sha256-zWcCXgdC4/owfH/eEXx26y5BLzTrefjtSLFHWVD5KxU=", "owner": "tinted-theming", "repo": "tinted-tmux", - "rev": "af5152c8d7546dfb4ff6df94080bf5ff54f64e3a", + "rev": "d48ee86394cbe45b112ba23ab63e33656090edb4", "type": "github" }, "original": { @@ -511,11 +511,11 @@ ] }, "locked": { - "lastModified": 1746216483, - "narHash": "sha256-4h3s1L/kKqt3gMDcVfN8/4v2jqHrgLIe4qok4ApH5x4=", + "lastModified": 1742982148, + "narHash": "sha256-aRA6LSxjlbMI6MmMzi/M5WH/ynd8pK+vACD9za3MKLQ=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "29ec5026372e0dec56f890e50dbe4f45930320fd", + "rev": "61c88349bf6dff49fa52d7dfc39b21026c2a8881", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 04aaea2..70fa1ee 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/release-2.92.tar.gz"; + url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.inputs.systems.follows = "systems"; diff --git a/justfile b/justfile index 483e46c..4021089 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 --fallback --flake .#vm --print-build-logs + nixos-rebuild build-vm --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 98de725..3f31f26 100644 --- a/modules/hm/default.nix +++ b/modules/hm/default.nix @@ -59,7 +59,6 @@ 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 2c2d898..5e58c72 100644 --- a/modules/hm/dev.nix +++ b/modules/hm/dev.nix @@ -17,6 +17,17 @@ 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 = { @@ -72,14 +83,13 @@ in templates.draft_commit_description = '' concat( description, - "\n", surround( "\nJJ: This commit contains the following changes:\n", "", - indent("JJ: ", diff.summary()), + indent("JJ: ", diff.stat(72)), ), surround( - "JJ: ignore-rest\n", "", - diff.git(), + "\nJJ: Diff:\n", "", + indent("JJ: ", diff.git()), ), ) ''; diff --git a/modules/hm/gui/default.nix b/modules/hm/gui/default.nix index 75d6cea..d885697 100644 --- a/modules/hm/gui/default.nix +++ b/modules/hm/gui/default.nix @@ -21,11 +21,6 @@ let }; in { - imports = [ - ./sway.nix - ./waybar.nix - ]; - config = lib.mkIf (jhome.enable && cfg.enable) { home.packages = (with pkgs; [ @@ -78,6 +73,30 @@ 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"; @@ -106,17 +125,7 @@ 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"; - }; + zellij.enable = cfg.terminal == "alacritty"; # alacritty has no terminal multiplexer built-in # PDF reader zathura.enable = true; # Auto start sway @@ -154,6 +163,17 @@ 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 new file mode 100644 index 0000000..cfc8788 --- /dev/null +++ b/modules/hm/gui/keybindings.nix @@ -0,0 +1,118 @@ +{ 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 new file mode 100644 index 0000000..e20e8aa --- /dev/null +++ b/modules/hm/gui/sway-config.nix @@ -0,0 +1,101 @@ +{ 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 deleted file mode 100644 index 5ed2293..0000000 --- a/modules/hm/gui/sway.nix +++ /dev/null @@ -1,226 +0,0 @@ -{ - 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 new file mode 100644 index 0000000..3fcf58c --- /dev/null +++ b/modules/hm/gui/waybar-settings.nix @@ -0,0 +1,127 @@ +{ 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 deleted file mode 100644 index eefdab4..0000000 --- a/modules/hm/gui/waybar.nix +++ /dev/null @@ -1,159 +0,0 @@ -{ - 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 e274f52..2f65337 100644 --- a/modules/hm/options.nix +++ b/modules/hm/options.nix @@ -198,6 +198,8 @@ 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 e2e4370..d6eeff7 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -17,7 +17,6 @@ in ./options.nix ./dev.nix ./gui.nix - ./starship.nix ./styling.nix ]; @@ -35,7 +34,42 @@ in pkgs.unzip ]; - programs.fish.enable = true; + 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) + ]; + }; + }; environment.etc = keysFromGithub; services = { diff --git a/modules/nixos/starship-nerdfont-symbols.nix b/modules/nixos/starship-nerdfont-symbols.nix new file mode 100644 index 0000000..2032150 --- /dev/null +++ b/modules/nixos/starship-nerdfont-symbols.nix @@ -0,0 +1,89 @@ +{ + 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 new file mode 100644 index 0000000..605a53a --- /dev/null +++ b/modules/nixos/starship-shorter-text.nix @@ -0,0 +1,66 @@ +{ + 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 deleted file mode 100644 index 3ab8d8b..0000000 --- a/modules/nixos/starship.nix +++ /dev/null @@ -1,183 +0,0 @@ -{ 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 6152af6..afe1a05 100644 --- a/modules/nixvim/default.nix +++ b/modules/nixvim/default.nix @@ -6,9 +6,10 @@ in imports = [ ./options.nix ]; config.programs.nixvim = lib.mkMerge [ - ./standalone.nix + (import ./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 4e3424e..f44c09b 100644 --- a/modules/nixvim/dev-plugins.nix +++ b/modules/nixvim/dev-plugins.nix @@ -7,7 +7,6 @@ }: let inherit (helpers) enableExceptInTests; - inherit (lib.trivial) const; cfg = config.jhome.nvim; enabledLSPs = [ "basedpyright" @@ -24,18 +23,21 @@ 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 (const enableOpt); } + { + plugins.lsp.servers = lib.genAttrs enabledLSPs (_: { + enable = true; + }); + } # Remove bundled LSPs (lib.mkIf (!cfg.dev.bundleLSPs) { - plugins.lsp.servers = lib.genAttrs enabledLSPs (const noPackage); + plugins.lsp.servers = lib.genAttrs enabledLSPs (_: { + package = null; + }); }) # Configure LSPs { @@ -44,19 +46,17 @@ in enable = true; servers = { # Pyright needs to have the project root set? - 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; + 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; }; }; 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 { - dependencies = { - gcc.enable = false; - nodejs.enable = false; - tree-sitter.enable = false; + plugins.treesitter = { + gccPackage = null; + nodejsPackage = null; + treesitterPackage = null; }; }) # Configure Formatters @@ -159,9 +159,17 @@ in } # Rust plugins { - plugins.rustaceanvim.enable = true; - # install through rustup - dependencies.rust-analyzer.enable = false; + plugins = { + bacon = { + enable = true; + settings.quickfix.enabled = true; + }; + rustaceanvim = { + enable = true; + # Install through rustup + rustAnalyzerPackage = null; + }; + }; } # Other plugins { diff --git a/modules/nixvim/extraPlugins/default.nix b/modules/nixvim/extraPlugins/default.nix new file mode 100644 index 0000000..87e972c --- /dev/null +++ b/modules/nixvim/extraPlugins/default.nix @@ -0,0 +1,11 @@ +{ 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 f66d239..cec3117 100644 --- a/modules/nixvim/standalone.nix +++ b/modules/nixvim/standalone.nix @@ -7,12 +7,7 @@ let cfg = config.jhome.nvim; plugins = pkgs.vimPlugins; - jExtraVimPlugins = pkgs.vimPlugins.extend ( - pkgs.callPackage ./extraPlugins/generated.nix { - inherit (pkgs.vimUtils) buildVimPlugin; - inherit (pkgs.neovimUtils) buildNeovimPlugin; - } - ); + extraPlugins = import ./extraPlugins { inherit pkgs; }; in { imports = [ @@ -60,6 +55,7 @@ in extraPlugins = [ plugins.nui-nvim plugins.nvim-web-devicons + plugins.vim-jjdescription # FIXME: included since neovim nightly ]; extraPackages = [ pkgs.luajitPackages.jsregexp ]; extraConfigLuaPre = @@ -83,7 +79,7 @@ in } # Big packages that are kinda unnecessary (lib.mkIf (!cfg.reduceSize) { - extraPlugins = [ jExtraVimPlugins.nvim-silicon ]; + extraPlugins = [ extraPlugins.nvim-silicon ]; extraPackages = [ pkgs.silicon ]; extraConfigLua = # lua diff --git a/scripts/audiomenu/Cargo.lock b/scripts/audiomenu/Cargo.lock index f395b59..3a7eda5 100644 --- a/scripts/audiomenu/Cargo.lock +++ b/scripts/audiomenu/Cargo.lock @@ -116,9 +116,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.37" +version = "4.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" +checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff" dependencies = [ "clap_builder", "clap_derive", @@ -126,9 +126,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.37" +version = "4.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" +checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489" dependencies = [ "anstream", "anstyle", @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.11" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", "windows-sys", @@ -214,15 +214,15 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "libc" -version = "0.2.172" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "linux-raw-sys" -version = "0.9.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" [[package]] name = "memchr" @@ -232,9 +232,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.6.0" +version = "7.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +checksum = "1a955165f87b37fd1862df2a59547ac542c77ef6d17c666f619d1ad22dd89484" dependencies = [ "backtrace", "backtrace-ext", @@ -246,14 +246,15 @@ dependencies = [ "supports-unicode", "terminal_size", "textwrap", + "thiserror", "unicode-width 0.1.14", ] [[package]] name = "miette-derive" -version = "7.6.0" +version = "7.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" +checksum = "bf45bf44ab49be92fd1227a3be6fc6f617f1a337c06af54981048574d8783147" dependencies = [ "proc-macro2", "quote", @@ -262,9 +263,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.8" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] @@ -280,9 +281,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" [[package]] name = "os_pipe" @@ -302,9 +303,9 @@ checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564" [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] @@ -326,9 +327,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "1.0.7" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" dependencies = [ "bitflags", "errno", @@ -377,9 +378,9 @@ dependencies = [ [[package]] name = "shared_child" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e297bd52991bbe0686c086957bee142f13df85d1e79b0b21630a99d374ae9dc" +checksum = "09fa9338aed9a1df411814a5b2252f7cd206c55ae9bf2fa763f8de84603aa60c" dependencies = [ "libc", "windows-sys", @@ -414,9 +415,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.101" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -443,6 +444,26 @@ 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 1894de7..23ec010 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -1,37 +1,23 @@ -{ lib, ... }: +# 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. let - 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; + files = builtins.readDir ./.; isPackage = path: type: (type == "directory") && (builtins.readDir path) ? "package.nix"; toPackage = name: pkgs: { inherit name; - value = pkgs.callPackage "${src}/${name}/package.nix" { }; + value = pkgs.callPackage (./. + "/${name}/package.nix") { }; }; # call pkgs.callPackage on all ./*/package.nix makePackage = pkgs: name: let type = files.${name}; - path = "${src}/${name}"; + path = ./. + "/${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 -{ - # Add scripts to overlay - flake.overlays.scripts = final: scripts; - - # Add scripts to packages - perSystem = - { pkgs, ... }: - { - packages = scripts pkgs; - }; -} +# we have lib.filterMapAttrs at home +pkgs: builtins.listToAttrs (builtins.concatMap (makePackage pkgs) (builtins.attrNames files)) diff --git a/scripts/jpassmenu/Cargo.lock b/scripts/jpassmenu/Cargo.lock index 8104c3f..7354614 100644 --- a/scripts/jpassmenu/Cargo.lock +++ b/scripts/jpassmenu/Cargo.lock @@ -108,9 +108,9 @@ checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "bstr" -version = "1.12.0" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" +checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" dependencies = [ "memchr", "serde", @@ -124,9 +124,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.37" +version = "4.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" +checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff" dependencies = [ "clap_builder", "clap_derive", @@ -134,9 +134,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.37" +version = "4.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" +checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489" dependencies = [ "anstream", "anstyle", @@ -217,9 +217,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.8" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" +checksum = "c3716d7a920fb4fac5d84e9d4bce8ceb321e9414b4409da61b07b75c1e3d0697" dependencies = [ "anstream", "anstyle", @@ -230,9 +230,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.11" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", "windows-sys", @@ -293,9 +293,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "jiff" -version = "0.2.12" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07d8d955d798e7a4d6f9c58cd1f1916e790b42b092758a9ef6e16fef9f1b3fd" +checksum = "c102670231191d07d37a35af3eb77f1f0dbf7a71be51a962dcd57ea607be7260" dependencies = [ "jiff-static", "log", @@ -306,9 +306,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.12" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f244cfe006d98d26f859c7abd1318d85327e1882dc9cef80f62daeeb0adcf300" +checksum = "4cdde31a9d349f1b1f51a0b3714a5940ac022976f4b49485fc04be052b183b4c" dependencies = [ "proc-macro2", "quote", @@ -329,15 +329,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.172" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "linux-raw-sys" -version = "0.9.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" [[package]] name = "log" @@ -353,9 +353,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.6.0" +version = "7.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +checksum = "1a955165f87b37fd1862df2a59547ac542c77ef6d17c666f619d1ad22dd89484" dependencies = [ "backtrace", "backtrace-ext", @@ -367,14 +367,15 @@ dependencies = [ "supports-unicode", "terminal_size", "textwrap", + "thiserror", "unicode-width 0.1.14", ] [[package]] name = "miette-derive" -version = "7.6.0" +version = "7.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" +checksum = "bf45bf44ab49be92fd1227a3be6fc6f617f1a337c06af54981048574d8783147" dependencies = [ "proc-macro2", "quote", @@ -383,9 +384,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.8" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] @@ -401,9 +402,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" [[package]] name = "os_pipe" @@ -438,9 +439,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] @@ -491,9 +492,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "1.0.7" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" dependencies = [ "bitflags", "errno", @@ -533,9 +534,9 @@ dependencies = [ [[package]] name = "shared_child" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e297bd52991bbe0686c086957bee142f13df85d1e79b0b21630a99d374ae9dc" +checksum = "09fa9338aed9a1df411814a5b2252f7cd206c55ae9bf2fa763f8de84603aa60c" dependencies = [ "libc", "windows-sys", @@ -570,9 +571,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.101" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -599,6 +600,26 @@ 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"