Skip to content

Commit

Permalink
Need overlay, because used in shell soursing
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Mar 24, 2024
1 parent f59c026 commit aa6b22f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
20 changes: 19 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
let
# https://github.com/NixOS/nixpkgs/blob/2e1b779e0a0e67fb4e4f3333606cc1b8a287afae/pkgs/shells/fzf-git-sh/default.nix#L22-L27
fzf-git-sh-overlay = final: prev: {
fzf-git-sh = prev.fzf-git-sh.override {
version = "git";
# https://github.com/kachick/fzf-git.sh/pull/1
src = prev.fetchFromGitHub {
owner = "kachick";
repo = "fzf-git.sh";
rev = "cfbc4b1ef75352d57a64284d0a998c1c6b45af67";
sha256 = "sha256-tY6dkBZVspo5lmBcjyg5VgWVgwRlO2GD9muizEf+kWo=";
};
};
};
in
{
inputs = {
# Candidate channels
Expand All @@ -19,7 +34,10 @@
outputs = { self, nixpkgs, home-manager, flake-utils, my-nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system;
overlays = [ fzf-git-sh-overlay ];
};
my-pkgs = my-nixpkgs.legacyPackages.${system};
in
rec {
Expand Down
15 changes: 1 addition & 14 deletions home-manager/packages.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
{ pkgs, my-pkgs, lib, ... }:

let
# https://github.com/NixOS/nixpkgs/blob/2e1b779e0a0e67fb4e4f3333606cc1b8a287afae/pkgs/shells/fzf-git-sh/default.nix#L22-L27
patched-fzf-git-sh = pkgs.fzf-git-sh.overrideAttrs (prev: {
version = "git";
# https://github.com/kachick/fzf-git.sh/pull/1
src = pkgs.fetchFromGitHub {
owner = "kachick";
repo = "fzf-git.sh";
rev = "cfbc4b1ef75352d57a64284d0a998c1c6b45af67";
sha256 = "sha256-tY6dkBZVspo5lmBcjyg5VgWVgwRlO2GD9muizEf+kWo=";
};
});
in
{
home.packages = with pkgs; [
# Use `bashInteractive`, don't `bash` - https://github.com/NixOS/nixpkgs/issues/29960, https://github.com/NixOS/nix/issues/730
Expand All @@ -30,7 +17,7 @@ in
fzf # History: CTRL+R, Walker: CTRL+T
# https://github.com/junegunn/fzf/blob/d579e335b5aa30e98a2ec046cb782bbb02bc28ad/ADVANCED.md#key-bindings-for-git-objects
# CTRL+O does not open web browser in WSL: https://github.com/kachick/dotfiles/issues/499
patched-fzf-git-sh # CTRL-G CTRL-{} keybinds for git
fzf-git-sh # CTRL-G CTRL-{} keybinds for git

# Used in anywhere
coreutils
Expand Down

0 comments on commit aa6b22f

Please sign in to comment.