mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-25 17:53:17 +01:00
meta: Make system module customizable
This commit is contained in:
parent
e1e1243618
commit
7ef220be22
@ -1,59 +1,81 @@
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkOption;
|
||||
inherit (lib.types) str listOf;
|
||||
inherit (pkgs.nixVersions) nix_2_19;
|
||||
|
||||
# TODO: Make these variables options
|
||||
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";
|
||||
cfg = config.modules.system;
|
||||
in
|
||||
{
|
||||
boot = {
|
||||
tmp.cleanOnBoot = true;
|
||||
options.modules.system = {
|
||||
timeZone = mkOption {
|
||||
type = str;
|
||||
default = "America/New_York";
|
||||
};
|
||||
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
editor = false;
|
||||
configurationLimit = 10;
|
||||
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 = {
|
||||
tmp.cleanOnBoot = true;
|
||||
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
editor = false;
|
||||
configurationLimit = 10;
|
||||
};
|
||||
|
||||
timeout = 0;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
timeout = 0;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
|
||||
systemd = {
|
||||
extraConfig = "DefaultTimeoutStopSec=10s";
|
||||
services.NetworkManager-wait-online.enable = false;
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = nix_2_19;
|
||||
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
|
||||
auto-optimise-store = true;
|
||||
warn-dirty = false;
|
||||
systemd = {
|
||||
extraConfig = "DefaultTimeoutStopSec=10s";
|
||||
services.NetworkManager-wait-online.enable = false;
|
||||
};
|
||||
};
|
||||
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
memoryPercent = 100;
|
||||
};
|
||||
nix = {
|
||||
package = nix_2_19;
|
||||
|
||||
time = {
|
||||
inherit timeZone;
|
||||
};
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
|
||||
auto-optimise-store = true;
|
||||
warn-dirty = false;
|
||||
};
|
||||
};
|
||||
|
||||
i18n = {
|
||||
inherit defaultLocale supportedLocales;
|
||||
};
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
memoryPercent = 100;
|
||||
};
|
||||
|
||||
system = {
|
||||
inherit stateVersion;
|
||||
time = {
|
||||
inherit (cfg) timeZone;
|
||||
};
|
||||
|
||||
i18n = {
|
||||
inherit (cfg) defaultLocale supportedLocales;
|
||||
};
|
||||
|
||||
system = {
|
||||
inherit (cfg) stateVersion;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user