Skip to content

Commit a53f40c

Browse files
committed
Add direnv, nix configs, and uv lock file
1 parent b2c419a commit a53f40c

File tree

6 files changed

+2058
-0
lines changed

6 files changed

+2058
-0
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/nix/store/qrc496n6fsqp4p5m5h8wmw5d5jwyw5mr-python3-3.12.8/bin/python3

flake.lock

Lines changed: 96 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: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# How to setup this project?
2+
#
3+
# 1. Install Nix:
4+
#
5+
# curl -sSf -L https://install.lix.systems/lix | sh -s -- install
6+
#
7+
# 2. Enter the reproducible developer shell:
8+
#
9+
# nix develop
10+
#
11+
# 3. Sync your Python venv with uv.lock file:
12+
#
13+
# uv sync
14+
#
15+
# Everything's good! You can also install http://direnv.net/ and enjoy automagic
16+
# activation of your environment ;)
17+
{
18+
inputs = {
19+
flake-utils.url = "github:numtide/flake-utils";
20+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
21+
rust-overlay.url = "github:oxalica/rust-overlay";
22+
};
23+
outputs = { flake-utils, nixpkgs, rust-overlay, ... }:
24+
flake-utils.lib.eachDefaultSystem (system:
25+
let
26+
overlays = [ (import rust-overlay) ];
27+
pkgs = import nixpkgs { inherit system overlays; };
28+
in {
29+
devShell = import ./shell.nix { inherit pkgs system; };
30+
});
31+
}

shell.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# If you plan to use `nix-shell` you have first to:
2+
#
3+
# $ nix-channel --add https://github.com/oxalica/rust-overlay/archive/master.tar.gz rust-overlay
4+
# $ nix-channel --update
5+
{ pkgs ? import <nixpkgs> { overlays = [ (import <rust-overlay>) ]; }
6+
, system ? builtins.currentSystem }:
7+
with pkgs;
8+
let
9+
toolchain = (rust-bin.fromRustupToolchainFile ./rust-toolchain).override {
10+
extensions = [ "rust-src" "rust-analyzer" "clippy" ];
11+
};
12+
in mkShell {
13+
buildInputs = [ gcc openssl pkg-config python3 uv ];
14+
shellHook = ''
15+
source .venv/bin/activate
16+
'';
17+
}

0 commit comments

Comments
 (0)