From a1db86ce4a95b9e84899dc6484f58deb5ce41e01 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Sun, 3 Aug 2025 17:18:09 +0200 Subject: vault backup: 2025-08-03 17:18:09 --- Creating a devshell with Nix flakes.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Creating a devshell with Nix flakes.md (limited to 'Creating a devshell with Nix flakes.md') 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 -- cgit v1.2.3