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: add package installation option for common integration module
This commit is contained in:
parent
1542702317
commit
628952542e
22
modules/env/common.nix
vendored
22
modules/env/common.nix
vendored
@ -21,6 +21,17 @@ let
|
|||||||
config._module.args.pkgs = lib.mkDefault pkgs;
|
config._module.args.pkgs = lib.mkDefault pkgs;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
{ lib, ... }: {
|
||||||
|
options.enableInstall = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = cfg.enableInstall;
|
||||||
|
description = "Install the package to the wider-scoped environment.";
|
||||||
|
example = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
] ++ cfg.sharedModules;
|
] ++ cfg.sharedModules;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
@ -33,6 +44,17 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
options.wrapper-manager = {
|
options.wrapper-manager = {
|
||||||
|
enableInstall = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = ''
|
||||||
|
Enable installing the package to the wider-scoped environment list
|
||||||
|
of packages. This is to be set as the default value of
|
||||||
|
{option}`enableInstall` in the wrapper-manager package environment.
|
||||||
|
'';
|
||||||
|
default = true;
|
||||||
|
example = false;
|
||||||
|
};
|
||||||
|
|
||||||
sharedModules = lib.mkOption {
|
sharedModules = lib.mkOption {
|
||||||
type = with lib.types; listOf deferredModule;
|
type = with lib.types; listOf deferredModule;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
|
6
modules/env/home-manager/default.nix
vendored
6
modules/env/home-manager/default.nix
vendored
@ -35,7 +35,11 @@ in
|
|||||||
})
|
})
|
||||||
|
|
||||||
(lib.mkIf (cfg.packages != { }) {
|
(lib.mkIf (cfg.packages != { }) {
|
||||||
home.packages = lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages;
|
home.packages =
|
||||||
|
let
|
||||||
|
validPackages = lib.filterAttrs (_: wrapper: wrapper.enableInstall) cfg.packages;
|
||||||
|
in
|
||||||
|
lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) validPackages;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
5
modules/env/nixos/default.nix
vendored
5
modules/env/nixos/default.nix
vendored
@ -34,7 +34,10 @@ in
|
|||||||
|
|
||||||
(lib.mkIf (cfg.packages != { }) {
|
(lib.mkIf (cfg.packages != { }) {
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages;
|
let
|
||||||
|
validPackages = lib.filterAttrs (_: wrapper: wrapper.enableInstall) cfg.packages;
|
||||||
|
in
|
||||||
|
lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) validPackages;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user