mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-06-23 19:21:40 +02:00
meta: Make system module customizable
This commit is contained in:
parent
e1e1243618
commit
7ef220be22
@ -1,15 +1,36 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) mkOption;
|
||||||
|
inherit (lib.types) str listOf;
|
||||||
inherit (pkgs.nixVersions) nix_2_19;
|
inherit (pkgs.nixVersions) nix_2_19;
|
||||||
|
|
||||||
# TODO: Make these variables options
|
cfg = config.modules.system;
|
||||||
timeZone = "America/New_York";
|
|
||||||
defaultLocale = "ja_JP.UTF-8";
|
|
||||||
supportedLocales = [ "ja_JP.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8" ];
|
|
||||||
stateVersion = "22.11";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
options.modules.system = {
|
||||||
|
timeZone = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "America/New_York";
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultLocale = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "ja_JP.UTF-8";
|
||||||
|
};
|
||||||
|
|
||||||
|
supportedLocales = mkOption {
|
||||||
|
type = listOf str;
|
||||||
|
default = [ "ja_JP.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
stateVersion = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "22.11";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
boot = {
|
boot = {
|
||||||
tmp.cleanOnBoot = true;
|
tmp.cleanOnBoot = true;
|
||||||
|
|
||||||
@ -46,14 +67,15 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
time = {
|
time = {
|
||||||
inherit timeZone;
|
inherit (cfg) timeZone;
|
||||||
};
|
};
|
||||||
|
|
||||||
i18n = {
|
i18n = {
|
||||||
inherit defaultLocale supportedLocales;
|
inherit (cfg) defaultLocale supportedLocales;
|
||||||
};
|
};
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
inherit stateVersion;
|
inherit (cfg) stateVersion;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user