Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mikroskeem committed Apr 13, 2022
1 parent 14737f5 commit 085f635
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions prefetch-sri.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
url="${1}"

output="$(nix-prefetch-url --type sha256 "${url}")"
sri="$(nix hash to-sri --type sha256 "${output}")"
echo "${sri}"
15 changes: 15 additions & 0 deletions trace-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

flake="$(pwd)"
drv="./test.nix"

nix-instantiate --dry-run --arg flakePath "${flake:-null}" --arg drvPath "./test.nix" -E '
{ flakePath, drvPath }:
let
flake = if flakePath != null then builtins.getFlake (toString flakePath) else null;
pkgs = import (flake.inputs.nixpkgs or <nixpkgs>) { };
traced = import ./lib/traced-fetchers.nix { inherit pkgs; };
in
traced.callPackage drvPath { }
'

0 comments on commit 085f635

Please sign in to comment.