]> git.dkaiser.de - config/nixos.git/commitdiff
Modularize locale
authorDominik Kaiser <dominik-kaiser@mailbox.org>
Mon, 17 Feb 2025 16:12:14 +0000 (17:12 +0100)
committerDominik Kaiser <dominik-kaiser@mailbox.org>
Mon, 17 Feb 2025 16:12:14 +0000 (17:12 +0100)
hosts/antares/configuration.nix
hosts/common/global/default.nix [new file with mode: 0644]
hosts/common/global/locale.nix [new file with mode: 0644]
hosts/sol/configuration.nix

index 5ac3fe2db71641b89288ff408fee647f03f84e46..92284b67e356a28f055ed9cc0701159787f4023c 100644 (file)
@@ -9,6 +9,7 @@
     (modulesPath + "/installer/scan/not-detected.nix")
     (modulesPath + "/profiles/qemu-guest.nix")
     ./disk-config.nix
+    ../common/global
   ];
   boot.loader.grub = {
     # no need to set devices, disko will add all devices that have a EF02 partition to the list already
@@ -33,7 +34,6 @@
   };
 
   networking.hostName = "antares";
-  time.timeZone = "Europe/Berlin";
 
   virtualisation.podman = {
     enable = true;
diff --git a/hosts/common/global/default.nix b/hosts/common/global/default.nix
new file mode 100644 (file)
index 0000000..3af5cc8
--- /dev/null
@@ -0,0 +1,6 @@
+{ inputs, outputs, ... }:
+{
+  imports = [
+    ./locale.nix
+  ];
+}
\ No newline at end of file
diff --git a/hosts/common/global/locale.nix b/hosts/common/global/locale.nix
new file mode 100644 (file)
index 0000000..7bc53c2
--- /dev/null
@@ -0,0 +1,18 @@
+{lib, ...}:
+{
+  time.timeZone = lib.mkDefault "Europe/Berlin";
+  i18n = {
+    defaultLocale = lib.mkDefault "en_US.UTF-8";
+    extraLocaleSettings = {
+      LC_ADDRESS = lib.mkDefault "en_IE.UTF-8";
+      LC_IDENTIFICATION = lib.mkDefault "en_IE.UTF-8";
+      LC_MEASUREMENT = lib.mkDefault "en_IE.UTF-8";
+      LC_MONETARY = lib.mkDefault "en_IE.UTF-8";
+      LC_NAME = lib.mkDefault "en_IE.UTF-8";
+      LC_NUMERIC = lib.mkDefault "en_IE.UTF-8";
+      LC_PAPER = lib.mkDefault "en_IE.UTF-8";
+      LC_TELEPHONE = lib.mkDefault "en_IE.UTF-8";
+      LC_TIME = lib.mkDefault "en_IE.UTF-8";
+    };
+  };
+}
\ No newline at end of file
index 27c325700162bd385ad357f99e62510cc878b8f0..2106d058dd2fe012c8f0d84f9307eeb1803940cf 100644 (file)
@@ -8,6 +8,7 @@
   imports =
     [ # Include the results of the hardware scan.
       ./hardware-configuration.nix
+      ../common/global
     ];
 
   nix.settings.experimental-features = [ "nix-command" "flakes" ];
   # Enable networking
   networking.networkmanager.enable = true;
 
-  # Set your time zone.
-  time.timeZone = "Europe/Berlin";
-
-  # Select internationalisation properties.
-  i18n.defaultLocale = "en_US.UTF-8";
-
-  i18n.extraLocaleSettings = {
-    LC_ADDRESS = "de_DE.UTF-8";
-    LC_IDENTIFICATION = "de_DE.UTF-8";
-    LC_MEASUREMENT = "de_DE.UTF-8";
-    LC_MONETARY = "de_DE.UTF-8";
-    LC_NAME = "de_DE.UTF-8";
-    LC_NUMERIC = "de_DE.UTF-8";
-    LC_PAPER = "de_DE.UTF-8";
-    LC_TELEPHONE = "de_DE.UTF-8";
-    LC_TIME = "de_DE.UTF-8";
-  };
-
   # Enable the X11 windowing system.
   services.xserver.enable = true;