mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
flake-parts/nixvim-configurations: init
This commit is contained in:
parent
3a781eff32
commit
2a8b8d9b08
@ -10,6 +10,7 @@
|
||||
./deploy-rs-nodes.nix
|
||||
./home-configurations.nix
|
||||
./home-modules.nix
|
||||
./nixvim-configurations.nix
|
||||
./setups
|
||||
];
|
||||
}
|
||||
|
49
modules/flake-parts/nixvim-configurations.nix
Normal file
49
modules/flake-parts/nixvim-configurations.nix
Normal file
@ -0,0 +1,49 @@
|
||||
{ config, lib, flake-parts-lib, ... }:
|
||||
|
||||
let
|
||||
inherit (flake-parts-lib) mkSubmoduleOptions mkPerSystemOption;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
flake = mkSubmoduleOptions {
|
||||
nixvimConfigurations = lib.mkOption {
|
||||
type = with lib.types; lazyAttrsOf (attrsOf package);
|
||||
default = { };
|
||||
description = ''
|
||||
An attribute set of per-system builds of
|
||||
[NixVim](https://github.com/nix-community/nixvim) configurations
|
||||
similar to `packages` flake output.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
perSystem = mkPerSystemOption {
|
||||
options = {
|
||||
nixvimConfigurations = lib.mkOption {
|
||||
type = with lib.types; attrsOf package;
|
||||
default = { };
|
||||
description = ''
|
||||
An attribute set of per-system builds of
|
||||
[NixVim](https://github.com/nix-community/nixvim) configurations
|
||||
similar to `packages` flake output.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
flake.nixvimConfigurations =
|
||||
lib.mapAttrs
|
||||
(k: v: v.nixvimConfigurations)
|
||||
(lib.filterAttrs
|
||||
(k: v: v.nixvimConfigurations != { })
|
||||
config.allSystems
|
||||
);
|
||||
|
||||
perInput = system: flake:
|
||||
lib.optionalAttrs (flake ? nixvimConfigurations.${system}) {
|
||||
nixvimConfigurations = flake.nixvimConfigurations.${system};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user