Shrink the flake to a more usable size

This commit is contained in:
Andreas Zweili 2022-11-16 21:33:49 +01:00
parent c56b51ebd3
commit cba8690ea9
2 changed files with 26 additions and 37 deletions

View File

@ -46,12 +46,25 @@
"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": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1668394823,
@ -62,9 +75,8 @@
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
"id": "poetry2nix",
"type": "indirect"
}
},
"root": {

View File

@ -2,46 +2,23 @@
description = "A Python API for various tools I use at work.";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
flake-utils = {
url = github:numtide/flake-utils;
};
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = github:numtide/flake-utils;
};
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:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
pkgs = nixpkgs.legacyPackages.${system};
in
{
apps = {
network_inventory = pkgs.network_inventory;
};
defaultApp = pkgs.network_inventory;
devShell = pkgs.mkShell {
buildInputs = [
pkgs.gnumake
pkgs.python39
pkgs.python39Packages.poetry
pkgs.network_inventory
];
};
}));
shellHook = ''
export DJANGO_SETTINGS_MODULE=network_inventory.settings.local
'';
});
}