feat: add localisation module
This commit is contained in:
@@ -25,6 +25,7 @@ in
|
||||
inputs.self.nixosModules.workstation
|
||||
inputs.self.nixosModules.nvidia
|
||||
inputs.self.nixosModules.initrd-ssh
|
||||
inputs.self.nixosModules.localisation
|
||||
];
|
||||
|
||||
yubikey.enable = true;
|
||||
@@ -67,9 +68,11 @@ in
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
time.timeZone = "Europe/Ljubljana";
|
||||
environment.variables.TZ = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
localisation = {
|
||||
enable = true;
|
||||
timeZone = "Europe/Ljubljana";
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
# WARN:(@janezicmatej) nix-ld for running pip-installed binaries outside nix, probably want to drop this
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
inputs.self.nixosModules.tuigreet
|
||||
inputs.self.nixosModules.workstation
|
||||
inputs.self.nixosModules.initrd-ssh
|
||||
inputs.self.nixosModules.localisation
|
||||
];
|
||||
|
||||
yubikey.enable = true;
|
||||
@@ -59,8 +60,11 @@
|
||||
pkiBundle = "/var/lib/sbctl";
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/Ljubljana";
|
||||
environment.variables.TZ = "Europe/Ljubljana";
|
||||
localisation = {
|
||||
enable = true;
|
||||
timeZone = "Europe/Ljubljana";
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
services.udisks2.enable = true;
|
||||
|
||||
|
||||
28
modules/nixos/localisation.nix
Normal file
28
modules/nixos/localisation.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
localisation = {
|
||||
enable = lib.mkEnableOption "localisation defaults";
|
||||
|
||||
timeZone = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
defaultLocale = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.localisation.enable {
|
||||
time.timeZone = config.localisation.timeZone;
|
||||
i18n.defaultLocale = config.localisation.defaultLocale;
|
||||
|
||||
# NOTE:(@janezicmatej) some apps (e.g. java) need TZ env var explicitly
|
||||
environment.variables.TZ = config.localisation.timeZone;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user