hostapps/flake.nix

81 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";
};
2022-10-09 09:57:03 -05:00
flake-utils = {
url = "github:numtide/flake-utils";
};
2023-03-24 10:53:20 -05:00
bash = {
url = "git+https://git.ocjtech.us/jeff/nixos-bash-prompt-builder.git";
};
2022-05-28 14:14:08 -05:00
};
2023-03-24 10:53:20 -05:00
outputs = { self, nixpkgs, flake-utils, bash }@input:
2022-10-09 09:57:03 -05:00
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
2023-03-24 10:47:06 -05:00
pkgs.sshpass
2022-10-09 09:57:03 -05:00
];
2022-10-10 17:31:38 -05:00
overrides = pkgs.poetry2nix.overrides.withDefaults
(
self: super: {
2023-03-24 10:47:06 -05:00
pynetbox = super.pynetbox.overridePythonAttrs
(
old: {
propagatedBuildInputs = [ super.setuptools-scm ] ++ super.pynetbox.propagatedBuildInputs;
}
);
2023-03-24 09:51:57 -05:00
pathspec = super.pathspec.overridePythonAttrs
2022-10-10 17:31:38 -05:00
(
old: {
2023-03-24 09:51:57 -05:00
propagatedBuildInputs = [ super.flit-core ] ++ super.flit-core.propagatedBuildInputs;
2022-10-10 17:31:38 -05:00
}
);
}
);
2022-10-09 09:57:03 -05:00
};
defaultPackage = self.packages.${system}.hostapps;
devShells.default =
let
python = pkgs.python310.withPackages (
ps: with ps; [
2023-03-24 09:51:57 -05:00
poetry-core
2022-10-09 09:57:03 -05:00
]
);
2023-03-24 10:53:20 -05:00
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}"
);
2022-10-09 09:57:03 -05:00
in
2022-10-10 17:20:59 -05:00
pkgs.mkShell {
2023-03-24 09:51:57 -05:00
buildInputs = [
2022-10-10 17:20:59 -05:00
python
2023-03-24 09:51:57 -05:00
pkgs.openssh
2023-03-24 10:47:06 -05:00
pkgs.sshpass
2023-03-24 09:51:57 -05:00
pkgs.poetry
2022-10-10 17:20:59 -05:00
];
shellHook = ''
2023-03-24 10:53:20 -05:00
export PATH=$(pwd)/.venv/bin:$PATH
2022-10-10 17:20:59 -05:00
export POETRY_VIRTUALENVS_IN_PROJECT=true
2023-03-24 10:53:20 -05:00
export PS1='${prompt}'
2022-10-10 17:20:59 -05:00
'';
2022-10-09 09:57:03 -05:00
};
}
);
2022-05-28 14:14:08 -05:00
}