diff options
| author | 2026-05-20 13:56:12 +0100 | |
|---|---|---|
| committer | 2026-05-20 13:56:12 +0100 | |
| commit | a41bcc4cd9cddde9e03cc99b2a57e6356e062d8d (patch) | |
| tree | d238896c7d1ff60257e8113d2431c406f4be65a8 /dot_config/zsh/dot_zshrc | |
| parent | 64a9cab4e753e33da0727d54f24a47bddffcac08 (diff) | |
| download | dotfiles-a41bcc4cd9cddde9e03cc99b2a57e6356e062d8d.tar.gz dotfiles-a41bcc4cd9cddde9e03cc99b2a57e6356e062d8d.tar.bz2 dotfiles-a41bcc4cd9cddde9e03cc99b2a57e6356e062d8d.zip | |
zsh: add hm wrapper for flake-based home-manager
The standalone 'home-manager' command defaults to the legacy
~/.config/home-manager/home.nix and errors out for flake users. The
wrapper auto-selects the host/vm profile by /etc/os-release ID and
points at whichever dotfiles checkout exists on the machine.
Usage:
hm news
hm switch
hm generations
Diffstat (limited to 'dot_config/zsh/dot_zshrc')
| -rw-r--r-- | dot_config/zsh/dot_zshrc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dot_config/zsh/dot_zshrc b/dot_config/zsh/dot_zshrc index f94b82e..0bca505 100644 --- a/dot_config/zsh/dot_zshrc +++ b/dot_config/zsh/dot_zshrc @@ -360,6 +360,18 @@ alias j='just' alias dj='just --justfile ~/dotfiles/justfile --working-directory ~/dotfiles' alias rj='just --justfile ~/.local/share/dotfiles/nix/justfile --working-directory ~/.local/share/dotfiles/nix' +# Home-Manager (flake-based; standalone HM defaults to legacy ~/.config/home-manager) +hm() { + local profile=host + [ -r /etc/os-release ] && . /etc/os-release + case "${ID:-}" in + ubuntu|debian) profile=vm ;; + esac + local flake="$HOME/dotfiles/nix#${profile}" + [ -d "$HOME/.local/share/dotfiles/nix" ] && flake="$HOME/.local/share/dotfiles/nix#${profile}" + nix run home-manager/master -- "$@" --flake "$flake" +} + # LLVM / Clang tooling alias ncmake='cmake -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="$DEV_CFLAGS" -DCMAKE_CXX_FLAGS="$DEV_CFLAGS" -DCMAKE_INSTALL_PREFIX=build/install -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B build' alias ircc='clang -S -emit-llvm -fno-discard-value-names -O0 -Xclang -disable-O0-optnone -o -' |
