code:
(define-module (emacs lsp)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (fiio meghanada)
  #:use-module (guix packages)
  #:use-module (guix git-download))

(define-public emacs-meghanada
  (package
   (name "emacs-meghanada")
   (version "1.2.0")
   (source
    (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/mopemope/meghanada-emacs.git")
           (commit (string-append "v" version))))
     (file-name (git-file-name name version))
     (sha256
      (base32
       "1ripap7is2amk3i2mavwiiv5mfsx9k3gxpy9nyaz58pzgvyjqplc"))))
   (build-system emacs-build-system)
   (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'configure
           (lambda* (#:key inputs #:allow-other-keys)

             (chmod "meghanada.el" #o644)
             (emacs-substitute-variables "meghanada.el"
               ("meghanada-server-install-dir"
                (string-append (assoc-ref inputs "meghanada-server") "/share")))
             #t)))))
   (propagated-inputs
    `(("emacs-yasnippet" ,emacs-yasnippet)
      ("emacs-company" ,emacs-company)
      ("emacs-flycheck" ,emacs-flycheck)))
   (inputs
    `(("meghanada-server" ,meghanada-server)))
   (home-page
    "https://github.com/mopemope/meghanada-emacs")
   (synopsis "A better java development mode")
   (description
    "Meghanada has a server component which can read the AST of your
project and its dependencies, providing features.")
   (license license:gpl3+)))


code:
(define-module (emacs magit-annex)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix download))

(define-public emacs-magit-annex
  (package
    (name "emacs-magit-annex")
    (version "1.7.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://stable.melpa.org/packages/magit-annex-"
             version
             ".el"))
       (sha256
        (base32
         "1nxkywcjariy5v8abc49xs8fvycagfry7kqybxz61gh8mk6kcysf"))))
    (build-system emacs-build-system)
    (propagated-inputs
     `(("emacs-magit" ,emacs-magit)
       ("emacs-magit-popup" ,emacs-magit-popup)))
    (home-page "https://github.com/magit/magit-annex")
    (synopsis "Control git-annex from Magit")
    (description
     "Magit-annex adds a few git-annex operations to the Magit interface.
Annex commands are available under the annex popup menu, which is
bound to at.  This key was chosen as a leading key mostly to be
consistent with John Wiegley's git-annex.el (which provides a Dired
interface to git-annex).")
    (license #f)))

repo_name: jlicht/guix

license: unknown


code:
(define-module (emacs mount)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix packages)
  #:use-module (guix git-download))

(define-public emacs-mount-mode
  (let ((commit "81ec12c8455e809cff1e2bf837c376f3cdd31d00")
        (revision "1"))
   (package
    (name "emacs-mount-mode")
    (version (git-version "0.1" revision commit))
    (source (origin
             (method git-fetch)
             (uri (git-reference
                   (url "https://github.com/zellerin/mount-mode.git")
                   (commit commit)))
             (file-name (git-file-name name version))
             (sha256
              (base32
               "1qw8xbg61ny391fipc1fq879jpyak2w427bsqck70f8394ilckvz"))))
    (build-system emacs-build-system)
    ;; (arguments
    ;;  `(#:include (cons "^snippets\\/k8s-mode\\/" %default-include)))
    (home-page "https://github.com/zellerin/mount-mode")
    (synopsis
     "Kubernetes mode in Emacs")
    (description "Kubernetes mode in Emacs")
    (license license:gpl3+))))


code:
(define-module (emacs org-gcal)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (gnu packages mail)
  #:use-module (guix download))

(define-public emacs-request-deferred
(package
  (name "emacs-request-deferred")
  (version "20160419.2305")
  (source
    (origin
      (method url-fetch)
      (uri (string-append
             "https://melpa.org/packages/request-deferred-"
             version
             ".el"))
      (sha256
        (base32
          "1i34lxv91m786pfwkyb3jajjjbnky8pi7jzv1s5jy30v8ljphfai"))))
  (build-system emacs-build-system)
  (propagated-inputs
    `(("emacs-deferred" ,emacs-deferred)
      ("emacs-request" ,emacs-request)))
  (home-page "unspecified")
  (synopsis "Wrap request.el by deferred")
  (description "")
  (license #f)))

(define-public emacs-org-gcal
(package
  (name "emacs-org-gcal")
  (version "20181004.748")
  (source
    (origin
      (method url-fetch)
      (uri (string-append
             "https://melpa.org/packages/org-gcal-"
             version
             ".el"))
      (sha256
        (base32
          "040j6ca8m2li576gsl63r6laiywdgbip2iyxws2zxh3hbzqdjgxf"))))
  (build-system emacs-build-system)
  (propagated-inputs
    `(("emacs-request-deferred"
       ,emacs-request-deferred)
      ("emacs-alert" ,emacs-alert)
      ("emacs-org" ,emacs-org)))
  (home-page "https://github.com/kidd/org-gcal.el")
  (synopsis "Org sync with Google Calendar")
  (description
    "Put the org-gcal.el to your
load-path.
Add to .emacs:
(require 'org-gcal)
")
  (license #f)))


code:
(define-module (emacs org-vcard)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix packages)
  #:use-module (guix download))

(define-public emacs-org-vcard
  (package
    (name "emacs-org-vcard")
    (version "20191130.703")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://melpa.org/packages/org-vcard-"
             version
             ".tar"))
       (sha256
        (base32
         "1rvh6968qg08dvcy9a7wbz5aibl54zfrxhznw0nrrl9hsvkbbazi"))))
    (build-system emacs-build-system)
    (arguments
     `(#:include '("\\.el$" "^styles/")))
    (home-page
     "https://github.com/flexibeast/org-vcard")
    (synopsis
     "org-mode support for vCard export and import.")
    (description
     "`org-vcard' is a package for exporting and importing vCards from
within GNU Emacs' Org mode.")
    (license license:gpl3+)))


code:
(define-module (emacs persp-projectile)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (gnu packages emacs))

(define-public emacs-persp-projectile
  (package
    (name "emacs-persp-projectile")
    (version "20180616.1944")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://melpa.org/packages/persp-projectile-"
             version
             ".el"))
       (sha256
	(base32
         "1pc1v6rc44wl7sq0qchgc4lxiy8lr7zvp0hygcp95c1x0dkqs8jl"))))
    (build-system emacs-build-system)
    (propagated-inputs
     `(("emacs-perspective" ,emacs-perspective)
       ("emacs-projectile" ,emacs-projectile)))
    (home-page "https://github.com/bbatsov/persp-projectile")
    (synopsis
     "Perspective integration with Projectile")
    (description
     "This library bridges perspective mode to the awesome library
Projectile.  The idea is to create a separate perspective when
switching project.  A perspective is an independent workspace for
Emacs, similar to multiple desktops in Gnome and MacOS.  I often work
on many projects at the same time, and using perspective and
projectile together allows me to easily know which project I'm current
in, and focus on files that only belong to current project when
switching buffer.")
    (license license:gpl3+)))


code:
(define-module (emacs plan9-theme)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix download))

(define-public emacs-plan9-theme
(package
  (name "emacs-plan9-theme")
  (version "20180804.1441")
  (source
    (origin
      (method url-fetch)
      (uri (string-append
             "https://melpa.org/packages/plan9-theme-"
             version
             ".el"))
      (sha256
        (base32
          "0k3sfw22zxcfcgh6kbalijk548c4hcd998205wwimxq2snl9ya1h"))))
  (build-system emacs-build-system)
  (home-page
    "https://github.com/john2x/plan9-theme.el")
  (synopsis
    "A color theme for Emacs based on Plan9")
  (description "")
  (license #f)))


code:
(define-module (emacs plantuml-mode)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix download))

(define-public emacs-plantuml-mode
  (package
    (name "emacs-plantuml-mode")
    (version "1.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://stable.melpa.org/packages/plantuml-mode-"
             version ".el"))
       (sha256
        (base32
         "1ymkcg97aalf72p4wdyznzk7pa1g9nc4qxn1w4yq0gq1198j8v5x"))))
    (build-system emacs-build-system)
    (propagated-inputs `(("emacs-dash" ,emacs-dash)))
    (home-page "https://github.com/skuro/plantuml-mode")
    (synopsis "Major mode for PlantUML")
    (description
     "A major mode for plantuml.  Plantuml is an open-source tool in
java that allows to quickly create UML diagrams.")
    (license license:gpl3+)))


code:
(define-module (emacs predd)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix git-download))

