aboutsummaryrefslogtreecommitdiff
path: root/src/property/timezone.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-06-27 13:53:00 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-06-27 13:53:00 -0700
commitd0aa307718036e54161cca197891e562486906cc (patch)
tree191a8a0672dd864edf4fd25c7941ebe94a639646 /src/property/timezone.lisp
parentbe00646656009a660aaf089200117dcd3384d875 (diff)
downloadconsfigurator-d0aa307718036e54161cca197891e562486906cc.tar.gz
add TIMEZONE:CONFIGURED
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/timezone.lisp')
-rw-r--r--src/property/timezone.lisp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/property/timezone.lisp b/src/property/timezone.lisp
new file mode 100644
index 0000000..f0d8d10
--- /dev/null
+++ b/src/property/timezone.lisp
@@ -0,0 +1,31 @@
+;;; Consfigurator -- Lisp declarative configuration management system
+
+;;; Copyright (C) 2021 Sean Whitton <spwhitton@spwhitton.name>
+
+;;; This file is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3, or (at your option)
+;;; any later version.
+
+;;; This file is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+(in-package :consfigurator.property.timezone)
+(named-readtables:in-readtable :consfigurator)
+
+(defproplist configured :posix (timezone)
+ "Set the system timezone. TIMEZONE is a relative path under /usr/share/zoneinfo,
+e.g. \"Europe/London\"."
+ (os:etypecase
+ (linux
+ (file:symlinked :from "/etc/localtime"
+ :to (merge-pathnames timezone #P"/usr/share/zoneinfo/"))))
+ (os:typecase
+ (os:debianlike
+ (on-change (file:has-content "/etc/timezone" (list timezone))
+ (apt:reconfigured "tzdata")))))