Compare commits
No commits in common. "main" and "development" have entirely different histories.
main
...
developmen
12
.github/workflows/build.yaml
vendored
12
.github/workflows/build.yaml
vendored
|
@ -19,11 +19,9 @@ jobs:
|
||||||
|
|
||||||
skopeo login --username ${{ secrets.DOCKER_USER }} --password ${{ secrets.DOCKER_PASSWORD }} "$REGISTRY"
|
skopeo login --username ${{ secrets.DOCKER_USER }} --password ${{ secrets.DOCKER_PASSWORD }} "$REGISTRY"
|
||||||
|
|
||||||
MAINTAG="sha-$(echo "$GITHUB_SHA" | cut -c 1-8)"
|
( # echo tags into the image uploader's read loop
|
||||||
nix run --show-trace .#upload-image "docker://$REGISTRY/$PACKAGE:$MAINTAG"
|
echo "sha-$(echo "$GITHUB_SHA" | cut -c 1-8)"
|
||||||
for TAG in \
|
echo "$GITHUB_REF_NAME-$(date +%Y%m%d-%H%M%S)"
|
||||||
"$GITHUB_REF_NAME" \
|
) | while read -r TAG;do
|
||||||
"$GITHUB_REF_NAME-$(date +%Y%m%d-%H%M%S)" \
|
nix run .#upload-image "docker://$REGISTRY/$PACKAGE:$TAG"
|
||||||
; do
|
|
||||||
skopeo copy "docker://$REGISTRY/$PACKAGE:$MAINTAG" "docker://$REGISTRY/$PACKAGE:$TAG"
|
|
||||||
done
|
done
|
||||||
|
|
15
.github/workflows/update.yaml
vendored
15
.github/workflows/update.yaml
vendored
|
@ -1,7 +1,7 @@
|
||||||
name: Update flake lock
|
name: Update flake lock
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '47 3 * * *'
|
- cron: '* * * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -10,15 +10,10 @@ 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 localadmin@strudelline.net
|
git config --local --add user.email gitea@strudelline.net
|
||||||
git config --local --add user.name 'Admin Actions'
|
git config --local --add user.name 'Gitea Actions'
|
||||||
git pull
|
|
||||||
nix flake update
|
nix flake update --commit-lock-file
|
||||||
if ! git commit -m "Flake updates for $(date)" -a;then
|
|
||||||
echo "no updates to commit"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
git push
|
git push
|
||||||
|
|
70
docker.nix
70
docker.nix
|
@ -1,74 +1,20 @@
|
||||||
{ config, pkgs, lib, ...}:
|
{ config, pkgs, ...}:
|
||||||
|
|
||||||
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 {
|
||||||
name = "entrypoint";
|
inherit name;
|
||||||
|
|
||||||
runtimeInputs = packages;
|
runtimeInputs = with pkgs; with nodePackages; [
|
||||||
|
node-red
|
||||||
|
ungoogled-chromium
|
||||||
|
];
|
||||||
|
|
||||||
text = ''
|
text = ''
|
||||||
DATA="''${DATA-/data}"
|
node-red
|
||||||
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)
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
12
flake.lock
12
flake.lock
|
@ -5,11 +5,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726560853,
|
"lastModified": 1710146030,
|
||||||
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -20,11 +20,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1729070438,
|
"lastModified": 1722421184,
|
||||||
"narHash": "sha256-KOTTUfPkugH52avUvXGxvWy8ibKKj4genodIYUED+Kc=",
|
"narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5785b6bb5eaae44e627d541023034e1601455827",
|
"rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user