fix: Remove obsolete inputs, use more standard naming

from `home-managerModule` to `homeManagerModules.default`
This commit is contained in:
Jiří Štefka 2024-10-18 14:49:12 +02:00
parent 8248b8c658
commit 11d39e91b4
Signed by: jiriks74
GPG key ID: 1D5E30D3DB2264DE
3 changed files with 189 additions and 204 deletions

View file

@ -27,7 +27,7 @@ A [`home-manager`]() flake containing my [`zsh`]() config.
extraSpecialArgs = {inherit inputs outputs;}; extraSpecialArgs = {inherit inputs outputs;};
modules = [ modules = [
... ...
zsh-config.home-managerModule inputs.zsh-config.homeManagerModules.default
... ...
]; ];
}; };

View file

@ -1,21 +1,5 @@
{ {
"nodes": { "nodes": {
"fast-syntax-highlighting": {
"flake": false,
"locked": {
"lastModified": 1702802089,
"narHash": "sha256-AEeGEx2vyyHVS92Nla7XoqSx3rTpQHYwPMrK1jFH1Mg=",
"owner": "z-shell",
"repo": "F-Sy-H",
"rev": "3dea11a9018061e6e3a77e529b79e5654679d3a0",
"type": "github"
},
"original": {
"owner": "z-shell",
"repo": "F-Sy-H",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -52,7 +36,6 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"fast-syntax-highlighting": "fast-syntax-highlighting",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }

374
flake.nix
View file

@ -13,219 +13,221 @@
... ...
} @ inputs: } @ inputs:
{ {
home-managerModule = { config, lib, pkgs, ... }: { homeManagerModules = {
home.packages = with pkgs;[ default = { config, lib, pkgs, ... }: {
nix-zsh-completions home.packages = with pkgs;[
nix-zsh-completions
asciinema # Terminal recording asciinema # Terminal recording
libnotify # Notifications libnotify # Notifications
websocat # For asciinema v2 streams websocat # For asciinema v2 streams
tldr tldr
lsd lsd
bat bat
eza eza
trash-cli trash-cli
fzf # enhancd fzf # enhancd
fd # enhancd fd # enhancd
# rofi # for fd # rofi # for fd
gnutar # ex gnutar # ex
bzip3 # ex bzip3 # ex
unzip # ex unzip # ex
p7zip # ex p7zip # ex
unrar # ex unrar # ex
gzip # ex gzip # ex
]; ];
programs = { programs = {
# nix-index = { # nix-index = {
# enable = true; # enable = true;
# enableZshIntegration = true; # enableZshIntegration = true;
# }; # };
# thefuck = { # thefuck = {
# enable = true; # enable = true;
# enableZshIntegration = true; # enableZshIntegration = true;
# }; # };
direnv = { direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
zsh = {
enable = true;
enableCompletion = true;
zplug = {
enable = true; enable = true;
plugins = [ enableZshIntegration = true;
{ name = "romkatv/powerlevel10k"; tags = [ "as:theme" "depth:1" ]; } # Installations with additional options. For the list of options, please refer to Zplug README. nix-direnv.enable = true;
{ name = "z-shell/F-Sy-H"; } # Feature-rich Syntax Highlighting for Zsh
# { name = "zsh-users/zsh-syntax-highlighting"; }
{ name = "zsh-users/zsh-completions"; } # Adds some missing completions to zsh
{ name = "zsh-users/zsh-autosuggestions"; } # Simple plugin installation
{ name = "MichaelAquilina/zsh-you-should-use"; } # Did you forget to use an alias?
{ name = "davidde/git"; } # Aliases for git
{ name = "babarot/enhancd"; tags = [ "use:init.sh" ]; } # Includes simmilar functionality to zsh-z
{ name = "supercrabtree/k"; } # Directory listings for Zsh with git features.
{ name = "plugins/command-not-found"; tags = [ "from:oh-my-zsh" ]; }
{ name = "gko/ssh-connect"; tags = [ "use:ssh-connect.sh" ]; } # List of most used ssh connections
{ name = "agkozak/zsh-z"; } # Jump arount your filesystem with ease
{ name = "sineto/web-search"; }
{ name = "zsh-users/zaw"; } # Desctiptions for command outputs (afaik)zplug "plugins/git", from:oh-my-zsh
# { name = "plugins/dirhistory"; tags = [ "from:oh-my-zsh" ]; }
];
}; };
initExtraFirst = '' zsh = {
if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then enable = true;
zmodload zsh/zprof # Profiling. Enable `zprof` at the end of initExtra too. enableCompletion = true;
else zplug = {
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. enable = true;
# Initialization code that may require console input (password prompts, [y/n] plugins = [
# confirmations, etc.) must go above this block; everything else may go below. { name = "romkatv/powerlevel10k"; tags = [ "as:theme" "depth:1" ]; } # Installations with additional options. For the list of options, please refer to Zplug README.
if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then { name = "z-shell/F-Sy-H"; } # Feature-rich Syntax Highlighting for Zsh
source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" # { name = "zsh-users/zsh-syntax-highlighting"; }
{ name = "zsh-users/zsh-completions"; } # Adds some missing completions to zsh
{ name = "zsh-users/zsh-autosuggestions"; } # Simple plugin installation
{ name = "MichaelAquilina/zsh-you-should-use"; } # Did you forget to use an alias?
{ name = "davidde/git"; } # Aliases for git
{ name = "babarot/enhancd"; tags = [ "use:init.sh" ]; } # Includes simmilar functionality to zsh-z
{ name = "supercrabtree/k"; } # Directory listings for Zsh with git features.
{ name = "plugins/command-not-found"; tags = [ "from:oh-my-zsh" ]; }
{ name = "gko/ssh-connect"; tags = [ "use:ssh-connect.sh" ]; } # List of most used ssh connections
{ name = "agkozak/zsh-z"; } # Jump arount your filesystem with ease
{ name = "sineto/web-search"; }
{ name = "zsh-users/zaw"; } # Desctiptions for command outputs (afaik)zplug "plugins/git", from:oh-my-zsh
# { name = "plugins/dirhistory"; tags = [ "from:oh-my-zsh" ]; }
];
};
initExtraFirst = ''
if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then
zmodload zsh/zprof # Profiling. Enable `zprof` at the end of initExtra too.
else
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh"
fi
fi fi
fi '';
'';
initExtra = '' initExtra = ''
# Remove nix from path if we are in a container (distrobox) # Remove nix from path if we are in a container (distrobox)
if [ -v DISTROBOX_ENTER_PATH ]; then if [ -v DISTROBOX_ENTER_PATH ]; then
export PATH=$(echo $PATH | tr ':' '\n' | grep -vE '/nix/|/run/wrappers|\.nix-profile|/etc/profiles/per-user/jirka/bin|/run/current-system/sw/bin' | tr '\n' ':') export PATH=$(echo $PATH | tr ':' '\n' | grep -vE '/nix/|/run/wrappers|\.nix-profile|/etc/profiles/per-user/jirka/bin|/run/current-system/sw/bin' | tr '\n' ':')
export PATH=$(echo $PATH | sed 's/:$//') export PATH=$(echo $PATH | sed 's/:$//')
fi fi
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export YSU_MESSAGE_POSITION="after" # you-should-use plugin export YSU_MESSAGE_POSITION="after" # you-should-use plugin
export ASCIINEMA_API_URL=https://asciinema.stefka.eu export ASCIINEMA_API_URL=https://asciinema.stefka.eu
if [ -v ASCIINEMA_REC ]; then if [ -v ASCIINEMA_REC ]; then
_zsh_autosuggest_disable _zsh_autosuggest_disable
fi fi
# Basic auto/tab complete: # Basic auto/tab complete:
autoload -U compinit autoload -U compinit
zstyle ':completion:*' menu select zstyle ':completion:*' menu select
zmodload zsh/complist zmodload zsh/complist
compinit compinit
_comp_options+=(globdots) # Include hidden files. _comp_options+=(globdots) # Include hidden files.
# Custom ZSH Binds # Custom ZSH Binds
bindkey '^ ' autosuggest-accept bindkey '^ ' autosuggest-accept
bindkey "^[[H" beginning-of-line bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line bindkey "^[[F" end-of-line
bindkey "^[[1;5C" forward-word bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word bindkey "^[[1;5D" backward-word
bindkey "^[[3~" delete-char bindkey "^[[3~" delete-char
# Extracting # Extracting
ex () ex ()
{ {
if [ -f $1 ] ; then if [ -f $1 ] ; then
case $1 in case $1 in
*.tar.bz2) tar xjf $1 ;; *.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;; *.tar.gz) tar xzf $1 ;;
*.tar.xz) tar xJf $1 ;; *.tar.xz) tar xJf $1 ;;
*.bz2) bunzip3 $1 ;; *.bz2) bunzip3 $1 ;;
*.rar) unrar x $1 ;; *.rar) unrar x $1 ;;
*.gz) gunzip $1 ;; *.gz) gunzip $1 ;;
*.tar) tar xf $1 ;; *.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;; *.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;; *.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;; *.zip) unzip $1 ;;
*.Z) uncompress $1;; *.Z) uncompress $1;;
*.7z) 7z x $1 ;; *.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;; *) echo "'$1' cannot be extracted via ex()" ;;
esac esac
else else
echo "'$1' is not a valid file" echo "'$1' is not a valid file"
fi fi
} }
# Kitty binds # Kitty binds
if [ "$TERM" = "xterm-kitty" ]; then if [ "$TERM" = "xterm-kitty" ]; then
alias ssh="kitty +kitten ssh" alias ssh="kitty +kitten ssh"
alias icat="kitty +kitten icat" alias icat="kitty +kitten icat"
alias d="kitty +kitten diff" alias d="kitty +kitten diff"
alias get="kitty +kitten transfer" alias get="kitty +kitten transfer"
alias put="kitty +kitten transfer --direction=upload" alias put="kitty +kitten transfer --direction=upload"
alias kclip="kitty +kitten clipboard" alias kclip="kitty +kitten clipboard"
fi fi
# Special aliases that may not work with Nix config # Special aliases that may not work with Nix config
# Command line head / tail shortcuts # Command line head / tail shortcuts
alias H="| head"; alias H="| head";
alias T="| tail"; alias T="| tail";
alias G="| grep"; alias G="| grep";
alias L="| less"; alias L="| less";
alias M="| most"; alias M="| most";
alias LL="2>&1 | less"; alias LL="2>&1 | less";
alias CA="2>&1 | cat -A"; alias CA="2>&1 | cat -A";
alias NE="2> /dev/null"; alias NE="2> /dev/null";
alias NUL="> /dev/null 2>&1"; alias NUL="> /dev/null 2>&1";
alias P="2>&1| pygmentize -l pytb"; alias P="2>&1| pygmentize -l pytb";
if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then if [[ "''${ZSH_PROFILE}" -eq 1 ]]; then
zprof zprof
fi fi
''; '';
shellAliases = { shellAliases = {
cat = "${pkgs.bat}/bin/bat -p"; cat = "${pkgs.bat}/bin/bat -p";
# update = "sudo nixos-rebuild switch"; # update = "sudo nixos-rebuild switch";
ls="lsd"; ls="lsd";
# ls, the common ones I use a lot shortened for rapid fire usage # ls, the common ones I use a lot shortened for rapid fire usage
l="ls -lFh"; #size,show type,human readable l="ls -lFh"; #size,show type,human readable
la="ls -lAFh"; #long list,show almost all,show type,human readable la="ls -lAFh"; #long list,show almost all,show type,human readable
lr="ls -tRFh"; #sorted by date,recursive,show type,human readable lr="ls -tRFh"; #sorted by date,recursive,show type,human readable
lt="ls -ltFh"; #long list,sorted by date,show type,human readable lt="ls -ltFh"; #long list,sorted by date,show type,human readable
ll="ls -l"; #long list ll="ls -l"; #long list
ldot="ls -ld .*"; ldot="ls -ld .*";
lS="ls -1FSsh"; lS="ls -1FSsh";
lart="ls -1Fcart"; lart="ls -1Fcart";
lrt="ls -1Fcrt"; lrt="ls -1Fcrt";
grep="grep --color"; grep="grep --color";
sgrep="grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} "; sgrep="grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} ";
t="tail -f"; t="tail -f";
dud="du -d 1 -h"; dud="du -d 1 -h";
duf="du -sh *"; duf="du -sh *";
# fd="find . -type d -name"; # fd="find . -type d -name";
ff="find . -type f -name"; ff="find . -type f -name";
h="history"; h="history";
hgrep="fc -El 0 | grep"; hgrep="fc -El 0 | grep";
help="man"; help="man";
p="ps -f"; p="ps -f";
sortnr="sort -n -r"; sortnr="sort -n -r";
unexport="unset"; unexport="unset";
# Use trash instead of rm if available # Use trash instead of rm if available
rm="trash"; rm="trash";
cp="cp -i"; cp="cp -i";
mv="mv -i"; mv="mv -i";
cls="clear"; cls="clear";
sshc="ssh-connect"; sshc="ssh-connect";
}; };
history = { history = {
# ignoreAllDups = true; # ignoreAllDups = true;
path = "${config.xdg.cacheHome}/zhistory"; path = "${config.xdg.cacheHome}/zhistory";
save = 10000; save = 10000;
size = 10000; size = 10000;
# share = true; # share = true;
};
}; };
}; };
};
home.file = {
home.file = { # ".zprofile".source = ./zprofile;
# ".zprofile".source = ./zprofile; };
}; };
}; };
}; };