From 99d2913b417ee110428385e6df3e0a15786d7c2e Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Thu, 22 Jun 2023 10:17:42 -0400 Subject: [PATCH] nix: Remove one-off variables Don't use variables for things that only get defined in one place. --- default.nix | 3 --- modules/locale.nix | 6 +++--- modules/timezone.nix | 4 ++-- src/variables.nix | 3 --- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/default.nix b/default.nix index 3e47ead..2eccc6f 100644 --- a/default.nix +++ b/default.nix @@ -15,11 +15,8 @@ options.variables = { hostname = lib.mkOption { default = "nixos"; }; - timezone = lib.mkOption { default = "America/New_York"; }; hostHardwareConfiguration = lib.mkOption { default = ./hardware/laptop.nix; }; stateVersion = lib.mkOption { default = "22.11"; }; - defaultLocale = lib.mkOption { default = "ja_JP.UTF-8"; }; - supportedLocales = lib.mkOption { default = [ "ja_JP.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8" ]; }; username = lib.mkOption { default = "user"; }; defaultBrowser = lib.mkOption { default = "librewolf"; }; }; diff --git a/modules/locale.nix b/modules/locale.nix index 67be9a8..7764131 100644 --- a/modules/locale.nix +++ b/modules/locale.nix @@ -1,4 +1,4 @@ -let VARIABLES = import ../src/variables.nix; in { - i18n.defaultLocale = VARIABLES.defaultLocale; - i18n.supportedLocales = VARIABLES.supportedLocales; +{ + i18n.defaultLocale = "ja_JP.UTF-8"; + i18n.supportedLocales = [ "ja_JP.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8" ]; } diff --git a/modules/timezone.nix b/modules/timezone.nix index 8e88c84..5174a5b 100644 --- a/modules/timezone.nix +++ b/modules/timezone.nix @@ -1,3 +1,3 @@ -let VARIABLES = import ../src/variables.nix; in { - time.timeZone = "${VARIABLES.timezone}"; +{ + time.timeZone = "America/New_York"; } diff --git a/src/variables.nix b/src/variables.nix index 8dea357..fd1d199 100644 --- a/src/variables.nix +++ b/src/variables.nix @@ -1,11 +1,8 @@ { hostname = "nixos"; system = "x86_64-linux"; - timezone = "America/New_York"; hostHardwareConfiguration = ../hardware/laptop.nix; stateVersion = "22.11"; - defaultLocale = "ja_JP.UTF-8"; - supportedLocales = [ "ja_JP.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8" ]; username = "user"; defaultBrowser = "librewolf"; }