(define-public emacs-predd
  (let ((commit "695517712f0972cdb69b2765d13b45441ec4be57")
        (revision "1"))
    (package
      (name "emacs-predd")
      (version (git-version "1.0.0" revision commit))
      (source
       (origin
	 (method git-fetch)
	 (uri (git-reference
	       (url "https://github.com/skeeto/predd.git")
               (commit commit)))
	 (sha256
          (base32
           "03cyh2v9x0gj1nljz7spxbx6v0dcp0hkrh7g5z0rghfahv6iya46"))))
      (build-system emacs-build-system)
      (arguments
       `(#:tests? #t
         #:test-command '("make" "test")))
      (home-page
       "https://github.com/skeeto/predd")
      (synopsis "Multimethods for Emacs Lisp")
      (description
       "This library provides Clojure-style multimethods for Emacs
Lisp, supporting multiple dispatch over an ad hoc type hierarchy.")
      (license license:unlicense))))


code:
(define-module (emacs prescient)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix git-download))

(define-public emacs-prescient
  (let ( (commit "e985e7c2d4cd40c9e9311caa93c7f24945ddb2af")
        (revision "1"))
    (package
      (name "emacs-prescient")
      (version (git-version "2.1" revision commit))
      (source
       (origin
	 (method git-fetch)
	 (uri (git-reference
	       (url "https://github.com/raxod502/prescient.el.git")
               (commit commit)))
	 (sha256
          (base32
	   "0gxzhabvgyfdj2clg86zdwaxmwvs4izqzkmsfabw4c51z2anw7y6"))))
      (build-system emacs-build-system)
      (propagated-inputs
       `(("emacs-company" ,emacs-company)
	 ("emacs-ivy" ,emacs-ivy)))
      (home-page
       "https://github.com/raxod502/prescient.el")
      (synopsis "Better sorting and filtering.")
      (description
       "prescient.el is a general-purpose library for sorting and
filtering candidates.")
      (license #f))))


code:
(define-module (emacs ranger)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (guix download))

(define-public emacs-ranger
  (package
    (name "emacs-ranger")
    (version "0.9.8.5")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://stable.melpa.org/packages/ranger-"
             version
             ".el"))
       (sha256
        (base32
         "1v3f55m7ybbl025frf2p69nwi0xkw1mmaa6z0bkwnxql6x92xila"))))
    (build-system emacs-build-system)
    (home-page "https://github.com/ralesi/ranger")
    (synopsis "Make dired more like ranger")
    (description
     "This is a derived major mode that runs within dired emulating many of the
features of ranger <https://github.com/hut/ranger>.")
    (license license:gpl3+)))


code:
(define-module (emacs rcirc-color)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (guix download))

(define-public emacs-rcirc-color
  (package
    (name "emacs-rcirc-color")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://elpa.gnu.org/packages/rcirc-color-"
             version
             ".el"))
       (sha256
        (base32
         "1zs3i3xr8zbjr8hzr1r1qx7mqb2wckpn25qh9444c9as2dnh9sn9"))))
    (build-system emacs-build-system)
    (home-page
     "http://elpa.gnu.org/packages/rcirc-color.html")
    (synopsis "color nicks")
    (description
     "Use /COLOR to list all colored nicks with their color
Use /COLOR NICK COLOR to color NICK using COLOR")
    (license license:gpl3+)))


code:
(define-module (emacs rcirc-notify)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (guix git-download))

(define-public emacs-rcirc-notify
  (let ((commit "841a7b5a6cdb0c11a812df924d2c6a7d364fd455")
        (revision "1"))
    (package
     (name "emacs-rcirc-notify")
     (version (git-version "1.0.0" revision commit))
     (source
      (origin
       (method git-fetch)
       (uri
	(git-reference
	 (url "https://github.com/nicferrier/rcirc-notify.git")
	 (commit commit)))
       (sha256
	(base32
	 "1k4knsrca626pikgaalqbqwy7im4wz1vrmzzhdrdb4lhdz6sq3q3"
	 ))))
     (build-system emacs-build-system)
     (home-page "https://github.com/nicferrier/rcirc-notify.git")
     (synopsis "libnotify popups")
     (description
      "This code is inspired in part by erc-page-me.el and offers
the same functionality as it, but for rcirc.")
     (license license:gpl3+))))


code:
(define-module (emacs spray)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (gnu packages emacs-xyz))

(define-public emacs-spray
  (package
    (name "emacs-spray")
    (version "20160304.2220")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://melpa.org/packages/spray-"
             version
             ".el"))
       (sha256
        (base32
         "0wwrgpyss44lh9c9shyr9zig0k43clxv0zd7v667ibsv5vc04931"))))
    (build-system emacs-build-system)
    (home-page
     "https://github.com/ian-kelling/spray")
    (synopsis "Speed reading mode")
    (description
     "For speed reading, or just more enjoyable reading.  Narrows the
buffer to show one word at a time.")
    (license license:gpl3+)))


code:
(define-module (emacs telephone-line)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix download))

