mirror of
https://github.com/foo-dogsquared/nix-module-wrapper-manager-fds.git
synced 2025-01-30 22:57:58 +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
|
||||
cfg = config.wrapper-manager;
|
||||
@ -7,6 +7,7 @@ let
|
||||
description = "wrapper-manager module";
|
||||
class = "wrapperManager";
|
||||
specialArgs = cfg.extraSpecialArgs // {
|
||||
inherit pkgs;
|
||||
modulesPath = builtins.toString ../wrapper-manager;
|
||||
};
|
||||
modules = [
|
||||
@ -18,6 +19,13 @@ let
|
||||
};
|
||||
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 = {
|
||||
sharedModules = lib.mkOption {
|
||||
type = with lib.types; listOf deferredModule;
|
||||
|
16
modules/env/home-manager/default.nix
vendored
16
modules/env/home-manager/default.nix
vendored
@ -8,14 +8,12 @@ in
|
||||
../common.nix
|
||||
];
|
||||
|
||||
options.wrapper-manager.wrappers = lib.mkOption {
|
||||
type = lib.types.submoduleWith {
|
||||
specialArgs.hmConfig = config;
|
||||
};
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
{ wrapper-manager.extraSpecialArgs.hmConfig = config; }
|
||||
|
||||
config = lib.mkIf (cfg.wrappers != {}) {
|
||||
home.packages =
|
||||
lib.mapAttrsToList (_: wrapper: wrapper.config.build.toplevel) cfg.wrappers;
|
||||
};
|
||||
(lib.mkIf (cfg.wrappers != {}) {
|
||||
home.packages =
|
||||
lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.wrappers;
|
||||
})
|
||||
] ;
|
||||
}
|
||||
|
16
modules/env/nixos/default.nix
vendored
16
modules/env/nixos/default.nix
vendored
@ -8,14 +8,12 @@ in
|
||||
../common.nix
|
||||
];
|
||||
|
||||
options.wrapper-manager.wrappers = lib.mkOption {
|
||||
type = lib.types.submoduleWith {
|
||||
specialArgs.nixosConfig = config;
|
||||
};
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
{ wrapper-manager.extraSpecialArgs.nixosConfig = config; }
|
||||
|
||||
config = lib.mkIf (cfg.wrappers != {}) {
|
||||
environment.systemPackages =
|
||||
lib.mapAttrsToList (_: wrapper: wrapper.config.build.toplevel) cfg.wrappers;
|
||||
};
|
||||
(lib.mkIf (cfg.wrappers != {}) {
|
||||
environment.systemPackages =
|
||||
lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.wrappers;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user