From 336dc00a94e39337c64decd6d0f4f6e4a4d43187 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Tue, 11 Mar 2025 16:31:03 -0400 Subject: initial commit --- modules/pkgs.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 modules/pkgs.nix (limited to 'modules/pkgs.nix') diff --git a/modules/pkgs.nix b/modules/pkgs.nix new file mode 100644 index 0000000..d984859 --- /dev/null +++ b/modules/pkgs.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: + +{ + options.pkgs = lib.mkOption { + type = lib.types.nullOr (lib.types.lazyAttrsOf lib.types.raw); + default = + if (config.sources ? "nixpkgs") then + import config.sources.nixpkgs { + config = { }; + overlays = [ ]; + } + else + null; + defaultText = "if (sources has nixpkgs) import sources.nixpkgs { ... } else null"; + description = "The instance of `nixpkgs` to pass as a module argument."; + example = lib.literalExpression "import { config = { allowUnfree = true; }; }"; + }; + + config = { + _module.args = { inherit (config) pkgs; }; + }; +} -- cgit v1.2.3