File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 3838 }
3939 } /Prelude/package.dhall" ;
4040
41+ # The location of the Dhall type specifications, used to type-check manifests.
4142 DHALL_TYPES = ./types ;
4243
4344 # We disable git-lfs files explicitly, as this is intended for large files
4445 # (typically >4GB), and source packgaes really ought not be shipping large
4546 # files — just source code.
4647 GIT_LFS_SKIP_SMUDGE = 1 ;
47-
4848 registryOverlay = final : prev : rec {
4949 nodejs = prev . nodejs_20 ;
5050
232232 in
233233 builtins . listToAttrs ( builtins . map toKeyPair noComments ) ;
234234
235- # Print an attrset of env vars { ENV_VAR = "value"; } as a newline-delimited
236- # string of "ENV_VAR=value" lines.
237- printEnv = env : pkgs . lib . concatStringsSep "\n " ( pkgs . lib . mapAttrsToList ( name : value : "${ name } =${ value } " ) env ) ;
238-
239235 # Allows you to run a local VM with the registry server, mimicking the
240236 # actual deployment.
241237 run-vm = let
746742 # Enable the registry server
747743 services . registry-server . enable = true ;
748744 services . registry-server . host = host ;
745+ services . registry-server . envVars = {
746+ # These env vars are known to Nix so we set them in advance.
747+ # Others, like credentials, must be set in a .env file in
748+ # the state directory, unless there are viable defaults.
749+ inherit DHALL_PRELUDE DHALL_TYPES GIT_LFS_SKIP_SMUDGE ;
750+ } ;
749751
750752 # Don't change this.
751753 system . stateVersion = "23.05" ;
Original file line number Diff line number Diff line change 7979 systemd . services = let
8080 # Print an attrset of env vars { ENV_VAR = "value"; } as a newline-delimited
8181 # string of "ENV_VAR=value" lines, then write the text to the Nix store.
82- defaultEnvFile =
83- pkgs . writeText ".env"
84- ( pkgs . lib . concatStringsSep "\n " ( pkgs . lib . mapAttrsToList ( name : value :
82+ printEnv = vars :
83+ pkgs . lib . concatStringsSep "\n " ( pkgs . lib . mapAttrsToList ( name : value :
8584 if ( builtins . typeOf value == "int" )
8685 then "${ name } =${ toString value } "
8786 else "${ name } =${ value } " )
88- cfg . envVars ) ) ;
87+ vars ) ;
88+ defaultEnvFile =
89+ pkgs . writeText ".env" ( printEnv cfg . envVars ) ;
8990 in {
9091 server = {
9192 description = "registry server" ;
You can’t perform that action at this time.
0 commit comments