Skip to content

Commit dedfd18

Browse files
committed
Flake based dev env
1 parent d0d93f7 commit dedfd18

File tree

5 files changed

+51
-0
lines changed

5 files changed

+51
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM ghcr.io/xtruder/nix-devcontainer:v1
2+
3+
# cache /nix
4+
VOLUME /nix

.devcontainer/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
The devcontainer setup is based on https://github.com/xtruder/nix-devcontainer
2+
3+
For more information on how to use devcontainers, see:
4+
5+
https://containers.dev/
6+
https://code.visualstudio.com/docs/remote/devcontainer-overview

.devcontainer/devcontainer.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
{
3+
"name": "codetracer-python-recorder",
4+
"dockerFile": "Dockerfile",
5+
"context": "${localWorkspaceFolder}",
6+
"build": {
7+
"args": {
8+
"USER_UID": "${localEnv:USER_UID}",
9+
"USER_GID": "${localEnv:USER_GID}"
10+
},
11+
},
12+
"postCreateCommand": "direnv allow",
13+
"customizations": {
14+
"vscode": {
15+
"extensions": [
16+
"direnv.direnv",
17+
"arrterian.nix-env-selector"
18+
]
19+
}
20+
}
21+
}

.envrc

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

flake.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
description = "Development environment for codetracer-python-recorder";
3+
4+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
5+
6+
outputs = { self, nixpkgs }:
7+
let
8+
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
9+
forEachSystem = nixpkgs.lib.genAttrs systems;
10+
in {
11+
devShells = forEachSystem (system:
12+
let pkgs = import nixpkgs { inherit system; };
13+
in {
14+
default = pkgs.mkShell {
15+
packages = with pkgs; [ python just git-lfs ];
16+
};
17+
});
18+
};
19+
}

0 commit comments

Comments
 (0)