nix-module-wrapper-manager-fds/modules/env/nixos/default.nix

40 lines
895 B
Nix
Raw Normal View History

2024-07-31 13:51:40 +00:00
{
config,
lib,
pkgs,
...
}:
let
cfg = config.wrapper-manager;
wmDocs = import ../../../docs { inherit pkgs; };
in
{
2024-07-31 13:51:40 +00:00
imports = [ ../common.nix ];
config = lib.mkMerge [
{
environment.systemPackages =
lib.optionals cfg.documentation.manpage.enable [ wmDocs.outputs.manpage ]
++ lib.optionals cfg.documentation.html.enable [ wmDocs.outputs.html ];
wrapper-manager.extraSpecialArgs.nixosConfig = config;
wrapper-manager.sharedModules = [
2024-07-31 13:51:40 +00:00
(
{ lib, ... }:
{
# NixOS already has the option to set the locale so we don't need to
# have this.
config.locale.enable = lib.mkDefault false;
}
)
];
}
2024-07-31 13:51:40 +00:00
(lib.mkIf (cfg.packages != { }) {
environment.systemPackages = lib.mapAttrsToList (_: wrapper: wrapper.build.toplevel) cfg.packages;
})
];
}