hostapps/flake.nix
2023-10-18 20:26:59 -05:00

62 lines
1.7 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
];
};
defaultPackage = self.packages.${system}.hostapps;
devShells.default =
let
python = pkgs.python311.withPackages (
ps: with ps; [
# poetry-core
]
);
project = "hostapps";
prompt = (
bash.build_ps1_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 PS1='${prompt}'
'';
};
}
);
}