From b361cdfcc7e7d8f80f4599115322014d7cfd18c2 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sat, 6 Jul 2024 09:42:54 +0200 Subject: [PATCH] nix: add devshell --- .envrc | 1 + .gitignore | 5 +++-- flake.nix | 6 ++++++ shell.nix | 10 ++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .envrc create mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..a5dbbcb --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake . diff --git a/.gitignore b/.gitignore index 2e80806..3850c73 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ # Added by cargo -/target -/result +target +result +.direnv diff --git a/flake.nix b/flake.nix index 111933a..3a745d1 100644 --- a/flake.nix +++ b/flake.nix @@ -10,5 +10,11 @@ inherit system inputs; pkgs = nixpkgs.legacyPackages.${system}; }); + devShells = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: { + default = import ./shell.nix { + inherit system inputs; + pkgs = nixpkgs.legacyPackages.${system}; + }; + }); }; } diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..b215bfb --- /dev/null +++ b/shell.nix @@ -0,0 +1,10 @@ +{ + pkgs, + system, + inputs, +}: + +pkgs.mkShell { + packages = with pkgs; []; + inputsFrom = with inputs.self.legacyPackages.${system}; [ backend web native ]; +}