From edf7cc355cb1f55a9301283ebec15e01dc4ffe62 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sun, 19 Nov 2023 21:58:34 +0300 Subject: 2023-11-19 --- packages/nixfiles.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'packages/nixfiles.nix') diff --git a/packages/nixfiles.nix b/packages/nixfiles.nix index 782a193..02e89f2 100644 --- a/packages/nixfiles.nix +++ b/packages/nixfiles.nix @@ -25,7 +25,7 @@ # Shamelessly appropriated from https://github.com/ncfavier/config. # Hopefully Naïm will not sue me for copyright infrigment. text = '' - nixfiles="''${NIXFILES:-$HOME/src/nixfiles}" + nixfiles="''${NIXFILES:-.}" cmd=$1 shift case $cmd in @@ -108,10 +108,10 @@ # Assumes that hosts are configured in the OpenSSH configuration. host=''${cmd#@} hostname=$(ssh -q "$host" 'echo "$HOSTNAME"') - exec nixos-rebuild -v --flake ".#$hostname" --target-host "$host" --use-remote-sudo --show-trace "$@" + exec nixos-rebuild -v --flake "$nixfiles#$hostname" --target-host "$host" --use-remote-sudo --show-trace "$@" ;; *) - exec nixos-rebuild -v --fast --flake "." --use-remote-sudo --show-trace "$cmd" "$@" + exec nixos-rebuild -v --fast --flake "$nixfiles" --use-remote-sudo --show-trace "$cmd" "$@" ;; esac ''; @@ -134,7 +134,7 @@ } _nixfiles() { local cur prev words cword - local nixfiles="''${NIXFILES:-$HOME/src/nixfiles}" + local nixfiles="''${NIXFILES:-.}" _init_completion -n ':=&' if [[ "$cword" == 1 ]] || [[ "$cword" == 2 && "$prev" == @* ]]; then if [[ $cur == @* ]]; then @@ -180,5 +180,6 @@ in license = licenses.wtfpl; platforms = platforms.unix; maintainers = with maintainers; [azahi]; + mainProgram = "nixfiles"; }; } -- cgit v1.2.3