diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..1d953f4 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f9d125b..51ab2c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,3 +8,10 @@ jobs: - uses: nixbuild/nix-quick-install-action@v28 - name: Structural Integirty Test run: cd test && ./bld.sh + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: nixbuild/nix-quick-install-action@v28 + - name: Code Format Check + run: eval "$(nix print-dev-env -f shell.nix)" && treefmt --fail-on-change diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..92b2793 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.direnv diff --git a/dev/mod.nix b/dev/mod.nix new file mode 100644 index 0000000..ffcd441 --- /dev/null +++ b/dev/mod.nix @@ -0,0 +1 @@ +{ } diff --git a/dev/shell.nix b/dev/shell.nix new file mode 100644 index 0000000..48ca0e4 --- /dev/null +++ b/dev/shell.nix @@ -0,0 +1,11 @@ +{ + pkgs ? import { }, +}: +pkgs.mkShell { + packages = with pkgs; [ + treefmt + npins + nixfmt-rfc-style + shfmt + ]; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..2ef387b --- /dev/null +++ b/shell.nix @@ -0,0 +1,4 @@ +let + dev = import ./. ./dev; +in +dev.shell diff --git a/test/bld.res.nix b/test/bld.res.nix index e3fd384..00ddbee 100644 --- a/test/bld.res.nix +++ b/test/bld.res.nix @@ -42,6 +42,6 @@ g = 5; h = 8; }; - test = scopedImport {std = builtins;} "${../std/set/filterMap.nix}"; + test = scopedImport { std = builtins; } "${../std/set/filterMap.nix}"; x = builtins.readFile ./bld/bum; } diff --git a/treefmt.toml b/treefmt.toml new file mode 100644 index 0000000..6328c02 --- /dev/null +++ b/treefmt.toml @@ -0,0 +1,11 @@ +[formatter.nix] +command = "nixfmt" +options = [] +includes = [ "*.nix" ] +excludes = [] + +[formatter.sh] +command = "shfmt" +options = [] +includes = [ "*.sh" ] +excludes = []