diff options
| author | Fuwn <[email protected]> | 2024-09-18 01:34:35 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-09-18 01:34:35 +0000 |
| commit | e351e7fa196936a4cf6197e49f3f1afbfe1a2fbb (patch) | |
| tree | 1d85b3b9f986dd87dc50559fadcef3ef03ec4536 /rui.go | |
| parent | refactor(rui): lower-case function names (diff) | |
| download | rui-e351e7fa196936a4cf6197e49f3f1afbfe1a2fbb.tar.xz rui-e351e7fa196936a4cf6197e49f3f1afbfe1a2fbb.zip | |
feat(rui): pass impure through extra arguments
Diffstat (limited to 'rui.go')
| -rw-r--r-- | rui.go | 21 |
1 files changed, 2 insertions, 19 deletions
@@ -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) } |