diff options
| author | seth <[email protected]> | 2023-03-17 21:13:55 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-03-17 21:18:02 -0400 |
| commit | fd481d4fdce31cfaaf414d24ebbba0b2ff99a20c (patch) | |
| tree | 28b6b3a61e1c5f6f833ca5fdfd48d4f1dda5d775 /flake.nix | |
| parent | b6f5bc462ec2ab587e41ea088301e2db8fc20a13 (diff) | |
feat(flake): init nix flake
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..993bfb7 --- /dev/null +++ b/flake.nix @@ -0,0 +1,49 @@ +{ + description = "getchoo's personal website"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-22.11"; + flake-utils.url = "github:numtide/flake-utils"; + pre-commit-hooks = { + url = "github:cachix/pre-commit-hooks.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + pre-commit-hooks, + ... + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs {inherit system;}; + in { + checks = { + pre-commit-check = pre-commit-hooks.lib.${system}.run { + src = ./.; + hooks = { + alejandra.enable = true; + prettier.enable = true; + editorconfig-checker.enable = true; + }; + }; + }; + + devShells = let + inherit (pkgs) mkShell; + inherit (self.checks.${system}.pre-commit-check) shellHook; + in { + default = mkShell { + inherit shellHook; + packages = with pkgs; [ + alejandra + deno + nodePackages.prettier + ]; + }; + }; + }); +} |
