mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-09-11 03:55:23 +03:00
I try to convert strings to integers so the configuration is less awkward. Nix doesn't do `0x______` integers. So since colours are never written in base ten, let's allow strings.
13 lines
298 B
Ruby
13 lines
298 B
Ruby
# 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
|