Compare commits

..

No commits in common. "development" and "main" have entirely different histories.

4 changed files with 85 additions and 24 deletions

View File

@ -19,9 +19,11 @@ jobs:
skopeo login --username ${{ secrets.DOCKER_USER }} --password ${{ secrets.DOCKER_PASSWORD }} "$REGISTRY" skopeo login --username ${{ secrets.DOCKER_USER }} --password ${{ secrets.DOCKER_PASSWORD }} "$REGISTRY"
( # echo tags into the image uploader's read loop MAINTAG="sha-$(echo "$GITHUB_SHA" | cut -c 1-8)"
echo "sha-$(echo "$GITHUB_SHA" | cut -c 1-8)" nix run --show-trace .#upload-image "docker://$REGISTRY/$PACKAGE:$MAINTAG"
echo "$GITHUB_REF_NAME-$(date +%Y%m%d-%H%M%S)" for TAG in \
) | while read -r TAG;do "$GITHUB_REF_NAME" \
nix run .#upload-image "docker://$REGISTRY/$PACKAGE:$TAG" "$GITHUB_REF_NAME-$(date +%Y%m%d-%H%M%S)" \
; do
skopeo copy "docker://$REGISTRY/$PACKAGE:$MAINTAG" "docker://$REGISTRY/$PACKAGE:$TAG"
done done

View File

@ -1,7 +1,7 @@
name: Update flake lock name: Update flake lock
on: on:
schedule: schedule:
- cron: '* * * * *' - cron: '47 3 * * *'
jobs: jobs:
build: build:
@ -10,10 +10,15 @@ jobs:
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
token: ${{ secrets.ADMIN_ACTIONS_TOKEN }}
fetch-depth: 0 fetch-depth: 0
- run: |- - run: |-
git config --local --add user.email gitea@strudelline.net git config --local --add user.email localadmin@strudelline.net
git config --local --add user.name 'Gitea Actions' git config --local --add user.name 'Admin Actions'
git pull
nix flake update --commit-lock-file nix flake update
if ! git commit -m "Flake updates for $(date)" -a;then
echo "no updates to commit"
exit 0
fi
git push git push

View File

@ -1,20 +1,74 @@
{ config, pkgs, ...}: { config, pkgs, lib, ...}:
let let
name = "node-red"; name = "node-red";
packages =
with pkgs;
[
neovim
nodejs
nodePackages.npm
nodePackages.node-red
#ungoogled-chromium
];
passportOIDC = pkgs.fetchFromGitHub {
owner = "jaredhanson";
repo = "passport-openidconnect";
rev = "c69c2137c5b49534e93008aa0645a00aba1f7f0b";
sha256 = "sha256-jaeEoJNcAoczZhcuhb2Uw2LKXXARBKkPDYhIDUblWRk=";
};
entrypoint = pkgs.writeShellApplication { entrypoint = pkgs.writeShellApplication {
inherit name; name = "entrypoint";
runtimeInputs = with pkgs; with nodePackages; [ runtimeInputs = packages;
node-red
ungoogled-chromium
];
text = '' text = ''
node-red DATA="''${DATA-/data}"
cd "$DATA"
node-red -u "$DATA" -s "''${SETTINGS-/data/settings.js}"
''; '';
}; };
in pkgs.dockerTools.streamLayeredImage { in pkgs.dockerTools.streamLayeredImage {
inherit name; inherit name;
contents = pkgs.buildEnv {
name = "imgroot";
paths = (with pkgs; [
shadow
less
bashInteractive
coreutils
findutils
dockerTools.usrBinEnv
dockerTools.binSh
dockerTools.caCertificates
#dockerTools.fakeNss
] ++ packages);
};
config.Cmd = [ "${entrypoint}/bin/entrypoint" ]; config.Cmd = [ "${entrypoint}/bin/entrypoint" ];
config.WorkingDir = "/data";
config.Env = with pkgs; [ "HOME=/data" ];
enableFakechroot = true;
fakeRootCommands = ''
# ${pkgs.runtimeShell}
mkdir -p tmp
chmod 1777 tmp
${pkgs.dockerTools.shadowSetup}
groupadd -r node-red
useradd -r -g node-red node-red
id node-red 2>&1 > node-red.id
mkdir -p /farts
mkdir -p /farts/copy
cp -a ${passportOIDC}/* /farts/copy/
${pkgs.nodejs}/bin/npm i --prefix /farts ${passportOIDC}
mkdir -p /data
(cd /data;${pkgs.nodejs}/bin/npm i passport-openidconnect)
chown -R node-red:node-red data
chmod -R 750 data
date > build-date.txt
'';
extraCommands = ''
#mkdir -p /data
#cd /data;${pkgs.nodejs}/bin/npm i passport-openidconnect
#(cd /data;${pkgs.nodejs}/bin/npm i passport-openidconnect)
'';
} }

View File

@ -5,11 +5,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1726560853,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1722421184, "lastModified": 1729070438,
"narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=", "narHash": "sha256-KOTTUfPkugH52avUvXGxvWy8ibKKj4genodIYUED+Kc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58", "rev": "5785b6bb5eaae44e627d541023034e1601455827",
"type": "github" "type": "github"
}, },
"original": { "original": {