Revert "Shrink the flake to a more usable size"

This reverts commit cba8690ea9.
This commit is contained in:
Andreas Zweili 2022-11-16 22:31:34 +01:00
parent 4c7375cd09
commit 6e87a7a7da
2 changed files with 37 additions and 26 deletions

View File

@ -46,25 +46,12 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1668629939,
"narHash": "sha256-MEh5T0wZ1oaoUn84odShFvIObwSIbZ+NEZ5Q2ff83nc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b85c2a060f6223e869493a8397ca47223ee2458a",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"poetry2nix": { "poetry2nix": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2" "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1668394823, "lastModified": 1668394823,
@ -75,8 +62,9 @@
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "poetry2nix", "owner": "nix-community",
"type": "indirect" "repo": "poetry2nix",
"type": "github"
} }
}, },
"root": { "root": {

View File

@ -2,23 +2,46 @@
description = "A Python API for various tools I use at work."; description = "A Python API for various tools I use at work.";
inputs = { inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05; nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
flake-utils.url = github:numtide/flake-utils; 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, poetry2nix }:
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 = nixpkgs.legacyPackages.${system}; pkgs = import nixpkgs {
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.python39
pkgs.python39Packages.poetry pkgs.python39Packages.poetry
pkgs.network_inventory
]; ];
}; };
shellHook = '' }));
export DJANGO_SETTINGS_MODULE=network_inventory.settings.local
'';
});
} }