mirror of
https://github.com/foo-dogsquared/nix-module-wrapper-manager-fds.git
synced 2025-01-31 04:58:17 +00:00
wrapper-manager-fds/modules: fix NixOS and home-manager module
This commit is contained in:
parent
664e891d91
commit
cf9e4c0c20
10
modules/env/common.nix
vendored
10
modules/env/common.nix
vendored
@ -1,4 +1,4 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.wrapper-manager;
|
cfg = config.wrapper-manager;
|
||||||
@ -7,6 +7,7 @@ let
|
|||||||
description = "wrapper-manager module";
|
description = "wrapper-manager module";
|
||||||
class = "wrapperManager";
|
class = "wrapperManager";
|
||||||
specialArgs = cfg.extraSpecialArgs // {
|
specialArgs = cfg.extraSpecialArgs // {
|
||||||
|
inherit pkgs;
|
||||||
modulesPath = builtins.toString ../wrapper-manager;
|
modulesPath = builtins.toString ../wrapper-manager;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
@ -18,6 +19,13 @@ let
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
# Bringing all of the arguments from the wrapper-manager environment for
|
||||||
|
# convenience. It would also allow its users for full control without using
|
||||||
|
# the integration module itself.
|
||||||
|
../wrapper-manager/extra-args.nix
|
||||||
|
];
|
||||||
|
|
||||||
options.wrapper-manager = {
|
options.wrapper-manager = {
|
||||||
sharedModules = lib.mkOption {
|
sharedModules = lib.mkOption {
|
||||||
type = with lib.types; listOf deferredModule;
|
type = with lib.types; listOf deferredModule;
|
||||||
|
14
modules/env/home-manager/default.nix
vendored
14
modules/env/home-manager/default.nix
vendored
@ -8,14 +8,12 @@ in
|
|||||||
../common.nix
|
../common.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.wrapper-manager.wrappers = lib.mkOption {
|
config = lib.mkMerge [
|
||||||
type = lib.types.submoduleWith {
|
{ wrapper-manager.extraSpecialArgs.hmConfig = config; }
|
||||||
specialArgs.hmConfig = config;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf (cfg.wrappers != {}) {
|
(lib.mkIf (cfg.wrappers != {}) {
|
||||||
home.packages =
|
home.packages =
|
||||||
lib.mapAttrsToList (_: wrapper: wrapper.config.build.toplevel) cfg.wrappers;
|
lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.wrappers;
|
||||||
};
|
})
|
||||||
|
] ;
|
||||||
}
|
}
|
||||||
|
14
modules/env/nixos/default.nix
vendored
14
modules/env/nixos/default.nix
vendored
@ -8,14 +8,12 @@ in
|
|||||||
../common.nix
|
../common.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.wrapper-manager.wrappers = lib.mkOption {
|
config = lib.mkMerge [
|
||||||
type = lib.types.submoduleWith {
|
{ wrapper-manager.extraSpecialArgs.nixosConfig = config; }
|
||||||
specialArgs.nixosConfig = config;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf (cfg.wrappers != {}) {
|
(lib.mkIf (cfg.wrappers != {}) {
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
lib.mapAttrsToList (_: wrapper: wrapper.config.build.toplevel) cfg.wrappers;
|
lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.wrappers;
|
||||||
};
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user