aboutsummaryrefslogtreecommitdiff
path: root/src/property/os.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-04 16:29:39 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-04 16:29:39 -0700
commit160b76c2bef0541ebcae3363ceebb0666e227451 (patch)
treedde309dc5666138500a4bbf49d8724158b31a2af /src/property/os.lisp
parentcebded4616c69a59767f2f19a071dfda0357d513 (diff)
downloadconsfigurator-160b76c2bef0541ebcae3363ceebb0666e227451.tar.gz
start figuring out representation of host operating systems
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/os.lisp')
-rw-r--r--src/property/os.lisp57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/property/os.lisp b/src/property/os.lisp
new file mode 100644
index 0000000..28e88d3
--- /dev/null
+++ b/src/property/os.lisp
@@ -0,0 +1,57 @@
+;;; 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.os)
+
+(defclass unixlike () ())
+
+(defclass linux (unixlike)
+ ((architecture
+ :initarg :arch :reader linux-architecture
+ :documentation
+ "Keyword whose name is Debian's name for this architecture, e.g. :AMD64")))
+
+(defclass debian (linux)
+ ((suite :initarg :suite
+ :reader debian-suite
+ :initform (error "Must provide suite"))))
+
+(defclass debian-stable (debian) ())
+
+(defprop debian-stable :posix (suite architecture)
+ (:hostattrs
+ (push-hostattrs :os
+ (make-instance 'debian-stable
+ :architecture architecture :suite suite))))
+
+(defclass debian-testing (debian)
+ ((suite :initform "testing")))
+
+(defprop debian-testing :posix (architecture)
+ (:hostattrs
+ (push-hostattrs :os
+ (make-instance 'debian-testing
+ :architecture architecture))))
+
+(defclass debian-unstable (debian)
+ ((suite :initform "unstable")))
+
+(defprop debian-unstable :posix (architecture)
+ (:hostattrs
+ (push-hostattrs :os
+ (make-instance 'debian-unstable
+ :architecture architecture))))