-
-
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
50cb830
commit a84d64d
Showing
39 changed files
with
396 additions
and
277 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 |
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 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,71 @@ | ||
{ | ||
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 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 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 |
---|---|---|
@@ -1,42 +1,41 @@ | ||
{ | ||
bubblewrap, | ||
diesel-cli, | ||
mdbook, | ||
mkShell, | ||
nix, | ||
nodePackages, | ||
nodejs, | ||
openssl, | ||
pkg-config, | ||
rust-analyzer, | ||
rustToolchain, | ||
rustfmt, | ||
sqlite, | ||
trunk, | ||
sources ? import ./sources.nix, | ||
system ? builtins.currentSystem or "unknown-system", | ||
pkgs ? import ./nixpkgs.nix {inherit sources system;}, | ||
rust ? import ./rust.nix {inherit sources system;}, | ||
}: | ||
mkShell { | ||
pkgs.mkShell { | ||
name = "typhon-devshell"; | ||
packages = [ | ||
packages = builtins.attrValues { | ||
# Rust | ||
rustToolchain | ||
rustfmt | ||
rust-analyzer | ||
openssl | ||
inherit (rust) rustToolchain; | ||
inherit | ||
(pkgs) | ||
rustfmt | ||
rust-analyzer | ||
openssl | ||
; | ||
|
||
# Typhon server | ||
bubblewrap | ||
diesel-cli | ||
pkg-config | ||
sqlite | ||
nix | ||
inherit | ||
(pkgs) | ||
bubblewrap | ||
diesel-cli | ||
pkg-config | ||
sqlite | ||
nix | ||
; | ||
|
||
# Typhon webapp | ||
nodePackages.sass | ||
trunk | ||
nodejs # npm | ||
inherit (pkgs.nodePackages) sass; | ||
inherit | ||
(pkgs) | ||
trunk | ||
nodejs # npm | ||
; | ||
|
||
# Documentation | ||
mdbook | ||
]; | ||
inherit (pkgs) mdbook; | ||
}; | ||
DATABASE_URL = "sqlite:typhon.sqlite"; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.