(define-public emacs-telephone-line
(package
  (name "emacs-telephone-line")
  (version "0.4")
  (source
    (origin
      (method url-fetch)
      (uri (string-append
             "https://stable.melpa.org/packages/telephone-line-"
             version
             ".tar"))
      (sha256
        (base32
          "13g79sljmaj0zx648ga3qxhhyzxshv6bqkf5c1043dm4sm7v37v5"))))
  (build-system emacs-build-system)
  ;; (propagated-inputs
  ;;   `(("emacs-cl-generic" ,emacs-cl-generic)))
 (home-page
    "https://github.com/dbordak/telephone-line")
  (synopsis "Rewrite of Powerline")
  (description
    "Telephone Line is a library for customizing the mode-line that is
based on the Vim Powerline.  Themes can be created by customizing
the telephone-line-lhs and telephone-line-rhs variables.
")
  (license license:gpl3+))
    )


code:
(define-module (emacs toc-org)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix packages)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix download))

(define-public emacs-toc-org
  (package
   (name "emacs-toc-org")
   (version "1.1.0")
   (source
    (origin
     (method url-fetch)
     (uri (string-append
           "https://stable.melpa.org/packages/toc-org-"
           version
           ".el"))
     (sha256
      (base32
       "10j4iysm8s688iwq3h483v0409w5f2j208x4qkddj0pdxdbm5z8n"))))
   (build-system emacs-build-system)
   (propagated-inputs
    `(("emacs-org" ,emacs-org)))
   (home-page "https://github.com/snosov1/toc-org")
   (synopsis
    "Add table of contents to org-mode files (formerly, org-toc)")
   (description
    "toc-org helps you to have an up-to-date table of contents in org
files without exporting.")
   (license license:gpl2+)))


code:
(define-module (fiio gradle)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system trivial)
  #:use-module (guix download)
  #:use-module (guix packages)
  #:use-module (gnu packages compression))

(define-public gradle
  (package
    (name "gradle")
    (version "5.6.2")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://services.gradle.org/distributions/gradle-"
                    version "-bin.zip"))
              (sha256
               (base32
                "1q4ybm59y3bwi9s2prpz226843bxns6sw19jmnq9kxs8i1ifdz1j"))))
    (build-system trivial-build-system)
    (arguments
     `(#:builder (begin
                   (use-modules (guix build utils))
                   (let* ((unzip
                           (string-append (assoc-ref %build-inputs "unzip")
                                          "/bin/unzip"))
                          (source (assoc-ref %build-inputs "source"))
                          (out    (assoc-ref %outputs "out"))
                          (zipdir (string-append out "/"  ,(string-append name "-" version))))
                     (mkdir-p out)
                     (symlink out zipdir)
                     (with-directory-excursion out
                       (invoke unzip source))
                     (delete-file zipdir)
                     #t))
       #:modules ((guix build utils))))
    (native-inputs `(("unzip" ,unzip)))
    (home-page "https://gradle.org")
    (synopsis "Build system")
    (description "Gradle helps teams build, automate and deliver
better software, faster.")
    (license license:asl2.0)))


code:
(define-module (fiio kubectl)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system trivial)
  #:use-module (guix download)
  #:use-module (guix packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages compression))

(define-public kubectl
  (package
    (name "kubectl")
    (version "1.16.3")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://storage.googleapis.com/kubernetes-release/release/"
                    "v" version
                    "/bin/linux/amd64/kubectl"))
              (sha256
               (base32
                "0b8grhjry0ndbxgiraxhbf0mwr37v5zpajq265gmfhap8131pvfd"))))
    (build-system trivial-build-system)
    (arguments
     `(#:builder (begin
                   (use-modules (guix build utils))
                   (let* ((source (assoc-ref %build-inputs "source"))
                          (out    (assoc-ref %outputs "out"))
                          (bindir (string-append out "/bin"))
                          (target (string-append bindir "/kubectl")))
                     (mkdir-p bindir)
                     (copy-file source target)
                     (chmod target #o555)
                     #t))
       #:modules ((guix build utils))))
    (supported-systems '("x86_64-linux"))
    (home-page "https://kubernetes.io")
    (synopsis "Command line interface for running commands against Kubernetes clusters")
    (description "Kubectl is a command line interface for running
commands against Kubernetes clusters. kubectl looks for a file named
config in the $HOME/. kube directory. You can specify other kubeconfig
files by setting the KUBECONFIG environment variable or by setting the
--kubeconfig flag.")
    (license license:asl2.0)))

(define-public kube-helm
  (package
    (name "kube-helm")
    (version "3.0.0")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://get.helm.sh/helm-v" version "-linux-amd64.tar.gz"))
              (sha256
               (base32
                "1p60v2ij06nxa60ks9l1qgb3vvz19f93mf9cgcfjn1k3lb6gvq8h"))))
    (build-system trivial-build-system)
    (arguments
     '(#:builder (begin
                   (use-modules (guix build utils))
                   (let* ((source  (assoc-ref %build-inputs "source"))
                          (tar     (assoc-ref %build-inputs "tar"))
                          (xz      (assoc-ref %build-inputs "xz"))
                          (gzip      (assoc-ref %build-inputs "gzip"))
                          (fname   "linux-amd64/helm")
                          (out     (assoc-ref %outputs "out"))
                          (bindir  (string-append out "/bin"))
                          (target  (string-append bindir "/helm")))
                     (mkdir-p bindir)
                     (set-path-environment-variable "PATH" '("bin")
                                                    (list tar xz gzip))
                     (invoke "tar" "-C" bindir
                             "--strip-components=1"
                             "-xvf" source fname)
                     (chmod target #o555)
                     #t))
       #:modules ((guix build utils))))
    (native-inputs
     `(("tar" ,tar)
       ("gzip" ,gzip)
       ("xz" ,xz)))
    (supported-systems '("x86_64-linux"))
    (home-page "https://helm.sh")
    (synopsis "The Kubernetes package manager")
    (description "This package is a tool for managing Charts.  Charts
are packages of pre-configured Kubernetes resources.")
    (license license:asl2.0)))


code:
(define-module (fiio meghanada)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system trivial)
  #:use-module (guix packages)
  #:use-module (guix download))

