help-guix
[Top][All Lists]
Advanced

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

Splitting up the operating-system configuration


From: Daniel Schäfer
Subject: Splitting up the operating-system configuration
Date: Mon, 14 Oct 2019 03:56:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0

Hi,

when my system configuration file grows large, I want to split it up into multiple files. For example, I'd like to have a set of basic configurations for all of my systems, one for just the laptops, one for all systems with a GUI and so on.

On NixOS I have been doing this by using `imports = [ base.nix laptop.nix guix.nix ];`,where each imported file looks like just another system configuration and Nix merges them all together. Is there something like this in Guix, which can merge multiple configs together?

My first try was to use modules and define variables. This could be a list called `my-gui-packages` that I then use in the machine specific configuration file and add it to the `operating-system`. "Including" such a configuration layer, however, requires much change to the machine configuration file that has the `use-module` statement.

What I'm doing now, is to define services in separate modules and include them in the machine specific `operating-system`. With this approach I define my own service that can override other services, such as adding packages to the global environment (profile-service-type), adding my user (account-service-type), adding config files to /etc (etc-service-type).

But can I do everything by defining a service? Can I change the values of `operating-system`, such as `keyboard-layout`, `kernel-arguments`? Adding to `services` is equivalent to adding a `service-extension` in my custom service, right?

Kind of a side question: Can I set a global environment variable, such as $EDITOR in my config?

Thanks,
Daniel




reply via email to

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