aboutsummaryrefslogtreecommitdiff
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
parent766eec304f9b54be3fbc08f307344ca52b6b8b2b (diff)
downloadrui-aaf9f9a4390c3996688b5109944bd79242f3ceb5.tar.xz
rui-aaf9f9a4390c3996688b5109944bd79242f3ceb5.zip
feat(rui): allow insecure packages flag
-rw-r--r--README.md5
-rw-r--r--flake.nix2
-rw-r--r--rui.go29
3 files changed, 28 insertions, 8 deletions
diff --git a/README.md b/README.md
index 2c6fcab..8c01849 100644
--- a/README.md
+++ b/README.md
@@ -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" ];
diff --git a/flake.nix b/flake.nix
index 7951a11..3d10e8a 100644
--- a/flake.nix
+++ b/flake.nix
@@ -51,7 +51,7 @@
inherit meta;
pname = "rui";
- version = "2024.09.27";
+ version = "2024.10.04";
src = pkgs.lib.cleanSource ./.;
vendorHash = "sha256-mN/QjzJ4eGfbW1H92cCKvC0wDhCR6IUes2HCZ5YBdPA=";
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{