Closed pinpox closed 2 years ago
It's kinda weird to set rebuild action in the config, shouldn't it be an argument on the command line?
It's kinda weird to set rebuild action in the config, shouldn't it be an argument on the command line?
I can also make it an argument, but the syntax is not very pretty. Since I'm using go-task we need to use --
to separate arguments passed to the commands as shown here: https://taskfile.dev/usage/#forwarding-cli-arguments-to-commands
Together with nix this would result in:
nix run '.' -- hostname -- action
A different approach would be to use environment variables for the action. E.g. setting the nixos-rebuild action to $LP_NIXOS_ACTION
and defaulting to switch
.
Not sure what way to go here yet, maybe there is a third, better option aswell.
A different approach would be to use environment variables for the action. E.g. setting the nixos-rebuild action to
$LP_NIXOS_ACTION
and defaulting toswitch
.
This feels like a better approach.
fixes #4