mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
modules/context: flake
option, provides access to our flake
This commit is contained in:
parent
7391dc14ca
commit
9487403532
3 changed files with 16 additions and 4 deletions
|
@ -30,11 +30,9 @@ in
|
||||||
lib.evalModules {
|
lib.evalModules {
|
||||||
modules = modules ++ [
|
modules = modules ++ [
|
||||||
../modules/top-level
|
../modules/top-level
|
||||||
|
|
||||||
# Pass our locked nixpkgs into the configuration
|
|
||||||
{
|
{
|
||||||
_file = "<nixvim-flake>";
|
_file = "<nixvim-flake>";
|
||||||
nixpkgs.source = lib.mkOptionDefault flake.inputs.nixpkgs;
|
flake = lib.mkOptionDefault flake;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
|
|
|
@ -1,6 +1,20 @@
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
isFlake = x: x._type or null == "flake";
|
||||||
|
flakeType = lib.types.addCheck lib.types.path isFlake // {
|
||||||
|
name = "flake";
|
||||||
|
description = "flake";
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
flake = lib.mkOption {
|
||||||
|
type = flakeType;
|
||||||
|
description = ''
|
||||||
|
Nixvim's flake.
|
||||||
|
'';
|
||||||
|
internal = true;
|
||||||
|
};
|
||||||
isTopLevel = lib.mkOption {
|
isTopLevel = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
|
|
@ -129,7 +129,7 @@ in
|
||||||
# NOTE: This is a nixvim-specific option; there's no equivalent in nixos
|
# NOTE: This is a nixvim-specific option; there's no equivalent in nixos
|
||||||
source = lib.mkOption {
|
source = lib.mkOption {
|
||||||
type = lib.types.path;
|
type = lib.types.path;
|
||||||
# NOTE: default is only set if `flake` is passed to our lib
|
default = config.flake.inputs.nixpkgs;
|
||||||
defaultText = lib.literalMD "Nixvim's flake `input.nixpkgs`";
|
defaultText = lib.literalMD "Nixvim's flake `input.nixpkgs`";
|
||||||
description = ''
|
description = ''
|
||||||
The path to import Nixpkgs from.
|
The path to import Nixpkgs from.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue