sway: specify dependent packages more idiomatically, and fix bug where phosh wasn't actually shipping its dependents

This commit is contained in:
Colin 2023-02-04 00:43:00 +00:00
parent f2e8be3bd1
commit 7ce0c34f43
3 changed files with 491 additions and 456 deletions

View File

@ -32,6 +32,16 @@ in
];
};
}
{
sane.programs = {
inherit (pkgs // {
"gnome.gnome-bluetooth" = pkgs.gnome.gnome-bluetooth;
})
phosh-mobile-settings
# "gnome.gnome-bluetooth"
;
};
}
(mkIf cfg.enable {
sane.gui.enable = true;

View File

@ -120,8 +120,40 @@ in
type = types.bool;
};
};
config = mkIf cfg.enable {
config = mkMerge [
{
sane.programs.swayApps = {
package = null;
suggestedPrograms = [
"swaylock"
"swayidle"
"wl-clipboard"
"mako" # notification daemon
# # "pavucontrol"
"gnome.gnome-bluetooth"
"gnome.gnome-control-center"
];
};
}
{
sane.programs = {
inherit (pkgs // {
"gnome.gnome-bluetooth" = pkgs.gnome.gnome-bluetooth;
"gnome.gnome-control-center" = pkgs.gnome.gnome-control-center;
})
swaylock
swayidle
wl-clipboard
mako
"gnome.gnome-bluetooth"
"gnome.gnome-control-center"
;
};
}
(mkIf cfg.enable {
sane.gui.enable = true;
sane.programs.swayApps.enableFor.user.colin = true;
# swap in these lines to use SDDM instead of `services.greetd`.
# services.xserver.displayManager.sddm.enable = true;
@ -624,20 +656,7 @@ in
# color: black;
# }
# '';
# TODO: refactor
sane.programs = {
swaylock.enableFor.user.colin = true;
swayidle.enableFor.user.colin = true; # (unused)
wl-clipboard.enableFor.user.colin = true;
mako.enableFor.user.colin = true; # notification daemon
xdg-utils.enableFor.user.colin = true; # for xdg-open
# user stuff
# pavucontrol
"sway-contrib.grimshot".enableFor.user.colin = true;
"gnome.gnome-bluetooth".enableFor.user.colin = true;
"gnome.gnome-control-center".enableFor.user.colin = true;
};
};
})
];
}

View File

@ -85,7 +85,12 @@ let
});
toPkgSpec = types.coercedTo types.package (p: { package = p; }) pkgSpec;
configs = mapAttrsToList (_name: p: {
configs = mapAttrsToList (name: p: {
assertions = map (sug: {
assertion = cfg ? "${sug}";
message = ''program "${sug}" referenced by "${name}", but not defined'';
}) p.suggestedPrograms;
# conditionally add to system PATH
environment.systemPackages = optional
(p.package != null && p.enableFor.system)
@ -112,6 +117,7 @@ in
config =
let
take = f: {
assertions = f.assertions;
environment.systemPackages = f.environment.systemPackages;
users.users = f.users.users;
sane.users = f.sane.users;