aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md16
-rw-r--r--flake.nix5
-rw-r--r--rui.go15
3 files changed, 26 insertions, 10 deletions
diff --git a/README.md b/README.md
index b666424..2c6fcab 100644
--- a/README.md
+++ b/README.md
@@ -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" ];
};
};
}
diff --git a/flake.nix b/flake.nix
index ddf3288..e9b1e25 100644
--- a/flake.nix
+++ b/flake.nix
@@ -119,6 +119,11 @@
type = types.bool;
default = false;
};
+
+ extra-args = mkOption {
+ type = types.listOf types.str;
+ default = [ ];
+ };
};
};
diff --git a/rui.go b/rui.go
index c76870e..2f06d43 100644
--- a/rui.go
+++ b/rui.go
@@ -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
}