-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #725 from andrew-scott-fischer/update-nix-flake-impl
Update nix flake impl
- Loading branch information
Showing
14 changed files
with
159 additions
and
649 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
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.pre-commit-config.yaml | ||
.direnv/ | ||
coverage/ | ||
dist/ | ||
|
This file was deleted.
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
coverage/ | ||
dist/ | ||
package-lock.json | ||
flake.lock |
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
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 |
---|---|---|
@@ -1,34 +1,53 @@ | ||
{ | ||
description = "api-ts"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
pre-commit-hooks = { | ||
url = "github:cachix/pre-commit-hooks.nix"; | ||
inputs = { | ||
nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
}; | ||
|
||
outputs = { | ||
self, | ||
nixpkgs, | ||
flake-utils, | ||
}: ( | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: ( | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
in { | ||
devShell = pkgs.mkShell { | ||
name = "api-ts-shell"; | ||
pre-commit-hooks, | ||
}: let | ||
forEachSystem = nixpkgs.lib.genAttrs [ | ||
"aarch64-darwin" | ||
"aarch64-linux" | ||
"x86_64-darwin" | ||
"x86_64-linux" | ||
]; | ||
in { | ||
checks = forEachSystem (system: let | ||
pre-commit-check = pre-commit-hooks.lib.${system}.run { | ||
src = ./.; | ||
hooks = { | ||
actionlint.enable = true; | ||
alejandra.enable = true; | ||
prettier.enable = true; | ||
}; | ||
}; | ||
in { | ||
inherit pre-commit-check; | ||
}); | ||
|
||
packages = with pkgs; [ | ||
nodejs | ||
]; | ||
devShells = forEachSystem (system: let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
in { | ||
default = pkgs.mkShell { | ||
packages = with pkgs; [ | ||
nodejs | ||
]; | ||
|
||
shellHook = '' | ||
export PATH="$(pwd)/node_modules/.bin:$PATH" | ||
''; | ||
}; | ||
} | ||
) | ||
) | ||
); | ||
shellHook = '' | ||
${self.checks.${system}.pre-commit-check.shellHook} | ||
export PATH="$(pwd)/node_modules/.bin:$PATH" | ||
''; | ||
}; | ||
}); | ||
}; | ||
} |
Oops, something went wrong.