From d1aede43c470cbaebdd6f31a062353ef409a550f Mon Sep 17 00:00:00 2001 From: Tyler Kelley Date: Tue, 6 Feb 2024 00:44:36 -0600 Subject: [PATCH] Adding Options for ntp, nfs, and local hwclock --- config/system/default.nix | 3 +++ config/system/hwclock.nix | 6 ++++++ config/system/nfs.nix | 13 +++++++++++++ config/system/ntp.nix | 6 ++++++ config/system/services.nix | 1 - options.nix | 2 ++ 6 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 config/system/hwclock.nix create mode 100644 config/system/nfs.nix create mode 100644 config/system/ntp.nix diff --git a/config/system/default.nix b/config/system/default.nix index 6732edc..566ec0a 100644 --- a/config/system/default.nix +++ b/config/system/default.nix @@ -6,10 +6,13 @@ ./autorun.nix ./boot.nix ./displaymanager.nix + ./hwclock.nix ./intel-amd.nix ./intel-gpu.nix ./intel-nvidia.nix ./neovim.nix + ./nfs.nix + ./ntp.nix ./nvidia.nix ./packages.nix ./polkit.nix diff --git a/config/system/hwclock.nix b/config/system/hwclock.nix new file mode 100644 index 0000000..b511623 --- /dev/null +++ b/config/system/hwclock.nix @@ -0,0 +1,6 @@ +{ config, ... }: + +let inherit (import ../../options.nix) localHWClock; in +lib.mkIf ("${localHWClock}" == "on") { + time.hardwareClockInLocalTime = true; +} diff --git a/config/system/nfs.nix b/config/system/nfs.nix new file mode 100644 index 0000000..2bcb996 --- /dev/null +++ b/config/system/nfs.nix @@ -0,0 +1,13 @@ +{ config, ... }: + +let inherit (import ../../options.nix) nfs; in +lib.mkIf ("${nfs}" == "on") { + fileSystems."${nfsMountPoint}" = { + device = "${nfsDevice}"; + fsType = "nfs"; + }; + services = { + rpcbind.enable = true; + nfs.server.enable = true; + }; +} diff --git a/config/system/ntp.nix b/config/system/ntp.nix new file mode 100644 index 0000000..33005aa --- /dev/null +++ b/config/system/ntp.nix @@ -0,0 +1,6 @@ +{ config, ... }: + +let inherit (import ../../options.nix) ntp; in +lib.mkIf ("${ntp}" == "on") { + networking.timeServers = options.networking.timeServers.default ++ [ "pool.ntp.org" ]; +} diff --git a/config/system/services.nix b/config/system/services.nix index b5f1dad..2d0a374 100644 --- a/config/system/services.nix +++ b/config/system/services.nix @@ -35,5 +35,4 @@ auth include login ''; }; - networking.timeServers = options.networking.timeServers.default ++ [ "pool.ntp.org" ]; } diff --git a/options.nix b/options.nix index 9de073f..b6019a5 100644 --- a/options.nix +++ b/options.nix @@ -26,5 +26,7 @@ intel-bus-id = "PCI:0:2:0"; nvidia-bus-id = "PCI:14:0:0"; nfs = "on"; + localHWClock = "off"; + ntp = "on"; }