Compare commits
2 Commits
5ef48d262b
...
b183c239b3
| Author | SHA1 | Date | |
|---|---|---|---|
| b183c239b3 | |||
| 4b48f20371 |
25
default.nix
25
default.nix
@ -65,7 +65,7 @@ let
|
|||||||
CGO_ENABLED = 0;
|
CGO_ENABLED = 0;
|
||||||
ldflags = "-s -w -X gopkg.c3c.cz/cv/app/server/internal/version.Tag=${version} -X gopkg.c3c.cz/cv/app/server/internal/version.Commit=${rev} -X gopkg.c3c.cz/cv/app/server/internal/version.commitTime=${commitTime} -X gopkg.c3c.cz/cv/app/server/internal/version.repoUrl=${repoUrl}";
|
ldflags = "-s -w -X gopkg.c3c.cz/cv/app/server/internal/version.Tag=${version} -X gopkg.c3c.cz/cv/app/server/internal/version.Commit=${rev} -X gopkg.c3c.cz/cv/app/server/internal/version.commitTime=${commitTime} -X gopkg.c3c.cz/cv/app/server/internal/version.repoUrl=${repoUrl}";
|
||||||
subPackages = [ "app/server" ];
|
subPackages = [ "app/server" ];
|
||||||
vendorSha256 = "sha256-BkwXD8n62+p639vTLwXpCiY8cqYtCjWxaa5tuw78u5g=";
|
vendorSha256 = "sha256-44xcyVk5KcurQLkVJv1MeAj+Pfcu53664pvVgHdyv3E=";
|
||||||
overrideModAttrs = (_: {
|
overrideModAttrs = (_: {
|
||||||
impureEnvVars = pkgs.lib.fetchers.proxyImpureEnvVars ++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" "GOPROXY" ];
|
impureEnvVars = pkgs.lib.fetchers.proxyImpureEnvVars ++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" "GOPROXY" ];
|
||||||
});
|
});
|
||||||
@ -117,6 +117,20 @@ in
|
|||||||
npm --prefix app/frontend run fix
|
npm --prefix app/frontend run fix
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "update-npm-deps-hash";
|
||||||
|
help = "Calculates and updates the npmDepsHash in default.nix";
|
||||||
|
command = ''
|
||||||
|
echo "Calculating npm deps"
|
||||||
|
# STDERR is poluted by the installed nodules, silencing
|
||||||
|
HASH=''$(prefetch-npm-deps ''$PRJ_ROOT/app/frontend/package-lock.json 2> /dev/null)
|
||||||
|
[[ ''$HASH = sha256* ]] && echo "Hash is ''$HASH"
|
||||||
|
[[ ''$HASH != sha256* ]] && echo "Failed" && exit 137
|
||||||
|
|
||||||
|
# Replace the first occurence of npmDepsHash with the new calculated hash in this file
|
||||||
|
sed -i "0,/npmDepsHash =/{s@npmDepsHash = .*@npmDepsHash = \"''$HASH\";@}" ''$PRJ_ROOT/default.nix
|
||||||
|
'';
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name = "pre-commit";
|
name = "pre-commit";
|
||||||
help = "Format and fix found issues";
|
help = "Format and fix found issues";
|
||||||
@ -125,14 +139,7 @@ in
|
|||||||
golangci-lint run --sort-results --out-format tab --fix
|
golangci-lint run --sort-results --out-format tab --fix
|
||||||
npm --prefix ''$PRJ_ROOT/app/frontend run fix
|
npm --prefix ''$PRJ_ROOT/app/frontend run fix
|
||||||
|
|
||||||
echo "Calculating npm deps"
|
update-npm-deps-hash
|
||||||
HASH=''$(prefetch-npm-deps ''$PRJ_ROOT/app/frontend/package-lock.json 2> /dev/null)
|
|
||||||
[[ ''$HASH = sha256* ]] && echo "Hash is ''$HASH"
|
|
||||||
[[ ''$HASH != sha256* ]] && echo "Failed" && exit 137
|
|
||||||
|
|
||||||
# Replace the first occurence of npmDepsHash with the new calculated hash in this file
|
|
||||||
sed -i "0,/npmDepsHash =/{s@npmDepsHash = .*@npmDepsHash = \"''$HASH\";@}" ''$PRJ_ROOT/default.nix
|
|
||||||
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user