How to use gexps in builds?

2019-05-08 Thread nly


...
(build-system trivial-build-system)
`(#:modules ((guix gexp))
 #:builder
 (gexp->derivation "gnumake"
   #~(begin
   (mkdir #$output)
   (chdir #$output)
   (symlink #$gnu-make #$output)))
 ))
...

The above form looks like it asks for too many (use-modules ...) (6 or
even more). What am I missing?



Adding Services

2019-05-08 Thread nly

I imagine a user(me) would do:

(service (oddmuse-service-type
  (oddmuse-configuration
   (inherit %oddmuse-configuration)
   (root "blah")
   (...

Is this alright? Oddmuse package is in (gnu packages web)
I am missing the service extensions, (i don't get what i need to put in
there)

Thanks
Amar

>From 3af150b5220fc40407c2e63eab1019afef303844 Mon Sep 17 00:00:00 2001
From: Amar Singh 
Date: Sun, 5 May 2019 04:15:13 +0530
Subject: [PATCH] gnu: Add oddmuse-service-type.

* gnu/services/oddmuse.scm (oddmuse-service-type): New variable.
---
 gnu/services/oddmuse.scm | 86 
 1 file changed, 86 insertions(+)
 create mode 100644 gnu/services/oddmuse.scm

diff --git a/gnu/services/oddmuse.scm b/gnu/services/oddmuse.scm
new file mode 100644
index 00..881d795e60
--- /dev/null
+++ b/gnu/services/oddmuse.scm
@@ -0,0 +1,86 @@
+;;; GNU Guix --- Functional package management for GNU
+;;;
+;;; Copyright (C) 2019 by Amar Singh 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix 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.
+;;;
+;;; GNU Guix 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 GNU Guix.  If not, see .
+
+(define-module (gnu services oddmuse))
+(use-modules
+ (srfi srfi-1)
+ (guix packages)
+ (gnu packages web)
+ (gnu services)
+ (gnu services web)
+ (gnu services configuration)
+ )
+
+(define (oddmuse-activation config)
+  #t)
+
+(define nginx-server-configuration-list?
+  (@@ (gnu services cgit) nginx-server-configuration-list?))
+
+(define serialize-nginx-server-configuration-list
+  (@@ (gnu services cgit) serialize-nginx-server-configuration-list))
+
+(define-configuration oddmuse-configuration
+  (package
+   (package oddmuse)
+   "The oddmuse package.")
+  (nginx
+   (nginx-server-configuration-list
+(list %oddmuse-configuration-nginx))
+   "Nginx server config"))
+
+(define-public oddmuse-service-type
+  (service-type
+   (name 'oddmuse)
+   (extensions
+(list
+ ;; (service-extension activation-service-type
+ ;; oddmuse-activation)
+  (service-extension nginx-service-type
+ oddmuse-configuration-ngnix)
+  (service-extension fcgiwrap-service-type
+ (const #t
+   (default-value (oddmuse-configuration))
+   (description
+"Run the oddmuse web wiki.")))
+
+(define %oddmuse-configuration-nginx
+  (nginx-server-configuration
+   (root "/srv/wiki")
+   (listen '("80"))
+   (server-name "localhost")
+   (locations
+(list
+ (nginx-location-configuration
+  (uri "~ ^/wiki/index\\.cgi/.*$")
+  (body '(
+  "rewrite ^/wiki/index\\.cgi.*/(.*$) /wiki/index.cgi?$1 permanent;"  )))
+ (nginx-location-configuration
+  (uri "~ \\.cgi")
+  (body '(
+  "fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;"
+  "include /etc/nginx/fastcgi_params;"
+  "fastcgi_index index.cgi;"
+  "fastcgi_pass fcgiwrap;"
+  )
+   (try-files (list "$uri" "@oddmuse"))
+   (ssl-certificate #f)
+   (ssl-certificate-key #f)))
+
+;;; oddmuse.scm ends here
-- 
2.21.0



Re: custom service definition files location

2019-02-17 Thread nly
Guix system is declared in 1 file. The file may be 'config.scm',or 'xyz.scm', 
or even 'foo.bar'.

It is not automatically detected by 'guix system' commands(you might be 
thinking of nix).

It is supplied as a command-line argument with the 'guix system' commands. 
Check 'guix system --help'.

On February 17, 2019 5:09:26 PM UTC, Reza Alizadeh Majd  
wrote:
>Hi, 
>
>does anyone know where do I have to place my custom service definition
>`.scm` files,
>in order to automatically be identified by `guix system reconfigure`
>command? 
>
>Thanks,
>Reza

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Re: User-Level services

2019-02-09 Thread nly
>I would love to see something closer to an event triggered service than 
>forking once and forgetting.
You can use shepherd and herd commands (without sudo).
For example:
$ shepherd [-c config.scm]
$ herd status

Then configure your `config.scm` as you like. As a default shepherd will use 
`$XDG_CONFIG_HOME/shepherd/init.scm`, and if the variable is not set then 
`$HOME/.config/shepherd/init.scm`.

>It would be awesome if the Guix System could provide a way to configure these 
>declaratively, too.
That can be done by generating a text-file in store containing the desired 
config then symbolic linking it to `$HOME.config/shepherd/init.scm`. This all 
can be done using guix daemon(declaratively).

Though I am not sure how you can 'autostart' the service at boot time and 
declaratively?

Cheers
amar

On February 9, 2019 1:14:28 PM UTC, John Soo  wrote:
>Thanks Chris,
>
>I wasn’t aware of the autostart spec so I took a look. Thanks! After
>reading it I’m not sure it provides the retry support (among other
>things) that a user service might provide. I would love to see
>something closer to an event triggered service than forking once and
>forgetting.
>
>It would be awesome if the Guix System could provide a way to configure
>these declaratively, too. I am not saying shepherd would be the
>mechanism, necessarily either. I just think people - myself included -
>will probably want this feature. 
>
>Thanks again,
>
>John
>
>> On Feb 9, 2019, at 12:48 AM, Chris Marusich 
>wrote:
>> 
>> John Soo  writes:
>> 
>>> Hi Reza,
>>> 
>>> I’m not sure this is possible right now. I recently tried making a
>>> service which would need the x display variable and I got stuck
>right
>>> about when I needed the logged in user. I would love to see it
>though.
>>> 
>>> Does anyone else know?
>> 
>> I don't think there's an easy solution that's integrated into the
>Guix
>> System (formerly known as GuixSD).  Instead, the best approach is to
>use
>> any of "the usual" methods for starting up user processes.  For
>example,
>> you might use the ~/.config/autostart convention:
>> 
>> https://freedesktop.org/wiki/Specifications/autostart-spec/
>> 
>> -- 
>> Chris

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Re: Gaming desktop hardware + 802.11 ac wifi

2019-01-07 Thread nly
>AMD RX 580 seems to be an excellent performance/cost choice,
considering the 560 seems to be buggy on Linux.

I have RX570, it won`t work at all, nada, without the blobs.

On January 7, 2019 3:01:16 PM UTC, Joshua Branson  wrote:
>Ricardo Wurmus  writes:
>
>> Hi Pierre,
>>
>>> How are AMD graphics card faring on Guix?  Are they working with
>>> Linux-libre?  According to
>>>
>https://www.phoronix.com/scan.php?page=article=radeon-rx590-linux,
>>> the AMD RX 580 seems to be an excellent performance/cost choice,
>>> considering the 560 seems to be buggy on Linux.
>>
>> Have you checked h-node.org?
>
>I feel like the only graphics cards that'll run on linux-libre is old
>nvidia's and integrated Intel CPUs...am I wrong in that?
>
>I did not believe there are /any/ AMD cards that work on linux-libre.
>
>-- 
>Joshua Branson
>Sent from Emacs and Gnus

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.