Skip to content

Commit

Permalink
dev: introduce nix flake for repo
Browse files Browse the repository at this point in the history
Signed-off-by: GRBurst <[email protected]>
  • Loading branch information
GRBurst committed Oct 3, 2024
1 parent ef7ac3d commit 0267465
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ export LOG_LEVEL=INFO

export PYTHONPATH="$PYTHONPATH:$(pwd)"

if command -v lorri &> /dev/null; then
if [[ -f flake.nix ]] && command -v nix &> /dev/null; then
use flake --impure
elif command -v lorri &> /dev/null; then
eval "$(lorri direnv)"
elif command -v nix &> /dev/null; then
use nix --command zsh
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ local-test/
build/
develop-eggs/
dist/
.direnv
downloads/
eggs/
.eggs/
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
description = "Slack Logger Python";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
devShells.default = import ./shell.nix { inherit pkgs; };
}
);
}
26 changes: 15 additions & 11 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ pkgs }:
let
pkgs = import <nixpkgs> { };
pname = "slack-logger-python";
vsextensions = (with pkgs.vscode-extensions; [
ms-azuretools.vscode-docker
Expand All @@ -18,16 +18,16 @@ let
sha256 = "sha256-lv4dUJDOFPemvS8YTD12/PjeTevWhR76Ex8qHjQH3vY=";
}
{
publisher = "ms-python";
name = "black-formatter";
version = "2023.5.11841009";
sha256 = "sha256-zmEDAdj/7ZyzXzh+iPes6LMIA7+63wZZB2ZD65kKp8I=";
publisher = "ms-python";
name = "black-formatter";
version = "2023.5.11841009";
sha256 = "sha256-zmEDAdj/7ZyzXzh+iPes6LMIA7+63wZZB2ZD65kKp8I=";
}
{
publisher = "ms-python";
name = "isort";
version = "2023.9.11781018";
sha256 = "sha256-ev+gSQP+Q1AEw+r1Uahi1TI+docalcC1iWO29N1L5VE=";
publisher = "ms-python";
name = "isort";
version = "2023.9.11781018";
sha256 = "sha256-ev+gSQP+Q1AEw+r1Uahi1TI+docalcC1iWO29N1L5VE=";
}
];
vscode-slack-logger = pkgs.vscode-with-extensions.override {
Expand All @@ -42,8 +42,9 @@ let
in

pkgs.mkShell {
packages = [ plugin-python ];
buildInputs = with pkgs; [
packages = with pkgs; [
plugin-python

git

black
Expand All @@ -53,4 +54,7 @@ pkgs.mkShell {

vscode-slack-logger
];
shellHook = ''
echo "Welcome to the ${pname} project"
'';
}

0 comments on commit 0267465

Please sign in to comment.