wip
This commit is contained in:
parent
27588a1d35
commit
7f1eaf879a
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
|
@ -20,7 +20,7 @@ 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)"
|
MAINTAG="sha-$(echo "$GITHUB_SHA" | cut -c 1-8)"
|
||||||
nix run .#upload-image "docker://$REGISTRY/$PACKAGE:$MAINTAG"
|
nix run --show-trace .#upload-image "docker://$REGISTRY/$PACKAGE:$MAINTAG"
|
||||||
for TAG in \
|
for TAG in \
|
||||||
"$GITHUB_REF_NAME" \
|
"$GITHUB_REF_NAME" \
|
||||||
"$GITHUB_REF_NAME-$(date +%Y%m%d-%H%M%S)" \
|
"$GITHUB_REF_NAME-$(date +%Y%m%d-%H%M%S)" \
|
||||||
|
|
68
docker.nix
68
docker.nix
|
@ -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 {
|
||||||
name = "entrypoint";
|
name = "entrypoint";
|
||||||
|
|
||||||
runtimeInputs = with pkgs; with nodePackages; [
|
runtimeInputs = packages;
|
||||||
node-red
|
|
||||||
#ungoogled-chromium
|
|
||||||
];
|
|
||||||
|
|
||||||
text = ''
|
text = ''
|
||||||
node-red -u "''${DATA-/data}" -s "''${SETTINGS-/data/settings.js}"
|
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)
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,16 +20,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722421184,
|
"lastModified": 1722813957,
|
||||||
"narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=",
|
"narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58",
|
"rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable-small",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user