From: Gary Johnson <lambdatronic@disroot.org>
To: "Marek Paśnikowski" <marekpasnikowski@protonmail.com>
Cc: Felix Lechner <felix.lechner@lease-up.com>, help-guix@gnu.org
Subject: Re: How to declare symlinks in the configuration?
Date: Wed, 17 May 2023 22:40:10 -0400 [thread overview]
Message-ID: <87jzx6s60d.fsf@disroot.org> (raw)
In-Reply-To: <LprBgLgg8BTUNjCDm55hb5YXWJaqBV_fbX74eLZEYYdQ6zmey2zyxNgYDrx9GCwcyoGFIsCUnpWrO2uoCcnuHCHSM0JNltI_1lSCLP2bhzk=@protonmail.com>
Marek Paśnikowski <marekpasnikowski@protonmail.com> writes:
> How can I declare symbolic links in the system configuration?
> In this specific case, I wish to be able to declare the following link:
> ~/.config/guix/channels.scm -> ~/src/izumi/channels.scm
Hi Marek,
`guix system` is meant to declare the immutable state of your filesystem
*outside* of your home directory as well as packages and services
installed at the system level.
`guix home` is meant to declare the immutable state of your filesystem
*within* your home directory as well as packages and services installed at
the user level.
Used together, they allow you to declare the immutable state of your
entire filesystem. Then you will just need to back up those parts which
are not immutable in order to be able to recover your system after a
failure or transfer the same configuration to another machine.
Since your question is about creating a symlink to a file in your home
directory, you will want to use `guix home` for this task. First place
this code into a file called `home-config.scm`:
```scheme
(use-modules
((gnu home) #:select (home-environment))
((gnu home services) #:select (service home-files-service-type))
((guix gexp) #:select (local-file)))
(home-environment
(services
(list
(service home-files-service-type
`((".config/guix/channels.scm" ,(local-file "/home/your_username/src/izumi/channels.scm")))))))
```
Next, run this command from your shell (do not use `sudo`):
```sh
guix home reconfigure home-config.scm
```
Once this command exits, you should find a symlink at
`~/.config/guix/channels.scm` that points to a copy of your
`channels.scm` file located under the system-wide immutable `/gnu/store`
directory. Each time you want to update this file, simply edit
`~/src/izumi/channels.scm` and re-run the `guix home` command above.
Good luck and happy hacking!
Gary
--
() 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
next prev parent reply other threads:[~2023-05-18 2:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 11:14 How to declare symlinks in the configuration? Marek Paśnikowski
2023-05-16 13:56 ` Felix Lechner via
2023-05-17 6:50 ` Marek Paśnikowski
2023-05-18 2:40 ` Gary Johnson [this message]
2023-05-18 3:43 ` Marek Paśnikowski
2023-05-18 3:45 ` Felix Lechner via
2023-05-23 14:40 ` Gary Johnson
2023-05-23 16:11 ` Felix Lechner via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jzx6s60d.fsf@disroot.org \
--to=lambdatronic@disroot.org \
--cc=felix.lechner@lease-up.com \
--cc=help-guix@gnu.org \
--cc=marekpasnikowski@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.