chore(repo): add nix flake dev-shell for development environment

This commit is contained in:
cswimr 2024-11-20 12:22:57 -05:00
parent 901c10a458
commit 216fa74a53
Signed by untrusted user: cswimr
GPG key ID: 0EC431A8DA8F8087
4 changed files with 327 additions and 0 deletions

50
flake.nix Normal file
View file

@ -0,0 +1,50 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
devenv.url = "github:cachix/devenv";
devenv.inputs.nixpkgs.follows = "nixpkgs";
};
nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
};
outputs = { self, nixpkgs, devenv, systems, ... } @ inputs:
let
forEachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
packages = forEachSystem (system: {
devenv-up = self.devShells.${system}.default.config.procfileScript;
devenv-test = self.devShells.${system}.default.config.test;
});
devShells = forEachSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
languages.python = {
enable = true;
package = pkgs.python311;
uv = {
enable = true;
sync = {
enable = true;
allExtras = true;
};
};
};
}
];
};
});
};
}