diff options
author | Franz Geffke <franz@pantherx.org> | 2024-03-30 16:31:16 +0000 |
---|---|---|
committer | Franz Geffke <franz@pantherx.org> | 2024-03-30 16:31:16 +0000 |
commit | fd80241d05dfbf2befa06e53aabeef8b1c3247cf (patch) | |
tree | c83c1474c2346d2455c8d87b7d603b0913531afd | |
parent | 139c3543fdf2c1877a8e9d986bfe8b477cc5e7a1 (diff) |
mongodb: drop
-rw-r--r-- | px/packages/databases.scm | 30 | ||||
-rw-r--r-- | px/services/databases.scm | 117 |
2 files changed, 0 insertions, 147 deletions
diff --git a/px/packages/databases.scm b/px/packages/databases.scm index eeb9d90..767fe97 100644 --- a/px/packages/databases.scm +++ b/px/packages/databases.scm @@ -42,36 +42,6 @@ #:use-module (srfi srfi-26) #:use-module (ice-9 match)) -(define-public mongodb - (package - (name "mongodb") - (version "5.0.9") - (source - (origin - (method url-fetch) - (uri (string-append "https://fastdl.mongodb.org/linux/" name - "-linux-x86_64-debian10-" version ".tgz")) - (sha256 - (base32 "0ycav2jckl5v8mjaiddzll2i25z4lp8fpsg9ymcxpzyj3kxxip6q")))) - (build-system binary-build-system) - (arguments - `(#:patchelf-plan `(("bin/mongo" ("curl" "gcc" "gcc-toolchain" "openssl" - "xz")) - ("bin/mongod" ("curl" "gcc" "gcc-toolchain" "openssl" - "xz")) - ("bin/mongos" ("curl" "gcc" "gcc-toolchain" "openssl" - "xz"))))) - (inputs (list curl - (list gcc "lib") gcc-toolchain openssl xz)) - (home-page "https://www.mongodb.org") - (synopsis "High performance and high availability document database") - (description - "Mongo is a high-performance, high availability, schema-free -document-oriented database. A key goal of MongoDB is to bridge the gap -between key/value stores (which are fast and highly scalable) and traditional -RDBMS systems (which are deep in functionality).") - (license license:expat))) - (define-public sqlitecpp (package (name "sqlitecpp") diff --git a/px/services/databases.scm b/px/services/databases.scm deleted file mode 100644 index 85107a0..0000000 --- a/px/services/databases.scm +++ /dev/null @@ -1,117 +0,0 @@ -;;; Databases service definitions for PantherX -;;; Reza Alizadeh Majd (r.majd@pantherx.org) - -(define-module (px services databases) - #:use-module (gnu services) - #:use-module (gnu services shepherd) - #:use-module (gnu system shadow) - #:use-module (gnu packages admin) - #:use-module (guix modules) - #:use-module (guix records) - #:use-module (guix gexp) - #:use-module (px packages databases) - #:use-module (srfi srfi-1) - #:use-module (ice-9 match) - #:export (mongodb-configuration - mongodb-configuration? - mongodb-configuration-mongodb - mongodb-configuration-config-file - mongodb-configuration-data-directory - mongodb-service-type)) - -;;; -;;; MongoDB -;;; -;;; @subsubheading MongoDB -;;; @defvr {Scheme Variable} mongodb-service-type -;;; This is the service type for @uref{https://www.mongodb.com/, MongoDB}. -;;; The value for the service type is a @code{mongodb-configuration} object. -;;; @end defvr -;;; @lisp -;;; (service mongodb-service-type) -;;; @end lisp -;;; @deftp {Data Type} mongodb-configuration -;;; Data type representing the configuration of mongodb. -;;; @table @asis -;;; @item @code{mongodb} (default: @code{mongodb}) -;;; The MongoDB package to use. -;;; @item @code{config-file} (default: @code{%default-mongodb-configuration-file}) -;;; The configuration file for MongoDB. -;;; @item @code{data-directory} (default: @code{"/var/lib/mongodb"}) -;;; This value is used to create the directory, so that it exists and is -;;; owned by the mongodb user. It should match the data-directory which -;;; MongoDB is configured to use through the configuration file. -;;; @end table -;;; @end deftp - -(define %default-mongodb-configuration-file - (plain-file "mongodb.yaml" "# GNU Guix: MongoDB default configuration file -processManagement: - pidFilePath: /var/run/mongodb/pid -storage: - dbPath: /var/lib/mongodb -")) - -(define-record-type* <mongodb-configuration> mongodb-configuration - make-mongodb-configuration - mongodb-configuration? - (mongodb mongodb-configuration-mongodb - (default mongodb)) - (config-file mongodb-configuration-config-file - (default %default-mongodb-configuration-file)) - (data-directory mongodb-configuration-data-directory - (default "/var/lib/mongodb"))) - -(define %mongodb-accounts - (list (user-group - (name "mongodb") - (system? #t)) - (user-account - (name "mongodb") - (group "mongodb") - (system? #t) - (comment "Mongodb server user") - (home-directory "/var/lib/mongodb") - (shell (file-append shadow "/sbin/nologin"))))) - -(define mongodb-activation - (match-lambda - (($ <mongodb-configuration> mongodb config-file data-directory) - #~(begin - (use-modules (guix build utils)) - (let ((user (getpwnam "mongodb"))) - (for-each (lambda (directory) - (mkdir-p directory) - (chown directory - (passwd:uid user) - (passwd:gid user))) - '("/var/run/mongodb" #$data-directory))))))) - -(define mongodb-shepherd-service - (match-lambda - (($ <mongodb-configuration> mongodb config-file data-directory) - (shepherd-service (provision '(mongodb)) - (documentation "Run the Mongodb daemon.") - (requirement '(user-processes loopback)) - (start #~(make-forkexec-constructor `(,(string-append #$mongodb - "/bin/mongod") - "--config" - ,#$config-file) - #:user "mongodb" - #:group "mongodb" - #:pid-file "/var/run/mongodb/pid" - #:log-file "/var/log/mongodb.log")) - (stop #~(make-kill-destructor)))))) - -(define mongodb-service-type - (service-type (name 'mongodb) - (description "Run the MongoDB document database server.") - (extensions (list (service-extension - shepherd-root-service-type - (compose list mongodb-shepherd-service)) - (service-extension activation-service-type - mongodb-activation) - (service-extension account-service-type - (const %mongodb-accounts)))) - (default-value (mongodb-configuration)))) - |