git.delta.rocks / jrsonnet / refs/commits / 6d3c085f68b1

difftreelog

source

modules/nixpkgs.nix1.6 KiBsourcehistory
1{2  lib,3  fleetLib,4  config,5  ...6}: let7  inherit (lib.options) mkOption literalExpression;8  inherit (lib.types) path;9  inherit (lib.modules) mkRemovedOptionModule;10  inherit (fleetLib.options) mkHostsOption;11  inherit (fleetLib.types) listOfOverlay;1213  _file = ./nixpkgs.lib;14in {15  options = {16    nixpkgs = {17      buildUsing = mkOption {18        description = ''19          Default nixpkgs to use for building the systems.20        '';21        type = path;22      };23      overlays = mkOption {24        description = ''25          Package overlays to apply for all the hosts, gets propagated into26          `hosts.*.nixosModules.nixpkgs.overlays`.27        '';28        type = listOfOverlay;29      };30    };31    hosts = mkHostsOption {32      inherit _file;33      options.nixpkgs.buildUsing = mkOption {34        description = ''35          Nixpkgs to use for building the system.3637          Note that this option is defined at the host level, not the nixosModules level,38          nixosModules will be evaluated using this flake input.39        '';40        type = path;41        default = config.nixpkgs.buildUsing;42        defaultText = literalExpression "config.nixpkgs.buildUsing";43      };44      # imports = [45      # 	(mkRemovedOptionModule ["nixpkgs" "overlays"] "this option needs to be specified at nixosModules level")46      # ];47      config.nixos = {48        inherit _file;49        nixpkgs.overlays = config.nixpkgs.overlays;50        imports = [51          (mkRemovedOptionModule ["nixpkgs" "buildUsing"] "this option should be specified at the host level, not the nixosModules level")52        ];53      };54    };55  };56}