Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: nix dev shell #1160

Merged
merged 7 commits into from Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,9 @@
/.vagga
/target
.vscode
.idea
.idea

# Nix
result
.direnv
.envrc
109 changes: 109 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions flake.nix
@@ -0,0 +1,48 @@
{
description = "The EdgeDB CLI";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";

# provides rust toolchain
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-analyzer-src.follows = "";
};

edgedb = {
url = "github:edgedb/packages-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
};

outputs = inputs@{ flake-parts, fenix, edgedb, ... }:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "x86_64-darwin"];
perSystem = { config, system, pkgs, ... }:
let
fenix_pkgs = fenix.packages.${system};

rustToolchain = (fenix_pkgs.complete.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
"rust-analyzer"
]);

in {
devShells.default = pkgs.mkShell {
buildInputs = [
rustToolchain

# needed for running tests
edgedb.packages.${system}.edgedb-server
];
};
};
};
}
3 changes: 3 additions & 0 deletions tests/.gitignore
Expand Up @@ -10,3 +10,6 @@
/migrations/db4/created1/00002.edgeql
/migrations/db1/project/priv/dbschema/migrations/00002.edgeql
/migrations/db1/project/priv/dbschema/migrations/00003.edgeql
/migrations/db1/squash
/migrations/db4/created1/migrations/00002.edgeql
/migrations/db4/modified1/migrations/00001.edgeql