Merge pull request #2105 from hannobraun/nix

Add configuration for developing on NixOS
This commit is contained in:
Hanno Braun 2023-11-22 17:32:43 +01:00 committed by GitHub
commit 0eb391540d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View File

@ -7,5 +7,6 @@
"rust-analyzer.diagnostics.disabled": [
"mismatched-arg-count"
],
"rust-analyzer.check.command": "clippy"
"rust-analyzer.check.command": "clippy",
"nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix"
}

22
shell.nix Normal file
View File

@ -0,0 +1,22 @@
# Defines an environment for `nix-shell` for developing Fornjot on NixOS.
#
# This is not complete, and probably not the correct NixOS way to do it either.
# It's just what works for me (@hannobraun) in combination with my local
# environment. Pull requests to improve this (best coupled with thorough
# explanations, because I understand very little about Nix/NixOS) welcome!
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
packages = with pkgs; [
# Used as a local build tool.
just
# Required by dependencies.
openssl
pkg-config
];
# Otherwise `export-validator` produces an error trying to link `libstdc++`.
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";
}