From 4fbcc1a04d62b5b569c7f26f8f80dec27326cf2a Mon Sep 17 00:00:00 2001 From: vkcku Date: Mon, 1 Jun 2026 09:43:32 +0530 Subject: infra: initial commit monorepo-revid: ed8c310e6049eb2c7bba4ee82872707984c2c5bb --- infra/README.md | 3 +++ infra/nix/_treefmt.nix | 7 +++++++ infra/nix/checks.nix | 22 ++++++++++++++++++++++ infra/nix/devshell.nix | 15 +++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 infra/README.md create mode 100644 infra/nix/_treefmt.nix create mode 100644 infra/nix/checks.nix create mode 100644 infra/nix/devshell.nix (limited to 'infra') diff --git a/infra/README.md b/infra/README.md new file mode 100644 index 0000000..ba43538 --- /dev/null +++ b/infra/README.md @@ -0,0 +1,3 @@ +# Infra + +This contains the configurations for all my machines and other related items. 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 ]; + }; + }; +} -- cgit v1.3.1