diff options
| -rw-r--r-- | README.md | 16 | ||||
| -rw-r--r-- | flake.nix | 5 | ||||
| -rw-r--r-- | rui.go | 15 |
3 files changed, 26 insertions, 10 deletions
@@ -45,23 +45,29 @@ inputs.home-manager.lib.homeManagerConfiguration { ```nix { programs.rui = { - enable = true; + enable = true; # Defaults to false settings = { - # Status notifications via `notify-send` + # Status notifications via `notify-send`; defaults to false notify = true; - # The command to use for sending notifications, view a cool example below! + # The command to use for sending notifications, view a cool example below; + # defaults to `notify-send` notifier = "notify-send"; # Rui falls back on the `FLAKE_EDITOR` and `EDITOR` environment variables + # if `editor` is unset editor = "code"; - # Rui falls back on the `FLAKE` environment variable + # Rui falls back on the `FLAKE` environment variable if `flake` is unset flake = "/path/to/your-flake"; - # Allow unfree packages + # Allow unfree packages; defaults to false allow-unfree = false; + + # Extra arguments to pass to `nixos-rebuild` and `home-manager`; defaults + # to [ ] + extra-args = [ "--impure" ]; }; }; } @@ -119,6 +119,11 @@ type = types.bool; default = false; }; + + extra-args = mkOption { + type = types.listOf types.str; + default = [ ]; + }; }; }; @@ -11,11 +11,12 @@ import ( ) type Configuration struct { - Notify bool `json:"notify"` - Editor string `json:"editor"` - Flake string `json:"flake"` - Notifier string `json:"notifier"` - AllowUnfree bool `json:"allow-unfree"` + Notify bool `json:"notify"` + Editor string `json:"editor"` + Flake string `json:"flake"` + Notifier string `json:"notifier"` + AllowUnfree bool `json:"allow-unfree"` + ExtraArgs []string `json:"extra-args"` } type ActionDetails struct { @@ -160,6 +161,8 @@ func main() { flake := configuration.Flake extraArgs := c.Args().Slice() + extraArgs = append(extraArgs, configuration.ExtraArgs...) + if flake == "" { flake = os.Getenv("FLAKE") } @@ -329,6 +332,8 @@ func home(c *cli.Context, action int) error { extraArgs := c.Args().Slice() name, verb, usableWithNH := actionDetails(action) + extraArgs = append(extraArgs, configuration.ExtraArgs...) + if err := notify("Queued home " + name); err != nil { return err } |