summaryrefslogtreecommitdiff
path: root/Creating a devshell with Nix flakes.md
diff options
context:
space:
mode:
authorJasper Ras <jaspert.ras@gmail.com>2025-08-03 17:18:09 +0200
committerJasper Ras <jaspert.ras@gmail.com>2025-08-03 17:18:09 +0200
commita1db86ce4a95b9e84899dc6484f58deb5ce41e01 (patch)
tree1229add670b631a2f3123799a47e17d840e5e4d8 /Creating a devshell with Nix flakes.md
parent19150baf3963c234158a79dea8974017bd0c0de4 (diff)
vault backup: 2025-08-03 17:18:09
Diffstat (limited to 'Creating a devshell with Nix flakes.md')
-rw-r--r--Creating a devshell with Nix flakes.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/Creating a devshell with Nix flakes.md b/Creating a devshell with Nix flakes.md
new file mode 100644
index 0000000..139d3f9
--- /dev/null
+++ b/Creating a devshell with Nix flakes.md
@@ -0,0 +1,24 @@
+```nix
+{
+ description = "Example flake with a devShell";
+
+ inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
+
+ outputs = { self, nixpkgs}:
+ let
+ system = "x86_64-linux";
+ pkgs = import nixpkgs { inherit system; };
+ in {
+ devShells.x86_64-linux.default = pkgs.mkShell {
+ buildInputs = with pkgs; [
+ hello
+ ];
+ shellHook = ''
+ echo "Welcome to the devShell!"
+ '';
+ };
+ };
+}
+```
+
+To enter: `nix develop`. Or use nix direnv and put a `.envrc` in place with `use flake`. \ No newline at end of file