This commit is contained in:
Jeffrey C. Ollie 2023-12-07 10:17:35 -06:00
parent 8cc696c43d
commit d20d2a98cb
No known key found for this signature in database
GPG key ID: F936E4DCB7E25F15
2 changed files with 113 additions and 95 deletions

View file

@ -1,30 +1,15 @@
{
"nodes": {
"bash": {
"locked": {
"lastModified": 1678247195,
"narHash": "sha256-m/wSwlSket+hob3JED4XUvoWJLtW7yhtOiZrlRDMShs=",
"ref": "refs/heads/main",
"rev": "e7a00dcc0e75bc3ef6856bdd94d7d809245f5636",
"revCount": 1,
"type": "git",
"url": "https://git.ocjtech.us/jeff/nixos-bash-prompt-builder.git"
},
"original": {
"type": "git",
"url": "https://git.ocjtech.us/jeff/nixos-bash-prompt-builder.git"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1692799911,
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
@ -38,11 +23,11 @@
"systems": "systems_2"
},
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
@ -74,11 +59,11 @@
]
},
"locked": {
"lastModified": 1688870561,
"narHash": "sha256-4UYkifnPEw1nAzqqPOTL2MvWtm3sNGw1UTYTalkTcGY=",
"lastModified": 1698974481,
"narHash": "sha256-yPncV9Ohdz1zPZxYHQf47S8S0VrnhV7nNhCawY46hDA=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "165b1650b753316aa7f1787f3005a8d2da0f5301",
"rev": "4bb5e752616262457bc7ca5882192a564c0472d2",
"type": "github"
},
"original": {
@ -89,16 +74,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1693341273,
"narHash": "sha256-wrsPjsIx2767909MPGhSIOmkpGELM9eufqLQOPxmZQg=",
"lastModified": 1701802827,
"narHash": "sha256-wTn0lpV75Uv6tU6haEypNsmnJJPb0hpaMIy/4uf5AiQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2ab91c8d65c00fd22a441c69bbf1bc9b420d5ea1",
"rev": "a804fc878d7ba1558b960b4c64b0903da426ac41",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.05",
"ref": "nixos-23.11",
"type": "indirect"
}
},
@ -108,14 +93,16 @@
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"nixpkgs"
]
],
"systems": "systems_3",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1693051011,
"narHash": "sha256-HNbuVCS/Fnl1YZOjBk9/MlIem+wM8fvIzTH0CVQrLSQ=",
"lastModified": 1701861752,
"narHash": "sha256-QfrE05P66856b1SMan69NPhjc9e82VtLxBKg3yiQGW8=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "5b3a5151cf212021ff8d424f215fb030e4ff2837",
"rev": "9fc487b32a68473da4bf9573f85b388043c5ecda",
"type": "github"
},
"original": {
@ -126,7 +113,6 @@
},
"root": {
"inputs": {
"bash": "bash",
"flake-utils": "flake-utils",
"make-shell": "make-shell",
"nixpkgs": "nixpkgs",
@ -162,6 +148,41 @@
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"id": "systems",
"type": "indirect"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1699786194,
"narHash": "sha256-3h3EH1FXQkIeAuzaWB+nK0XK54uSD46pp+dMD3gAcB4=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "e82f32aa7f06bbbd56d7b12186d555223dc399d1",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",

121
flake.nix
View file

@ -3,7 +3,7 @@
inputs = {
nixpkgs = {
url = "nixpkgs/nixos-23.05";
url = "nixpkgs/nixos-23.11";
};
poetry2nix = {
url = "github:nix-community/poetry2nix";
@ -12,76 +12,73 @@
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:
outputs = {
self,
nixpkgs,
poetry2nix,
flake-utils,
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; [
(
system: let
inherit (poetry2nix.lib.mkPoetry2Nix {inherit pkgs;}) 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";
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
'';
make-shell {
packages = [
python
pkgs.poetry
];
env = {
POETRY_VIRTUALENVS_IN_PROJECT = "true";
name = project;
};
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;
};
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;
}
);
};
default = self.packages.${system}.starlink-grpc-tools;
}
);
}