mkosi icon indicating copy to clipboard operation
mkosi copied to clipboard

Support environment file(s)

Open nopeslide opened this issue 4 years ago • 3 comments

Currently mkosi supports specification of environment variables via cli and inside the mkosi.default file. Both variants are tedious to use when variables are generated outside of mkosi. I propose a new option EnvironmentFile (mkosi.env as default) which takes multiple file paths that are parsed & translated into nspawn env options when building the container and set inside the mkosi.finalize script. The file format that is used to describe the variables inside these files could be a "plain" shell-like format like systemd uses, which can be generated outside of mkosi.

nopeslide avatar Jun 14 '21 08:06 nopeslide

makes sense I guess.

poettering avatar Jun 17 '21 08:06 poettering

@nopeslide You can now specify Environment=FOO, and this will propagate $FOO from the mkosi environment. Is this enough for you, or do you still want the env file?

keszybz avatar Sep 08 '21 15:09 keszybz

@nopeslide You can now specify Environment=FOO, and this will propagate $FOO from the mkosi environment. Is this enough for you, or do you still want the env file?

I have a few hundred variables (multiple network configs), a file based approach would be nice. I also started an implementation, but didn't had the time to finalize it.

nopeslide avatar Sep 08 '21 16:09 nopeslide