Hi, I am a beginner of NixOS.
I am using some unfree drivers and putting them into separated .nix
file:
brother-printer-unfree.nix:
{ pkgs, lib, ... }:
{
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"dcp375cwlpr"
"dcp375cw-cupswrapper"
];
services.printing = {
enable = true;
drivers = [ pkgs.dcp375cwlpr pkgs.dcp375cw-cupswrapper ];
};
# other printer config...
}
nvidia-unfree.nix:
{ config, lib, pkgs, ... }:
{
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"nvidia-x11"
"nvidia-settings"
"nvidia-persistenced"
];
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# some other nvidia config...
};
}
Both of them are imported in configuration.nix
However, seems nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [];
cannot be duplicate in multiple file like environment.systemPackages = with pkgs; []
, I have to put all of them in one place to make it work.
How can I separate them into multiple .nix file? Thanks!