network_inventory/flake.nix

40 lines
1.4 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 = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
2022-01-31 19:27:53 +01:00
flake-utils = {
url = github:numtide/flake-utils;
};
mach-nix = {
2022-02-04 09:58:42 +01:00
url = "mach-nix/3.4.0";
2022-01-31 19:27:53 +01:00
};
2021-12-08 18:07:49 +01:00
};
2022-01-31 19:27:53 +01:00
outputs = { self, nixpkgs, flake-utils, mach-nix, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
2021-12-08 18:07:49 +01:00
let
pkgs = nixpkgs.legacyPackages.${system};
2022-01-31 19:27:53 +01:00
machNix = mach-nix.lib."${system}";
local_requirements = builtins.readFile ./requirements/local.txt;
2021-12-08 18:07:49 +01:00
in
2022-01-31 19:27:53 +01:00
{
devShell = machNix.mkPythonShell {
packagesExtra = with pkgs; [ pkgs.gnumake ];
requirements = local_requirements;
_.pytest-cov.propagatedBuildInputs.mod = pySelf: self: oldVal: oldVal ++ [ pySelf.tomli ];
};
packages.venv = machNix.mkPython {
requirements = local_requirements;
2022-01-31 19:35:08 +01:00
_.pytest-cov.propagatedBuildInputs.mod = pySelf: self: oldVal: oldVal ++ [ pySelf.tomli ];
2021-12-08 18:07:49 +01:00
};
2022-02-02 10:41:56 +01:00
defaultPackage = (machNix.mkDockerImage {
packagesExtra = with pkgs; [ pkgs.bash ];
2022-02-01 17:56:02 +01:00
requirements = builtins.readFile ./requirements/docker.txt;
_.pytest-cov.propagatedBuildInputs.mod = pySelf: self: oldVal: oldVal ++ [ pySelf.tomli ];
2022-02-02 10:41:56 +01:00
}).override (oldAttrs: {
name = "network-inventory";
2022-02-02 13:17:51 +01:00
config.Cmd = [ "run.sh" ];
2022-02-02 10:41:56 +01:00
});
2021-12-08 18:07:49 +01:00
});
}