about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--README.org (renamed from README.md)77
-rw-r--r--gn/deploy/machines.scm64
-rw-r--r--gn/deploy/machines/myserver.scm66
3 files changed, 161 insertions, 46 deletions
diff --git a/README.md b/README.org
index 42712a0..1d51aaf 100644
--- a/README.md
+++ b/README.org
@@ -1,116 +1,101 @@
-# guix-bioinformatics
+* guix-bioinformatics
 
 Bioinformatics packages for GNU Guix that are used in
-http://genenetwork.org/.  See
-[Guix Notes](https://github.com/pjotrp/guix-notes/blob/master/HACKING.org)
-for installing and hacking GNU Guix.
+http://genenetwork.org/.  See [[https://github.com/pjotrp/guix-notes/blob/master/HACKING.org][Guix notes]] for installing and hacking
+GNU Guix.
 
-To easily use the packages from this repo, simply add it to your `channels` list:
+To easily use the packages from this repo, simply add it to your
+`channels` list in ~/.config/guix/channels.scm as described
+[[https://guix.gnu.org/manual/en/html_node/Channels.html][here]]:
 
+#+BEGIN_SRC scheme
     (cons*
       (channel
         (name 'gn-bioinformatics)
-        (url "https://gitlab.com/genenetwork/guix-bioinformatics")
+        (url "https://git.genenetwork.org/pjotrp/guix-bioinformatics.git")
         (branch "master"))
       %default-channels)
+#+END_SRC
 
-and run `guix pull` like normal to update your software. This is the recommended
-way to use the software from this repository and the code snippets in this
-README assume you have done so.
+and run `guix pull` like normal to update your software. This is the
+recommended way to use the software from this repository and the code
+snippets in this README assume you have done so.
 
 If you want to make changes to the packages in this repo then simply set
 the GUIX_PACKAGE_PATH to point to the root of this directory
 before running Guix. E.g.
 
-    git clone https://github.com/genenetwork/guix-bioinformatics.git
+#+BEGIN_SRC bash
+    git clone https://git.genenetwork.org/pjotrp/guix-bioinformatics.git
     export GUIX_PACKAGE_PATH=$PWD/guix-bioinformatics/
     guix package -A cwl
+#+END_SRC
 
 or using a checked out Guix repo with
 
-    env GUIX_PACKAGE_PATH=$genenetwork/guix-bioinformatics/ ./pre-inst-env guix package -A cwl
+: env GUIX_PACKAGE_PATH=$genenetwork/guix-bioinformatics/ ./pre-inst-env guix package -A cwl
 
 Some (or most) of these package definitions should make it upstream
 into the GNU Guix repository when tested and stable.
 
-## Slurm and munge
+* Slurm and munge
 
 Install slurm with
 
+#+BEGIN_SRC bash
     guix pull
     guix package -i slurm-llnl
 
     ~/.guix-profile/sbin/slurmd -C -D
       ClusterName=(null) NodeName=selinunte CPUs=4 Boards=1 SocketsPerBoard=1 CoresPerSocket=2 ThreadsPerCore=2 RealMemory=7890 TmpDisk=29909
+#+END_SRC
 
-## Module system
+* Module system
 
 Install the module environment with
 
+#+BEGIN_SRC bash
     guix pull
     guix package -i environment-modules
 
     modulecmd --version
       VERSION=3.2.10
       DATE=2012-12-21
+#+END_SRC
 
-## python2-numarray 1.5.2
-
-Install python2-numarray package with
-
-    guix pull
-    guix package -i python2-numarray
-
-## Common Workflow Language (CWL)
+* Common Workflow Language (CWL)
 
 Install the common workflow language tool cwltool with
 
+#+BEGIN_SRC bash
     guix pull
     guix package -i python2-cwltool
 
     cwtool --version
       1.0.20150916041152
+#+END_SRC
 
-# Packages moved from here to main line GNU Guix
-
-## LLVM D compiler
-
-The LLVM D compiler was added to GNU Guix main stream!
-
-    guix package -i ldc
-
-## Elixir and Erlang
-
-Both languages have gone in to main line Guix:
-
-    guix package -i elixir
-    guix package -i erlang
-
-## R/qtl
-
-R-qtl is now part of main stream GNU Guix:
-
-    guix package -i r-qtl r
-
-# Development tips
+* Development tips
 
-## Override individual packages
+** Override individual packages
 
 The cheerful way of overriding a version of a package:
 
+#+BEGIN_SRC scheme
     (use-modules (guix) (gnu packages emacs))
 
     (package
       (inherit emacs)
       (name "emacs-snapshot")
       (source "/path/to/some-file-or-directory.tar.gz"))
+#+END_SRC
 
 and then run:
 
-    guix package --install-from-file=that-file.scm
+: guix package --install-from-file=that-file.scm
 
 
-## LICENSE
+* LICENSE
 
 These package descriptions (so-called Guix expressions) are
 distributed by the same license as GNU Guix, i.e. GPL3+
diff --git a/gn/deploy/machines.scm b/gn/deploy/machines.scm
new file mode 100644
index 0000000..b54f2f1
--- /dev/null
+++ b/gn/deploy/machines.scm
@@ -0,0 +1,64 @@
+; Machine definitions
+
+(define-module (gn deploy machines)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix utils)
+  #:use-module (guix download)
+  #:use-module (guix gexp)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system perl)
+  #:use-module (guix build-system python)
+  ;; #:use-module (guix build-system ruby)
+  #:use-module (guix build-system r)
+  #:use-module (guix build-system trivial)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages web)
+  #:use-module (gn packages web)
+  #:use-module (srfi srfi-1))
+
+; Configure a default version of the nginx web server
+(define-public nginx-config
+  (let ((commit "e2ac61bfa472f23eb8e0c6863395a79c94a3d68a")
+        (revision "1"))
+    (package
+     (name "nginx-gn-config")
+     (version (git-version "0.0.1" revision commit))
+     (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "http://git.genenetwork.org/pjotrp/guix-bioinformatics.git")
+                    (commit commit)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1pczs7farkcklvh96q1psjgv86mlwv93c3lzmc1mwp9m299g4qdr"))))
+     (build-system trivial-build-system)
+     (native-inputs `(("unzip" ,unzip)
+                      ("source" ,source)))
+     (propagated-inputs `(("nginx" ,nginx)))
+     (arguments
+      `(#:modules ((guix build utils))
+        #:builder
+        (begin
+          (use-modules (guix build utils))
+          (let ((target (string-append (assoc-ref %outputs "out")
+                                       "/etc/nginx"))
+                (nginx-etc (string-append (assoc-ref %build-inputs "nginx")
+                                            "/share/nginx/conf")))
+            ; (write target)
+            (mkdir-p target)
+            ; copy original nginx configuration /gnu/store/nginx-ver/share/nginx/conf/*
+                                        ; (copy-recursively nginx-etc target)
+            (copy-file (string-append nginx-etc "/nginx.conf")
+                       (string-append target "/nginx.conf"))
+            (plain-file "sudoers" "\
+root ALL=(ALL) ALL
+%wheel ALL=(ALL) ALL\n")
+            #t))))
+     (home-page "http://git.genenetwork.org/pjotrp/guix-bioinformatics")
+     (synopsis "Nginx configuration")
+     (description "None.")
+     (license license:expat))))
diff --git a/gn/deploy/machines/myserver.scm b/gn/deploy/machines/myserver.scm
new file mode 100644
index 0000000..9a9923d
--- /dev/null
+++ b/gn/deploy/machines/myserver.scm
@@ -0,0 +1,66 @@
+;; This is an operating system configuration template
+;; for a "bare bones" setup, with no X11 display server.
+
+(use-modules (gnu)
+             (gnu packages web))
+(use-service-modules networking ssh web)
+(use-package-modules screen ruby)
+
+(operating-system
+  (host-name "komputilo")
+  (timezone "Europe/Amsterdam")
+  (locale "en_US.utf8")
+
+  ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
+  ;; target hard disk, and "my-root" is the label of the target
+  ;; root file system.
+  (bootloader (bootloader-configuration
+                (bootloader grub-bootloader)
+                (target "/dev/sdX")))
+  (file-systems (cons (file-system
+                        (device (file-system-label "my-root"))
+                        (mount-point "/")
+                        (type "ext4"))
+                      %base-file-systems))
+
+  ;; This is where user accounts are specified.  The "root"
+  ;; account is implicit, and is initially created with the
+  ;; empty password.
+  (users (cons (user-account
+                (name "pjotr")
+                (password "$6$EoLVFsCpLywbQmy1$aJJ3dIrgIH4UtiTVynIZ0MiC667w4C5ybygGisUnUfusPrgxZ7ncz.Cjv67EJPA6VW3EPFbOaiadQzxFn2sLb.")
+                (comment "Pjotr")
+                (group "users")
+
+                ;; Adding the account to the "wheel" group
+                ;; makes it a sudoer.  Adding it to "audio"
+                ;; and "video" allows the user to play sound
+                ;; and access the webcam.
+                (supplementary-groups '("wheel"
+                                        "audio" "video")))
+               %base-user-accounts))
+
+  ;; Globally-installed packages.
+  ; (packages (cons screen %base-packages))
+
+  (packages (append (list
+                     screen nginx)
+                    %base-packages))
+
+
+  ;; Add services to the baseline: a DHCP client and
+  ;; an SSH server with nginx
+  (services (append (list (service dhcp-client-service-type)
+                          (service openssh-service-type
+                                   (openssh-configuration
+                                    ; (authorized-keys
+                                    ;  `(("pjotr" ,(local-file "/home/pjotr/.ssh/authorized_keys"))))
+                                    (password-authentication? #t)
+                                    (port-number 2222)))
+                          (service nginx-service-type
+                                   (nginx-configuration
+                                    (server-blocks
+                                     (list (nginx-server-configuration
+                                            (listen '("8080")))))))
+                                   )
+                    %base-services)))