Skip to content

Instantly share code, notes, and snippets.

@steshaw
Created May 17, 2023 00:37
Show Gist options
  • Save steshaw/259c79d2a1574b6b99f0e24387ea0126 to your computer and use it in GitHub Desktop.
Save steshaw/259c79d2a1574b6b99f0e24387ea0126 to your computer and use it in GitHub Desktop.
{
description = "Application packaged using poetry2nix";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
# see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication;
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages = {
myapp = mkPoetryApplication { projectDir = self; };
default = self.packages.${system}.myapp;
};
devShells.default = pkgs.mkShell {
packages = [ poetry2nix.packages.${system}.poetry ];
};
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment