fish
This commit is contained in:
parent
0b7da58795
commit
18caa32b2c
5 changed files with 162 additions and 84 deletions
90
flake.lock
generated
90
flake.lock
generated
|
|
@ -152,11 +152,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": {
|
||||
|
|
@ -332,11 +332,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1742014779,
|
||||
"narHash": "sha256-I6fG1zrfdLFcp/imGZElig0BJO3YU0QEXLgvwWoOpJ8=",
|
||||
"lastModified": 1744693102,
|
||||
"narHash": "sha256-1Z4WPGVky4w3lrhrgs89OKsLzPdtkbi1bPLNFWsoLfY=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "hercules-ci-effects",
|
||||
"rev": "524637ef84c177661690b924bf64a1ce18072a2c",
|
||||
"rev": "5b6cec51c9ec095a0d3fd4c8eeb53eb5c59ae33e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -382,6 +382,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"mini-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1746264830,
|
||||
"narHash": "sha256-A3FIyfy/3VUBMPfWd6PLaqAhOAOA5ava0nc4Z9JCKCI=",
|
||||
"owner": "echasnovski",
|
||||
"repo": "mini.nvim",
|
||||
"rev": "ee23e1abc206efc6d6cce19ec8c0a3da7a897035",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "echasnovski",
|
||||
"repo": "mini.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"neovim-nightly-overlay": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_3",
|
||||
|
|
@ -393,11 +409,11 @@
|
|||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1743898191,
|
||||
"narHash": "sha256-JCcQDgwYV+C4igYA6DchGpKKA6eyZXLvRrxWHmQbmDk=",
|
||||
"lastModified": 1746256223,
|
||||
"narHash": "sha256-a97mwMJcE0cYGfwB5N5v+Ey+by1poGTc/fsrd47Fom8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "neovim-nightly-overlay",
|
||||
"rev": "276567b29d8c9aca7b6a54e93a9183e44a17f19c",
|
||||
"rev": "02ec02529a5d602a9e9d273531d776d160fae182",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -409,11 +425,11 @@
|
|||
"neovim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1743893800,
|
||||
"narHash": "sha256-i/X0b3b/dAqjNIB5RoryeDvMkVfdoPBwK5xn06W6Wdo=",
|
||||
"lastModified": 1746214751,
|
||||
"narHash": "sha256-FlGgG3A9oJwGP0YTWU2Nw9fwdnqPMapjx3twonu0Vkg=",
|
||||
"owner": "neovim",
|
||||
"repo": "neovim",
|
||||
"rev": "28e819018520a2300eaeeec6794ffcd614b25dd2",
|
||||
"rev": "5a2edc483dff93cc94847b6950713d80a51087c0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -503,11 +519,11 @@
|
|||
},
|
||||
"nixpkgs-uns": {
|
||||
"locked": {
|
||||
"lastModified": 1743827369,
|
||||
"narHash": "sha256-rpqepOZ8Eo1zg+KJeWoq1HAOgoMCDloqv5r2EAa9TSA=",
|
||||
"lastModified": 1746232882,
|
||||
"narHash": "sha256-MHmBH2rS8KkRRdoU/feC/dKbdlMkcNkB5mwkuipVHeQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "42a1c966be226125b48c384171c44c651c236c22",
|
||||
"rev": "7a2622e2c0dbad5c4493cb268aba12896e28b008",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -519,11 +535,11 @@
|
|||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1743689281,
|
||||
"narHash": "sha256-y7Hg5lwWhEOgflEHRfzSH96BOt26LaYfrYWzZ+VoVdg=",
|
||||
"lastModified": 1746152631,
|
||||
"narHash": "sha256-zBuvmL6+CUsk2J8GINpyy8Hs1Zp4PP6iBWSmZ4SCQ/s=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2bfc080955153be0be56724be6fa5477b4eefabb",
|
||||
"rev": "032bc6539bd5f14e9d0c51bd79cfe9a055b094c3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -535,11 +551,11 @@
|
|||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1743962461,
|
||||
"narHash": "sha256-UaulIYZqwVF7CRYsDG6Jt3k3+Qs21yJT2/CLRWT9qzg=",
|
||||
"lastModified": 1746314326,
|
||||
"narHash": "sha256-2xqKEdmbFttKUwIxZgQAOG24rNqVvJ7c3LmA+ZnvWlc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "eb77ff4e9c1f071693be92d144f363ef24701039",
|
||||
"rev": "0eb56ece14bc2e4301f756c342356ceceb90b6f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -553,16 +569,18 @@
|
|||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"gen-luarc": "gen-luarc",
|
||||
"mini-nvim": "mini-nvim",
|
||||
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"nixpkgs-uns": "nixpkgs-uns"
|
||||
"nixpkgs-uns": "nixpkgs-uns",
|
||||
"nvim-orgmode": "nvim-orgmode"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1745307137,
|
||||
"narHash": "sha256-EVj4wP0bn0isewPi2NjwD2s5H5ED0i9fTQraGzV3HEM=",
|
||||
"lastModified": 1747518373,
|
||||
"narHash": "sha256-+D8K0ex5Y6UCFhCNK3cbUM5gIqf/QrwvQXPpXdWV7q0=",
|
||||
"owner": "iofq",
|
||||
"repo": "nvim.nix",
|
||||
"rev": "96a162e9e8e9fa55f6d69296b6ecef0781dc3e4d",
|
||||
"rev": "f47fc0f76f6b9a520b2b3c059c773a81589f0b0b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -571,6 +589,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim-orgmode": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1747057841,
|
||||
"narHash": "sha256-mLT3XnsRyG+ZldB9NrR9tjmaznRAISBsdVTVPSjhj0A=",
|
||||
"owner": "nvim-orgmode",
|
||||
"repo": "orgmode",
|
||||
"rev": "8ff03c75f3d808e3ea1765b7aba0fb4783a5a83f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nvim-orgmode",
|
||||
"repo": "orgmode",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_5",
|
||||
|
|
@ -680,11 +714,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1743748085,
|
||||
"narHash": "sha256-uhjnlaVTWo5iD3LXics1rp9gaKgDRQj6660+gbUU3cE=",
|
||||
"lastModified": 1746216483,
|
||||
"narHash": "sha256-4h3s1L/kKqt3gMDcVfN8/4v2jqHrgLIe4qok4ApH5x4=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "815e4121d6a5d504c0f96e5be2dd7f871e4fd99d",
|
||||
"rev": "29ec5026372e0dec56f890e50dbe4f45930320fd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
host,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
|
|
@ -7,6 +6,7 @@
|
|||
./tmux.nix
|
||||
./git.nix
|
||||
./gpg.nix
|
||||
./fish.nix
|
||||
];
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
|
|
@ -18,60 +18,6 @@
|
|||
nvim-pkg
|
||||
];
|
||||
};
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set fish_greeting # Disable greeting
|
||||
set show_startup_tips false
|
||||
set -U tide_right_prompt_items status\x1ecmd_duration\x1etime
|
||||
'';
|
||||
shellInit = "
|
||||
fish_add_path /usr/local/go/bin
|
||||
fish_add_path ~/go/bin
|
||||
fish_add_path ~/.local/bin
|
||||
set -gx MANPAGER 'nvim +Man!'
|
||||
set -gx EDITOR 'nvim'
|
||||
set -gx _JAVA_AWT_WM_NONREPARENTING 1
|
||||
set -gx NIX_FLAKE '/home/e/dev/nix'
|
||||
";
|
||||
plugins = [
|
||||
{
|
||||
name = "fzf";
|
||||
inherit (pkgs.fishPlugins.fzf-fish) src;
|
||||
}
|
||||
{
|
||||
name = "puffer";
|
||||
inherit (pkgs.fishPlugins.puffer) src;
|
||||
}
|
||||
];
|
||||
functions = {
|
||||
nix = {
|
||||
wraps = "nix";
|
||||
body = ''
|
||||
if status is-interactive
|
||||
and test (count $argv) = 1 -a "$argv[1]" = develop
|
||||
nix develop --command (status fish-path)
|
||||
else
|
||||
command nix $argv
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
shellAbbrs = {
|
||||
g = "git";
|
||||
k = "kubectl";
|
||||
};
|
||||
shellAliases = {
|
||||
":q" = "exit";
|
||||
hms = "home-manager switch --flake $NIX_FLAKE#${host.username}";
|
||||
rbs = "sudo nixos-rebuild switch --flake $NIX_FLAKE#${host.hostName}";
|
||||
mpv = "mpv --no-keepaspect-window";
|
||||
cat = "bat -pp";
|
||||
tcd = "cd $(mktemp -d)";
|
||||
docker = "nerdctl";
|
||||
vimdiff = "nvim -d";
|
||||
};
|
||||
};
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
|
|
|
|||
97
home-manager/shared/programs/shell/fish.nix
Normal file
97
home-manager/shared/programs/shell/fish.nix
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
{pkgs, host, ...}: {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set fish_greeting # Disable greeting
|
||||
set show_startup_tips false
|
||||
set -U tide_right_prompt_items status\x1ecmd_duration\x1etime
|
||||
'';
|
||||
shellInit = "
|
||||
fish_add_path /usr/local/go/bin
|
||||
fish_add_path ~/go/bin
|
||||
fish_add_path ~/.local/bin
|
||||
set -gx MANPAGER 'nvim +Man!'
|
||||
set -gx EDITOR 'nvim'
|
||||
set -gx _JAVA_AWT_WM_NONREPARENTING 1
|
||||
set -gx NIX_FLAKE '/home/e/dev/nix'
|
||||
";
|
||||
plugins = [
|
||||
{
|
||||
name = "fzf";
|
||||
inherit (pkgs.fishPlugins.fzf-fish) src;
|
||||
}
|
||||
{
|
||||
name = "puffer";
|
||||
inherit (pkgs.fishPlugins.puffer) src;
|
||||
}
|
||||
];
|
||||
functions = {
|
||||
nix = {
|
||||
wraps = "nix";
|
||||
body = ''
|
||||
if status is-interactive
|
||||
and test (count $argv) = 1 -a "$argv[1]" = develop
|
||||
nix develop --command (status fish-path)
|
||||
else
|
||||
command nix $argv
|
||||
end
|
||||
'';
|
||||
};
|
||||
fish_jj_prompt = {
|
||||
body = ''
|
||||
if not command -sq jj
|
||||
return 1
|
||||
end
|
||||
|
||||
if not jj root &>/dev/null
|
||||
return 1
|
||||
end
|
||||
|
||||
# Generate prompt
|
||||
set -l info "$(
|
||||
jj log --ignore-working-copy --no-graph --color=always --revisions=@ --template "
|
||||
separate(
|
||||
' ',
|
||||
self.change_id().shortest(),
|
||||
bookmarks.join(', '),
|
||||
if(conflict, label('conflict', '×')),
|
||||
if(empty, label('empty', '(empty)')),
|
||||
if(divergent, label('divergent', '(divergent)')),
|
||||
if(hidden, label('hidden', '(hidden)')),
|
||||
)
|
||||
"
|
||||
)"
|
||||
or return 1
|
||||
|
||||
if test -n $info
|
||||
printf ' (jj: %s)' $info
|
||||
else
|
||||
return 1
|
||||
end
|
||||
'';
|
||||
};
|
||||
fish_vcs_prompt = {
|
||||
body = ''
|
||||
fish_jj_prompt $argv
|
||||
or fish_git_prompt $argv
|
||||
or fish_hg_prompt $argv
|
||||
or fish_fossil_prompt $argv
|
||||
'';
|
||||
};
|
||||
};
|
||||
shellAbbrs = {
|
||||
g = "git";
|
||||
k = "kubectl";
|
||||
};
|
||||
shellAliases = {
|
||||
":q" = "exit";
|
||||
hms = "home-manager switch --flake $NIX_FLAKE#${host.username}";
|
||||
rbs = "sudo nixos-rebuild switch --flake $NIX_FLAKE#${host.hostName}";
|
||||
mpv = "mpv --no-keepaspect-window";
|
||||
cat = "bat -pp";
|
||||
tcd = "cd $(mktemp -d)";
|
||||
docker = "nerdctl";
|
||||
vimdiff = "nvim -d";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
git -C "$left" commit -q -m baseline --allow-empty
|
||||
mv "$left/.git" "$right"
|
||||
git -C "$right" add --intent-to-add -A
|
||||
(cd "$right"; nvim -c "lua require('lazy').load({plugins = {'diffview.nvim'}})" -c DiffviewOpen)
|
||||
(cd "$right"; nvim -c "lua vim.g.snacks_indent=false" -c "lua require('lazy').load({plugins = {'diffview.nvim'}})" -c DiffviewOpen)
|
||||
git -C "$right" diff-index --quiet --cached HEAD && { echo "No changes done, aborting split."; exit 1; }
|
||||
git -C "$right" commit -q -m split
|
||||
git -C "$right" restore . # undo changes in modified files
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ in {
|
|||
};
|
||||
steam.enable = true;
|
||||
adb.enable = true;
|
||||
fish.enable = true;
|
||||
};
|
||||
services = {
|
||||
resolved = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue