mirror of
https://github.com/nix-community/home-manager
synced 2024-12-27 20:29:47 +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 {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.blueman-applet" pkgs
|
||||
platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.blueman-applet = {
|
||||
Unit = {
|
||||
Description = "Blueman applet";
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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"; };
|
||||
|
||||
|
|
|
@ -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 [
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue