build: Add Nix files
This commit is contained in:
committed by
yangliwei
parent
898ca877e9
commit
10efdad45f
62
flake.nix
Normal file
62
flake.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
systems.url = "github:nix-systems/default";
|
||||
devenv.url = "github:cachix/devenv";
|
||||
nixpkgs-python = {
|
||||
url = "github:cachix/nixpkgs-python";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
devenv,
|
||||
systems,
|
||||
...
|
||||
} @ inputs: let
|
||||
forEachSystem = nixpkgs.lib.genAttrs (import systems);
|
||||
in {
|
||||
# packages = forEachSystem (system: {
|
||||
# default =
|
||||
# nixpkgs.legacyPackages.${system}.poetry2nix.mkPoetryApplication
|
||||
# {
|
||||
# projectDir = self;
|
||||
# preferWheels = true;
|
||||
# };
|
||||
# });
|
||||
|
||||
devShells =
|
||||
forEachSystem
|
||||
(system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
default = devenv.lib.mkShell {
|
||||
inherit inputs pkgs;
|
||||
|
||||
modules = [
|
||||
{
|
||||
packages = with pkgs; [pre-commit poethepoet stdenv.cc.cc.lib];
|
||||
|
||||
languages.python = {
|
||||
enable = true;
|
||||
# poetry = {
|
||||
# enable = true;
|
||||
# install.enable = true;
|
||||
# install.groups = ["dev" "tests"];
|
||||
# install.allExtras = true;
|
||||
# };
|
||||
version = "3.11";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
nixConfig = {
|
||||
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
|
||||
extra-substituters = "https://devenv.cachix.org";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user