1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 06:59:45 +01:00

modules: add platform assertions

This commit is contained in:
midchildan 2022-04-24 23:25:54 +09:00 committed by Robert Helgesson
parent d6b1d42682
commit 17dc593930
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
16 changed files with 82 additions and 0 deletions

View file

@ -21,6 +21,11 @@ with lib;
};
config = mkIf config.services.blueman-applet.enable {
assertions = [
(hm.assertions.assertPlatform "services.blueman-applet" pkgs
platforms.linux)
];
systemd.user.services.blueman-applet = {
Unit = {
Description = "Blueman applet";

View file

@ -130,6 +130,10 @@ in {
config = mkIf cfg.enable (mkMerge [
{
assertions = [
(hm.assertions.assertPlatform "services.dunst" pkgs platforms.linux)
];
home.packages = [ cfg.package ];
xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source =

View file

@ -263,6 +263,10 @@ in {
#
# directory.
{
assertions = [
(hm.assertions.assertPlatform "services.gpg-agent" pkgs platforms.linux)
];
systemd.user.services.gpg-agent = {
Unit = {
Description = "GnuPG cryptographic agent and passphrase cache";

View file

@ -27,6 +27,11 @@ in {
(mkIf cfg.enable {
home.packages = [ package ];
assertions = [
(hm.assertions.assertPlatform "services.kdeconnect" pkgs
platforms.linux)
];
systemd.user.services.kdeconnect = {
Unit = {
Description =
@ -46,6 +51,11 @@ in {
})
(mkIf cfg.indicator {
assertions = [
(hm.assertions.assertPlatform "services.kdeconnect" pkgs
platforms.linux)
];
systemd.user.services.kdeconnect-indicator = {
Unit = {
Description = "kdeconnect-indicator";

View file

@ -12,6 +12,10 @@ with lib;
};
config = mkIf config.services.keepassx.enable {
assertions = [
(hm.assertions.assertPlatform "services.keepassx" pkgs platforms.linux)
];
systemd.user.services.keepassx = {
Unit = {
Description = "KeePassX password manager";

View file

@ -39,6 +39,11 @@ in {
};
config = mkIf cfg.enable {
assertions = [
(hm.assertions.assertPlatform "services.mpd-discord-rpc" pkgs
platforms.linux)
];
xdg.configFile."discord-rpc/config.toml".source = configFile;
systemd.user.services.mpd-discord-rpc = {

View file

@ -8,6 +8,11 @@ with lib;
};
config = mkIf config.services.owncloud-client.enable {
assertions = [
(hm.assertions.assertPlatform "services.owncloud-client" pkgs
platforms.linux)
];
systemd.user.services.owncloud-client = {
Unit = {
Description = "Owncloud Client";

View file

@ -10,6 +10,10 @@ with lib;
};
config = mkIf config.services.pasystray.enable {
assertions = [
(hm.assertions.assertPlatform "services.pasystray" pkgs platforms.linux)
];
systemd.user.services.pasystray = {
Unit = {
Description = "PulseAudio system tray";

View file

@ -270,6 +270,11 @@ in {
};
config = mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.picom" pkgs
lib.platforms.linux)
];
services.picom.settings = mkDefaultAttrs {
# fading
fading = cfg.fade;

View file

@ -68,6 +68,11 @@ in {
config = mkIf cfg.enable (mkMerge ([
{
assertions = [
(hm.assertions.assertPlatform "services.random-background" pkgs
platforms.linux)
];
systemd.user.services.random-background = {
Unit = {
Description = "Set random desktop background using feh";

View file

@ -51,6 +51,11 @@ in {
config = mkIf cfg.enable (mkMerge [
{
assertions = [
(hm.assertions.assertPlatform "services.stalonetray" pkgs
platforms.linux)
];
home.packages = [ cfg.package ];
systemd.user.services.stalonetray = {

View file

@ -108,6 +108,10 @@ in {
};
config = mkIf cfg.enable {
assertions = [
(hm.assertions.assertPlatform "services.swayidle" pkgs platforms.linux)
];
systemd.user.services.swayidle = {
Unit = {
Description = "Idle manager for Wayland";

View file

@ -98,6 +98,11 @@ in {
})
(mkIf (isAttrs cfg.tray && cfg.tray.enable) {
assertions = [
(hm.assertions.assertPlatform "services.syncthing.tray" pkgs
platforms.linux)
];
systemd.user.services = {
${cfg.tray.package.pname} = {
Unit = {
@ -118,6 +123,11 @@ in {
# deprecated
(mkIf (isBool cfg.tray && cfg.tray) {
assertions = [
(hm.assertions.assertPlatform "services.syncthing.tray" pkgs
platforms.linux)
];
systemd.user.services = {
"syncthingtray" = {
Unit = {

View file

@ -24,6 +24,10 @@ in {
};
config = mkIf config.services.taffybar.enable {
assertions = [
(hm.assertions.assertPlatform "services.taffybar" pkgs platforms.linux)
];
systemd.user.services.taffybar = {
Unit = {
Description = "Taffybar desktop bar";

View file

@ -10,6 +10,10 @@ with lib;
};
config = mkIf config.services.tahoe-lafs.enable {
assertions = [
(hm.assertions.assertPlatform "services.tahoe-lafs" pkgs platforms.linux)
];
systemd.user.services.tahoe-lafs = {
Unit = { Description = "Tahoe-LAFS"; };

View file

@ -98,6 +98,10 @@ in {
};
config = mkIf config.services.udiskie.enable {
assertions = [
(hm.assertions.assertPlatform "services.udiskie" pkgs platforms.linux)
];
xdg.configFile."udiskie/config.yml".source =
yaml.generate "udiskie-config.yml" (mergeSets [
{