Skip to content

Commit f8c778b

Browse files
committed
Add flake.nix and direnv
1 parent 0b83580 commit f8c778b

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# shellcheck disable=SC2148
2+
use flake

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.direnv
2+
.venv
3+
flake.lock

flake.nix

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
description = "Use `nix develop` to temp install everything you need for working on this project";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils, ... }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
overlays = [ ];
13+
pkgs = import nixpkgs {
14+
inherit system overlays;
15+
};
16+
in
17+
{
18+
devShells.default = with pkgs; mkShell {
19+
buildInputs = [
20+
python3
21+
];
22+
shellHook = "python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt";
23+
};
24+
}
25+
);
26+
}

0 commit comments

Comments
 (0)