Skip to content

Commit

Permalink
Add experimental nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekker1 committed Dec 6, 2023
1 parent 6b61953 commit 6364612
Show file tree
Hide file tree
Showing 2 changed files with 209 additions and 0 deletions.
175 changes: 175 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
description = "Application packaged using poetry2nix";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, flake-utils, poetry2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication mkPoetryEditablePackage;
in
{
packages = {
minizinc-python = mkPoetryApplication { projectDir = self; };
minizinc-python-dev = mkPoetryApplication {
projectDir = self;
groups = [ "dev" "test" ];
};
default = self.packages.${system}.minizinc-python;
};

devShells.default = pkgs.mkShell {
inputsFrom = [ self.packages.${system}.minizinc-python-dev ];
packages = [ pkgs.poetry ];
};
});
}

0 comments on commit 6364612

Please sign in to comment.