add nix flake
All checks were successful
Actions / Build (push) Successful in 13s
Actions / Lint with Ruff, Pylint, & MyPy (push) Successful in 24s
Actions / Build Documentation (push) Successful in 27s

This commit is contained in:
cswimr 2024-12-08 09:39:53 -05:00
parent 84ef67b69f
commit 317de057fc
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
5 changed files with 400 additions and 1 deletions

65
flake.nix Normal file
View file

@ -0,0 +1,65 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
uv.url = "github:MisileLab/nixpkgs?rev=fc8245f8b056d2a26680ea12ffea37981f1681ce";
nixpkgs-python.url = "github:cachix/nixpkgs-python";
nixpkgs-python.inputs = {
nixpkgs.follows = "nixpkgs";
};
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};
uvPkgs = inputs.uv.legacyPackages.${system};
in
{
default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
languages.python = {
enable = true;
version = "3.11";
uv = {
enable = true;
package = uvPkgs.uv;
sync = {
enable = true;
allExtras = true;
};
};
};
}
];
};
}
);
};
}