Merge branch 'poetry' of github.com:Nebucatnetzer/network_inventory into poetry

This commit is contained in:
Andreas Zweili 2022-11-17 18:13:57 +01:00
commit f2741061b3
2 changed files with 7 additions and 64 deletions

View File

@ -15,21 +15,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1668189330, "lastModified": 1668189330,
@ -46,32 +31,10 @@
"type": "github" "type": "github"
} }
}, },
"poetry2nix": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1668394823,
"narHash": "sha256-UJqW+Zp1boVhTKfWel2WTi7Qn0R9hfpVeSRdJYPJwXQ=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "3cc82ca6ccca2a06dbb05cb0b74efd5d50e60d48",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs"
"poetry2nix": "poetry2nix"
} }
} }
}, },

View File

@ -5,43 +5,23 @@
flake-utils = { flake-utils = {
url = github:numtide/flake-utils; url = github:numtide/flake-utils;
}; };
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, flake-utils, poetry2nix }: outputs = { self, nixpkgs, flake-utils }:
{ flake-utils.lib.eachDefaultSystem (system:
# 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:
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ self.overlay ];
}; };
in in
{ {
apps = {
network_inventory = pkgs.network_inventory;
};
defaultApp = pkgs.network_inventory;
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
buildInputs = [ buildInputs = [
pkgs.gnumake pkgs.gnumake
(pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;
})
pkgs.python39Packages.poetry pkgs.python39Packages.poetry
pkgs.network_inventory
]; ];
}; };
})); });
} }