1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 19:23:01 +03:00
mobile-nixos/boot/init/lib/configuration.rb
Samuel Dionne-Riel 555548d3f4 boot/init: Review how configuration is loaded and used
This way it can be used at any time, regardless of execution state, as
long as the Configuration module has been parsed.
2020-02-03 16:19:10 -05:00

8 lines
218 B
Ruby

# Handles lazy-loading the configuration, and giving a value for a given key.
module Configuration
def self.[](key)
@configuration ||= JSON.parse(File.read("/etc/boot/config"));
@configuration[key]
end
end