# nixos-config - My current NixOS configuration # # Copyright (C) 2025 Benedikt Peetz # SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of my nixos-config. # # You should have received a copy of the License along with this program. # If not, see . { lib, config, packageSets, ... }: let cfg = config.soispha.nixpkgs; in { options.soispha.nixpkgs = { enable = lib.mkEnableOption "Nixpkgs config"; systemName = lib.mkOption { description = "The name of the system."; example = "x86_64-linux"; type = lib.types.str; }; unfreePackageNames = lib.mkOption { description = "Names of unfree packages to allow"; example = "[ steam steam-unwrapped ]"; type = lib.types.listOf lib.types.str; }; problemHandlers = lib.mkOption { description = "Decide how to handle a package marked with problems."; example = "{ \"gtk+\".broken = \"warn\"; }"; type = lib.types.attrsOf (lib.types.attrsOf lib.types.anything); }; }; config = let myPkgsOverlay = self: super: packageSets.in_tree; in lib.mkIf cfg.enable { nixpkgs = { hostPlatform = cfg.systemName; overlays = [ myPkgsOverlay ]; config = { hostSystem = cfg.systemName; problems.handlers = cfg.problemHandlers; allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) cfg.unfreePackageNames; }; }; }; }