help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to put a file in /gnu/store and set its permissions


From: Gary Johnson
Subject: Re: How to put a file in /gnu/store and set its permissions
Date: Sun, 05 Dec 2021 21:30:09 -0500

Nathan Dehnel <ncdehnel@gmail.com> writes:

> Thanks. I guess then I need to know how to put a file in /etc/ssh
> without putting it in the store.

To programmatically add a file to /etc, you can extend the
etc-service-type in your operating-system's services field like so:

```
(use-modules
 ((gnu services)         #:select (simple-service etc-service-type))
 ((gnu services desktop) #:select (%desktop-services))
 ((gnu system)           #:select (operating-system))
 ((guix gexp)            #:select (local-file)))

(define guixrig_host_rsa_key
  (local-file "ssh/guixrig_host_rsa_key" #:recursive? #t))

(operating-system
 ...
 (services (cons* (simple-service 'my-secret-service etc-service-type
                                  `(("ssh/guixrig_host_rsa_key" 
,guixrig_host_rsa_key)))
                  %desktop-services)))
```

Have fun and happy hacking!
  ~Gary

-- 
GPG Key ID: 7BC158ED
Use `gpg --search-keys lambdatronic' to find me
Protect yourself from surveillance: https://emailselfdefense.fsf.org
=======================================================================
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]