mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 21:35:37 +00:00
51 lines
1.2 KiB
Nix
51 lines
1.2 KiB
Nix
{
|
|
description = "Python project flake";
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
|
poetry2nix.url = "github:nix-community/poetry2nix";
|
|
};
|
|
outputs =
|
|
{ nixpkgs, poetry2nix, ... }:
|
|
let
|
|
projectDir = ./.;
|
|
supportedSystems = [
|
|
"x86_64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-linux"
|
|
"aarch64-darwin"
|
|
];
|
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
|
in
|
|
{
|
|
packages = forAllSystems (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [ poetry2nix.overlays.default ];
|
|
};
|
|
in
|
|
{
|
|
default = pkgs.poetry2nix.mkPoetryApplication { inherit projectDir; };
|
|
}
|
|
);
|
|
devShells = forAllSystems (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [ poetry2nix.overlays.default ];
|
|
};
|
|
in
|
|
{
|
|
default = pkgs.mkShell {
|
|
buildInputs = [
|
|
(pkgs.poetry2nix.mkPoetryEnv { inherit projectDir; })
|
|
pkgs.poetry
|
|
];
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|