mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-16 21:38:21 +00:00
add extra commands for nixdarwin-rebuild
This commit is contained in:
parent
4a7514f2ea
commit
23a0eefe2d
1 changed files with 7 additions and 3 deletions
10
config.nix
10
config.nix
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs }:
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ let
|
||||||
autoload -U compinit && compinit
|
autoload -U compinit && compinit
|
||||||
autoload -U promptinit && promptinit
|
autoload -U promptinit && promptinit
|
||||||
|
|
||||||
|
bindkey -e
|
||||||
setopt autocd
|
setopt autocd
|
||||||
|
|
||||||
export PROMPT='%B%(?..[%?] )%b> '
|
export PROMPT='%B%(?..[%?] )%b> '
|
||||||
|
@ -75,8 +76,11 @@ let
|
||||||
|
|
||||||
nixdarwin-rebuild () {
|
nixdarwin-rebuild () {
|
||||||
case $1 in
|
case $1 in
|
||||||
'switch') nix-env -f '<nixpkgs>' -iA nixdarwin.toplevel ;;
|
"build") nix-build --no-out-link "<nixpkgs>" -A nixdarwin.toplevel ;;
|
||||||
''') return 1 ;;
|
"repl") nix-repl "$HOME/.nixpkgs/config.nix" ;;
|
||||||
|
"shell") nix-shell "<nixpkgs>" -p nixdarwin.toplevel --run "zsh -l" ;;
|
||||||
|
"switch") nix-env -f "<nixpkgs>" -iA nixdarwin.toplevel && exec zsh -l ;;
|
||||||
|
"") return 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Reference in a new issue