diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-06-27 13:53:00 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-06-27 13:53:00 -0700 |
commit | d0aa307718036e54161cca197891e562486906cc (patch) | |
tree | 191a8a0672dd864edf4fd25c7941ebe94a639646 | |
parent | be00646656009a660aaf089200117dcd3384d875 (diff) | |
download | consfigurator-d0aa307718036e54161cca197891e562486906cc.tar.gz |
add TIMEZONE:CONFIGURED
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | consfigurator.asd | 1 | ||||
-rw-r--r-- | src/package.lisp | 7 | ||||
-rw-r--r-- | src/property/timezone.lisp | 31 |
3 files changed, 39 insertions, 0 deletions
diff --git a/consfigurator.asd b/consfigurator.asd index 6d16e04..46b4191 100644 --- a/consfigurator.asd +++ b/consfigurator.asd @@ -62,6 +62,7 @@ (:file "src/property/apache") (:file "src/property/systemd") (:file "src/property/firewalld") + (:file "src/property/timezone") (:file "src/connection/shell-wrap") (:file "src/connection/fork") (:file "src/connection/rehome") diff --git a/src/package.lisp b/src/package.lisp index ea19029..7a76497 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -745,6 +745,13 @@ #:rich-rule #:direct-rule)) +(defpackage :consfigurator.property.timezone + (:use #:cl #:consfigurator) + (:local-nicknames (#:file #:consfigurator.property.file) + (#:apt #:consfigurator.property.apt) + (#:os #:consfigurator.property.os)) + (:export #:configured)) + (defpackage :consfigurator.connection.local (:use #:cl #:consfigurator #:alexandria) (:export #:local-connection)) 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"))))) |