87 lines
2.6 KiB
Nix
87 lines
2.6 KiB
Nix
{
|
|
description = "Starling gRPC Tools";
|
|
|
|
inputs = {
|
|
nixpkgs = {
|
|
url = "nixpkgs/nixos-23.05";
|
|
};
|
|
poetry2nix = {
|
|
url = "github:nix-community/poetry2nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
flake-utils = {
|
|
url = "github:numtide/flake-utils";
|
|
};
|
|
bash = {
|
|
url = "git+https://git.ocjtech.us/jeff/nixos-bash-prompt-builder.git";
|
|
};
|
|
make-shell = {
|
|
url = "github:ursi/nix-make-shell";
|
|
};
|
|
};
|
|
outputs = { self, nixpkgs, poetry2nix, flake-utils, bash, make-shell, ... }@inputs:
|
|
flake-utils.lib.eachDefaultSystem
|
|
(system:
|
|
let
|
|
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication overrides;
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
};
|
|
python = pkgs.python311.withPackages (ps: with ps; [
|
|
poetry-core
|
|
]);
|
|
in
|
|
{
|
|
devShells.default =
|
|
let
|
|
make-shell = import inputs.make-shell {
|
|
inherit system;
|
|
pkgs = pkgs;
|
|
};
|
|
project = "starlink";
|
|
prompt = (
|
|
bash.build_prompt
|
|
bash.ansi_normal_blue
|
|
"${project} - ${bash.username}@${bash.hostname_short}: ${bash.current_working_directory}"
|
|
"${project}:${bash.current_working_directory}"
|
|
);
|
|
in
|
|
make-shell {
|
|
packages = [
|
|
python
|
|
pkgs.poetry
|
|
];
|
|
env = {
|
|
POETRY_VIRTUALENVS_IN_PROJECT = "true";
|
|
PS1 = prompt;
|
|
};
|
|
setup = ''
|
|
export PATH=''$(pwd)/.venv/bin:$PATH
|
|
'';
|
|
};
|
|
packages = {
|
|
starlink-grpc-tools = mkPoetryApplication {
|
|
python = pkgs.python311;
|
|
projectDir = ./.;
|
|
groups = [ ];
|
|
overrides = overrides.withDefaults (
|
|
self: super: {
|
|
yagrc = super.yagrc.overridePythonAttrs (
|
|
old: {
|
|
buildInputs = old.buildInputs ++ [ self.setuptools ];
|
|
}
|
|
);
|
|
}
|
|
);
|
|
meta = with pkgs.lib; {
|
|
homepage = "https://github.com/sparky8512/starlink-grpc-tools";
|
|
description = "";
|
|
longDescription = '''';
|
|
license = licenses.unlicense;
|
|
};
|
|
};
|
|
};
|
|
default = self.packages.${system}.starlink-grpc-tools;
|
|
}
|
|
);
|
|
}
|