I've currently got a list defined as:
environment.systemPackages = with pkgs; [
acpi
ag
alacritty
audacity
awscli
bash
breeze-gtk
cabal-install
];
How would I go about defining two lists and then merging them to set the environment.systemPackages
value?
I'd like to split the list so it's easier to manage groups of related packages.
https://nixos.org/manual/nix/stable/expressions/language-operators.html
The ++
operator:
nix-repl> [1 2 3] ++ [5 6]
[ 1 2 3 5 6 ]
Code example:
let
unstable = import <unstable> {
config = config.nixpkgs.config;
};
examplePkgs = with pkgs; [
bash
];
in
{
environment.systemPackages = with pkgs; [
google-chrome
]
++ examplePkgs;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With