-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e5ca00
commit 2e9b691
Showing
5 changed files
with
310 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: checks | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- run: nix flake check -Lv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ yarn.lock | |
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ | ||
result |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{ | ||
description = "Nodejs Dev Shell"; | ||
|
||
inputs = { | ||
devshell.url = "github:numtide/devshell"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
git-hooks = { | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
url = "github:cachix/git-hooks.nix"; | ||
}; | ||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | ||
|
||
nix-filter.url = "github:numtide/nix-filter"; | ||
}; | ||
|
||
outputs = | ||
{ | ||
devshell, | ||
flake-utils, | ||
git-hooks, | ||
nixpkgs, | ||
nix-filter, | ||
self, | ||
... | ||
}: | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: | ||
let | ||
app-source = nix-filter.lib.filter { | ||
root = ./.; | ||
exclude = [ ]; | ||
|
||
include = [ | ||
"src" | ||
(nix-filter.lib.matchExt "js") | ||
(nix-filter.lib.matchExt "json") | ||
(nix-filter.lib.matchExt "ts") | ||
]; | ||
}; | ||
|
||
pkg-lock = builtins.fromJSON (builtins.readFile ./package.json); | ||
|
||
pkgs = import nixpkgs { | ||
overlays = [ devshell.overlays.default ]; | ||
inherit system; | ||
}; | ||
in | ||
{ | ||
checks.git-hooks = git-hooks.lib.${system}.run { | ||
src = self; | ||
hooks = { | ||
actionlint.enable = true; | ||
|
||
deadnix = { | ||
enable = true; | ||
settings.edit = true; | ||
}; | ||
|
||
nixfmt-rfc-style.enable = true; | ||
|
||
prettier = { | ||
enable = true; | ||
settings.write = true; | ||
}; | ||
|
||
statix.enable = true; | ||
|
||
statix-write = { | ||
enable = true; | ||
name = "Statix Write"; | ||
entry = "${pkgs.statix}/bin/statix fix"; | ||
language = "system"; | ||
pass_filenames = false; | ||
}; | ||
|
||
trufflehog-verified = { | ||
enable = pkgs.stdenv.isLinux; | ||
name = "Trufflehog Search"; | ||
entry = "${pkgs.trufflehog}/bin/trufflehog git file://. --since-commit HEAD --only-verified --fail --no-update"; | ||
language = "system"; | ||
pass_filenames = false; | ||
}; | ||
}; | ||
}; | ||
|
||
devShells.default = pkgs.devshell.mkShell { | ||
devshell.startup.git-hooks.text = self.checks.${system}.git-hooks.shellHook; | ||
name = "dev-shell"; | ||
packages = with pkgs; [ | ||
deadnix | ||
nixfmt-rfc-style | ||
nodejs_20 | ||
nodePackages.prettier | ||
nodePackages.typescript | ||
statix | ||
]; | ||
}; | ||
|
||
formatter = pkgs.nixfmt-rfc-style; | ||
|
||
packages = { | ||
newwwie = pkgs.buildNpmPackage { | ||
inherit (pkg-lock) version; | ||
pname = "newwwie"; | ||
src = app-source; | ||
npmDepsHash = "sha256-FGQpZmR5uSh3kLYyRPLG4KlQnnOzUxnJKeVkCVMabZM="; | ||
}; | ||
}; | ||
} | ||
); | ||
|
||
} |