Skip to content

Commit 91b46f5

Browse files
authored
build: add nix flake for dev environment (#17)
1 parent 473a1c3 commit 91b46f5

File tree

4 files changed

+105
-0
lines changed

4 files changed

+105
-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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,8 @@ target/
7070

7171
# VSCode
7272
.vscode/
73+
74+
# Nix development
75+
.direnv/
76+
.secrets
77+
result

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: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 {
16+
inherit system;
17+
config.allowUnfree = true;
18+
};
19+
in
20+
{
21+
devShells.default =
22+
with pkgs;
23+
mkShell {
24+
packages = [
25+
python3
26+
uv
27+
ruff
28+
basedpyright
29+
];
30+
};
31+
32+
formatter = pkgs.nixfmt-rfc-style;
33+
}
34+
);
35+
}

0 commit comments

Comments
 (0)