mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 16:57:55 +00:00
Gabriel Arazas
e8e2d67810
NixOS doesn't allow configuring nixpkgs modularly for externally defined nixpkgs instances so we'll have to create the option ourselves. This is also defined for other module environments just in case.
55 lines
1.5 KiB
Nix
55 lines
1.5 KiB
Nix
{ config, lib, options, ... }:
|
|
|
|
{
|
|
# A compatibility option while the newer iteration of configuring nixpkgs
|
|
# inside our internal flake-parts module is in progress.
|
|
imports = [
|
|
(lib.mkAliasOptionModule [ "nixpkgsBranch" ] [ "nixpkgs" "branch" ])
|
|
];
|
|
|
|
options.nixpkgs = {
|
|
branch = lib.mkOption {
|
|
type = lib.types.nonEmptyStr;
|
|
default = "nixpkgs";
|
|
description = ''
|
|
The nixpkgs branch to be used as the nixpkgs instance of the
|
|
environment. By default, it will use the `nixpkgs` flake input.
|
|
|
|
::: {.note}
|
|
This is based from your flake inputs and not somewhere else. If you
|
|
want to have support for multiple nixpkgs branch, simply add them as
|
|
a flake input.
|
|
:::
|
|
'';
|
|
example = "nixos-unstable-small";
|
|
};
|
|
|
|
config = lib.mkOption {
|
|
type = with lib.types; attrsOf anything;
|
|
description = ''
|
|
The configuration to be passed to the nixpkgs instance of the module
|
|
environment.
|
|
'';
|
|
default = { };
|
|
example = {
|
|
allowUnfree = true;
|
|
};
|
|
};
|
|
|
|
overlays = lib.mkOption {
|
|
type = with lib.types; listOf (functionTo raw);
|
|
default = [ ];
|
|
example = lib.literalExpression ''
|
|
[
|
|
inputs.neovim-nightly-overlay.overlays.default
|
|
inputs.emacs-overlay.overlays.default
|
|
]
|
|
'';
|
|
description = ''
|
|
A list of overlays to be applied for the nixpkgs instance of the
|
|
environment.
|
|
'';
|
|
};
|
|
};
|
|
}
|