frontpage/flake.nix
2022-11-02 10:52:42 +11:00

39 lines
1.0 KiB
Nix

{
description = "Application packaged using poetry2nix";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
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 = ./.;
};
})
];
nixosModules = rec {
default = frontpage;
frontpage = import ./nixos;
};
} // (flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; }; in
{
apps = {
frontpage = pkgs.frontpage;
};
defaultApp = pkgs.frontpage;
devShell = (pkgs.poetry2nix.mkPoetryEnv {
python = pkgs.python39;
projectDir = ./.;
extraPackages = ps: [ ps.python-lsp-server ];
}).env;
}));
}