Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: support for multi-files configuration.nix #33

Open
Zahrun opened this issue Mar 6, 2023 · 2 comments
Open

FR: support for multi-files configuration.nix #33

Zahrun opened this issue Mar 6, 2023 · 2 comments

Comments

@Zahrun
Copy link
Contributor

Zahrun commented Mar 6, 2023

My main configuration file is /etc/nixox/configuration.nix, however, I keep my environment.systemPackages in aroun.nix and have import in configuration.nix via

imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      ./aroun.nix
    ];

If the sofware-center parser could open the files under imports, parse them, and find the location of environment.systemPackages, that would be great

cf. snowfallorg/nixos-conf-editor#7

@vlinkz
Copy link
Collaborator

vlinkz commented Mar 14, 2023

May not be exactly what you're looking for, but if you have a specific file containing environment.systemPackages that you want the software center to use, selecting that instead of configuration.nix in the preferences should work. But parsing imports is definitely something that would greatly expand configuration flexibility using this program!

@Zahrun
Copy link
Contributor Author

Zahrun commented Apr 7, 2023

Yes, for now I just point to the file where I have most of my systemPackages, and that works fine for me. As per the NixOS manual, it is possible to have multiple definitions of the same option, see https://nixos.org/manual/nixos/stable/index.html#sec-modularity.

Note that both configuration.nix and kde.nix define the option environment.systemPackages. When multiple modules define an option, NixOS will try to merge the definitions. In the case of environment.systemPackages, that’s easy: the lists of packages can simply be concatenated. The value in configuration.nix is merged last, so for list-type options, it will appear at the end of the merged list. If you want it to appear first, you can use mkBefore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants