6 Commits

Author SHA1 Message Date
Arnie b183c239b3 Extract npm deps hash calculation to a separate command 2023-06-02 14:24:29 +02:00
Arnie 4b48f20371 Update vendor sha for golang 2023-06-02 14:24:14 +02:00
Arnie 5ef48d262b Automatically calculate npm deps and update it 2023-06-02 14:17:03 +02:00
Arnie 1d68d0f91f Update nix derivation 2023-06-02 13:55:58 +02:00
Arnie 65bc08f033 Add nix shell to the list of skills 2023-06-02 13:52:08 +02:00
Arnie f8db5d68cc Update nix derivation sha 2023-06-02 13:51:38 +02:00
2 changed files with 29 additions and 3 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ const otherSkills: OtherSkill[] = [
{
title: "Some of the relevant Frameworks/Tooling",
description:
"Terraform, Prometheus, Grafana, React, Webpack, Rollup, Esbuild, deep understanding of Git",
"Terraform, Prometheus, Grafana, Nix shell, React, Webpack, Rollup, Esbuild, deep understanding of Git",
},
{
title: "Software Development",
+28 -2
View File
@@ -47,7 +47,7 @@ let
cp -a dist $out
'';
npmInstallFlags = "--no-audit --no-progress --no-fund";
npmDepsHash = "sha256-dnUbw0kfAA50ZaQ91q/fC+gZhAGNo6vrSQBz6Qf2ngo=";
npmDepsHash = "sha256-p4rTpy0t8aajbubvtF1TA83/FFqvfKEOPBb5T0ZRfQY=";
npmPackFlags = [ "--ignore-scripts" ];
};
@@ -65,7 +65,7 @@ let
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}";
subPackages = [ "app/server" ];
vendorSha256 = "sha256-BkwXD8n62+p639vTLwXpCiY8cqYtCjWxaa5tuw78u5g=";
vendorSha256 = "sha256-44xcyVk5KcurQLkVJv1MeAj+Pfcu53664pvVgHdyv3E=";
overrideModAttrs = (_: {
impureEnvVars = pkgs.lib.fetchers.proxyImpureEnvVars ++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" "GOPROXY" ];
});
@@ -89,6 +89,7 @@ in
packages = [
go
golangci-lint
pkgs.prefetch-npm-deps
nodejs
@@ -116,6 +117,31 @@ in
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";
help = "Format and fix found issues";
command = ''
cd ''$PRJ_ROOT
golangci-lint run --sort-results --out-format tab --fix
npm --prefix ''$PRJ_ROOT/app/frontend run fix
update-npm-deps-hash
'';
}
{
name = "dev";
help = "Starts the javascript project in dev";