nix: add package option for home-manager

This commit is contained in:
Lin Xianyi 2025-08-12 17:07:45 +08:00
parent 1259683027
commit b6c4f59a07

View file

@ -4,7 +4,6 @@ self: {
pkgs, pkgs,
... ...
}: let }: let
inherit (self.packages.${pkgs.system}) mango;
cfg = config.wayland.windowManager.mango; cfg = config.wayland.windowManager.mango;
variables = lib.concatStringsSep " " cfg.systemd.variables; variables = lib.concatStringsSep " " cfg.systemd.variables;
extraCommands = lib.concatStringsSep " && " cfg.systemd.extraCommands; extraCommands = lib.concatStringsSep " && " cfg.systemd.extraCommands;
@ -20,6 +19,11 @@ in {
type = types.bool; type = types.bool;
default = false; default = false;
}; };
package = lib.mkOption {
type = lib.types.package;
default = self.packages.${pkgs.system}.mango;
description = "The mango package to use";
};
systemd = { systemd = {
enable = mkOption { enable = mkOption {
type = types.bool; type = types.bool;
@ -92,7 +96,7 @@ in {
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = [mango]; home.packages = [ cfg.package ];
home.activation = home.activation =
lib.optionalAttrs (cfg.autostart_sh != "") { lib.optionalAttrs (cfg.autostart_sh != "") {
createMangoScript = lib.hm.dag.entryAfter ["clearMangoConfig"] '' createMangoScript = lib.hm.dag.entryAfter ["clearMangoConfig"] ''