1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

add extra commands for nixdarwin-rebuild

This commit is contained in:
Daiderd Jordan 2016-10-22 22:49:26 +02:00
parent 4a7514f2ea
commit 23a0eefe2d
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -1,4 +1,4 @@
{ pkgs }:
{ pkgs ? import <nixpkgs> {} }:
let
@ -62,6 +62,7 @@ let
autoload -U compinit && compinit
autoload -U promptinit && promptinit
bindkey -e
setopt autocd
export PROMPT='%B%(?..[%?] )%b> '
@ -75,8 +76,11 @@ let
nixdarwin-rebuild () {
case $1 in
'switch') nix-env -f '<nixpkgs>' -iA nixdarwin.toplevel ;;
''') return 1 ;;
"build") nix-build --no-out-link "<nixpkgs>" -A nixdarwin.toplevel ;;
"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
}
'';