Deployment and lifecycle management for Nix
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

seed-ci: upload flake inputs

+15 -5
+15 -5
bin/seed-ci
··· 1 1 #!/usr/bin/env nu 2 2 3 - let git_branch = get-git-branch 4 - let repo_url = get-repo-url 5 - 6 3 def attic-setup [url: string, cache: string, token: string] { 7 4 print $"⭐ Ensuring attic cache ($url)/($cache)" 8 5 let check = attic cache info $"main:($cache)" | complete ··· 92 89 let build_dependencies = $built_targets | get drvPath | each { |drv| 93 90 nix-store --query --requisites --include-outputs $drv | lines 94 91 } | flatten 95 - $acc ++ ( $built_targets | get outputs.out) ++ $build_dependencies 92 + $acc ++ ( $built_targets | get outputs.out ) ++ $build_dependencies ++ ( get-flake-inputs | get outPath ) 96 93 } | attic-upload $attic_cache 97 94 98 95 $configs ··· 125 122 $configs | each { |c| 126 123 # simplify for output 127 124 $c.targets | filter { |t| $t.build != null } | each { |t| 128 - { type: $c.type, name: $t.name, output: $t.build.outputs.out.0, branch: $git_branch, repo_url: $repo_url } 125 + { type: $c.type, name: $t.name, output: $t.build.outputs.out.0 } 129 126 } 130 127 } | flatten 131 128 } 132 129 130 + export def get-flake-inputs [] { 131 + nix flake archive --json | from json | get inputs | transpose | select column0 column1.path | each { |c| 132 + { 133 + name: $c.column0, 134 + outPath: $c.column1_path, 135 + drvPath: nul 136 + } 137 + } 138 + } 139 + 133 140 export def post-sower-seeds [--sower-url: string] { 134 141 let configs = $in 135 142 print $"🫱 Giving seeds to sower ($sower_url)" 143 + 144 + let git_branch = get-git-branch 145 + let repo_url = get-repo-url 136 146 137 147 # sower only understands certain build outputs 138 148 $configs | filter { |c| $c.type == "home-manager" or $c.type == "nix-darwin" or $c.type == "nixos" } | each { |c|