Skip to content

Commit

Permalink
build: nix dev shell (#1160)
Browse files Browse the repository at this point in the history
Co-authored-by: Aljaž Mur Eržen <aljaz@edgedb.com>
  • Loading branch information
MrFoxPro and aljazerzen committed Mar 7, 2024
1 parent d8c8097 commit 743c571
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 1 deletion.
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

0 comments on commit 743c571

Please sign in to comment.