-
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.
Merge pull request #23 from hasura/samirtalwar/nix-config
Set up a development shell with Nix.
- Loading branch information
Showing
6 changed files
with
145 additions
and
0 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,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
source_env_if_exists ./.envrc.local |
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,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
use flake | ||
|
||
source_env ../.envrc |
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,20 @@ | ||
name: test Nix support | ||
|
||
on: push | ||
|
||
jobs: | ||
evaluate-nix-shell: | ||
name: Evaluate the Nix shell | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Nix ❄ | ||
uses: DeterminateSystems/nix-installer-action@v4 | ||
|
||
- name: Run the Magic Nix Cache 🔌 | ||
uses: DeterminateSystems/magic-nix-cache-action@v2 | ||
|
||
- name: Evaluate the Nix shell | ||
run: nix develop -c "true" |
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 +1,5 @@ | ||
# Rust | ||
/target | ||
|
||
# direnv | ||
/.direnv |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This is used to create a local development shell with Nix, containing all the | ||
# packages used for development. | ||
# | ||
# To use it, install Nix and run `nix develop`. | ||
# | ||
# You can use it with direnv by creating a file called .envrc.local and adding | ||
# the line, `use flake`. | ||
|
||
{ | ||
description = "ndc-sdk"; | ||
|
||
inputs = { | ||
flake-utils.url = github:numtide/flake-utils; | ||
nixpkgs.url = github:NixOS/nixpkgs/master; | ||
}; | ||
|
||
outputs = | ||
{ self | ||
, flake-utils | ||
, nixpkgs | ||
}: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { inherit system; }; | ||
in | ||
{ | ||
devShells.default = pkgs.mkShell { | ||
nativeBuildInputs = [ | ||
pkgs.cargo | ||
pkgs.cargo-edit | ||
pkgs.cargo-machete | ||
pkgs.clippy | ||
pkgs.rust-analyzer | ||
pkgs.rustPlatform.rustcSrc | ||
pkgs.rustc | ||
pkgs.rustfmt | ||
]; | ||
|
||
buildInputs = pkgs.lib.optionals pkgs.stdenv.isDarwin [ | ||
pkgs.darwin.apple_sdk.frameworks.Security | ||
pkgs.libiconv | ||
] | ||
|
||
++ pkgs.lib.optionals pkgs.stdenv.isLinux [ | ||
pkgs.pkg-config | ||
pkgs.openssl | ||
]; | ||
}; | ||
|
||
formatter = pkgs.nixpkgs-fmt; | ||
}); | ||
} |