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 38
38
}
39
39
} /Prelude/package.dhall" ;
40
40
41
+ # The location of the Dhall type specifications, used to type-check manifests.
41
42
DHALL_TYPES = ./types ;
42
43
43
44
# We disable git-lfs files explicitly, as this is intended for large files
44
45
# (typically >4GB), and source packgaes really ought not be shipping large
45
46
# files — just source code.
46
47
GIT_LFS_SKIP_SMUDGE = 1 ;
47
-
48
48
registryOverlay = final : prev : rec {
49
49
nodejs = prev . nodejs_20 ;
50
50
232
232
in
233
233
builtins . listToAttrs ( builtins . map toKeyPair noComments ) ;
234
234
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
-
239
235
# Allows you to run a local VM with the registry server, mimicking the
240
236
# actual deployment.
241
237
run-vm = let
746
742
# Enable the registry server
747
743
services . registry-server . enable = true ;
748
744
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
+ } ;
749
751
750
752
# Don't change this.
751
753
system . stateVersion = "23.05" ;
Original file line number Diff line number Diff line change 79
79
systemd . services = let
80
80
# Print an attrset of env vars { ENV_VAR = "value"; } as a newline-delimited
81
81
# 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 :
85
84
if ( builtins . typeOf value == "int" )
86
85
then "${ name } =${ toString value } "
87
86
else "${ name } =${ value } " )
88
- cfg . envVars ) ) ;
87
+ vars ) ;
88
+ defaultEnvFile =
89
+ pkgs . writeText ".env" ( printEnv cfg . envVars ) ;
89
90
in {
90
91
server = {
91
92
description = "registry server" ;
You can’t perform that action at this time.
0 commit comments