diff options
| author | vkcku <[email protected]> | 2026-06-01 09:43:32 +0530 |
|---|---|---|
| committer | vkcku <[email protected]> | 2026-06-01 09:43:32 +0530 |
| commit | 4fbcc1a04d62b5b569c7f26f8f80dec27326cf2a (patch) | |
| tree | 70baa3ec054ce9c2d0919ec039aa22d59e2ab7d4 /infra/nix | |
| parent | root: configure markdown formatter (diff) | |
infra: initial commit
monorepo-revid: ed8c310e6049eb2c7bba4ee82872707984c2c5bb
Diffstat (limited to 'infra/nix')
| -rw-r--r-- | infra/nix/_treefmt.nix | 7 | ||||
| -rw-r--r-- | infra/nix/checks.nix | 22 | ||||
| -rw-r--r-- | infra/nix/devshell.nix | 15 |
3 files changed, 44 insertions, 0 deletions
diff --git a/infra/nix/_treefmt.nix b/infra/nix/_treefmt.nix new file mode 100644 index 0000000..2814c0a --- /dev/null +++ b/infra/nix/_treefmt.nix @@ -0,0 +1,7 @@ +{ treefmt-nix, pkgs, ... }: +let + conf = { + imports = [ ../../root/nix/_treefmt-base.nix ]; + }; +in +treefmt-nix.lib.mkWrapper pkgs conf diff --git a/infra/nix/checks.nix b/infra/nix/checks.nix new file mode 100644 index 0000000..52abdc8 --- /dev/null +++ b/infra/nix/checks.nix @@ -0,0 +1,22 @@ +{ inputs, ... }: +{ + perSystem = + { pkgs, ... }: + { + checks.infra-lint = + let + treefmt = pkgs.callPackage ./_treefmt.nix { treefmt-nix = inputs.treefmt-nix; }; + in + pkgs.stdenvNoCC.mkDerivation { + name = "infra-lint"; + version = "0.0.1"; + + src = ../../.; + + buildPhase = '' + "${treefmt}/bin/treefmt" --ci + touch "$out" + ''; + }; + }; +} diff --git a/infra/nix/devshell.nix b/infra/nix/devshell.nix new file mode 100644 index 0000000..676f663 --- /dev/null +++ b/infra/nix/devshell.nix @@ -0,0 +1,15 @@ +{ inputs, self, ... }: +{ + perSystem = + { pkgs, system, ... }: + { + devShells.infra = + let + treefmt = pkgs.callPackage ./_treefmt.nix { treefmt-nix = inputs.treefmt-nix; }; + in + pkgs.mkShellNoCC { + inputsFrom = [ self.devShells."${system}".common ]; + packages = [ treefmt ]; + }; + }; +} |
