diff options
| author | seth <[email protected]> | 2024-01-26 05:43:47 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2024-01-26 05:43:47 -0500 |
| commit | 90c83b4694150bdcfe4fcac1c55fcfdef17c3612 (patch) | |
| tree | 74f3a8d9cac0b972fc7e50fdcf2403f60e39795e /test | |
initial commit
Diffstat (limited to 'test')
| -rw-r--r-- | test/flake.lock | 64 | ||||
| -rw-r--r-- | test/flake.nix | 55 |
2 files changed, 119 insertions, 0 deletions
diff --git a/test/flake.lock b/test/flake.lock new file mode 100644 index 0000000..cd4bda2 --- /dev/null +++ b/test/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "call-flake": { + "locked": { + "lastModified": 1705800408, + "narHash": "sha256-bmhE1TmrJG4ba93l9WQTLuYM53kwGQAjYHRvHOeuxWU=", + "owner": "divnix", + "repo": "call-flake", + "rev": "d3327852c5de242e340cb0fd798807c5258e28cc", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "call-flake", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1706173671, + "narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4fddc9be4eaf195d631333908f2a454b03628ee5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704982712, + "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "root": { + "inputs": { + "call-flake": "call-flake", + "nixpkgs": "nixpkgs", + "parts": "parts" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/test/flake.nix b/test/flake.nix new file mode 100644 index 0000000..bb8ff4c --- /dev/null +++ b/test/flake.nix @@ -0,0 +1,55 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + + call-flake.url = "github:divnix/call-flake"; + }; + + outputs = inputs: + inputs.parts.lib.mkFlake {inherit inputs;} { + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + + imports = [(inputs.call-flake ../.).flakeModule]; + + debug = true; + + perSystem = { + config, + lib, + pkgs, + ... + }: { + procfiles.daemons.processes = { + redis = lib.getExe' pkgs.redis "redis-server"; + }; + + devShells.default = pkgs.mkShellNoCC { + packages = [ + (pkgs.writeShellScriptBin "run-ci" '' + set -x + + exec ${lib.getExe config.procfiles.daemons.package} & + sleep 5 # avoid race conditions + + if ! overmind status | grep running; then + echo "Processes failed to launch! Exiting with error" + overmind kill + exit 1 + fi + + overmind kill + echo "Process finished! Exiting as success" + '') + ]; + }; + }; + }; +} |
