mirror of
https://gitlab.com/TECHNOFAB/coder-templates.git
synced 2025-12-12 02:00:11 +01:00
bak
This commit is contained in:
commit
249d048d34
11 changed files with 744 additions and 0 deletions
27
image.nix
Normal file
27
image.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
processes ? {},
|
||||
...
|
||||
}: let
|
||||
# https://github.com/cachix/devenv/blob/5a30b9e5ac7c6167e61b1f4193d5130bb9f8defa/src/modules/processes.nix#L121
|
||||
procfile = pkgs.writeText "procfile" (lib.concatStringsSep "\n" (lib.mapAttrsToList (name: process: "${name}: exec ${pkgs.writeShellScript name process}") processes));
|
||||
overmind-sys = pkgs.writeShellScriptBin "overmind-sys" ''
|
||||
OVERMIND_SOCKET=/run/overmind-sys.sock \
|
||||
OVERMIND_ANY_CAN_DIE=1 \
|
||||
OVERMIND_PROCFILE=${procfile} \
|
||||
${pkgs.overmind}/bin/overmind "$@"
|
||||
'';
|
||||
in
|
||||
pkgs.dockerTools.buildImage {
|
||||
name = "nix-coder";
|
||||
tag = "latest";
|
||||
|
||||
copyToRoot = pkgs.buildEnv {
|
||||
name = "image-root";
|
||||
paths = [pkgs.bashInteractive overmind-sys];
|
||||
pathsToLink = ["/bin"];
|
||||
};
|
||||
|
||||
config.Cmd = ["/bin/bash"];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue