aboutsummaryrefslogtreecommitdiff
path: root/rui.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-04 04:43:14 -0700
committerFuwn <[email protected]>2024-10-04 04:43:14 -0700
commitaaf9f9a4390c3996688b5109944bd79242f3ceb5 (patch)
treeacad62a12c590a7e44fba5766e6ef8f1d980dd35 /rui.go
parent766eec304f9b54be3fbc08f307344ca52b6b8b2b (diff)
downloadrui-aaf9f9a4390c3996688b5109944bd79242f3ceb5.tar.xz
rui-aaf9f9a4390c3996688b5109944bd79242f3ceb5.zip
feat(rui): allow insecure packages flag
Diffstat (limited to 'rui.go')
-rw-r--r--rui.go29
1 files changed, 23 insertions, 6 deletions
diff --git a/rui.go b/rui.go
index 2f06d43..dab9907 100644
--- a/rui.go
+++ b/rui.go
@@ -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{