-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
556fc66
commit 6adfde0
Showing
10 changed files
with
220 additions
and
161 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
File renamed without changes.
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,24 @@ | ||
{ craneLib, lib, openssl, pkg-config }: | ||
|
||
let | ||
|
||
src = lib.sourceByRegex ./.. [ | ||
"Cargo.toml" | ||
"Cargo.lock" | ||
"typhon.*" | ||
"typhon-types.*" | ||
]; | ||
|
||
cargoToml = ../typhon/api-client-test/Cargo.toml; | ||
|
||
cargoExtraArgs = "-p typhon-api-client-test"; | ||
|
||
nativeBuildInputs = [ openssl pkg-config ]; | ||
|
||
cargoArtifacts = craneLib.buildDepsOnly { | ||
inherit src cargoToml cargoExtraArgs nativeBuildInputs; | ||
}; | ||
|
||
in craneLib.buildPackage { | ||
inherit src cargoToml cargoArtifacts cargoExtraArgs nativeBuildInputs; | ||
} |
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,34 @@ | ||
{ typhon, typhon-api-client-test, stdenv, coreutils, bubblewrap, diesel-cli | ||
, pkg-config, sqlite, nix }: | ||
|
||
stdenv.mkDerivation { | ||
name = "Test 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 = [ | ||
typhon-api-client-test | ||
typhon | ||
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,29 @@ | ||
{ rustToolchain, mkShell, rustfmt, rust-analyzer, openssl, bubblewrap | ||
, diesel-cli, pkg-config, sqlite, nix, nodePackages, trunk, nodejs, mdbook }: | ||
|
||
mkShell { | ||
name = "typhon-devshell"; | ||
packages = [ | ||
# Rust | ||
rustToolchain | ||
rustfmt | ||
rust-analyzer | ||
openssl | ||
|
||
# Typhon server | ||
bubblewrap | ||
diesel-cli | ||
pkg-config | ||
sqlite | ||
nix | ||
|
||
# Typhon webapp | ||
nodePackages.sass | ||
trunk | ||
nodejs # npm | ||
|
||
# Documentation | ||
mdbook | ||
]; | ||
DATABASE_URL = "sqlite:typhon.sqlite"; | ||
} |
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,9 @@ | ||
{ stdenv, mdbook }: | ||
|
||
stdenv.mkDerivation { | ||
name = "typhon-doc"; | ||
src = ../doc; | ||
nativeBuildInputs = [ mdbook ]; | ||
buildPhase = "mdbook build"; | ||
installPhase = "cp -r book $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
File renamed without changes.
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 @@ | ||
{ craneLib, lib, sqlite }: | ||
|
||
let | ||
|
||
src = lib.sourceByRegex ./.. [ | ||
"Cargo.toml" | ||
"Cargo.lock" | ||
"typhon.*" | ||
"typhon-types.*" | ||
]; | ||
|
||
cargoToml = ../typhon/Cargo.toml; | ||
|
||
cargoArtifacts = craneLib.buildDepsOnly { inherit src cargoToml; }; | ||
|
||
in craneLib.buildPackage { | ||
inherit src cargoToml cargoArtifacts; | ||
buildInputs = [ sqlite.dev ]; | ||
} |
Oops, something went wrong.