diff options
Diffstat (limited to 'Creating a devshell with Nix flakes.md')
-rw-r--r-- | Creating a devshell with Nix flakes.md | 24 |
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 |