4
hosts/common/system/configs/ntp/default.nix
Normal file
4
hosts/common/system/configs/ntp/default.nix
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.ntp.enable = true;
|
||||||
|
}
|
14
hosts/common/system/configs/timezone/default.nix
Normal file
14
hosts/common/system/configs/timezone/default.nix
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{ lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
networking.networkmanager.dispatcherScripts = [
|
||||||
|
{
|
||||||
|
source = lib.meta.getExe (
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "timezone-sync";
|
||||||
|
runtimeInputs = with pkgs; [ curl ];
|
||||||
|
text = builtins.readFile ./timezone.sh;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
7
hosts/common/system/configs/timezone/timezone.sh
Normal file
7
hosts/common/system/configs/timezone/timezone.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
case "$2" in
|
||||||
|
connectivity-change)
|
||||||
|
if timezone=$(curl --fail https://ipapi.co/timezone); then
|
||||||
|
timedatectl set-timezone "$timezone"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
@@ -16,12 +16,14 @@
|
|||||||
../common/system/configs/nix
|
../common/system/configs/nix
|
||||||
../common/system/configs/nix-ld
|
../common/system/configs/nix-ld
|
||||||
../common/system/configs/nixpkgs
|
../common/system/configs/nixpkgs
|
||||||
|
../common/system/configs/ntp
|
||||||
../common/system/configs/pipewire
|
../common/system/configs/pipewire
|
||||||
../common/system/configs/plymouth
|
../common/system/configs/plymouth
|
||||||
../common/system/configs/ranger
|
../common/system/configs/ranger
|
||||||
../common/system/configs/sops
|
../common/system/configs/sops
|
||||||
../common/system/configs/ssh
|
../common/system/configs/ssh
|
||||||
../common/system/configs/system
|
../common/system/configs/system
|
||||||
|
../common/system/configs/timezone
|
||||||
../common/system/configs/tmux
|
../common/system/configs/tmux
|
||||||
../common/system/configs/tree
|
../common/system/configs/tree
|
||||||
../common/system/configs/users
|
../common/system/configs/users
|
||||||
@@ -32,7 +34,5 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
time.timeZone = "Europe/London";
|
|
||||||
|
|
||||||
sops.defaultSopsFile = ./secrets/secrets.yaml;
|
sops.defaultSopsFile = ./secrets/secrets.yaml;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user