aboutsummaryrefslogtreecommitdiff
path: root/root/nix/devshell.nix
diff options
context:
space:
mode:
authorvkcku <[email protected]>2026-06-01 08:21:20 +0530
committervkcku <[email protected]>2026-06-01 08:21:20 +0530
commitb911adccfdf598d7130ca017e677f5b58f476299 (patch)
treee6f3d56e088ef1e7b2b48fa06729d3698ffb9f9e /root/nix/devshell.nix
parentroot: initial commit (diff)
root: setup nix
monorepo-revid: f83eede55beb9a636ce34eead83d4d5fce288b51
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)"
+ '';
+ };
+ };
+}