-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: use
devenv
to create a shell environment
Devenv[^1] is tool to create easily composable development environments for nix. Hooking it in to our nix flake gives us the following improvements: - more declarative python environment config - avoid the `patchElf` hack to pull in native dependencies - python packages updates won't undo the effect of `patchElf` - due to a long-standing bug[^2], a patched `devenv` version is needed The `.devenv` directory is pre-created because of a quirk: it needs to be present in the `src` derivation of `shell.nix`, otherwise it is unable to create it due to a permission error. [^1]: https://devenv.sh/ [^2]: cachix/devenv-nixpkgs#2
- Loading branch information
Showing
8 changed files
with
678 additions
and
52 deletions.
There are no files selected for viewing
Empty file.
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,4 @@ | ||
watch_file flake.nix flake.lock devenv.nix | ||
use nix \ | ||
--option extra-substituters "https://unblob.cachix.org" \ | ||
--option extra-trusted-public-keys "unblob.cachix.org-1:5kWA6DwOg176rSqU8TOTBXWxsDB4LoCMfGfTgL5qCAE=" |
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
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 |
---|---|---|
|
@@ -9,3 +9,5 @@ build/ | |
.coverage* | ||
/.venv/ | ||
unblob.log | ||
/.devenv | ||
/.direnv |
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,24 @@ | ||
{ pkgs, ... }: | ||
|
||
# https://devenv.sh/reference/options/ | ||
{ | ||
languages.python = { | ||
enable = true; | ||
libraries = with pkgs; [ | ||
file # python-magic | ||
]; | ||
poetry = { | ||
enable = true; | ||
activate.enable = true; | ||
install.enable = true; | ||
install = { | ||
groups = [ "dev" ]; | ||
installRootPackage = true; | ||
}; | ||
}; | ||
}; | ||
|
||
packages = with pkgs; [ | ||
nvfetcher | ||
] ++ unblob.runtimeDeps; | ||
} |
Oops, something went wrong.