tasks/update: Manage filesystem artifacts
This commit is contained in:
parent
eb455e4941
commit
bad63ce0c2
3 changed files with 14 additions and 9 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,8 +1,3 @@
|
|||
# Local configuration
|
||||
local/
|
||||
*.local.nix
|
||||
|
||||
# Package updates
|
||||
/packages/*.cmp
|
||||
/*.log
|
||||
/update-git-commits.txt
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
# Used by ./tasks/update
|
||||
{}: import <nixpkgs> { overlays = [ (import ./common/packages.nix) ]; }
|
16
tasks/update
16
tasks/update
|
@ -1,12 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
# See https://discourse.nixos.org/t/25274
|
||||
set -Eeu
|
||||
|
||||
root="$(readlink --canonicalize -- "$(dirname -- "$0")/..")"
|
||||
nixpkgs="$(nix-instantiate --eval --expr '<nixpkgs>')"
|
||||
|
||||
exec nix-shell "$nixpkgs/maintainers/scripts/update.nix" \
|
||||
# Mock nixpkgs
|
||||
trap 'rm -f "$root/default.nix"' EXIT; cat > "$root/default.nix" << NIX
|
||||
{}: import <nixpkgs> { overlays = [ (import ./common/packages.nix) ]; }
|
||||
NIX
|
||||
|
||||
# Run update scripts
|
||||
nixpkgs="$(nix-instantiate --eval --expr '<nixpkgs>')"
|
||||
nix-shell "$nixpkgs/maintainers/scripts/update.nix" \
|
||||
--arg include-overlays "(import $root { }).overlays" \
|
||||
--arg predicate "(
|
||||
let prefix = \"$root/packages/\"; prefixLen = builtins.stringLength prefix;
|
||||
in (_: p: (builtins.substring 0 prefixLen p.meta.position) == prefix)
|
||||
)"
|
||||
|
||||
# Clean up
|
||||
if [[ -f "$root/update-git-commits.txt" ]]; then
|
||||
cat "$root/update-git-commits.txt" && rm "$root/update-git-commits.txt"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue