network_inventory/flake.nix

48 lines
1.2 KiB
Nix
Raw Normal View History

2021-12-08 18:07:49 +01:00
{
description = "A Python API for various tools I use at work.";
inputs = {
2022-11-13 17:51:09 +01:00
nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
2022-01-31 19:27:53 +01:00
flake-utils = {
url = github:numtide/flake-utils;
};
2022-11-15 22:04:13 +01:00
poetry2nix = {
url = "github:nix-community/poetry2nix";
2022-08-29 17:44:26 +02:00
inputs.nixpkgs.follows = "nixpkgs";
2022-01-31 19:27:53 +01:00
};
2021-12-08 18:07:49 +01:00
};
2022-11-15 22:04:13 +01:00
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
{
# Nixpkgs overlay providing the application
overlay = nixpkgs.lib.composeManyExtensions [
poetry2nix.overlay
(final: prev: {
# The application
network_inventory = prev.poetry2nix.mkPoetryApplication {
projectDir = ./.;
};
})
];
} // (flake-utils.lib.eachDefaultSystem (system:
2021-12-08 18:07:49 +01:00
let
2022-11-15 22:04:13 +01:00
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
2022-03-01 09:56:58 +01:00
in
{
2022-11-15 22:04:13 +01:00
apps = {
network_inventory = pkgs.network_inventory;
};
defaultApp = pkgs.network_inventory;
2022-03-01 09:56:58 +01:00
devShell = pkgs.mkShell {
buildInputs = [
pkgs.gnumake
2022-11-15 22:04:13 +01:00
pkgs.python39Packages.poetry
pkgs.network_inventory
2022-03-01 09:56:58 +01:00
];
2021-12-08 18:07:49 +01:00
};
2022-11-15 22:04:13 +01:00
}));
2021-12-08 18:07:49 +01:00
}