hostapps/flake.nix
Jeffrey C. Ollie d181553877
update
2023-03-24 10:53:20 -05:00

81 lines
2.5 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.python310;
projectDir = ./.;
propagatedBuildInputs = [
pkgs.openssh
pkgs.sshpass
];
overrides = pkgs.poetry2nix.overrides.withDefaults
(
self: super: {
pynetbox = super.pynetbox.overridePythonAttrs
(
old: {
propagatedBuildInputs = [ super.setuptools-scm ] ++ super.pynetbox.propagatedBuildInputs;
}
);
pathspec = super.pathspec.overridePythonAttrs
(
old: {
propagatedBuildInputs = [ super.flit-core ] ++ super.flit-core.propagatedBuildInputs;
}
);
}
);
};
defaultPackage = self.packages.${system}.hostapps;
devShells.default =
let
python = pkgs.python310.withPackages (
ps: with ps; [
poetry-core
]
);
project = "netbox-maintenance";
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}'
'';
};
}
);
}