Compare commits

..

3 Commits

Author SHA1 Message Date
Tom Alexander
d28e9b9745 Include homepage_private static files.
Some checks failed
build-staging Build build-staging has failed
2026-07-13 21:05:07 -04:00
Tom Alexander
d523c7c7a4 Remove the passing of nix cache creds.
There is no way to include them when fetching from a substituter.
2026-07-13 20:47:12 -04:00
Tom Alexander
feb9f58a86 Add support for building the site via nix. 2026-07-13 20:43:28 -04:00
4 changed files with 8 additions and 19 deletions

View File

@@ -142,8 +142,6 @@ spec:
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true" - "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --opt - --opt
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time) - build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- --secret
- id=cache_token,src=/workspace/nix-cache-creds/CACHE_GET_TOKEN
- name: BUILDKITD_TOML - name: BUILDKITD_TOML
value: | value: |
debug = true debug = true
@@ -157,8 +155,6 @@ spec:
workspace: git-source workspace: git-source
- name: dockerconfig - name: dockerconfig
workspace: docker-credentials workspace: docker-credentials
- name: nix-cache-creds
workspace: nix-cache-creds
runAfter: runAfter:
- fetch-repository - fetch-repository
finally: finally:
@@ -223,7 +219,6 @@ spec:
workspaces: workspaces:
- name: git-source - name: git-source
- name: docker-credentials - name: docker-credentials
- name: nix-cache-creds
workspaces: workspaces:
- name: git-source - name: git-source
volumeClaimTemplate: volumeClaimTemplate:
@@ -238,9 +233,6 @@ spec:
- name: docker-credentials - name: docker-credentials
secret: secret:
secretName: harbor-plain secretName: harbor-plain
- name: nix-cache-creds
secret:
secretName: nix-pull-through-cache
params: params:
- name: image-name - name: image-name
value: "harbor.fizz.buzz/private/homepage-staging" value: "harbor.fizz.buzz/private/homepage-staging"

View File

@@ -10,8 +10,6 @@ filter-syscalls = false
substituters = http://ncps.nix-pull-through-cache.svc.cluster.local:80 https://cache.nixos.org substituters = http://ncps.nix-pull-through-cache.svc.cluster.local:80 https://cache.nixos.org
EOF EOF
# RUN --mount=type=secret,id=cache_token echo "extra-access-tokens = ncps.nix-pull-through-cache.svc.cluster.local=PAT:$(cat /run/secrets/cache_token)" >> /etc/nix/nix.conf
RUN cp "$(nix build nixpkgs#cacert --print-out-paths)/etc/ssl/certs/ca-bundle.crt" /tmp/ca-bundle.crt RUN cp "$(nix build nixpkgs#cacert --print-out-paths)/etc/ssl/certs/ca-bundle.crt" /tmp/ca-bundle.crt
COPY . /tmp/build COPY . /tmp/build

View File

@@ -84,12 +84,18 @@
homepage = final.lib.makeScope final.newScope ( homepage = final.lib.makeScope final.newScope (
homepageScope: homepageScope:
let let
homepage_private = fetchGit {
url = "git@code.fizz.buzz:talexander/homepage_private.git";
ref = "main";
rev = "89ba9628bf3e596345bc83f59cef5a2943584894";
};
natter' = (natter.overlays.default final final).natter.release; natter' = (natter.overlays.default final final).natter.release;
organic_ast_explorer' = organic_ast_explorer' =
(organic_ast_explorer.overlays.default final final).organic_ast_explorer.release; (organic_ast_explorer.overlays.default final final).organic_ast_explorer.release;
release = homepageScope.callPackage ./nix/package.nix { release = homepageScope.callPackage ./nix/package.nix {
natter = natter'; natter = natter';
organic_ast_explorer = organic_ast_explorer'; organic_ast_explorer = organic_ast_explorer';
inherit homepage_private;
}; };
nginx_conf = final.replaceVars "${./docker/server/nginx.conf}" { nginx_conf = final.replaceVars "${./docker/server/nginx.conf}" {
web_root = release; web_root = release;

View File

@@ -1,9 +1,9 @@
{ {
hello,
lib, lib,
pkgs, pkgs,
natter, natter,
organic_ast_explorer, organic_ast_explorer,
homepage_private,
}: }:
let let
@@ -14,19 +14,12 @@ pkgs.stdenv.mkDerivation rec {
src = lib.cleanSource ../.; src = lib.cleanSource ../.;
nativeBuildInputs = [
# pkgs.simgrid
# pkgs.boost
# pkgs.cmake
];
configurePhase = ""; configurePhase = "";
# TODO copy COPY --link --from=private /homepage_private/static /source/static/
buildPhase = '' buildPhase = ''
mkdir -p static/organic/ast_explorer mkdir -p static/organic/ast_explorer
cp ${organic_ast_explorer}/* static/organic/ast_explorer/ cp ${organic_ast_explorer}/* static/organic/ast_explorer/
cp -r ${homepage_private}/static/* static/
${natter}/bin/natter build --config natter.toml ${natter}/bin/natter build --config natter.toml
''; '';