Skip to content

chore: add flake.nix - #113

Open
ggreif wants to merge 3 commits into
masterfrom
gabor/flake
Open

chore: add flake.nix#113
ggreif wants to merge 3 commits into
masterfrom
gabor/flake

Conversation

@ggreif

Copy link
Copy Markdown
Contributor

build with

nix build

run like

result/bin/ic-repl --help

build with
```
nix build
```
run like
```
result/bin/ic-repl --help
```
@ggreif
ggreif requested a review from a team as a code ownerMay 15, 2025 07:40
@ggreif
ggreif requested a review from basvandijkMay 15, 2025 07:40

@basvandijkbasvandijk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Comment threadflake.nix
nixpkgs,
rust-overlay,
}: let
system = "aarch64-darwin";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also consider using flake-utils like we do in motoko to support all common systems.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, gonna cross-study. I am at present just copying the ggreif/sdk flake recipe!

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't get nix develop working yet! Any idea what I am getting wrong?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You correctly added a devShells.${system}.default so that''s good. What error are you getting?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also seems you're using pkgs.mkShell correctly.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ nix develop
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'nix-shell'
whose name attribute is located at /nix/store/x9wnkly3k1gkq580m90jjn32q9f05q2v-source/pkgs/stdenv/generic/make-derivation.nix:439:13
… while evaluating attribute '__impureHostDeps' of derivation 'nix-shell'
at /nix/store/x9wnkly3k1gkq580m90jjn32q9f05q2v-source/pkgs/stdenv/generic/make-derivation.nix:579:15:
578| );
579| __impureHostDeps =
| ^
580| computedImpureHostDeps
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: opening file '/nix/store/jwjajnviyim6mzpsbdwin496gv88x04b-source/rust-toolchain.toml': No such file or directory

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this dev-dependency needs to be declared?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means you didn't add rust-toolchain.toml to git.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there is no such file. Maybe later. Kind-of negates devShell, but no biggie.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ggreif@basvandijk