aboutsummaryrefslogtreecommitdiff
path: root/root/nix/devshell.nix
diff options
context:
space:
mode:
Diffstat (limited to 'root/nix/devshell.nix')
-rw-r--r--root/nix/devshell.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/root/nix/devshell.nix b/root/nix/devshell.nix
new file mode 100644
index 0000000..6c1dc29
--- /dev/null
+++ b/root/nix/devshell.nix
@@ -0,0 +1,30 @@
+{ inputs, self, ... }:
+{
+ perSystem =
+ { pkgs, system, ... }:
+ {
+ devShells.common = pkgs.mkShellNoCC {
+ name = "common";
+
+ packages = [
+ pkgs.nixd
+ ];
+ };
+
+ devShells.root =
+ let
+ treefmt = pkgs.callPackage ./_treefmt.nix { treefmt-nix = inputs.treefmt-nix; };
+ in
+ pkgs.mkShellNoCC {
+ name = "root";
+
+ inputsFrom = [ self.devShells."${system}".common ];
+ packages = [
+ treefmt
+ ];
+ shellHook = ''
+ export TREEFMT_WORKING_DIR="$("${pkgs.git}/bin/git" rev-parse --show-toplevel)"
+ '';
+ };
+ };
+}