diff options
| author | Fuwn <[email protected]> | 2024-10-04 04:43:14 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-04 04:43:14 -0700 |
| commit | aaf9f9a4390c3996688b5109944bd79242f3ceb5 (patch) | |
| tree | acad62a12c590a7e44fba5766e6ef8f1d980dd35 | |
| parent | 766eec304f9b54be3fbc08f307344ca52b6b8b2b (diff) | |
| download | rui-aaf9f9a4390c3996688b5109944bd79242f3ceb5.tar.xz rui-aaf9f9a4390c3996688b5109944bd79242f3ceb5.zip | |
feat(rui): allow insecure packages flag
| -rw-r--r-- | README.md | 5 | ||||
| -rw-r--r-- | flake.nix | 2 | ||||
| -rw-r--r-- | rui.go | 29 |
3 files changed, 28 insertions, 8 deletions
@@ -62,9 +62,12 @@ inputs.home-manager.lib.homeManagerConfiguration { # Rui falls back on the `FLAKE` environment variable if `flake` is unset flake = "/path/to/your-flake"; - # Allow unfree packages; defaults to false + # Allow unfree packages on the global level; defaults to false allow-unfree = false; + # Allow insecure packages on the global level; defaults to false + allow-insecure = false; + # Extra arguments to pass to `nixos-rebuild` and `home-manager`; defaults # to [ ] extra-args = [ "--impure" ]; @@ -51,7 +51,7 @@ inherit meta; pname = "rui"; - version = "2024.09.27"; + version = "2024.10.04"; src = pkgs.lib.cleanSource ./.; vendorHash = "sha256-mN/QjzJ4eGfbW1H92cCKvC0wDhCR6IUes2HCZ5YBdPA="; @@ -11,12 +11,13 @@ 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"` - ExtraArgs []string `json:"extra-args"` + Notify bool `json:"notify"` + Editor string `json:"editor"` + Flake string `json:"flake"` + Notifier string `json:"notifier"` + AllowUnfree bool `json:"allow-unfree"` + AllowInsecure bool `json:"allow-insecure"` + ExtraArgs []string `json:"extra-args"` } type ActionDetails struct { @@ -117,12 +118,28 @@ func main() { return os.Setenv("NIXPKGS_ALLOW_UNFREE", state) }, }, + &cli.BoolFlag{ + Name: "allow-insecure", + Action: func(c *cli.Context, b bool) error { + state := "0" + + if b { + state = "1" + } + + return os.Setenv("NIXPKGS_ALLOW_INSECURE", state) + }, + }, }, Before: func(c *cli.Context) error { if configuration.AllowUnfree { c.Set("allow-unfree", "1") } + if configuration.AllowInsecure { + c.Set("allow-insecure", "1") + } + return nil }, Commands: []*cli.Command{ |