pinpox / lollypops

Lollypop Operations - NixOS Deployment Tool
https://pinpox.github.io/lollypops/
GNU General Public License v3.0
118 stars 17 forks source link

Add option to set rebuild action #7

Closed pinpox closed 2 years ago

pinpox commented 2 years ago

fixes #4

misuzu commented 2 years ago

It's kinda weird to set rebuild action in the config, shouldn't it be an argument on the command line?

pinpox commented 2 years ago

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.

misuzu commented 2 years ago

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.

This feels like a better approach.