42 lines
1.1 KiB
Nix
42 lines
1.1 KiB
Nix
{
|
|
description = "docker builder for cascade's node-red";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
lib = nixpkgs.lib;
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
streamImage = pkgs.callPackage (import ./docker.nix) {};
|
|
#pkgs.dockerTools.streamLayeredImage {
|
|
# name = "node-red";
|
|
# config.Cmd = [ "${pkgs.nodePackages.node-red}/bin/node-red" ];
|
|
#};
|
|
in
|
|
{
|
|
|
|
packages.upload-image = pkgs.writeScriptBin "upload" ''
|
|
${streamImage} | ${pkgs.skopeo}/bin/skopeo copy docker-archive:/dev/stdin "$@"
|
|
'';
|
|
|
|
packages.stream-image = pkgs.writeScriptBin "stream" ''
|
|
${streamImage}
|
|
'';
|
|
|
|
packages.default = pkgs.writeScriptBin "help" ''
|
|
echo ${lib.escapeShellArg ''
|
|
nixos-based docker node-red image builder
|
|
|
|
usage:
|
|
|
|
nix run .#stream-image | docker load
|
|
nix run .#upload-image docker://registry.where/it/goes:its4tag
|
|
''}
|
|
|
|
'';
|
|
});
|
|
}
|