frontpage/flake.nix

55 lines
1.6 KiB
Nix
Raw Normal View History

2022-09-03 14:33:33 +10:00
{
description = "Application packaged using poetry2nix";
inputs.flake-utils.url = "github:numtide/flake-utils";
2023-06-01 10:48:13 +10:00
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
2022-09-03 14:33:33 +10:00
inputs.poetry2nix.url = "github:nix-community/poetry2nix";
outputs = { self, nixpkgs, flake-utils, poetry2nix }: {
overlay = nixpkgs.lib.composeManyExtensions [
poetry2nix.overlay
(final: prev: {
2022-12-07 13:06:25 +11:00
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" ]));
};
2022-09-03 14:33:33 +10:00
})
];
2022-11-02 10:48:50 +11:00
nixosModules = rec {
default = frontpage;
frontpage = import ./nixos;
};
2022-09-03 14:33:33 +10:00
} // (flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; }; in
{
apps = {
2023-06-01 10:48:13 +10:00
default = pkgs.frontpage;
2022-09-03 14:33:33 +10:00
frontpage = pkgs.frontpage;
};
devShell = (pkgs.poetry2nix.mkPoetryEnv {
python = pkgs.python39;
projectDir = ./.;
extraPackages = ps: [ ps.python-lsp-server ];
}).env;
2023-06-01 10:48:13 +10:00
packages = {
default = pkgs.frontpage;
frontpage = pkgs.frontpage;
};
2022-09-03 14:33:33 +10:00
}));
}