Skip to content

Support multiple configuration files (selectable from grub) #23458

@TomSmeets

Description

@TomSmeets

Description

I was thinking if it is possible to select configurations when booting.
With configurations I mean multiple files that look like configuration.nix but can be selected from the boot menu (grub or efi).

NixOS could really benefit from this feature, and offer something that no other distro has.
And I would use it extensively with my laptop (different places ask for different configurations).

Example

Here are a few example configurations that I had in mind.
These paths could be specified in the standard configuration.nix file.

Path Description
configurations/default.nix Default configuration
configurations/work.nix No games, different host-name and mac-address
configurations/headless.nix Nixos without starting the x-server
configurations/free.nix disable all nonfree software
configurations/nvidia.nix disable bumblebee and directly use the graphics card

Implementation

These configurations will import common configurations (or each-other) to prevent copy-pasting.

I don't have enough knowledge to know if this is actually possible.
But I think so, because we already do something like this with the multiple bootable 'generations'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions