Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758package nixery
import ( "fmt" "strings")
func nixConfStep() Step { setupCmd := `mkdir -p /etc/nixecho 'extra-experimental-features = nix-command flakes' >> /etc/nix/nix.confecho 'build-users-group = ' >> /etc/nix/nix.confecho 'sandbox = false' >> /etc/nix/nix.confprintf '#!/bin/sh\nrm -rf /homeless-shelter\n' > /etc/nix/post-build-hook.shchmod +x /etc/nix/post-build-hook.shecho 'post-build-hook = /etc/nix/post-build-hook.sh' >> /etc/nix/nix.conf` return Step{ command: setupCmd, name: "Configure Nix", }}
// dependencyStep processes dependencies defined in the workflow.// For dependencies using a custom registry (i.e. not nixpkgs), it collects// all packages and adds a single 'nix profile add' step to the// beginning of the workflow's step list.func dependencyStep(deps map[string][]string) *Step { var customPackages []string
for registry, packages := range deps { if registry == "nixpkgs" { continue }
if len(packages) == 0 { customPackages = append(customPackages, registry) } // collect packages from custom registries for _, pkg := range packages { customPackages = append(customPackages, fmt.Sprintf("'%s#%s'", registry, pkg)) } }
if len(customPackages) > 0 { installCmd := "nix --extra-experimental-features nix-command --extra-experimental-features flakes profile add" cmd := fmt.Sprintf("%s %s", installCmd, strings.Join(customPackages, " ")) installStep := Step{ command: cmd, name: "Install custom dependencies", environment: map[string]string{ "NIX_NO_COLOR": "1", "NIX_SHOW_DOWNLOAD_PROGRESS": "0", }, } return &installStep } return nil}