shell

package
v1.1.6-nightly Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:   "shell",
	Short: "",
	Run: func(cmd *cobra.Command, args []string) {
		k, pk, err := lib.PreCommand()
		if err != nil {
			panic(err)
		}

		pkgs := make([]string, 0, len(k.Packages))
		for i := range k.Packages {
			pp, err := lib.ParsePackage(k.Packages[i])
			if err != nil {
				panic(err)
			}
			pkgs = append(pkgs, pp.NixpkgsHash)
		}

		libs := make([]string, 0, len(k.Libraries))
		for i := range k.Libraries {
			pp, err := lib.ParsePackage(k.Libraries[i])
			if err != nil {
				panic(err)
			}
			libs = append(libs, pp.NixpkgsHash)
		}

		if err := lib.NixShell(cmd.Context(), lib.ShellArgs{
			Shell:     os.Getenv("SHELL"),
			EnvVars:   append(pk.EnvVars, "KL_SHELL=true", "KL_HASH="+pk.Hash),
			Packages:  pkgs,
			Libraries: libs,
		}); err != nil {
			panic(err)
		}
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL