forked from Fediversity/Fediversity
34 lines
701 B
Nix
34 lines
701 B
Nix
{
|
|
system ? builtins.currentSystem,
|
|
sources ? import ../npins,
|
|
pkgs ? import sources.nixpkgs { inherit system; },
|
|
}:
|
|
let
|
|
inherit (pkgs) lib;
|
|
setup = pkgs.writeScriptBin "setup" ''
|
|
echo '${lib.strings.toJSON sources}' > .npins.json
|
|
rm -f .terraform.lock.hcl
|
|
rm -rf .terraform/
|
|
tofu init
|
|
'';
|
|
in
|
|
{
|
|
# shell for testing TF directly
|
|
shell = pkgs.mkShellNoCC {
|
|
packages = [
|
|
(import ./tf.nix { inherit lib pkgs; })
|
|
pkgs.jaq
|
|
setup
|
|
];
|
|
};
|
|
|
|
tests = pkgs.callPackage ./tests.nix { };
|
|
|
|
# re-export inputs so they can be overridden granularly
|
|
# (they can't be accessed from the outside any other way)
|
|
inherit
|
|
sources
|
|
system
|
|
pkgs
|
|
;
|
|
}
|