-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc21311
commit 45cc7d8
Showing
45 changed files
with
433 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
( | ||
import | ||
( | ||
let | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
in | ||
fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; | ||
} | ||
) | ||
{src = ./.;} | ||
) | ||
.defaultNix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(import ../nix/devshells.nix {}).doc |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
sources ? import ../sources.nix, | ||
system ? builtins.currentSystem or "unknown-system", | ||
pkgs ? import ../nixpkgs.nix {inherit sources system;}, | ||
rust ? import ../rust.nix {inherit sources system;}, | ||
}: let | ||
inherit (pkgs) lib; | ||
|
||
inherit (rust) craneLib; | ||
|
||
src = lib.sourceByRegex ../.. [ | ||
"Cargo.toml" | ||
"Cargo.lock" | ||
"typhon.*" | ||
]; | ||
|
||
cargoToml = ../../typhon-api-client-test/Cargo.toml; | ||
|
||
cargoExtraArgs = "-p typhon-api-client-test"; | ||
|
||
nativeBuildInputs = [ | ||
pkgs.openssl | ||
pkgs.pkg-config | ||
]; | ||
|
||
cargoArtifacts = craneLib.buildDepsOnly { | ||
inherit | ||
src | ||
cargoToml | ||
cargoExtraArgs | ||
nativeBuildInputs | ||
; | ||
}; | ||
|
||
typhon-api-client-test = craneLib.buildPackage { | ||
inherit | ||
src | ||
cargoToml | ||
cargoArtifacts | ||
cargoExtraArgs | ||
nativeBuildInputs | ||
; | ||
}; | ||
|
||
typhon = import ../packages/server.nix {inherit sources system;}; | ||
in | ||
pkgs.stdenv.mkDerivation { | ||
name = "test-typhon-api"; | ||
phases = ["configurePhase" "installPhase"]; | ||
DATABASE_URL = "/tmp/typhon.sqlite"; | ||
configurePhase = '' | ||
export HOME=$(mktemp -d) | ||
mkdir -p ~/.config/nix | ||
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf | ||
''; | ||
installPhase = '' | ||
# start Typhon server | ||
typhon -p $(echo -n password | sha256sum | head -c 64) -j null -w "" & | ||
sleep 1 | ||
# run the test client | ||
PROJECT_DECL="path:${../../tests/empty}" typhon-api-client-test | ||
# kill the server and creates $out | ||
kill %1 && touch $out | ||
''; | ||
nativeBuildInputs = builtins.attrValues { | ||
inherit | ||
typhon | ||
typhon-api-client-test | ||
; | ||
inherit | ||
(pkgs) | ||
coreutils | ||
bubblewrap | ||
diesel-cli | ||
pkg-config | ||
sqlite | ||
nix | ||
; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
sources ? import ../sources.nix, | ||
system ? builtins.currentSystem or "unknown-system", | ||
}: { | ||
api = import ./api.nix {inherit sources system;}; | ||
formatted = import ./formatted.nix {inherit sources system;}; | ||
nixos = import ./nixos.nix {inherit sources system;}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
sources ? import ../sources.nix, | ||
system ? builtins.currentSystem or "unknown-system", | ||
pkgs ? import ../nixpkgs.nix {inherit sources system;}, | ||
rust ? import ../rust.nix {inherit sources system;}, | ||
}: | ||
pkgs.stdenv.mkDerivation { | ||
name = "formatted"; | ||
src = ../..; | ||
nativeBuildInputs = [ | ||
pkgs.alejandra | ||
rust.rustToolchain | ||
]; | ||
buildPhase = '' | ||
alejandra -c . | ||
cargo fmt --check | ||
''; | ||
installPhase = "touch $out"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.