From 7326ab40f0a0e8f93748e06d69e24581aa85f269 Mon Sep 17 00:00:00 2001 From: pagedmov Date: Sat, 15 Feb 2025 20:31:57 -0500 Subject: [PATCH] 02-15-25 update --- flake.lock | 4 +-- flake.nix | 6 ++-- hosts/desktop/config.nix | 6 ++-- modules/home/environment/starship.nix | 4 +-- modules/home/environment/zsh/env.nix | 2 ++ modules/home/environment/zsh/extraconfig.nix | 4 +++ modules/home/environment/zsh/options.nix | 8 +++++- overlay/overlay.nix | 3 +- overlay/pkgs/lash/update_lash.sh | 29 -------------------- overlay/pkgs/{lash => slash}/Cargo.lock | 2 +- overlay/pkgs/{lash => slash}/package.nix | 12 ++++---- overlay/pkgs/slash/update_slash.sh | 29 ++++++++++++++++++++ overlay/pkgs/zsh-fzf-tab/package.nix | 16 +++++++++++ 13 files changed, 77 insertions(+), 48 deletions(-) delete mode 100755 overlay/pkgs/lash/update_lash.sh rename overlay/pkgs/{lash => slash}/Cargo.lock (99%) rename overlay/pkgs/{lash => slash}/package.nix (55%) create mode 100755 overlay/pkgs/slash/update_slash.sh create mode 100644 overlay/pkgs/zsh-fzf-tab/package.nix diff --git a/flake.lock b/flake.lock index af49bff..fce4d58 100755 --- a/flake.lock +++ b/flake.lock @@ -932,13 +932,13 @@ "lastModified": 1739483770, "narHash": "sha256-AGItl4LN8hWqcNmE6d9snIkaV/FZKKD58e2pf7A22UA=", "owner": "pagedMov", - "repo": "lash", + "repo": "slash", "rev": "5c038fbb569fdad802f22fa0bd5ca9a839dcaed8", "type": "github" }, "original": { "owner": "pagedMov", - "repo": "lash", + "repo": "slash", "type": "github" } }, diff --git a/flake.nix b/flake.nix index a4e3f81..d2da2ea 100755 --- a/flake.nix +++ b/flake.nix @@ -30,14 +30,14 @@ url = "github:gerg-l/spicetify-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - lash_flake.url = "github:pagedMov/lash"; + lash_flake.url = "github:pagedMov/slash"; }; outputs = { self, home-manager, disko, lash_flake, nixpkgs, impermanence, nixvim, stylix, ... }@inputs: let system = "x86_64-linux"; username = "pagedmov"; - lash = lash_flake.packages.${system}.default; + slash = lash_flake.packages.${system}.default; nixpkgsConfig = { allowUnfree = true; }; @@ -143,7 +143,7 @@ nixosConfigurations = { oganesson = nixpkgs.lib.nixosSystem { # Desktop specialArgs = { - inherit self inputs username lash; + inherit self inputs username slash; host = "oganesson"; overlays = [ (import ./overlay/overlay.nix { root = self; }) diff --git a/hosts/desktop/config.nix b/hosts/desktop/config.nix index 3f99efb..cae94fb 100755 --- a/hosts/desktop/config.nix +++ b/hosts/desktop/config.nix @@ -1,4 +1,4 @@ -{ lash, pkgs, username, ... }: +{ slash, pkgs, username, ... }: { imports = [ ./hardware.nix ]; @@ -28,7 +28,7 @@ environment = { variables = { PATH = "${pkgs.clang-tools}/bin:$PATH"; }; - shells = [ pkgs.myPkgs.lash pkgs.zsh pkgs.bash ]; + shells = [ pkgs.myPkgs.slash pkgs.zsh pkgs.bash ]; }; users = { @@ -38,7 +38,7 @@ ${username} = { isNormalUser = true; initialPassword = "1234"; - shell = pkgs.myPkgs.lash; + shell = pkgs.zsh; extraGroups = [ "input" "wheel" "persist" "libvirtd" ]; }; }; diff --git a/modules/home/environment/starship.nix b/modules/home/environment/starship.nix index c858972..627b2fb 100755 --- a/modules/home/environment/starship.nix +++ b/modules/home/environment/starship.nix @@ -15,7 +15,7 @@ "($ssh_symbol)($username)($hostname)($nix_shell)(bold white)($cmd_duration)($character)" "($git_branch)($git_status)($rust)" "($directory)" - "$line_break[ > ](bold #89b4fa)" + "$line_break[ ](bold #89b4fa)" ]; username = { @@ -42,7 +42,7 @@ }; cmd_duration = { - format = "[ 󰔛 $duration]($style)"; + format = "[󰔛 $duration]($style)"; disabled = false; style = "bg:none fg:#f9e2af"; show_notifications = false; diff --git a/modules/home/environment/zsh/env.nix b/modules/home/environment/zsh/env.nix index f1e205b..dbf6c20 100644 --- a/modules/home/environment/zsh/env.nix +++ b/modules/home/environment/zsh/env.nix @@ -16,6 +16,8 @@ FLAKEPATH = "$HOME/.sysflake"; STEAMPATH = "$HOME/.local/share/Steam"; PATH = "$PATH:$HOME/.userpath/"; + FZF_DEFAULT_COMMAND = "fd"; + FZF_DEFAULT_OPTS = "--height 40% --layout=reverse --border"; }; }; }; diff --git a/modules/home/environment/zsh/extraconfig.nix b/modules/home/environment/zsh/extraconfig.nix index 756de44..83082d5 100644 --- a/modules/home/environment/zsh/extraconfig.nix +++ b/modules/home/environment/zsh/extraconfig.nix @@ -3,6 +3,7 @@ let shellsound = "${pkgs.myScripts.playshellsound}/bin/playshellsound"; color-commit = "${pkgs.myScripts.color-commit}/bin/color-commit"; + fzf-tab = "${pkgs.myPkgs.fzf-tab}"; sndpath = "${self}/assets/sound"; in { @@ -174,6 +175,9 @@ in autoload -U up-line-or-beginning-search; zle -N up-line-or-beginning-search autoload -U down-line-or-beginning-search; zle -N down-line-or-beginning-search + compinit + source ${fzf-tab}/fzf-tab.plugin.zsh + bindkey -v kitty_theme type starship_zle-keymap-select >/dev/null || \ diff --git a/modules/home/environment/zsh/options.nix b/modules/home/environment/zsh/options.nix index b4a9006..7ff070d 100644 --- a/modules/home/environment/zsh/options.nix +++ b/modules/home/environment/zsh/options.nix @@ -18,7 +18,13 @@ oh-my-zsh = { enable = true; - plugins = [ "git" "fzf" ]; + plugins = [ + "git" + "fzf" + "aliases" + "command-not-found" + "eza" + ]; }; enableCompletion = true; diff --git a/overlay/overlay.nix b/overlay/overlay.nix index 972cf90..87d7495 100644 --- a/overlay/overlay.nix +++ b/overlay/overlay.nix @@ -20,7 +20,8 @@ in }); myPkgs = { # Packages that I've made - lash = super.callPackage ./pkgs/lash/package.nix {}; + slash = super.callPackage ./pkgs/slash/package.nix {}; + fzf-tab = super.callPackage ./pkgs/zsh-fzf-tab/package.nix {}; }; myScripts = { # Scripts written using pkgs.writeShellApplication diff --git a/overlay/pkgs/lash/update_lash.sh b/overlay/pkgs/lash/update_lash.sh deleted file mode 100755 index fa487ee..0000000 --- a/overlay/pkgs/lash/update_lash.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -export GIT_SSH_COMMAND="ssh -F /dev/null" - -curl -O https://raw.githubusercontent.com/pagedMov/lash/refs/heads/master/Cargo.lock -NEW_SRC=$(fetchfromgh pagedMov/lash) - -REV_SHORT=$(git ls-remote git@github.com:pagedMov/lash.git HEAD | awk '{print substr($1, 1, 7)}') -CUR_TAG=$(git ls-remote --tags git@github.com:pagedMov/lash.git | tail -n 2 | head -n 1 | cut -f2 | cut -d'/' -f3) -NEW_VER="${CUR_TAG}_$REV_SHORT" - -cat < {} }: - -pkgs.rustPlatform.buildRustPackage rec { - pname = "lash"; - version = "$NEW_VER"; - - $NEW_SRC - - doCheck = false; # TODO: Find a way to make tests work - - cargoLock.lockFile = ./Cargo.lock; - - passthru = { - shellPath = "/bin/lash"; - }; - } -EOF diff --git a/overlay/pkgs/lash/Cargo.lock b/overlay/pkgs/slash/Cargo.lock similarity index 99% rename from overlay/pkgs/lash/Cargo.lock rename to overlay/pkgs/slash/Cargo.lock index 25b8a14..5aa0126 100644 --- a/overlay/pkgs/lash/Cargo.lock +++ b/overlay/pkgs/slash/Cargo.lock @@ -847,7 +847,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" [[package]] -name = "lash" +name = "slash" version = "0.1.0" dependencies = [ "bincode", diff --git a/overlay/pkgs/lash/package.nix b/overlay/pkgs/slash/package.nix similarity index 55% rename from overlay/pkgs/lash/package.nix rename to overlay/pkgs/slash/package.nix index 8ade5cd..8080fcb 100644 --- a/overlay/pkgs/lash/package.nix +++ b/overlay/pkgs/slash/package.nix @@ -1,14 +1,14 @@ { pkgs ? import {} }: pkgs.rustPlatform.buildRustPackage rec { - pname = "lash"; - version = "v0.5.0_5c038fb"; + pname = "slash"; + version = "v0.5.0_662cb43"; src = pkgs.fetchFromGitHub { owner = "pagedMov"; - repo = "lash"; - rev = "5c038fbb569fdad802f22fa0bd5ca9a839dcaed8"; - hash = "sha256-AGItl4LN8hWqcNmE6d9snIkaV/FZKKD58e2pf7A22UA="; + repo = "slash"; + rev = "662cb43e499d179579d99bf358073516605230ea"; + hash = "sha256-4DKAhRkd1XeDNyYH8yL1TnbTc6hZnp2+UV7UYeDRkpE="; }; @@ -17,6 +17,6 @@ pkgs.rustPlatform.buildRustPackage rec { cargoLock.lockFile = ./Cargo.lock; passthru = { - shellPath = "/bin/lash"; + shellPath = "/bin/slash"; }; } diff --git a/overlay/pkgs/slash/update_slash.sh b/overlay/pkgs/slash/update_slash.sh new file mode 100755 index 0000000..e440136 --- /dev/null +++ b/overlay/pkgs/slash/update_slash.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +export GIT_SSH_COMMAND="ssh -F /dev/null" + +curl -O https://raw.githubusercontent.com/pagedMov/slash/refs/heads/master/Cargo.lock +NEW_SRC=$(fetchfromgh pagedMov/slash) + +REV_SHORT=$(git ls-remote git@github.com:pagedMov/slash.git HEAD | awk '{print substr($1, 1, 7)}') +CUR_TAG=$(git ls-remote --tags git@github.com:pagedMov/slash.git | tail -n 2 | head -n 1 | cut -f2 | cut -d'/' -f3) +NEW_VER="${CUR_TAG}_$REV_SHORT" + +cat < {} }: + +pkgs.rustPlatform.buildRustPackage rec { + pname = "slash"; + version = "$NEW_VER"; + + $NEW_SRC + + doCheck = false; # TODO: Find a way to make tests work + + cargoLock.lockFile = ./Cargo.lock; + + passthru = { + shellPath = "/bin/slash"; + }; + } +EOF diff --git a/overlay/pkgs/zsh-fzf-tab/package.nix b/overlay/pkgs/zsh-fzf-tab/package.nix new file mode 100644 index 0000000..666c561 --- /dev/null +++ b/overlay/pkgs/zsh-fzf-tab/package.nix @@ -0,0 +1,16 @@ +{ pkgs ? import { } }: + +pkgs.stdenv.mkDerivation { + pname = "fzf-tab"; + version = "v1.1.2"; + src = pkgs.fetchFromGitHub { + owner = "Aloxaf"; + repo = "fzf-tab"; + rev = "6aced3f35def61c5edf9d790e945e8bb4fe7b305"; + hash = "sha256-EWMeslDgs/DWVaDdI9oAS46hfZtp4LHTRY8TclKTNK8="; + }; + + installPhase = '' + cp -r $src $out + ''; +}