()
| 15 | const nixDaemonFlag = "daemon" |
| 16 | |
| 17 | func setupCmd() *cobra.Command { |
| 18 | setupCommand := &cobra.Command{ |
| 19 | Use: "setup", |
| 20 | Short: "Setup devbox dependencies", |
| 21 | Hidden: true, |
| 22 | } |
| 23 | |
| 24 | installNixCommand := &cobra.Command{ |
| 25 | Use: "nix", |
| 26 | Short: "Install Nix", |
| 27 | RunE: func(cmd *cobra.Command, args []string) error { |
| 28 | return runInstallNixCmd(cmd) |
| 29 | }, |
| 30 | } |
| 31 | |
| 32 | installNixCommand.Flags().Bool( |
| 33 | nixDaemonFlag, |
| 34 | false, |
| 35 | "Install Nix in multi-user mode. This flag is not supported if you are using DetSys installer", |
| 36 | ) |
| 37 | setupCommand.AddCommand(installNixCommand) |
| 38 | return setupCommand |
| 39 | } |
| 40 | |
| 41 | func runInstallNixCmd(cmd *cobra.Command) error { |
| 42 | if nix.BinaryInstalled() { |
no test coverage detected