Re: getting loginctl to work
Hi! Is it maybe Polkit? Polkit was stopping me from suspending my laptop via SSH. The exact same behavior as you: no output and error code 1. Since the only `loginctl` command I cared about was `suspend`, I added my user to the `power` group, added the `power` group to `operating-system`, defined the following extension: ; Rule template stolen from from gnu/services/desktop.scm: polkit-wheel ; and rule itself stolen from https://askubuntu.com/a/992878 (define polkit-power-rules (file-union "polkit-power" `(("share/polkit-1/rules.d/power.rules" ,(plain-file "power.rules" "polkit.addRule(function(action, subject) { if (action.id == \"org.freedesktop.login1.suspend\" && subject.isInGroup(\"power\")) { return polkit.Result.YES; } });") and added the above to my services like: (simple-service 'polkit-power-rules polkit-service-type (list polkit-power-rules)) You'd have to do something but I'm guessing for `login1.poweroff` instead. SeerLite
Re: open config.scm with sudo and gedit or emacs
Hi! On March 12, 2023 4:07:25 AM GMT-03:00, "Boris A. Dekshteyn" wrote: >SeerLite writes: > >> >> sudo guix system reconfigure ~/.config/guix/system-config.scm > >sudo -E ... > No, that will create root-owned files in ~/.cache. I always get trouble using sudo -E because programs tend to create root-owned files under ~. There's no need for -E as guix doesn't need any environment variable from the user to reconfigure, everything is self contained in the `guix` binary and the system configuration file. SeerLite
Re: open config.scm with sudo and gedit or emacs
On March 11, 2023 2:05:01 PM GMT-03:00, Sergiu Ivanov wrote: >Hi Gottfried, > >Gottfried [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 Hi! Why not use the configuration from ~/.config directly? Why copy at all? I do sudo guix system reconfigure ~/.config/guix/system-config.scm SeerLite
Re: Mysteries of channel configuration during system reconfigure
Hi! On 2023-03-09 03:50, Kyle Andrews wrote: One of the selling points in Guix marketing for me is that the system configuration should be self contained within /etc/config.scm and channels.scm. However, this appears to not be the case. There seems a third element hidden away which prevents me from running: ``` guix system reconfigure /etc/config.scm ``` This command errors out: ``` failed to load '/etc/config.scm' ... no code for module ... ``` At the moment since I am still very early in setting up my new computer, I have to type everything so I'm not going to go into more detail than that. Suffice to say it doesn't see the modules I need from the extra channel. It did see them during the installation otherwise my computer would be in a far less usable state than it is. `sudo guix system reconfigure` and any `guix package` command will (by default) use the generation shown in `guix describe`. On first boot, this generation _will_ be different from the one you had in the live system. This is because the generation is saved at ~/.config/guix/current on every `guix pull` and that file will be gone together with the live system. You have two options: 1. Get the channels you want correctly set up in ~/.config/guix/channels.scm and run `guix pull` with your user in the running system. IIRC this takes a while because it'll download the whole Guix checkout again (the one used to install would have disappeared along with the rest of the live system). 2. Run guix pull -C /run/current-system/channels.scm. This will pull the exact generation used to build the system. This will also take time. After either of these you should be able to `sudo guix system reconfigure ...` and get your system running as the channels will be available again to every guix subcommand. Note that you could also copy /run/current-system/channels.scm to ~/.config/guix/channels.scm but you have to be careful remove the commit lines, otherwise all your `guix pull`s will pull the exact same commits and you'll stay on an outdated system. Maybe it could be clarified in the manual that another `guix pull` is needed after the first boot. Or maybe the installation could be optimized so that the checkout is copied from the live system to the installed system. When I run the following command: ``` guix system describe ``` The addition channel gets listed. How can it be listed yet be unknown to the `guix system reconfigure` command? Because it was indeed the channel and commit the system was built from. It has nothing to do with your "current powers". That all depends on what generation of Guix you're using AKA what comes up in `guix describe` I hope my explanation was helpful! SeerLite
Re: Generating helptags for vim plugins
On 2023-02-21 11:32, n...@promisedlandt.de wrote: I also think that having each plugin in its own folder is the most robust solution. Both vim and neovim have package loading that works with no or minimal configuration for quite a few years now, and to me it makes sense if guix adds the plugins in the structure the built-in loaders expect. However, I would not expect the user to have to :packadd each plugin separately. Having plugins autoload is the behaviour with the current guix packages, and I think that's the most common use case anyway. For that, I think all that needs to be done is to install the plugins at ~/.guix-home/profile/share/vim/plugins/pack/guix/start/ and then having set packpath=~/.guix-home/profile/share/vim/plugins in the system vimrc. For neovim plugins, the path would be ~/.guix-home/profile/share/nvim/site/pack/guix/start/. Hi! Whichever way you go I recommend you avoid hardcoded paths and instead use search paths. This way you can have Vim and its plugins in a non-default profile and no collisions or unexpected sourcing will happen in `guix shell`. `--pure` should be pure! See my old patch for more info: <https://issues.guix.gnu.org/54221#30> SeerLite
Re: package exists but not showing
Perhaps `guix install` should disallow installing guix to avoid these common mistakes?
Re: printer installed, now scanner ?
On 2/20/22 13:25, Gottfried wrote: Hi, Below is my config.scm: it has 60 lines (if the 61:1 refers to a line???) after: sudo guix system reconfigure /etc/config.scm this message: /etc/config.scm:61:1: schließende Klammer fehlt (in English closing bracket is missing) I don`t know where is the missing bracket? You're missing 2 closing parentheses here: (services (append (list (service mate-desktop-service-type) (service enlightenment-desktop-service-type) (service cups-service-type (cups-configuration (web-interface? #t) (extensions (list cups-filters hplip (service openssh-service-type) (service tor-service-type) (set-xorg-configuration (xorg-configuration (keyboard-layout keyboard-layout (modify-services %desktop-services (sane-service-type _ => sane-backends)) One to close the "(append" and another one to close the "(services". We need these because otherwise Guile doesn't know where your _append_ stops and where your _services_ stop. It will continue reading everything as if it's part of the "append", when it actually has to close inside of services. Does that make sense? I hope you're able to get it working this time! :) SeerLite
Re: printer installed, now scanner ?
On 2/20/22 11:13, Gottfried wrote: what do I have to add exactly and where? Hi! You have to *replace* %desktop-services in your file with the example usage of modify-services from the manual that Gary sent in his previous email. This: %desktop-services has to become this: (modify-services %desktop-services (sane-service-type _ => sane-backends)) Additionally, you have to import the right module that contains the sane-backends package. So you'll have to add "scanner" to your use-package-modules line at the top.
Re: Stuck at scheme prompt when booting
On 2/12/22 15:15, coralgoat--- via wrote: I could try booting an operating system in memory and then use a disk encryption program to decrypt the hard drive with my passphrase and then run `chattr -i /etc/resolv.conf`. What disk encryption program should I use to decrypt the hard disk? Guix uses dm-crypt so you should be able to use the cryptsetup tool available in most distributions by default: cryptsetup open /dev/sda2 guix The above command creates decrypted representation of the /dev/sda2 partition at /dev/mapper/guix. You can mount this file like any other partition. This should be enough to access the contents of the system in case the boot process completely breaks. However in this case Ricardo's advice may be enough to get it to work from within Guix itself. I explained the above for future reference or in case it doesn't work. I resolved the domain name resolution errors by doing 2 things: 1) editing /etc/resolv.conf changing it to a single line that set a specific nameserver 2) I ran this command `chattr +i /etc/resolv.conf` If you want to avoid getting /etc/resolv.conf modified, instead of adding the immutable attribute to the file (AKA changing the "state" of the file) you should configure the responsible service so it doesn't modify it in the first place. This is especially important in a declarative system like Guix, where the operating-system and its services should function no matter the *state* of the files in it. Almost every system-level setting can be configured with Guix's configuration system. And using it prevents broken configurations like these from making the system completely unbootable, as you would be able to boot to a previous generation from the boot menu. I'm assuming you're using a configuration based on the official example, so the service that modifies this file should be NetworkManager coming from %desktop-services. To disable its modification to /etc/resolv.conf you can set the `dns` field to "none" in its `network-manager-configuration`. You can modify it by using `modify-services` on %desktop-services. See these manual pages for the usage of modify-services and also documentation of network-manager-configuration: * https://guix.gnu.org/manual/en/html_node/Service-Reference.html * https://guix.gnu.org/manual/en/html_node/Networking-Services.html SeerLite
Overriding xkeyboard-config package used by xorg-wrapper
Hi! I'm trying to override xkeyboard-config with a fork. I've successfully defined a variant in my system configuration along with variants for setxkbmap, xkbcomp and xorg-server that use it as input. They all build fine and seem to run fine too, but the problem is some things break unless the new XKB location is set directly in `X`'s `-xkbdir` argument. I thought it would automatically get set to the correct location if I used my xorg-server variant in my slim service's xorg-configuration, but that wasn't the case. I looked at gnu/services/xorg.scm and it seems like`xorg-wrapper` just uses the default xkeyboard-config for `-xkbdir`. Is there a way I can make it use the input from the server package I set in xorg-configuration instead? Or is there at least any way I can directly override the xkeyboard-config package used by xorg-wrapper? Thanks :) SeerLite