(define-public meghanada-server
  (package
    (name "meghanada-server")
    (version "1.2.0")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://github.com/mopemope/meghanada-server/releases/download/"
                    "v" version "/meghanada-1.2.0.jar"))
              (sha256
               (base32
                "1sag12m0s9ga3mhqndvhqy5jmvfzdd6pxn8d0rjd140k502bx786"))))
    (build-system trivial-build-system)
    (arguments
     `(#:modules ((guix build utils))
       #:builder (begin
                   (use-modules (guix build utils))
                   (let ((source (assoc-ref %build-inputs "source"))
                         (jar-dir (string-append %output "/share/")))
                     (mkdir-p jar-dir)
                     (copy-file source
                                (string-append jar-dir
                                               ,(string-append "meghanada-" version ".jar")))))))
    (home-page "https://github.com/mopemope/meghanada-server")
    (synopsis "Java IDE")
    (description "Meghanada adds Java IDE-like features to your
favourite editor.")
    (license license:gpl3+)))


code:
(define-module (fiio terraform)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system trivial)
  #:use-module (guix download)
  #:use-module (guix packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages compression))
;;
(define-public terraform
  (package
    (name "terraform")
    (version "0.13.2")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://releases.hashicorp.com/terraform/"
                    version "/terraform_" version "_linux_amd64.zip"))
              (sha256
               (base32
                "0im7bfs9bfjkyiv7ikfx3x84ymjh6ivnbskaja2rw6fbqm06873c"))))
    (build-system trivial-build-system)
    (arguments
     `(#:builder (begin
                   (use-modules (guix build utils))
                   (let* ((unzip
                           (string-append (assoc-ref %build-inputs "unzip")
                                          "/bin/unzip"))
                          (source (assoc-ref %build-inputs "source"))
                          (out    (assoc-ref %outputs "out"))
                          (bindir (string-append out "/bin"))
                          (zipdir (string-append out "/"  ,(string-append name "-" version))))
                     (mkdir-p bindir)
                     (symlink bindir zipdir)
                     (with-directory-excursion bindir
                       (invoke unzip source))
                     (delete-file zipdir)
                     #t))
       #:modules ((guix build utils))))
    (native-inputs `(("unzip" ,unzip)))
    (supported-systems '("x86_64-linux"))
    (home-page "https://terraform.io")
    (synopsis "infrastructure as code")
    (description "terraform allows you to use Infrastructure as Code
to provision and manage any cloud, infrastructure or service.")
    (license license:mpl2.0)))

terraform


code:
(define-module (games minecraft)
  #:use-module (guix build-system cmake)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages java)
  #:use-module (guix packages)
  #:use-module (guix git-download))

(define-public multimc
  (package
    (name "multimc")
    (version "0.6.7")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/MultiMC/MultiMC5.git")
                    (recursive? #t)
                    (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1i160rmsdvrcnvlr6m2qjwkfx0lqnzrcifjkaklw96ina6z6cg2n"))))
    (build-system cmake-build-system)
    (arguments
     `(#:tests? #f
       #:configure-flags '("-DMultiMC_LAYOUT=lin-system")
       #:phases
       (modify-phases %standard-phases
         (add-after 'install 'patch-paths
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let* ((out            (assoc-ref outputs "out"))
                    (bin            (string-append out "/bin"))
                    (exe            (string-append bin "/multimc"))
                    (xrandr         (assoc-ref inputs "xrandr"))
                    (jdk            (assoc-ref inputs "jdk")))
               (wrap-program exe
                 `("PATH" ":" prefix (,(string-append xrandr "/bin")
                                      ,(string-append jdk "/bin")))
                 `("GAME_LIBRARY_PATH" ":" prefix
                   (,@(map (lambda (dep)
                             (string-append (assoc-ref inputs dep)
                                            "/lib"))
                           '("libx11" "libxext" "libxcursor"
                             "libxrandr" "libxxf86vm" "pulseaudio" "mesa")))))
               #t))))))
    (inputs
     `(("jdk" ,icedtea "jdk")
       ("zlib" ,zlib)
       ("qtbase" ,qtbase)
       ("xrandr" ,xrandr)
       ("libx11" ,libx11)
       ("libxext" ,libxext)
       ("libxcursor" ,libxcursor)
       ("libxrandr" ,libxrandr)
       ("libxxf86vm" ,libxxf86vm)
       ("pulseaudio" ,pulseaudio)
       ("mesa" ,mesa)))
    (home-page "https://multimc.org/")
    (synopsis "Launcher for Minecraft")
    (description
     "Allows you to have multiple, separate instances of Minecraft and
helps you manage them and their associated options with a simple
interface.")
    ;; TODO: https://github.com/MultiMC/MultiMC5/blob/develop/COPYING.md
    (license #f)))


code:
(define-module (jlicht build xpi-utils)
  #:use-module (ice-9 popen)
  #:use-module (guix build json)
  #:use-module (srfi srfi-26)
  #:export (read-manifest-json
            multi-assoc-ref
            extract-id))

(define (read-manifest-json file)
  (let* ((cmd (string-append "unzip -p \"" file "\" manifest.json"))
         (port (open-input-pipe cmd))
         (str  (read-json port)))
    (close-pipe port) str))

(define (multi-assoc-ref alist . keys)
  (if (or (null? keys))
      alist
      (let* ((v (assoc-ref alist (car keys))))
        (apply multi-assoc-ref v (cdr keys)))))

(define (extract-id al)
  (multi-assoc-ref al
                   "browser_specific_settings"
                   "gecko"
                   "id"))


code:
;; -*- geiser-scheme-implementation: guile -*-

(define-module (jlicht guile-semver)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system gnu)
  #:use-module (guix packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages base)
  #:use-module (gnu packages code)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages texinfo)
  #:use-module (guix download))

;; (define-public guile-semver
;;   (package
;;     (name "guile-semver")
;;     (version "0.1.0")
;;     (source (origin
;;               (method url-fetch)
;;               (uri (string-append "https://notabug.org/jlicht/guile-semver/archive/" version ".tar.gz"))
;;               (file-name (string-append name "-" version ".tar.gz"))
;;               (sha256
;;                (base32
;;                 "1s3ajkavsixjny1vv4as7xhxgh901hyq8bz0c8hb7zhp479d0b8v"))) )
;;     (build-system gnu-build-system)
;;     (arguments
;;      '(#:phases
;;        (modify-phases %standard-phases
;;          (add-after 'unpack 'bootstrap
;;            (lambda _ (invoke "sh" "bootstrap.sh"))))))
;;     (native-inputs
;;      `(("pkg-config" ,pkg-config)
;;        ("autoconf" ,autoconf)
;;        ("automake" ,automake)
;;        ("texinfo" ,texinfo)))
;;     (inputs
;;      `(("guile" ,guile-2.2)))
;;     (home-page "https://git.fsfe.org/jlicht/guile-semver")
;;     (synopsis "Semantic Versioning tooling for Guile")
;;     (description "guile-semver provides similar tooling to the node
;; semver package for reading and manipulating datums conforming to the
;; Semantic versioning standard.")
;;     (license license:gpl3+)))


code:
(define-module (libraries csfml)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system cmake)
  #:use-module (guix packages)
  #:use-module (gnu packages game-development)
  #:use-module (gnu packages pkg-config)
  #:use-module (guix download))

(define-public csfml
  (package
    (name "csfml")
    (version "2.5")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://github.com/SFML/CSFML/archive/"
                                  version ".tar.gz"))
              (sha256
               (base32
                "0q6qm9ydm710ppxmsym06bf448cjlyy10kajvmhcmnqlkjzdz7fl"))))
    (build-system cmake-build-system)
    (arguments
     '(#:tests? #f)) ; no tests
    (native-inputs
     `(("pkg-config" ,pkg-config)))
    (inputs
     `(("sfml" ,sfml)))
    (home-page "https://www.sfml-dev.org")
    (synopsis "C bindings for Simple and Fast Multimedia Library")
    (description
     "C bindings")
    (license license:zlib)))

csfml


code:
(define-module (libraries libappindicator)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system glib-or-gtk)
  #:use-module (guix packages)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages glib)
  #:use-module (guix download))

(define-public libdbusmenu
  (package
    (name "libdbusmenu")
    (version "16.04.0")
    (source (origin
              (method url-fetch)
              (uri (string-append
		    "https://launchpad.net/" "libdbusmenu/16.04/" version
		    "/+download/libdbusmenu-" version ".tar.gz"))
              (sha256
               (base32
		"12l7z8dhl917iy9h02sxmpclnhkdjryn08r8i4sr8l3lrlm4mk5r"
		))))
    (build-system glib-or-gtk-build-system)
    (arguments
     '(#:tests? #f))
    (native-inputs
     `(
       ;; ("imagemagick" ,imagemagick)
        ("pkg-config" ,pkg-config)
        ("intltool" ,intltool)
       ;; ("util-linux" ,util-linux)
       ;; ("sox" ,sox)
       ))
    (inputs
     `(
       ("gtk+" ,gtk+)
       ("gtk+" ,gtk+-2)
       ("glib" ,glib)
       ("json-glib" ,json-glib)
       ("gobject-introspection" ,gobject-introspection)
       ;; (boost" ,boost)
       ;; ("libconfig" ,libconfig)
       ;; ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-mixer)))
       ;; ("zlib" ,zlib)
       ))
    (home-page "")
    (synopsis "")
    (description
     "")
    (license (list license:lgpl2.1 license:lgpl3))))

(define-public libappindicator
  (package
    (name "libappindicator")
    (version "12.10.0")
    (source (origin
              (method url-fetch)
	      ;; https://launchpad.net/libappindicator/12.10/12.10.0/+download/libappindicator-12.10.0.tar.gz
              (uri (string-append
		    "https://launchpad.net/libappindicator/12.10/"
		    version "/+download/libappindicator-" version
		    ".tar.gz"))
              (sha256
               (base32
		"17xlqd60v0zllrxp8bgq3k5a1jkj0svkqn8rzllcyjh8k0gpr46m"))))
    (build-system glib-or-gtk-build-system)
    (native-inputs
     `(
       ;; ("imagemagick" ,imagemagick)
        ("pkg-config" ,pkg-config)
       ;; ("util-linux" ,util-linux)
       ;; ("sox" ,sox)
       ))
    (inputs
     `(
       ("gtk+" ,gtk+-2)
       ("glib" ,glib)
       ("libdbusmenu" ,libdbusmenu)
       ;; (boost" ,boost)
       ;; ("libconfig" ,libconfig)
       ;; ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-mixer)))
       ;; ("zlib" ,zlib)
       ))
    (home-page "https://launchpad.net/libappindicator")
    (synopsis "Allow applications to export a menu into the menubar")
    (description
     "Libappindicator allows applications to export a menu into the menubar")
    (license (list license:lgpl2.1 license:lgpl3))))


code:
(define-module (libraries mgl)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system gnu)
  #:use-module (guix packages)
  #:use-module (gnu packages audio)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages xiph)
  #:use-module (gnu packages xorg)
  #:use-module (guix git-download))

(define-public mgl
  (let ((commit "731bd321468745fdb5e5b925dc248ebe903662d8")
        (revision "1"))
    (package
      (name "mgl")
      (version (git-version "0.0.0" revision commit))
      (source
       (origin
	 (method git-fetch)
	 (uri
	  (git-reference
	   (url "https://github.com/Aaron-SP/mgl.git")
	   (commit commit)))
         (file-name (git-file-name name version))
	 (sha256
	  (base32
           "0zczwr77cr2hfwf1bhkc11q2jbraxwmxbmrj6ip8lcxi0vfcfdm9"))))
      (build-system gnu-build-system)
      (arguments
       `(#:test-target "tests"
         #:make-flags
         (list (string-append "MGL_DESTDIR=" (assoc-ref %outputs "out") "/include"))
         #:phases
         (modify-phases %standard-phases
           (delete 'configure))))
      (native-inputs
       `(("pkg-config" ,pkg-config)))
      (inputs
       `(("libvorbis" ,libvorbis)
         ("openal" ,openal)
         ("freetype" ,freetype)
         ("libx11" ,libx11)
         ("glew" ,glew)))
      (home-page "https://github.com/Aaron-SP/mgl")
      (synopsis "Minimal Graphics Library.")
      (description
       "This package includes the distribution of the Minimal Graphics
Library, hence abbreviated MGL.")
      (license license:asl2.0))))

(define-public bds
  (let ((commit "5ddd3f2a67884e74270b4012a78948e772299cf5")
        (revision "1"))
    (package
      (name "bds")
      (version (git-version "0.1.316" revision commit))
      (source
       (origin
	 (method git-fetch)
	 (uri
	  (git-reference
	   (url "https://github.com/Aaron-SP/bds.git")
	   (commit commit)))
         (file-name (git-file-name name version))
	 (sha256
	  (base32
           "1abq5v4jbnp8glzngwz7ksyghrvkdhkjf7wvg6f6jxv3h8y58f3v"))))
      (build-system gnu-build-system)
      (arguments
       `(#:test-target "tests"
	 #:make-flags
         (list (string-append "MGL_DESTDIR=" (assoc-ref %build-inputs "mgl") "/include")
               (string-append "DESTDIR=" (assoc-ref %outputs "out"))
               "APPLICATIONS=/share/applications"
               "PREFIX=")
	 #:phases
	 (modify-phases %standard-phases
	   (delete 'configure))))
      (native-inputs
       `(("pkg-config" ,pkg-config)))
      (inputs
       `( ("libvorbis" ,libvorbis)
	  ("openal" ,openal)
	  ("mgl" ,mgl)
          ("freetype" ,freetype)
          ("libx11" ,libx11)
	  ("glew" ,glew)))
      (home-page "https://aaron-sp.github.io/index.html")
      (synopsis "Beyond Dying Skies Official Simulation.")
      (description
       "This package includes the distribution of the Beyond Dying Skies,
, hence abbreviated BDS.")
      (license license:asl2.0))))


code:
(define-module (node sucrase)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system node)
  #:use-module (guix packages)
  #:use-module (guix download))

;; TODO: Remove <out>/bin symlink from things that don't need it
(define-public node-any-promise-bootstrap
  (package
    (name "node-any-promise-bootstrap")
    (version "1.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://registry.npmjs.org/any-promise/-/any-promise-"
             version ".tgz"))
       (sha256
        (base32
         "0fjn1ckk3ds74szpk1lh2g7jjw7mzyr9ci6w12v6ckb273ssz8cv"))))
    (build-system node-build-system)
    (arguments
     '(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (add-after 'install 'remove-dangling-bin
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let* ((out (assoc-ref outputs "out"))
                             (bin-link (string-append out "/bin")))
                        (delete-file bin-link))
                      #t)))))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))

(define-public node-commander-bootstrap
  (package
    (name "node-commander-bootstrap")
    (version "2.20.0")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://registry.npmjs.org/commander/-/commander-"
             version ".tgz"))
       (sha256
        (base32
         "10in1plyla91sphd2z86vksxn8xwgxyzip0n6k2wm2a2ny6ir2qv"))))
    (build-system node-build-system)
    (arguments
     '(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (add-after 'install 'remove-dangling-bin
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let* ((out (assoc-ref outputs "out"))
                             (bin-link (string-append out "/bin")))
                        (delete-file bin-link))
                      #t)))))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))

(define-public node-lines-and-columns-bootstrap
  (package
    (name "node-lines-and-columns-bootstrap")
    (version "1.1.6")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-"
             version ".tgz"))
       (sha256
        (base32
         "09p61rikwf78jz4m8n4vad0m4wpbgzaivrrbr74sxcg13v82a83m"))))
    (build-system node-build-system)
    (arguments
     '(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (delete 'build)
                  (add-after 'install 'remove-dangling-bin
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let* ((out (assoc-ref outputs "out"))
                             (bin-link (string-append out "/bin")))
                        (delete-file bin-link))
                      #t)))))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))

(define-public node-node-modules-regexp-bootstrap
  (package
    (name "node-node-modules-regexp-bootstrap")
    (version "1.0.0")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://registry.npmjs.org/node-modules-regexp/-/node-modules-bootstrap-"
             version ".tgz"))
       (sha256
        (base32
         "02mjlh509ajkh852dwvlrdc0sx62yfixsvby97gbnzpfxnam27qc"))))
    (build-system node-build-system)
    (arguments
     '(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (add-after 'install 'remove-dangling-bin
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let* ((out (assoc-ref outputs "out"))
                             (bin-link (string-append out "/bin")))
                        (delete-file bin-link))
                      #t)))))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))

(define-public node-object-assign-bootstrap
  (package
    (name "node-object-assign-bootstrap")
    (version "4.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://registry.npmjs.org/object-assign/-/object-assign-"
             version ".tgz"))
       (sha256
        (base32
         "1v999sycxcp74j2pikdhyinm2d80p2bsy4nnrrnb59rv4rm74bbq"))))
    (build-system node-build-system)
    (arguments
     '(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (add-after 'install 'remove-dangling-bin
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let* ((out (assoc-ref outputs "out"))
                             (bin-link (string-append out "/bin")))
                        (delete-file bin-link))
                      #t)))))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))

(define-public node-pirates-bootstrap
  (package
    (name "node-pirates-bootstrap")
    (version "4.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://registry.npmjs.org/pirates/-/pirates-"
             version ".tgz"))
       (sha256
        (base32
         "19hpwdlxw3prq0z10c5sxv6wbg48pg7n006mja7w7pvy4iy07j6n"))))
    (build-system node-build-system)
    (inputs
     `(("node-node-modules-regexp" ,node-node-modules-regexp-bootstrap)))
    (arguments
     '(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (delete 'build)
                  (add-after 'install 'remove-dangling-bin
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let* ((out (assoc-ref outputs "out"))
                             (bin-link (string-append out "/bin")))
                        (delete-file bin-link))
                      #t)))))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))

(define-public node-thenify-bootstrap
  (package
    (name "node-thenify-bootstrap")
    (version "3.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://registry.npmjs.org/thenify/-/thenify-"
             version ".tgz"))
       (sha256
        (base32
         "0qp65v95adsf52vrxf5ca3nqw43hqkcjrclyhqp8z1bn3rrjwzkh"))))
    (build-system node-build-system)
    (inputs
     `(("node-any-promise" ,node-any-promise-bootstrap)))
    (arguments
     '(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (add-after 'install 'remove-dangling-bin
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let* ((out (assoc-ref outputs "out"))
                             (bin-link (string-append out "/bin")))
                        (delete-file bin-link))
                      #t)))))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))

(define-public node-thenify-all-bootstrap
  (package
    (name "node-thenify-all-bootstrap")
    (version "1.6.0")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://registry.npmjs.org/thenify/-/thenify-"
             version ".tgz"))
       (sha256
        (base32
         "1fzcliy88iz2qzkh99jicjzf0j3snvx6jg93ga64ps08b4l6hqdh"))))
    (build-system node-build-system)
    (inputs
     `(("node-thenify" ,node-thenify-bootstrap)))
    (arguments
     '(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (add-after 'install 'remove-dangling-bin
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let* ((out (assoc-ref outputs "out"))
                             (bin-link (string-append out "/bin")))
                        (delete-file bin-link))
                      #t)))))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))

(define-public node-mz-bootstrap
  (package
    (name "node-mz-bootstrap")
    (version "2.7.0")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://registry.npmjs.org/mz/-/mz-"
             version ".tgz"))
       (sha256
        (base32
         "0cxmswx4xgi5pv90mcx08apdg86da52r7dhv8c90l9llz18frl77"))))
    (build-system node-build-system)
    (inputs
     `(("node-any-promise" ,node-any-promise-bootstrap)
       ("node-object-assign" ,node-object-assign-bootstrap)
       ("node-thenify-all" ,node-thenify-all-bootstrap)))
    (arguments
     '(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (add-after 'install 'remove-dangling-bin
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let* ((out (assoc-ref outputs "out"))
                             (bin-link (string-append out "/bin")))
                        (delete-file bin-link))
                      #t)))))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))

(define-public node-sucrase-bootstrap
  (package
    (name "node-sucrase-bootstrap")
    (version "3.10.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://registry.npmjs.org/sucrase/-/sucrase-"
             version ".tgz"))
       (sha256
        (base32
         "1jlc17r6fkzkpawb4y8pzrxv6wglp6n94b3ww2zzzb5n7gb09p2y"))))
    (build-system node-build-system)
    (inputs
     `(("node-commander" ,node-commander-bootstrap)
       ("node-lines-and-columns" ,node-lines-and-columns-bootstrap)
       ("node-mz" ,node-mz-bootstrap)
       ("node-pirates" ,node-pirates-bootstrap)))
    (arguments
     '(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (delete 'build))))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))


code:
(define-module (nongnu services fhs)
  #:use-module (ice-9 ftw) ;; for creating recursive list of directories of libs for FHS  #:use-module (guix download)
  #:use-module (srfi srfi-1) ;; For filter-map
  #:use-module (guix records) ;; For defining record types
  #:use-module (guix profiles) ;; for  manifest-entries
  #:use-module (gnu services) ;; For defining services
  #:use-module (guix gexp) ;; For computed-file and other things
  #:use-module (guix packages) ;; For package
  #:use-module (gnu packages) ;; For specifications->manifest
  #:use-module (gnu packages base) ;; For glibc

  #:export (fhs-binaries-compatibility-service-type
            fhs-binaries-compatibility-service
            fhs-configuration))

(define (32bit-package pkg)
  (package (inherit pkg)
           (name (string-append (package-name pkg) "-i686-linux"))
	   (arguments
	    `(#:system "i686-linux"
	      ,@(package-arguments pkg)))))

(define glibc-for-fhs
  (package (inherit glibc)
           (name "glibc-for-fhs") ;; Maybe rename this to "glibc-with-ldconfig-for-fhs"
           (source (origin
                    (inherit (package-source glibc))
                    (snippet #f))))) ;; Re-enable ldconfig

(define (packages->ld.so.conf packages)
  (computed-file
   "ld.so.conf"
   (with-imported-modules
    `((guix build union)
      (guix build utils))
    #~(begin
        (use-modules (guix build union)
                     (guix build utils))
        (let* ((packages '#$packages) ;; Need to quote "#$packages" as #$packages tries to "apply" the first item to the rest, like a procedure.
               (find-lib-directories-in-single-package
                (lambda (package)
                  (find-files (string-append package "/lib")
                              (lambda (file stat)
                                ;; setting keyword "stat" to "stat" means it will follow
                                ;; symlinks, unlike what it's set to by default ("lstat").
                                (eq? 'directory (stat:type stat)))
                              #:stat stat
                              #:directories? #t)))
               (find-lib-directories-in-all-packages
                (lambda (packages)
                  (apply append ;; Concatenate the directory lists from "map" into one list
                         (map (lambda (package)
                                (find-lib-directories-in-single-package package))
                              packages))))
               (fhs-lib-dirs
                (find-lib-directories-in-all-packages packages)))
          (with-output-to-file
              #$output
            (lambda _
              (format #t
                      (string-join fhs-lib-dirs "\n"))
              #$output)))))))

(define (ld.so.conf->ld.so.cache ld-conf)
  (computed-file "ld.so.cache"
                 (with-imported-modules `((guix build utils))
                                        #~(begin
                                            (use-modules (guix build utils))
                                            (let* ((ldconfig (string-append #$glibc-for-fhs "/sbin/ldconfig")))
                                              (invoke ldconfig
                                                      "-X" ;; Don't update symbolic links
                                                      "-f" #$ld-conf ;; Use #$configuration as configuration file
                                                      "-C" #$output)))))) ;; Use #$output as cache file

(define (packages->ld.so.cache packages)
  (ld.so.conf->ld.so.cache (packages->ld.so.conf packages)))

(define-record-type* <fhs-configuration>
  fhs-configuration
  make-fhs-configuration
  fhs-configuration?
  (lib-packages                   fhs-configuration-lib-packages
                                  (default '()))
  (additional-profile-packages    fhs-configuration-additional-profile-packages ;; For putting programs in $PATH and for share data
                                  (default '()))
  (additional-special-files       fhs-configuration-additional-special-files
                                  (default '())))

(define* (union name packages #:key options)
  (computed-file name
                 (with-imported-modules `((guix build union))
                                        #~(begin
                                            (use-modules (guix build union))
                                            (union-build #$output '#$packages)))
                 #:options options))

(define* (fhs-libs-union packages #:key system)
  (let* ((name (if system
                   (string-append "fhs-libs-" system)
                   "fhs-libs")))
    (union name
           packages
           #:options `(#:system ,system))))

(define (fhs-special-files-service config)
  "Return the list of special files for the fhs service"
  (let* ((fhs-lib-packages (fhs-configuration-lib-packages config))
         (fhs-lib-package-unions (append fhs-lib-packages
                                         `(,(fhs-libs-union fhs-lib-packages #:system "i686-linux"))))
         (fhs-glibc-special-files
          `(("/etc/ld.so.cache" ,(packages->ld.so.cache fhs-lib-package-unions))
            ("/etc/ld.so.conf" ,(packages->ld.so.conf fhs-lib-package-unions)) ;;Not needed to function, but put it here anyway for debugging purposes
            ("/lib64/ld-linux-x86-64.so.2" ,(file-append (canonical-package glibc-for-fhs) "/lib/ld-linux-x86-64.so.2"))
            ("/lib/ld-linux.so.2" ,(file-append (canonical-package (32bit-package glibc-for-fhs)) "/lib/ld-linux.so.2"))))
         ;;             ("/fhs/libs" ,(file-append (canonical-package fhs-libs-64) "/lib"))
         (fhs-additional-special-files (fhs-configuration-additional-special-files config)))
    (append fhs-glibc-special-files
            fhs-additional-special-files)))

(define (fhs-profile-service config)
  "Return the list of packages to add to the system profile"
  ;; Get list of packages from config to add to system profile and return them
  (fhs-configuration-additional-profile-packages config))

(define fhs-binaries-compatibility-service-type
  (service-type (name 'fhs-compatibility-service)
                (extensions
                 (list (service-extension special-files-service-type
                                          fhs-special-files-service)
                       (service-extension profile-service-type
                                          fhs-profile-service)
                       ))
                (description
                 "Support binaries compiled for the filesystem hierarchy standard.")
                (default-value (fhs-configuration))))

(define fhs-binaries-compatibility-service
  (service fhs-binaries-compatibility-service-type))


code:
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
;;; Copyright © 2019 Jelle Licht <jlicht@fsfe.org>
;;;
;;; This program 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 of the License, or
;;; (at your option) any later version.
;;;
;;; This program 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 <https://www.gnu.org/licenses/>.

(define-module (nongnu services my-kernel-modules)
  #:use-module (gnu packages linux)
  #:use-module (gnu services)
  #:use-module (gnu services base)
  #:use-module (gnu services shepherd)
  #:use-module (guix gexp)
  #:use-module (guix records)
  #:use-module (ice-9 match)
  #:export (kernel-modules-configuration
            kernel-modules-configuration?
            kernel-modules-service-type))

(define-record-type* <kernel-modules-configuration>
  kernel-modules-configuration make-kernel-modules-configuration
  kernel-modules-configuration?
  (kmod  kernel-modules-configuration-kmod
         (default kmod))
  (modules kernel-modules-configuration-modules ;list of <package>
           (default '()))
  (names kernel-modules-configuration names ; list of string for modprobe
         (default '())))

(define (modules-directory modules)
  "Return a directory containing MODULES, the OOT kernel modules."
  (directory-union "kernel-modules" modules))

(define kernel-modules-shepherd-service
  (match-lambda
    (($ <kernel-modules-configuration> kmod modules names)
     (let ((modules (modules-directory modules)))
       (list
        (shepherd-service
         (documentation "Load free(?) kernel modules.")
         (requirement '(file-systems))
         (provision '(kernel-modules))
         (one-shot? #t)
         (start
          #~(lambda _
              (define modprobe
                (lambda (name)
                  (zero? (system* "env" (string-append
                                         "LINUX_MODULE_DIRECTORY="
                                         #$(file-append modules "/lib/modules"))
                                  #$(file-append kmod "/bin/modprobe") name))))
              (for-each modprobe (list #$@names))
              #t))))))))

(define kernel-modules-service-type
  (let
      ((config->packages
        (match-lambda
         (($ <kernel-modules-configuration> kmod modules _)
          `(,kmod ,@modules)))))
    (service-type
     (name 'kernel-modules)
     (extensions
      (list (service-extension shepherd-root-service-type
                               kernel-modules-shepherd-service)
            ;; Add kmod and modules to the system profile.
            (service-extension profile-service-type config->packages)))
     (default-value (kernel-modules-configuration))
     (description
      "Load OOT kernel modules."))))


code:
(define-module (norepro scrcpy)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages video)
  #:use-module (gnu packages sdl)
  #:use-module (guix build-system meson))

(define-public scrcpy-sources
  (origin
    (method url-fetch)
    (uri (string-append
          "https://github.com/Genymobile/scrcpy/releases/download/v1.16/scrcpy-server-v1.16"))
    (sha256
     (base32
      "0ciq7d4x9qff40a5s35z8wx6w585pwnd3nbvmdh093a9nh2rx9wl"))))

(define-public scrcpy
  (package
    (name "scrcpy-server")
    (version "1.16")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/Genymobile/scrcpy.git")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "1zi0wx621mgal0hkvggg0hnl2ahviwwd3bbahyy4sz3bspkii14j"))))
    (build-system meson-build-system)
    (arguments
     `(#:glib-or-gtk? #f
       #:configure-flags (list
                          (string-append "-Dprebuilt_server="
                                         (assoc-ref %build-inputs "prebuilt-server")))))
    (inputs
     `(("sdl" ,sdl2)
       ("prebuilt-server" ,scrcpy-sources)
       ("ffmpeg" ,ffmpeg)))
    (native-inputs
     `(("pkg-config" ,pkg-config)))
    (home-page "https://github.com/Genymobile/scrcpy")
    (synopsis "Share Android screen to your pc")
    (description "scrcpy is an application that provides display and
control of Android devices connected on USB. It does not require root
access.")
    (license license:asl2.0)))

scrcpy


code:
;;union currently requires options given to it, other an error "apply to non-list #f" occurs.
;;Todo: in create-inferior-package, forward build output.

(define-module (pkill9 utils)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix build-system trivial)
  #:use-module (guix inferior) ;; create-inferior-package
  #:use-module (guix channels) ;; create-inferior-package
  #:use-module (guix utils) ;; create-inferior-package
  #:export (union
            package-output->package
            create-bash-script
            create-inferior-package))

(define* (union name packages #:key options)
  (computed-file name
                 (with-imported-modules `((guix build union))
                                        #~(begin
                                            (use-modules (guix build union))
                                            (union-build #$output '#$packages)))
                 #:options options))

(define (package-output->package original-package package-output)
  (package
   (name (string-append (package-name original-package) "-" package-output))
   (version (package-version original-package))
   (source #f)
   (build-system trivial-build-system)
   (inputs
    `(("package" ,original-package ,package-output)))
   (arguments
    `(#:modules ((guix build utils))
      #:builder
      (begin
        (use-modules (guix build utils))
        (let* ((out (assoc-ref %outputs "out"))
               (original-package (assoc-ref %build-inputs "package")))
          (symlink original-package out)))))
   (home-page #f)
   (synopsis (string-append "Output " package-output
                            " of package: " (package-name original-package)))
   (description synopsis)
   (license (package-license original-package))))

(define* (executable-mixed-text-file name #:rest text)
  "Return an object representing store file NAME containing TEXT.  TEXT is a
sequence of strings and file-like objects, as in:

  (mixed-text-file \"profile\"
                   \"export PATH=\" coreutils \"/bin:\" grep \"/bin\")

This is the declarative counterpart of 'text-file*'. The resulting file is made executable."
  (define build
    (gexp (call-with-output-file (ungexp output "out")
            (lambda (port)
              (display (string-append (ungexp-splicing text)) port)
              (chmod (ungexp output "out") #o755)))))

  (computed-file name build))

(define* (executable-plain-file name text)
  "Return an object representing store file NAME containing TEXT.  TEXT is a
a string.

This is equivalent to plain-file, but the file is executable."
  (define build
    (gexp (call-with-output-file (ungexp output "out")
            (lambda (port)
              (display (ungexp text) port)
              (chmod (ungexp output "out") #o755)))))

  (computed-file name build))

(define* (create-bash-script script-name script-text paths-to-executables #:optional paths-to-arbitrary-files)
  ;;Create a bash script with executable permission
  ;;
  ;;all commands will have variables with their names pointing to the store path, so the bash script must use for example $mkdir instead of mkdir.
  ;;
  ;;paths-to-executables consists of a list of lists, which are composed of (<package-object> "/subdirectory/" "executable")
  ;; for example, (list (list coreutils "/bin/" "mkdir") (list grep "/bin/ "grep"))
  ;; However, if only two list items exist, then assume that the first is a store path direct to the executable, and the second is the variable name
  ;;
  ;; Paths-to-other-files consists of a list of lists, which are composed of (<package-object> "/path/to/file" "variable-name")
  ;; Maybe instead make a function that takes these, idk
  (let* ((executables-paths-header-lines
          (map
           (lambda (path)
             (if (> (length path) 2)
                 ;;If more than two list items
                 (list
                  (list-ref path 2) ;; Variable name
                  "="
                  (list-ref path 0) ;; Package object (executable-mixed-text-file converts to store path)
                  (list-ref path 1) ;; Subdirectory
                  (list-ref path 2) ;; Executable
                  "\n")
                 ;;Else
                 (list
                  (list-ref path 1) ;; Variable name
                  "="
                  (list-ref path 0) ;; Executable
                  "\n")))
           paths-to-executables))
         (arbitrary-paths-header-lines
          (if paths-to-arbitrary-files
              (map
               (lambda (path)
                 (list
                  (list-ref path 2) ;;Variable name
                  "="
                  (list-ref path 0) ;; Package object (executable-mixed-text-file converts to store path)
                  (list-ref path 1) ;; Subpath to file
                  "\n"
                  ))
               paths-to-arbitrary-files)
              (list)))
         (smooshed-header-lines (append (apply append executables-paths-header-lines)
                                        (apply append arbitrary-paths-header-lines)))
         )
    (apply executable-mixed-text-file (append (list script-name)
                                              (list "#!" (@ (gnu packages bash) bash) "/bin/bash" "\n\n")
                                              smooshed-header-lines
                                              (list "\n\n")
                                              (list script-text)))
    ))

(define* (create-inferior-package #:key
                                  guix-commit
                                  package-code-to-evaluate)
  (let* ((inferior-package (@@ (guix inferior) inferior-package)) ;; Localise private function
         (%inferior (inferior-for-channels
                     (list (channel
                            (name 'guix)
                            (url "https://git.savannah.gnu.org/git/guix.git")
                            (commit guix-commit)))))
         (pkg-info
          (inferior-eval
           `(begin
              (let* ((new-package ,package-code-to-evaluate)
                     (new-package-id (object-address new-package)))
                (hashv-set! %package-table new-package-id new-package) ;; Add the new package's object-address (assigned to id) to the inferior's %package-table
                `(,(package-name new-package)
                  ,(package-version new-package)
                  ,new-package-id)));; Return the package info for use with (inferior-package)
           %inferior)))
    (inferior-package %inferior
                      (list-ref pkg-info 0)
                      (list-ref pkg-info 1)
                      (list-ref pkg-info 2)))) ;; Return the inferior-package