55 lines
1.6 KiB
Nix
55 lines
1.6 KiB
Nix
{
|
|
description = "Application packaged using poetry2nix";
|
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
|
inputs.poetry2nix.url = "github:nix-community/poetry2nix";
|
|
|
|
outputs = { self, nixpkgs, flake-utils, poetry2nix }: {
|
|
overlay = nixpkgs.lib.composeManyExtensions [
|
|
poetry2nix.overlay
|
|
(final: prev: {
|
|
frontpage = prev.poetry2nix.mkPoetryApplication
|
|
{
|
|
python = prev.python39;
|
|
projectDir = ./.;
|
|
overrides =
|
|
prev.poetry2nix.overrides.withDefaults (final_: prev_:
|
|
nixpkgs.lib.listToAttrs
|
|
(builtins.map
|
|
(name: {
|
|
inherit name;
|
|
value = prev_."${name}".overridePythonAttrs (old: {
|
|
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ final_.setuptools ];
|
|
});
|
|
})
|
|
[ "beaker" "flask-pyoidc-oda" "oic" ]));
|
|
};
|
|
})
|
|
];
|
|
|
|
nixosModules = rec {
|
|
default = frontpage;
|
|
frontpage = import ./nixos;
|
|
};
|
|
} // (flake-utils.lib.eachDefaultSystem (system:
|
|
let pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; }; in
|
|
{
|
|
apps = {
|
|
default = pkgs.frontpage;
|
|
frontpage = pkgs.frontpage;
|
|
};
|
|
|
|
devShell = (pkgs.poetry2nix.mkPoetryEnv {
|
|
python = pkgs.python39;
|
|
projectDir = ./.;
|
|
extraPackages = ps: [ ps.python-lsp-server ];
|
|
}).env;
|
|
|
|
packages = {
|
|
default = pkgs.frontpage;
|
|
frontpage = pkgs.frontpage;
|
|
};
|
|
}));
|
|
}
|