aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-18 01:34:35 +0000
committerFuwn <[email protected]>2024-09-18 01:34:35 +0000
commite351e7fa196936a4cf6197e49f3f1afbfe1a2fbb (patch)
tree1d85b3b9f986dd87dc50559fadcef3ef03ec4536
parentrefactor(rui): lower-case function names (diff)
downloadrui-e351e7fa196936a4cf6197e49f3f1afbfe1a2fbb.tar.xz
rui-e351e7fa196936a4cf6197e49f3f1afbfe1a2fbb.zip
feat(rui): pass impure through extra arguments
-rw-r--r--rui.go21
1 files changed, 2 insertions, 19 deletions
diff --git a/rui.go b/rui.go
index 72b5b71..5400e2c 100644
--- a/rui.go
+++ b/rui.go
@@ -80,10 +80,6 @@ func main() {
Aliases: []string{"sw"},
Flags: []cli.Flag{
&cli.BoolFlag{
- Name: "impure",
- Value: true,
- },
- &cli.BoolFlag{
Name: "force-home-manager",
},
&cli.StringFlag{
@@ -92,16 +88,12 @@ func main() {
},
Action: func(c *cli.Context) error {
nh, err := exec.LookPath("nh")
- extraArgs := []string{}
+ extraArgs := c.Args().Slice()
if err := notify("Queued home switch"); err != nil {
return err
}
- if c.Bool("impure") {
- extraArgs = []string{"--impure"}
- }
-
if err == nil && !c.Bool("force-home-manager") {
err = command(nh, append([]string{"home", "switch", "--"},
extraArgs...)...)
@@ -136,24 +128,15 @@ func main() {
&cli.StringFlag{
Name: "user",
},
- &cli.BoolFlag{
- Name: "impure",
- Value: true,
- },
},
Action: func(c *cli.Context) error {
flake := configuration.Flake
+ extraArgs := c.Args().Slice()
if flake == "" {
flake = os.Getenv("FLAKE")
}
- extraArgs := []string{}
-
- if c.Bool("impure") {
- extraArgs = []string{"--impure"}
- }
-
if user := c.String("user"); user != "" {
flake = fmt.Sprintf("%s#%s", flake, user)
}