hostapps/flake.nix

94 lines
2.5 KiB
Nix
Raw Normal View History

2022-05-28 14:14:08 -05:00
{
description = "hostapps";
inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs/nixos-unstable";
};
2023-10-30 15:48:40 -05:00
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2022-10-09 09:57:03 -05:00
flake-utils = {
url = "github:numtide/flake-utils";
};
2023-10-29 21:33:23 -05:00
make-shell = {
url = "github:ursi/nix-make-shell";
2023-03-24 10:53:20 -05:00
};
2022-05-28 14:14:08 -05:00
};
2023-10-29 21:33:23 -05:00
outputs = {
self,
nixpkgs,
2023-10-30 15:48:40 -05:00
poetry2nix,
2023-10-29 21:33:23 -05:00
flake-utils,
make-shell,
} @ inputs:
2022-10-09 09:57:03 -05:00
flake-utils.lib.eachDefaultSystem
2023-10-29 21:33:23 -05:00
(
system: let
version = self.lastModifiedDate;
pkgs = import nixpkgs {
inherit system;
2023-10-30 15:48:40 -05:00
config.permittedInsecurePackages = [
"python3.11-requests-2.29.0"
"python3.11-cryptography-40.0.2"
];
2023-10-29 21:33:23 -05:00
};
make-shell = import inputs.make-shell {
inherit system pkgs;
};
2023-10-30 15:48:40 -05:00
inherit (poetry2nix.lib.mkPoetry2Nix {inherit pkgs;}) mkPoetryApplication overrides;
2023-10-29 21:33:23 -05:00
in {
2023-10-30 15:48:40 -05:00
packages.hostapps = mkPoetryApplication {
2023-10-30 13:59:27 -05:00
python = pkgs.python311;
2023-10-29 21:33:23 -05:00
projectDir = ./.;
propagatedBuildInputs = [
2023-10-30 13:59:27 -05:00
pkgs.inetutils
2023-10-29 21:33:23 -05:00
pkgs.openssh
pkgs.sshpass
];
2023-10-30 15:48:40 -05:00
overrides = overrides.withDefaults (
self: super: {
pyansi = super.pyansi.overridePythonAttrs (
old: {
buildInputs = old.buildInputs ++ [self.poetry];
}
);
# annotated-types = super.annotated-types.overridePythonAttrs (
# old: {
# buildInputs = old.buildInputs ++ [self.hatchling];
# }
# );
# pydantic-core = super.pydantic-core.overridePythonAttrs (
# old: {
# buildInputs = old.buildInputs ++ [self.maturin];
# }
# );
}
);
2023-10-29 21:33:23 -05:00
};
defaultPackage = self.packages.${system}.hostapps;
devShells.default = let
python = pkgs.python312.withPackages (
ps:
with ps; [
# poetry-core
]
);
project = "hostapps";
2022-10-09 09:57:03 -05:00
in
2023-10-29 21:33:23 -05:00
make-shell {
packages = [
python
2023-10-30 13:59:27 -05:00
pkgs.inetutils
2022-10-09 09:57:03 -05:00
pkgs.openssh
2023-10-29 21:33:23 -05:00
pkgs.poetry
2023-10-30 13:59:27 -05:00
pkgs.sshpass
2022-10-09 09:57:03 -05:00
];
2023-10-29 21:33:23 -05:00
env = {
NIX_PROJECT = project;
2022-10-09 09:57:03 -05:00
};
2023-10-29 21:33:23 -05:00
};
}
);
2022-05-28 14:14:08 -05:00
}