@@ -28,14 +28,14 @@ func buildClosure(flake string, spec JobSpec, builder string) (string, error) {
2828 // Step 1: Evaluate the .drv path locally
2929 data , err := runJSON ("nix" , "--extra-experimental-features" , "nix-command flakes" , "eval" , "--raw" , drvExpr )
3030 if err != nil {
31- return "" , fmt .Errorf ("Failed to evaluate drvPath for %s: %w" , spec .Output , err )
31+ return "" , fmt .Errorf ("failed to evaluate drvPath for %s: %w" , spec .Output , err )
3232 }
3333 drvPath := strings .TrimSpace (string (data ))
3434
3535 // Step 2: Copy the .drv closure to the remote builder (if needed)
3636 if builder != "localhost" {
3737 if _ , err := run ("nix" , "--extra-experimental-features" , "nix-command flakes" , "copy" , "--to" , "ssh-ng://" + builder , drvPath ); err != nil {
38- return "" , fmt .Errorf ("Failed to copy .drv to %s: %w" , builder , err )
38+ return "" , fmt .Errorf ("failed to copy .drv to %s: %w" , builder , err )
3939 }
4040 }
4141
@@ -47,26 +47,26 @@ func buildClosure(flake string, spec JobSpec, builder string) (string, error) {
4747 buildOut , err = runJSON ("nix" , "--extra-experimental-features" , "nix-command flakes" , "build" , "--no-link" , "--json" , drvPath + "^*" )
4848 }
4949 if err != nil {
50- return "" , fmt .Errorf ("Failed to build %s on %s: %w" , spec .Output , builder , err )
50+ return "" , fmt .Errorf ("failed to build %s on %s: %w" , spec .Output , builder , err )
5151 }
5252
5353 // Step 4: Parse the output path
5454 var results []BuildResult
5555 if err := json .Unmarshal (buildOut , & results ); err != nil {
56- return "" , fmt .Errorf ("Invalid build JSON for %s: %w\n Raw: %s" , spec .Output , err , string (buildOut ))
56+ return "" , fmt .Errorf ("invalid build JSON for %s: %w\n Raw: %s" , spec .Output , err , string (buildOut ))
5757 }
5858 if len (results ) == 0 {
59- return "" , fmt .Errorf ("Build result for %s was empty" , spec .Output )
59+ return "" , fmt .Errorf ("build result for %s was empty" , spec .Output )
6060 }
6161 out , ok := results [0 ].Outputs ["out" ]
6262 if ! ok {
63- return "" , fmt .Errorf ("Missing 'out' key in build result for %s" , spec .Output )
63+ return "" , fmt .Errorf ("missing 'out' key in build result for %s" , spec .Output )
6464 }
6565
6666 // Step 5: Copy built closure back from builder to local (if needed)
6767 if builder != "localhost" {
6868 if _ , err := run ("nix" , "copy" , "--from" , "ssh-ng://" + builder , out , "--no-check-sigs" ); err != nil {
69- return "" , fmt .Errorf ("Error copying from %s: %v" , builder , err )
69+ return "" , fmt .Errorf ("could not copy from %s: %v" , builder , err )
7070 }
7171 }
7272
@@ -117,11 +117,11 @@ func loadDeploymentSpec(cfg string) (map[string]JobSpec, error) {
117117 // Nix -> JSON
118118 data , err := runJSON ("nix" , "eval" , "--json" , "-f" , cfg )
119119 if err != nil {
120- return nil , fmt .Errorf ("Failed to run nix eval on %s: %w" , cfg , err )
120+ return nil , fmt .Errorf ("failed to run nix eval on %s: %w" , cfg , err )
121121 }
122122 jobs := make (map [string ]JobSpec )
123123 if err := json .Unmarshal (data , & jobs ); err != nil {
124- return nil , fmt .Errorf ("Invalid JSON in %s: %w" , cfg , err )
124+ return nil , fmt .Errorf ("invalid JSON in %s: %w" , cfg , err )
125125 }
126126 return jobs , nil
127127}
@@ -161,10 +161,10 @@ func validateJobs(jobs map[string]JobSpec) (map[string]JobSpec, error) {
161161 }
162162
163163 if spec .User == "" {
164- return nil , fmt .Errorf ("Missing user for job: %s" , name )
164+ return nil , fmt .Errorf ("missing user for job: %s" , name )
165165 }
166166 if spec .Type != "nixos" && spec .Type != "darwin" {
167- return nil , fmt .Errorf ("Unsupported system type '%s' for job: %s" , spec .Type , name )
167+ return nil , fmt .Errorf ("unsupported system type '%s' for job: %s" , spec .Type , name )
168168 }
169169
170170 validated [name ] = spec
0 commit comments