Compare commits

...

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

4 changed files with 24 additions and 85 deletions

View File

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

View File

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

View File

@ -1,74 +1,20 @@
{ config, pkgs, lib, ...}:
{ config, pkgs, ...}:
let
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 {
name = "entrypoint";
inherit name;
runtimeInputs = packages;
runtimeInputs = with pkgs; with nodePackages; [
node-red
ungoogled-chromium
];
text = ''
DATA="''${DATA-/data}"
cd "$DATA"
node-red -u "$DATA" -s "''${SETTINGS-/data/settings.js}"
node-red
'';
};
in pkgs.dockerTools.streamLayeredImage {
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.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"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1729070438,
"narHash": "sha256-KOTTUfPkugH52avUvXGxvWy8ibKKj4genodIYUED+Kc=",
"lastModified": 1722421184,
"narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5785b6bb5eaae44e627d541023034e1601455827",
"rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58",
"type": "github"
},
"original": {