[misc] add helper to import contract
This commit is contained in:
parent
90f625fca0
commit
22b0bfae75
2 changed files with 13 additions and 9 deletions
|
|
@ -35,6 +35,14 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
importContract = module:
|
||||||
|
let
|
||||||
|
importedModule = pkgs.callPackage module {};
|
||||||
|
in
|
||||||
|
mkContractFunctions {
|
||||||
|
inherit (importedModule) mkRequest mkResult;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit mkContractFunctions;
|
inherit mkContractFunctions;
|
||||||
|
|
@ -42,7 +50,7 @@ in
|
||||||
databasebackup = import ./databasebackup.nix { inherit lib; };
|
databasebackup = import ./databasebackup.nix { inherit lib; };
|
||||||
backup = import ./backup.nix { inherit lib; };
|
backup = import ./backup.nix { inherit lib; };
|
||||||
mount = import ./mount.nix { inherit lib; };
|
mount = import ./mount.nix { inherit lib; };
|
||||||
secret = import ./secret.nix { inherit pkgs lib; };
|
secret = importContract ./secret.nix;
|
||||||
ssl = import ./ssl.nix { inherit lib; };
|
ssl = import ./ssl.nix { inherit lib; };
|
||||||
test = {
|
test = {
|
||||||
secret = import ./secret/test.nix { inherit pkgs lib; };
|
secret = import ./secret/test.nix { inherit pkgs lib; };
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
{ pkgs, lib, ... }:
|
{ lib, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib) concatStringsSep literalMD mkOption optionalAttrs optionalString;
|
inherit (lib) concatStringsSep literalMD mkOption optionalAttrs optionalString;
|
||||||
inherit (lib.types) anything listOf submodule str;
|
inherit (lib.types) listOf submodule str;
|
||||||
|
in
|
||||||
contractsLib = import ./default.nix { inherit pkgs lib; };
|
{
|
||||||
|
|
||||||
mkRequest =
|
mkRequest =
|
||||||
{ mode ? "0400",
|
{ mode ? "0400",
|
||||||
owner ? "root",
|
owner ? "root",
|
||||||
|
|
@ -109,7 +108,4 @@ let
|
||||||
path = pathText;
|
path = pathText;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
in
|
|
||||||
contractsLib.mkContractFunctions {
|
|
||||||
inherit mkRequest mkResult;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue