[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: open config.scm with sudo and gedit or emacs
From: |
Luis Felipe |
Subject: |
Re: open config.scm with sudo and gedit or emacs |
Date: |
Sun, 12 Mar 2023 18:13:54 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 |
Hello people,
El 12/03/23 a las 11:00, Sergiu Ivanov escribió:
Hi SeerLite,
SeerLite <seerlite@disroot.org> [2023-03-12T00:42:42+0100]:
On March 11, 2023 2:05:01 PM GMT-03:00, Sergiu Ivanov <sivanov@colimite.fr>
wrote:
Gottfried <gottfried@posteo.de> [2023-03-11T11:33:33+0100]:
because of my limited knowledge
when opening my config.scm file with sudo
I can do it only with nano
The strategy I personally prefer is to edit a file in my home directory
and then sudo cp to /etc/config.scm.
More concretely, I store my system configuration in
~/.config/guix/system-config.scm. I edit it with Emacs, as I would edit
any other normal file. When I am done editing, I do what essentially is
sudo cp ~/.config/guix/system-config.scm /etc/config.scm
Why not use the configuration from ~/.config directly? Why copy at all? I do
sudo guix system reconfigure ~/.config/guix/system-config.scm
You are right, it's probably even better.
I prefer keeping my system config in /etc/config.scm because this is
what everyone seems to do, but that's probably a bad reason, supported
by unreliable data :D
I don't think there is any need to edit /etc/config.scm at all (maybe
something in the manual needs clarification?). Once you have installed
the Guix System, you can
1. Open /etc/config.scm with any text editor you want
2. Copy its contents and save them to a file in any location in your
home folder. For example: ~/Documents/my-guix-things/production-os.scm.
From that moment on, you can edit production-os.scm as your regular
user in any way you like and only use "sudo" to apply the configuration
to your system:
guix pull # Recommended.
sudo guix system reconfigure
~/Documents/my-guix-things/production-os.scm
You can even create copies of "production-os.scm" and shape different
systems you'd like to try out separately (e.g. gnome-os.scm,
sway-os.scm, some-server.scm, etc.).
In fact, the Guix manual says: "The normal way to change the system
configuration is by updating this file [a file like the
production-os.scm] and re-running ‘[sudo] guix system reconfigure’. One
should never have to touch files in ‘/etc’" (see System Configuration).
Hope that helps,
--
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/
OpenPGP_0x0AB0D067012F08C3.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature
Re: open config.scm with sudo and gedit or emacs, Thanos Apollo, 2023/03/12