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 /rui.go | |
| parent | 766eec304f9b54be3fbc08f307344ca52b6b8b2b (diff) | |
| download | rui-aaf9f9a4390c3996688b5109944bd79242f3ceb5.tar.xz rui-aaf9f9a4390c3996688b5109944bd79242f3ceb5.zip | |
feat(rui): allow insecure packages flag
Diffstat (limited to 'rui.go')
| -rw-r--r-- | rui.go | 29 |
1 files changed, 23 insertions, 6 deletions
@@ -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{ |