jlog/flake.nix
Jeffrey C. Ollie f1efca7ea8
first
2023-10-04 22:06:49 -05:00

77 lines
2.1 KiB
Nix

{
description = "jlog";
inputs = {
nixpkgs = {
url = "nixpkgs/nixos-23.05";
};
flake-utils = {
url = "github:numtide/flake-utils";
};
bash = {
url = "git+https://git.ocjtech.us/jeff/nixos-bash-prompt-builder.git";
};
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
make-shell = {
url = "github:ursi/nix-make-shell";
};
};
outputs = { self, nixpkgs, poetry2nix, flake-utils, bash, ... }@inputs:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
devShells.default =
let
project = "jlog";
prompt = (
bash.build_prompt
bash.ansi_normal_blue
"${project} - ${bash.username}@${bash.hostname_short}: ${bash.current_working_directory}"
"${project}:${bash.current_working_directory}"
);
python = pkgs.python311.withPackages (ps: with ps; [
poetry-core
]);
make-shell = import inputs.make-shell {
inherit system;
pkgs = pkgs;
};
in
make-shell {
packages = [
python
pkgs.poetry
pkgs.samba
];
env = {
POETRY_VIRTUALENVS_IN_PROJECT = "true";
POETRY_VIRTUALENVS_OPTIONS_SYSTEM_SITE_PACKAGES = "true";
PS1 = prompt;
PYTHON_KEYRING_BACKEND = "keyring.backends.null.Keyring";
};
setup = '''';
};
packages = {
jlog =
let
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication overrides;
in
mkPoetryApplication {
python = pkgs.python311;
projectDir = ./.;
groups = [ ];
};
};
}
);
}