(dir string)
| 297 | } |
| 298 | |
| 299 | func (g *glibcPatchFlake) writeTo(dir string) error { |
| 300 | wantCUDA := slices.ContainsFunc(g.Dependencies, func(dep string) bool { |
| 301 | return strings.Contains(dep, "cudaPackages") |
| 302 | }) |
| 303 | if wantCUDA { |
| 304 | err := g.copySystemCUDALib(dir) |
| 305 | if err != nil { |
| 306 | slog.Debug("error copying system libcuda.so to flake", "dir", dir) |
| 307 | } |
| 308 | } |
| 309 | changed, err := writeFromTemplate(dir, g, "glibc-patch.nix", "flake.nix") |
| 310 | if err != nil { |
| 311 | return err |
| 312 | } |
| 313 | if changed { |
| 314 | _ = os.Remove(filepath.Join(dir, "flake.lock")) |
| 315 | } |
| 316 | return nil |
| 317 | } |
| 318 | |
| 319 | func (g *glibcPatchFlake) LogValue() slog.Value { |
| 320 | inputs := make([]slog.Attr, 0, 2+len(g.Inputs)) |
no test coverage detected