aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-27 00:41:03 -0700
committerFuwn <[email protected]>2024-09-27 00:47:04 -0700
commit648ab372616597f3193ebad0f3cb710f9cd1f77c (patch)
treeae331ebcf82d056daaafadcff8c72243486d4b6a
parentade53cef414c09b91864cebff185556e1126fe36 (diff)
downloadrui-648ab372616597f3193ebad0f3cb710f9cd1f77c.tar.xz
rui-648ab372616597f3193ebad0f3cb710f9cd1f77c.zip
feat(rui): allow-unfree configuration option
-rw-r--r--README.md3
-rw-r--r--flake.nix7
-rw-r--r--rui.go16
3 files changed, 21 insertions, 5 deletions
diff --git a/README.md b/README.md
index 49caf34..b666424 100644
--- a/README.md
+++ b/README.md
@@ -59,6 +59,9 @@ inputs.home-manager.lib.homeManagerConfiguration {
# Rui falls back on the `FLAKE` environment variable
flake = "/path/to/your-flake";
+
+ # Allow unfree packages
+ allow-unfree = false;
};
};
}
diff --git a/flake.nix b/flake.nix
index 1c4fc99..ddf3288 100644
--- a/flake.nix
+++ b/flake.nix
@@ -41,7 +41,7 @@
{
packages.default = pkgs.buildGoModule {
pname = "rui";
- version = "2024.09.23";
+ version = "2024.09.27";
src = pkgs.lib.cleanSource ./.;
vendorHash = "sha256-mN/QjzJ4eGfbW1H92cCKvC0wDhCR6IUes2HCZ5YBdPA=";
@@ -114,6 +114,11 @@
type = types.str;
default = "";
};
+
+ allow-unfree = mkOption {
+ type = types.bool;
+ default = false;
+ };
};
};
diff --git a/rui.go b/rui.go
index ea261b7..c76870e 100644
--- a/rui.go
+++ b/rui.go
@@ -11,10 +11,11 @@ import (
)
type Configuration struct {
- Notify bool `json:"notify"`
- Editor string `json:"editor"`
- Flake string `json:"flake"`
- Notifier string `json:"notifier"`
+ Notify bool `json:"notify"`
+ Editor string `json:"editor"`
+ Flake string `json:"flake"`
+ Notifier string `json:"notifier"`
+ AllowUnfree bool `json:"allow-unfree"`
}
type ActionDetails struct {
@@ -116,6 +117,13 @@ func main() {
},
},
},
+ Before: func(c *cli.Context) error {
+ if configuration.AllowUnfree {
+ c.Set("allow-unfree", "1")
+ }
+
+ return nil
+ },
Commands: []*cli.Command{
{
Name: "hs",