-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2350 from aftix/update_nix
Updated nix completer with the new flake APIs
- Loading branch information
Showing
48 changed files
with
637 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var derivationCmd = &cobra.Command{ | ||
Use: "derivation", | ||
Short: "work with derivations", | ||
GroupID: "utility", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(derivationCmd).Standalone() | ||
|
||
rootCmd.AddCommand(derivationCmd) | ||
|
||
addEvaluationFlags(derivationCmd) | ||
addFlakeFlags(derivationCmd) | ||
addLoggingFlags(derivationCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var derivation_addCmd = &cobra.Command{ | ||
Use: "add", | ||
Short: "add a store derivation", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(derivation_addCmd).Standalone() | ||
|
||
derivation_addCmd.Flags().Bool("dry-run", false, "Show what this command would do without doing it") | ||
|
||
derivationCmd.AddCommand(derivation_addCmd) | ||
|
||
addLoggingFlags(derivation_addCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/nix" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var derivation_showCmd = &cobra.Command{ | ||
Use: "show", | ||
Short: "work with derivations", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(derivation_showCmd).Standalone() | ||
|
||
derivation_showCmd.Flags().Bool("dry-run", false, "Show what this command would do without doing it") | ||
derivation_showCmd.Flags().Bool("stdin", false, "Read installables from the standard input") | ||
|
||
derivationCmd.AddCommand(derivation_showCmd) | ||
|
||
addEvaluationFlags(derivation_showCmd) | ||
addFlakeFlags(derivation_showCmd) | ||
addLoggingFlags(derivation_showCmd) | ||
|
||
carapace.Gen(derivation_showCmd).PositionalAnyCompletion(nix.ActionInstallables()) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/nix" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var flake_checkCmd = &cobra.Command{ | ||
Use: "check [flags] [flake-url]", | ||
Short: "check whether the flake evaluates and runs its tests", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(flake_checkCmd).Standalone() | ||
|
||
flake_checkCmd.Flags().Bool("all-systems", false, "Check the outputs for all systems") | ||
flake_checkCmd.Flags().Bool("no-build", false, "Do not build checks") | ||
|
||
addEvaluationFlags(flake_checkCmd) | ||
addFlakeFlags(flake_checkCmd) | ||
addLoggingFlags(flake_checkCmd) | ||
|
||
carapace.Gen(flake_checkCmd).PositionalCompletion(nix.ActionFlakes()) | ||
|
||
flakeCmd.AddCommand(flake_checkCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/nix" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var flake_cloneCmd = &cobra.Command{ | ||
Use: "clone [flags] [flake-url]", | ||
Short: "clone flake repository", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(flake_cloneCmd).Standalone() | ||
|
||
flake_cloneCmd.Flags().StringP("dest", "f", "", "Specify target directory for flake repository") | ||
|
||
addEvaluationFlags(flake_cloneCmd) | ||
addFlakeFlags(flake_cloneCmd) | ||
addLoggingFlags(flake_cloneCmd) | ||
|
||
carapace.Gen(flake_cloneCmd).FlagCompletion(carapace.ActionMap{ | ||
"dest": carapace.ActionDirectories(), | ||
}) | ||
carapace.Gen(flake_cloneCmd).PositionalCompletion(nix.ActionFlakes()) | ||
|
||
flakeCmd.AddCommand(flake_cloneCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/nix" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var flake_initCmd = &cobra.Command{ | ||
Use: "init", | ||
Short: "create a flake in current directory from a template", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(flake_initCmd).Standalone() | ||
|
||
flake_initCmd.Flags().StringP("template", "t", "default", "The template to use") | ||
|
||
addEvaluationFlags(flake_initCmd) | ||
addFlakeFlags(flake_initCmd) | ||
addLoggingFlags(flake_initCmd) | ||
|
||
carapace.Gen(flake_initCmd).FlagCompletion(carapace.ActionMap{ | ||
"template": nix.ActionTemplates(), | ||
}) | ||
|
||
flakeCmd.AddCommand(flake_initCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/nix" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var flake_lockCmd = &cobra.Command{ | ||
Use: "lock [flags] [flake-url]", | ||
Short: "create missing lockfile entries", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(flake_lockCmd).Standalone() | ||
|
||
addEvaluationFlags(flake_lockCmd) | ||
addFlakeFlags(flake_lockCmd) | ||
addLoggingFlags(flake_lockCmd) | ||
|
||
carapace.Gen(flake_lockCmd).PositionalCompletion(nix.ActionFlakes()) | ||
|
||
flakeCmd.AddCommand(flake_lockCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/nix" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var flake_metadataCmd = &cobra.Command{ | ||
Use: "metadata [flags] [flake-url]", | ||
Short: "show flake metadata", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
Aliases: []string{"info"}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(flake_metadataCmd).Standalone() | ||
|
||
flake_metadataCmd.Flags().Bool("json", false, "Produce output in JSON format") | ||
|
||
addEvaluationFlags(flake_metadataCmd) | ||
addFlakeFlags(flake_metadataCmd) | ||
addLoggingFlags(flake_metadataCmd) | ||
|
||
carapace.Gen(flake_metadataCmd).PositionalCompletion(nix.ActionFlakes()) | ||
|
||
flakeCmd.AddCommand(flake_metadataCmd) | ||
} |
Oops, something went wrong.