mirror of
https://github.com/nix-community/home-manager
synced 2024-11-05 02:39:45 +01:00
modules: add platform assertions
This commit is contained in:
parent
d6b1d42682
commit
17dc593930
16 changed files with 82 additions and 0 deletions
|
@ -21,6 +21,11 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.services.blueman-applet.enable {
|
config = mkIf config.services.blueman-applet.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.blueman-applet" pkgs
|
||||||
|
platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.blueman-applet = {
|
systemd.user.services.blueman-applet = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Blueman applet";
|
Description = "Blueman applet";
|
||||||
|
|
|
@ -130,6 +130,10 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
{
|
{
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.dunst" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source =
|
xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source =
|
||||||
|
|
|
@ -263,6 +263,10 @@ in {
|
||||||
#
|
#
|
||||||
# directory.
|
# directory.
|
||||||
{
|
{
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.gpg-agent" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.gpg-agent = {
|
systemd.user.services.gpg-agent = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "GnuPG cryptographic agent and passphrase cache";
|
Description = "GnuPG cryptographic agent and passphrase cache";
|
||||||
|
|
|
@ -27,6 +27,11 @@ in {
|
||||||
(mkIf cfg.enable {
|
(mkIf cfg.enable {
|
||||||
home.packages = [ package ];
|
home.packages = [ package ];
|
||||||
|
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.kdeconnect" pkgs
|
||||||
|
platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.kdeconnect = {
|
systemd.user.services.kdeconnect = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description =
|
Description =
|
||||||
|
@ -46,6 +51,11 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.indicator {
|
(mkIf cfg.indicator {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.kdeconnect" pkgs
|
||||||
|
platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.kdeconnect-indicator = {
|
systemd.user.services.kdeconnect-indicator = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "kdeconnect-indicator";
|
Description = "kdeconnect-indicator";
|
||||||
|
|
|
@ -12,6 +12,10 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.services.keepassx.enable {
|
config = mkIf config.services.keepassx.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.keepassx" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.keepassx = {
|
systemd.user.services.keepassx = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "KeePassX password manager";
|
Description = "KeePassX password manager";
|
||||||
|
|
|
@ -39,6 +39,11 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.mpd-discord-rpc" pkgs
|
||||||
|
platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
xdg.configFile."discord-rpc/config.toml".source = configFile;
|
xdg.configFile."discord-rpc/config.toml".source = configFile;
|
||||||
|
|
||||||
systemd.user.services.mpd-discord-rpc = {
|
systemd.user.services.mpd-discord-rpc = {
|
||||||
|
|
|
@ -8,6 +8,11 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.services.owncloud-client.enable {
|
config = mkIf config.services.owncloud-client.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.owncloud-client" pkgs
|
||||||
|
platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.owncloud-client = {
|
systemd.user.services.owncloud-client = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Owncloud Client";
|
Description = "Owncloud Client";
|
||||||
|
|
|
@ -10,6 +10,10 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.services.pasystray.enable {
|
config = mkIf config.services.pasystray.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.pasystray" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.pasystray = {
|
systemd.user.services.pasystray = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "PulseAudio system tray";
|
Description = "PulseAudio system tray";
|
||||||
|
|
|
@ -270,6 +270,11 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.picom" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
services.picom.settings = mkDefaultAttrs {
|
services.picom.settings = mkDefaultAttrs {
|
||||||
# fading
|
# fading
|
||||||
fading = cfg.fade;
|
fading = cfg.fade;
|
||||||
|
|
|
@ -68,6 +68,11 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge ([
|
config = mkIf cfg.enable (mkMerge ([
|
||||||
{
|
{
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.random-background" pkgs
|
||||||
|
platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.random-background = {
|
systemd.user.services.random-background = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Set random desktop background using feh";
|
Description = "Set random desktop background using feh";
|
||||||
|
|
|
@ -51,6 +51,11 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
{
|
{
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.stalonetray" pkgs
|
||||||
|
platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
systemd.user.services.stalonetray = {
|
systemd.user.services.stalonetray = {
|
||||||
|
|
|
@ -108,6 +108,10 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.swayidle" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.swayidle = {
|
systemd.user.services.swayidle = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Idle manager for Wayland";
|
Description = "Idle manager for Wayland";
|
||||||
|
|
|
@ -98,6 +98,11 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (isAttrs cfg.tray && cfg.tray.enable) {
|
(mkIf (isAttrs cfg.tray && cfg.tray.enable) {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.syncthing.tray" pkgs
|
||||||
|
platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services = {
|
systemd.user.services = {
|
||||||
${cfg.tray.package.pname} = {
|
${cfg.tray.package.pname} = {
|
||||||
Unit = {
|
Unit = {
|
||||||
|
@ -118,6 +123,11 @@ in {
|
||||||
|
|
||||||
# deprecated
|
# deprecated
|
||||||
(mkIf (isBool cfg.tray && cfg.tray) {
|
(mkIf (isBool cfg.tray && cfg.tray) {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.syncthing.tray" pkgs
|
||||||
|
platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services = {
|
systemd.user.services = {
|
||||||
"syncthingtray" = {
|
"syncthingtray" = {
|
||||||
Unit = {
|
Unit = {
|
||||||
|
|
|
@ -24,6 +24,10 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.services.taffybar.enable {
|
config = mkIf config.services.taffybar.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.taffybar" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.taffybar = {
|
systemd.user.services.taffybar = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Taffybar desktop bar";
|
Description = "Taffybar desktop bar";
|
||||||
|
|
|
@ -10,6 +10,10 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.services.tahoe-lafs.enable {
|
config = mkIf config.services.tahoe-lafs.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.tahoe-lafs" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.tahoe-lafs = {
|
systemd.user.services.tahoe-lafs = {
|
||||||
Unit = { Description = "Tahoe-LAFS"; };
|
Unit = { Description = "Tahoe-LAFS"; };
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,10 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.services.udiskie.enable {
|
config = mkIf config.services.udiskie.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "services.udiskie" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
xdg.configFile."udiskie/config.yml".source =
|
xdg.configFile."udiskie/config.yml".source =
|
||||||
yaml.generate "udiskie-config.yml" (mergeSets [
|
yaml.generate "udiskie-config.yml" (mergeSets [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue