89 lines
2.8 KiB
Nix
89 lines
2.8 KiB
Nix
{
|
|
description = "hostapps";
|
|
inputs = {
|
|
nixpkgs = {
|
|
url = "github:nixos/nixpkgs/nixos-unstable";
|
|
};
|
|
flake-utils = {
|
|
url = "github:numtide/flake-utils";
|
|
};
|
|
bash = {
|
|
url = "git+https://git.ocjtech.us/jeff/nixos-bash-prompt-builder.git";
|
|
};
|
|
};
|
|
outputs = { self, nixpkgs, flake-utils, bash }@input:
|
|
flake-utils.lib.eachDefaultSystem
|
|
(system:
|
|
let
|
|
version = self.lastModifiedDate;
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
};
|
|
in
|
|
{
|
|
packages.hostapps = pkgs.poetry2nix.mkPoetryApplication {
|
|
python = pkgs.python311;
|
|
projectDir = ./.;
|
|
propagatedBuildInputs = [
|
|
pkgs.openssh
|
|
pkgs.sshpass
|
|
];
|
|
overrides = pkgs.poetry2nix.overrides.withDefaults
|
|
(
|
|
self: super: {
|
|
pynetbox = super.pynetbox.overridePythonAttrs
|
|
(
|
|
old: {
|
|
patches = old.patches or [ ] ++ [
|
|
(
|
|
pkgs.fetchpatch {
|
|
name = "pkg-resources.patch";
|
|
url = "https://github.com/jcollie/pynetbox/commit/f051085a4051a98565c08b9646d5b2d69fe1739e.patch";
|
|
hash = "sha256-lxjc0lG34N5vFu6TnDvrxw0eXI+yf4kqHs7MNuVq7mc=";
|
|
}
|
|
)
|
|
];
|
|
}
|
|
);
|
|
# pathspec = super.pathspec.overridePythonAttrs
|
|
# (
|
|
# old: {
|
|
# propagatedBuildInputs = [ super.flit-core ] ++ super.flit-core.propagatedBuildInputs;
|
|
# }
|
|
# );
|
|
}
|
|
);
|
|
};
|
|
defaultPackage = self.packages.${system}.hostapps;
|
|
devShells.default =
|
|
let
|
|
python = pkgs.python311.withPackages (
|
|
ps: with ps; [
|
|
# poetry-core
|
|
]
|
|
);
|
|
project = "hostapps";
|
|
prompt = (
|
|
bash.build_prompt
|
|
bash.ansi_normal_blue
|
|
"${project} - ${bash.username}@${bash.hostname_short}: ${bash.current_working_directory}"
|
|
"${project}:${bash.current_working_directory}"
|
|
);
|
|
in
|
|
pkgs.mkShell {
|
|
buildInputs = [
|
|
python
|
|
pkgs.openssh
|
|
pkgs.sshpass
|
|
pkgs.poetry
|
|
];
|
|
shellHook = ''
|
|
export PATH=$(pwd)/.venv/bin:$PATH
|
|
export POETRY_VIRTUALENVS_IN_PROJECT=true
|
|
export PS1='${prompt}'
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
}
|