diff options
| -rw-r--r-- | infra/README.md | 3 | ||||
| -rw-r--r-- | infra/nix/_treefmt.nix | 7 | ||||
| -rw-r--r-- | infra/nix/checks.nix | 22 | ||||
| -rw-r--r-- | infra/nix/devshell.nix | 15 | ||||
| -rw-r--r-- | root/nix/_treefmt.nix | 4 |
5 files changed, 51 insertions, 0 deletions
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 ]; + }; + }; +} diff --git a/root/nix/_treefmt.nix b/root/nix/_treefmt.nix index 8cd6d6d..07056db 100644 --- a/root/nix/_treefmt.nix +++ b/root/nix/_treefmt.nix @@ -2,6 +2,10 @@ let conf = { imports = [ ./_treefmt-base.nix ]; + + settings.excludes = [ + "infra/*" + ]; }; in treefmt-nix.lib.mkWrapper pkgs conf |
