Skip to content

Commit b4a7633

Browse files
committed
build: add nix flake for reproducible dev env
1 parent 3dd352e commit b4a7633

File tree

4 files changed

+96
-0
lines changed

4 files changed

+96
-0
lines changed

.envrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
has nix && use flake
2+
watch_file *.nix
3+
dotenv_if_exists .env # You can create a .env file with your env vars for this project. You can also use .secrets if you are using act. See the line below.
4+
dotenv_if_exists .secrets # Used by [act](https://nektosact.com/) to load secrets into the pipelines

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ venv/
6161

6262
# Direnv
6363
.envrc
64+
.direnv/
65+
.secrets
6466

6567
# IntelliJ projects
6668
.idea/

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
};
6+
outputs =
7+
{
8+
self,
9+
nixpkgs,
10+
flake-utils,
11+
}:
12+
flake-utils.lib.eachDefaultSystem (
13+
system:
14+
let
15+
pkgs = import nixpkgs { inherit system; };
16+
in
17+
{
18+
devShells.default =
19+
with pkgs;
20+
mkShell {
21+
packages = [
22+
python310 # Minimum supported python version in this project
23+
];
24+
};
25+
26+
formatter = pkgs.nixfmt-rfc-style;
27+
}
28+
);
29+
}

0 commit comments

Comments
 (0)