1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-11 21:17:45 +03:00
mobile-nixos/boot/splash/configuration.rb

13 lines
298 B
Ruby
Raw Normal View History

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