diff options
| author | Fuwn <[email protected]> | 2024-09-27 00:41:03 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-09-27 00:47:04 -0700 |
| commit | 648ab372616597f3193ebad0f3cb710f9cd1f77c (patch) | |
| tree | ae331ebcf82d056daaafadcff8c72243486d4b6a | |
| parent | ade53cef414c09b91864cebff185556e1126fe36 (diff) | |
| download | rui-648ab372616597f3193ebad0f3cb710f9cd1f77c.tar.xz rui-648ab372616597f3193ebad0f3cb710f9cd1f77c.zip | |
feat(rui): allow-unfree configuration option
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | flake.nix | 7 | ||||
| -rw-r--r-- | rui.go | 16 |
3 files changed, 21 insertions, 5 deletions
@@ -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; }; }; } @@ -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; + }; }; }; @@ -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", |