diff --git a/doc/release-notes/rl-2111.adoc b/doc/release-notes/rl-2111.adoc index 63986f953..14216eff8 100644 --- a/doc/release-notes/rl-2111.adoc +++ b/doc/release-notes/rl-2111.adoc @@ -9,7 +9,29 @@ section is therefore not final. This release has the following notable changes: -* Nothing has happened. +* All Home Manager modules are now loaded on all platforms. With this +change you will get a more descriptive error message if you attempt to +enable a module that is incompatible with the host platform. ++ +Previously, modules that were platform specific would only be loaded +on that particular platform. For example, a module defining a +https://systemd.io/[systemd] service would only be loaded when the +host platform was Linux. This reduced evaluation times, simplified the +generated documentation, and made it impossible to accidentally use +modules that do not support the host platform. ++ +While the above benefits are quite nice, avoiding module loads also +brings a few problems. For example, the +https://nix-community.github.io/home-manager/[public documentation] +will only show the options available for Linux hosts and the +documentation cannot make references to options within modules that +are unavailable on some hosts. Finally, users who wish to use the same +configuration file for different platforms cannot do so, even if the +platform incompatible options are unused. ++ +Ultimately, the benefits of loading all modules won and the behavior +has now changed. For associated discussion see +https://github.com/nix-community/home-manager/issues/1906[issue #1906]. [[sec-release-21.11-state-version-changes]] === State Version Changes diff --git a/modules/config/i18n.nix b/modules/config/i18n.nix index 9fca360da..c795bbcff 100644 --- a/modules/config/i18n.nix +++ b/modules/config/i18n.nix @@ -36,7 +36,7 @@ let in { meta.maintainers = with maintainers; [ midchildan ]; - config = { + config = mkIf pkgs.hostPlatform.isLinux { # For shell sessions. home.sessionVariables = localeVars; diff --git a/modules/i18n/input-method/default.nix b/modules/i18n/input-method/default.nix index 0abfec179..27b3ae86d 100644 --- a/modules/i18n/input-method/default.nix +++ b/modules/i18n/input-method/default.nix @@ -95,6 +95,10 @@ in { }; config = mkIf (cfg.enabled != null) { + assertions = [ + (hm.assertions.assertPlatform "i18n.inputMethod" pkgs platforms.linux) + ]; + home.packages = [ cfg.package gtk2Cache gtk3Cache ]; }; diff --git a/modules/lib/assertions.nix b/modules/lib/assertions.nix new file mode 100644 index 000000000..1089c27b8 --- /dev/null +++ b/modules/lib/assertions.nix @@ -0,0 +1,14 @@ +{ lib }: + +{ + assertPlatform = module: pkgs: platforms: { + assertion = lib.elem pkgs.stdenv.hostPlatform.system platforms; + message = let + platformsStr = lib.concatStringsSep "\n" + (map (p: " - ${p}") (lib.sort (a: b: a < b) platforms)); + in '' + The module ${module} does not support your platform. It only supports + + ${platformsStr}''; + }; +} diff --git a/modules/lib/default.nix b/modules/lib/default.nix index 7c2c72f70..c087c8109 100644 --- a/modules/lib/default.nix +++ b/modules/lib/default.nix @@ -16,6 +16,8 @@ rec { entryBefore = d.dagEntryBefore; }; + assertions = import ./assertions.nix { inherit lib; }; + gvariant = import ./gvariant.nix { inherit lib; }; maintainers = import ./maintainers.nix; strings = import ./strings.nix { inherit lib; }; diff --git a/modules/misc/numlock.nix b/modules/misc/numlock.nix index c823f6dbd..88032417f 100644 --- a/modules/misc/numlock.nix +++ b/modules/misc/numlock.nix @@ -12,6 +12,10 @@ in { options = { xsession.numlock.enable = mkEnableOption "Num Lock"; }; config = mkIf cfg.enable { + assertions = [ + (hm.assertions.assertPlatform "xsession.numlock" pkgs platforms.linux) + ]; + systemd.user.services.numlockx = { Unit = { Description = "NumLockX"; diff --git a/modules/misc/tmpfiles.nix b/modules/misc/tmpfiles.nix index c46fe2c55..248843029 100644 --- a/modules/misc/tmpfiles.nix +++ b/modules/misc/tmpfiles.nix @@ -25,6 +25,11 @@ in { }; config = mkIf (cfg.rules != [ ]) { + assertions = [ + (hm.assertions.assertPlatform "systemd.user.tmpfiles" pkgs + platforms.linux) + ]; + xdg = { dataFile."user-tmpfiles.d/home-manager.conf" = { text = '' diff --git a/modules/misc/xdg-desktop-entries.nix b/modules/misc/xdg-desktop-entries.nix index 382d6c2b5..73452c075 100644 --- a/modules/misc/xdg-desktop-entries.nix +++ b/modules/misc/xdg-desktop-entries.nix @@ -171,8 +171,13 @@ in { ''; }; - config.home.packages = mkIf (config.xdg.desktopEntries != { }) - (map hiPrio # we need hiPrio to override existing entries + config = mkIf (config.xdg.desktopEntries != { }) { + assertions = [ + (hm.assertions.assertPlatform "xdg.desktopEntries" pkgs platforms.linux) + ]; + + home.packages = (map hiPrio # we need hiPrio to override existing entries (attrsets.mapAttrsToList makeFile config.xdg.desktopEntries)); + }; } diff --git a/modules/misc/xdg-mime-apps.nix b/modules/misc/xdg-mime-apps.nix index 81d2ba0fc..c7867d44f 100644 --- a/modules/misc/xdg-mime-apps.nix +++ b/modules/misc/xdg-mime-apps.nix @@ -73,6 +73,9 @@ in { }; config = mkIf cfg.enable { + assertions = + [ (hm.assertions.assertPlatform "xdg.mimeApps" pkgs platforms.linux) ]; + # Deprecated but still used by some applications. xdg.dataFile."applications/mimeapps.list".source = config.xdg.configFile."mimeapps.list".source; diff --git a/modules/misc/xdg-mime.nix b/modules/misc/xdg-mime.nix index 5999e1299..9a6d7860e 100644 --- a/modules/misc/xdg-mime.nix +++ b/modules/misc/xdg-mime.nix @@ -10,7 +10,9 @@ in { options = { xdg.mime.enable = mkOption { type = types.bool; - default = true; + default = pkgs.hostPlatform.isLinux; + defaultText = + literalExample "true if host platform is Linux, false otherwise"; description = '' Whether to install programs and files to support the XDG Shared MIME-info specification and XDG MIME Applications @@ -24,6 +26,9 @@ in { }; config = mkIf config.xdg.mime.enable { + assertions = + [ (hm.assertions.assertPlatform "xdg.mime" pkgs platforms.linux) ]; + home.packages = [ # Explicitly install package to provide basic mime types. pkgs.shared-mime-info diff --git a/modules/misc/xdg-system-dirs.nix b/modules/misc/xdg-system-dirs.nix index f79ebc55b..876244581 100644 --- a/modules/misc/xdg-system-dirs.nix +++ b/modules/misc/xdg-system-dirs.nix @@ -36,6 +36,12 @@ in { }; config = mkMerge [ + (mkIf (cfg.config != [ ] || cfg.data != [ ]) { + assertions = [ + (hm.assertions.assertPlatform "xdg.systemDirs" pkgs platforms.linux) + ]; + }) + (mkIf (cfg.config != [ ]) { home.sessionVariables.XDG_CONFIG_DIRS = "${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}"; diff --git a/modules/misc/xdg-user-dirs.nix b/modules/misc/xdg-user-dirs.nix index 6694b52d7..78d350cde 100644 --- a/modules/misc/xdg-user-dirs.nix +++ b/modules/misc/xdg-user-dirs.nix @@ -103,6 +103,9 @@ in { XDG_VIDEOS_DIR = cfg.videos; } // cfg.extraConfig; in mkIf cfg.enable { + assertions = + [ (hm.assertions.assertPlatform "xdg.userDirs" pkgs platforms.linux) ]; + xdg.configFile."user-dirs.dirs".text = let # For some reason, these need to be wrapped with quotes to be valid. wrapped = mapAttrs (_: value: ''"${value}"'') directories; diff --git a/modules/modules.nix b/modules/modules.nix index 8b76f6c04..a82c3cb6f 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -14,234 +14,225 @@ with lib; let - hostPlatform = pkgs.stdenv.hostPlatform; - - loadModule = file: { condition ? true }: { - inherit file condition; - }; - - allModules = [ - (loadModule ./accounts/email.nix { }) - (loadModule ./config/i18n.nix { condition = hostPlatform.isLinux; }) - (loadModule ./files.nix { }) - (loadModule ./home-environment.nix { }) - (loadModule ./i18n/input-method/default.nix { condition = hostPlatform.isLinux; }) - (loadModule ./manual.nix { }) - (loadModule ./misc/dconf.nix { }) - (loadModule ./misc/debug.nix { }) - (loadModule ./misc/fontconfig.nix { }) - (loadModule ./misc/gtk.nix { }) - (loadModule ./misc/lib.nix { }) - (loadModule ./misc/news.nix { }) - (loadModule ./misc/nixpkgs.nix { condition = useNixpkgsModule; }) - (loadModule ./misc/numlock.nix { condition = hostPlatform.isLinux; }) - (loadModule ./misc/pam.nix { }) - (loadModule ./misc/qt.nix { }) - (loadModule ./misc/submodule-support.nix { }) - (loadModule ./misc/tmpfiles.nix { condition = hostPlatform.isLinux; }) - (loadModule ./misc/version.nix { }) - (loadModule ./misc/vte.nix { }) - (loadModule ./misc/xdg-system-dirs.nix { condition = hostPlatform.isLinux; }) - (loadModule ./misc/xdg-desktop-entries.nix { condition = hostPlatform.isLinux; }) - (loadModule ./misc/xdg-mime.nix { condition = hostPlatform.isLinux; }) - (loadModule ./misc/xdg-mime-apps.nix { condition = hostPlatform.isLinux; }) - (loadModule ./misc/xdg-user-dirs.nix { condition = hostPlatform.isLinux; }) - (loadModule ./misc/xdg.nix { }) - (loadModule ./programs/abook.nix { condition = hostPlatform.isLinux; }) - (loadModule ./programs/afew.nix { }) - (loadModule ./programs/alacritty.nix { }) - (loadModule ./programs/alot.nix { }) - (loadModule ./programs/aria2.nix { }) - (loadModule ./programs/astroid.nix { }) - (loadModule ./programs/autojump.nix { }) - (loadModule ./programs/autorandr.nix { }) - (loadModule ./programs/bash.nix { }) - (loadModule ./programs/bat.nix { }) - (loadModule ./programs/beets.nix { }) - (loadModule ./programs/broot.nix { }) - (loadModule ./programs/browserpass.nix { }) - (loadModule ./programs/chromium.nix { }) - (loadModule ./programs/command-not-found/command-not-found.nix { }) - (loadModule ./programs/dircolors.nix { }) - (loadModule ./programs/direnv.nix { }) - (loadModule ./programs/eclipse.nix { }) - (loadModule ./programs/emacs.nix { }) - (loadModule ./programs/exa.nix { }) - (loadModule ./programs/feh.nix { }) - (loadModule ./programs/firefox.nix { }) - (loadModule ./programs/fish.nix { }) - (loadModule ./programs/foot.nix { condition = hostPlatform.isLinux; }) - (loadModule ./programs/fzf.nix { }) - (loadModule ./programs/getmail.nix { condition = hostPlatform.isLinux; }) - (loadModule ./programs/gh.nix { }) - (loadModule ./programs/git.nix { }) - (loadModule ./programs/gnome-terminal.nix { }) - (loadModule ./programs/go.nix { }) - (loadModule ./programs/gpg.nix { }) - (loadModule ./programs/himalaya.nix { }) - (loadModule ./programs/home-manager.nix { }) - (loadModule ./programs/htop.nix { }) - (loadModule ./programs/i3status.nix { }) - (loadModule ./programs/i3status-rust.nix { condition = hostPlatform.isLinux; }) - (loadModule ./programs/info.nix { }) - (loadModule ./programs/irssi.nix { }) - (loadModule ./programs/lieer.nix { }) - (loadModule ./programs/jq.nix { }) - (loadModule ./programs/kakoune.nix { }) - (loadModule ./programs/keychain.nix { }) - (loadModule ./programs/kitty.nix { }) - (loadModule ./programs/lazygit.nix { }) - (loadModule ./programs/lesspipe.nix { }) - (loadModule ./programs/lf.nix { }) - (loadModule ./programs/lsd.nix { }) - (loadModule ./programs/man.nix { }) - (loadModule ./programs/mangohud.nix { condition = hostPlatform.isLinux; }) - (loadModule ./programs/matplotlib.nix { }) - (loadModule ./programs/mbsync.nix { }) - (loadModule ./programs/mcfly.nix { }) - (loadModule ./programs/mercurial.nix { }) - (loadModule ./programs/mpv.nix { }) - (loadModule ./programs/msmtp.nix { }) - (loadModule ./programs/mu.nix { }) - (loadModule ./programs/ncmpcpp.nix { }) - (loadModule ./programs/ncspot.nix { }) - (loadModule ./programs/ne.nix { }) - (loadModule ./programs/neomutt.nix { }) - (loadModule ./programs/neovim.nix { }) - (loadModule ./programs/newsboat.nix { }) - (loadModule ./programs/nix-index.nix { }) - (loadModule ./programs/noti.nix { }) - (loadModule ./programs/notmuch.nix { }) - (loadModule ./programs/nushell.nix { }) - (loadModule ./programs/obs-studio.nix { }) - (loadModule ./programs/octant.nix { }) - (loadModule ./programs/offlineimap.nix { }) - (loadModule ./programs/opam.nix { }) - (loadModule ./programs/password-store.nix { }) - (loadModule ./programs/pazi.nix { }) - (loadModule ./programs/pet.nix { }) - (loadModule ./programs/pidgin.nix { }) - (loadModule ./programs/piston-cli.nix { }) - (loadModule ./programs/powerline-go.nix { }) - (loadModule ./programs/qutebrowser.nix { }) - (loadModule ./programs/rbw.nix { }) - (loadModule ./programs/readline.nix { }) - (loadModule ./programs/rofi.nix { }) - (loadModule ./programs/rofi-pass.nix { }) - (loadModule ./programs/rtorrent.nix { }) - (loadModule ./programs/scmpuff.nix { }) - (loadModule ./programs/senpai.nix { }) - (loadModule ./programs/skim.nix { }) - (loadModule ./programs/sm64ex.nix { }) - (loadModule ./programs/starship.nix { }) - (loadModule ./programs/sbt.nix { }) - (loadModule ./programs/ssh.nix { }) - (loadModule ./programs/taskwarrior.nix { }) - (loadModule ./programs/termite.nix { }) - (loadModule ./programs/texlive.nix { }) - (loadModule ./programs/tmux.nix { }) - (loadModule ./programs/terminator.nix { condition = hostPlatform.isLinux; }) - (loadModule ./programs/topgrade.nix { }) - (loadModule ./programs/urxvt.nix { }) - (loadModule ./programs/vim.nix { }) - (loadModule ./programs/vscode.nix { }) - (loadModule ./programs/vscode/haskell.nix { }) - (loadModule ./programs/waybar.nix { condition = hostPlatform.isLinux; }) - (loadModule ./programs/xmobar.nix { }) - (loadModule ./programs/z-lua.nix { }) - (loadModule ./programs/zathura.nix { }) - (loadModule ./programs/zoxide.nix { }) - (loadModule ./programs/zplug.nix { }) - (loadModule ./programs/zsh.nix { }) - (loadModule ./programs/zsh/prezto.nix { }) - (loadModule ./services/barrier.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/blueman-applet.nix { }) - (loadModule ./services/caffeine.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/cbatticon.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/clipmenu.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/compton.nix { }) - (loadModule ./services/devilspie2.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/dropbox.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/dunst.nix { }) - (loadModule ./services/dwm-status.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/emacs.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/etesync-dav.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/flameshot.nix { }) - (loadModule ./services/fluidsynth.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/redshift-gammastep/gammastep.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/getmail.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/gnome-keyring.nix { }) - (loadModule ./services/gpg-agent.nix { }) - (loadModule ./services/grobi.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/hound.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/imapnotify.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/kanshi.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/kbfs.nix { }) - (loadModule ./services/kdeconnect.nix { }) - (loadModule ./services/keepassx.nix { }) - (loadModule ./services/keybase.nix { }) - (loadModule ./services/keynav.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/lieer.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/lorri.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/mako.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/mbsync.nix { }) - (loadModule ./services/mpd.nix { }) - (loadModule ./services/mpdris2.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/mpris-proxy.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/muchsync.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/network-manager-applet.nix { }) - (loadModule ./services/nextcloud-client.nix { }) - (loadModule ./services/owncloud-client.nix { }) - (loadModule ./services/pantalaimon.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/parcellite.nix { }) - (loadModule ./services/pass-secret-service.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/password-store-sync.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/pasystray.nix { }) - (loadModule ./services/pbgopy.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/picom.nix { }) - (loadModule ./services/plan9port.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/playerctld.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/polybar.nix { }) - (loadModule ./services/poweralertd.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/pulseeffects.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/random-background.nix { }) - (loadModule ./services/redshift-gammastep/redshift.nix { }) - (loadModule ./services/rsibreak.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/screen-locker.nix { }) - (loadModule ./services/stalonetray.nix { }) - (loadModule ./services/status-notifier-watcher.nix { }) - (loadModule ./services/spotifyd.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/sxhkd.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/syncthing.nix { }) - (loadModule ./services/taffybar.nix { }) - (loadModule ./services/tahoe-lafs.nix { }) - (loadModule ./services/taskwarrior-sync.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/udiskie.nix { }) - (loadModule ./services/unclutter.nix { }) - (loadModule ./services/unison.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/window-managers/awesome.nix { }) - (loadModule ./services/window-managers/bspwm/default.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/window-managers/i3-sway/i3.nix { }) - (loadModule ./services/window-managers/i3-sway/sway.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/window-managers/xmonad.nix { }) - (loadModule ./services/wlsunset.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/xcape.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/xembed-sni-proxy.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/xidlehook.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/xscreensaver.nix { }) - (loadModule ./services/xsettingsd.nix { condition = hostPlatform.isLinux; }) - (loadModule ./services/xsuspender.nix { condition = hostPlatform.isLinux; }) - (loadModule ./systemd.nix { }) - (loadModule ./targets/darwin { condition = hostPlatform.isDarwin; }) - (loadModule ./targets/generic-linux.nix { condition = hostPlatform.isLinux; }) - (loadModule ./xcursor.nix { }) - (loadModule ./xresources.nix { }) - (loadModule ./xsession.nix { }) - (loadModule (pkgs.path + "/nixos/modules/misc/assertions.nix") { }) - (loadModule (pkgs.path + "/nixos/modules/misc/meta.nix") { }) - ]; - - modules = map (getAttr "file") (filter (getAttr "condition") allModules); + modules = [ + ./accounts/email.nix + ./config/i18n.nix + ./files.nix + ./home-environment.nix + ./i18n/input-method/default.nix + ./manual.nix + ./misc/dconf.nix + ./misc/debug.nix + ./misc/fontconfig.nix + ./misc/gtk.nix + ./misc/lib.nix + ./misc/news.nix + ./misc/numlock.nix + ./misc/pam.nix + ./misc/qt.nix + ./misc/submodule-support.nix + ./misc/tmpfiles.nix + ./misc/version.nix + ./misc/vte.nix + ./misc/xdg-desktop-entries.nix + ./misc/xdg-mime-apps.nix + ./misc/xdg-mime.nix + ./misc/xdg-system-dirs.nix + ./misc/xdg-user-dirs.nix + ./misc/xdg.nix + ./programs/abook.nix + ./programs/afew.nix + ./programs/alacritty.nix + ./programs/alot.nix + ./programs/aria2.nix + ./programs/astroid.nix + ./programs/autojump.nix + ./programs/autorandr.nix + ./programs/bash.nix + ./programs/bat.nix + ./programs/beets.nix + ./programs/broot.nix + ./programs/browserpass.nix + ./programs/chromium.nix + ./programs/command-not-found/command-not-found.nix + ./programs/dircolors.nix + ./programs/direnv.nix + ./programs/eclipse.nix + ./programs/emacs.nix + ./programs/exa.nix + ./programs/feh.nix + ./programs/firefox.nix + ./programs/fish.nix + ./programs/foot.nix + ./programs/fzf.nix + ./programs/getmail.nix + ./programs/gh.nix + ./programs/git.nix + ./programs/gnome-terminal.nix + ./programs/go.nix + ./programs/gpg.nix + ./programs/himalaya.nix + ./programs/home-manager.nix + ./programs/htop.nix + ./programs/i3status-rust.nix + ./programs/i3status.nix + ./programs/info.nix + ./programs/irssi.nix + ./programs/jq.nix + ./programs/kakoune.nix + ./programs/keychain.nix + ./programs/kitty.nix + ./programs/lazygit.nix + ./programs/lesspipe.nix + ./programs/lf.nix + ./programs/lieer.nix + ./programs/lsd.nix + ./programs/man.nix + ./programs/mangohud.nix + ./programs/matplotlib.nix + ./programs/mbsync.nix + ./programs/mcfly.nix + ./programs/mercurial.nix + ./programs/mpv.nix + ./programs/msmtp.nix + ./programs/mu.nix + ./programs/ncmpcpp.nix + ./programs/ncspot.nix + ./programs/ne.nix + ./programs/neomutt.nix + ./programs/neovim.nix + ./programs/newsboat.nix + ./programs/nix-index.nix + ./programs/noti.nix + ./programs/notmuch.nix + ./programs/nushell.nix + ./programs/obs-studio.nix + ./programs/octant.nix + ./programs/offlineimap.nix + ./programs/opam.nix + ./programs/password-store.nix + ./programs/pazi.nix + ./programs/pet.nix + ./programs/pidgin.nix + ./programs/piston-cli.nix + ./programs/powerline-go.nix + ./programs/qutebrowser.nix + ./programs/rbw.nix + ./programs/readline.nix + ./programs/rofi-pass.nix + ./programs/rofi.nix + ./programs/rtorrent.nix + ./programs/sbt.nix + ./programs/scmpuff.nix + ./programs/senpai.nix + ./programs/skim.nix + ./programs/sm64ex.nix + ./programs/ssh.nix + ./programs/starship.nix + ./programs/taskwarrior.nix + ./programs/terminator.nix + ./programs/termite.nix + ./programs/texlive.nix + ./programs/tmux.nix + ./programs/topgrade.nix + ./programs/urxvt.nix + ./programs/vim.nix + ./programs/vscode.nix + ./programs/vscode/haskell.nix + ./programs/waybar.nix + ./programs/xmobar.nix + ./programs/z-lua.nix + ./programs/zathura.nix + ./programs/zoxide.nix + ./programs/zplug.nix + ./programs/zsh.nix + ./programs/zsh/prezto.nix + ./services/barrier.nix + ./services/blueman-applet.nix + ./services/caffeine.nix + ./services/cbatticon.nix + ./services/clipmenu.nix + ./services/compton.nix + ./services/devilspie2.nix + ./services/dropbox.nix + ./services/dunst.nix + ./services/dwm-status.nix + ./services/emacs.nix + ./services/etesync-dav.nix + ./services/flameshot.nix + ./services/fluidsynth.nix + ./services/getmail.nix + ./services/gnome-keyring.nix + ./services/gpg-agent.nix + ./services/grobi.nix + ./services/hound.nix + ./services/imapnotify.nix + ./services/kanshi.nix + ./services/kbfs.nix + ./services/kdeconnect.nix + ./services/keepassx.nix + ./services/keybase.nix + ./services/keynav.nix + ./services/lieer.nix + ./services/lorri.nix + ./services/mako.nix + ./services/mbsync.nix + ./services/mpd.nix + ./services/mpdris2.nix + ./services/mpris-proxy.nix + ./services/muchsync.nix + ./services/network-manager-applet.nix + ./services/nextcloud-client.nix + ./services/owncloud-client.nix + ./services/pantalaimon.nix + ./services/parcellite.nix + ./services/pass-secret-service.nix + ./services/password-store-sync.nix + ./services/pasystray.nix + ./services/pbgopy.nix + ./services/picom.nix + ./services/plan9port.nix + ./services/playerctld.nix + ./services/polybar.nix + ./services/poweralertd.nix + ./services/pulseeffects.nix + ./services/random-background.nix + ./services/redshift-gammastep/gammastep.nix + ./services/redshift-gammastep/redshift.nix + ./services/rsibreak.nix + ./services/screen-locker.nix + ./services/spotifyd.nix + ./services/stalonetray.nix + ./services/status-notifier-watcher.nix + ./services/sxhkd.nix + ./services/syncthing.nix + ./services/taffybar.nix + ./services/tahoe-lafs.nix + ./services/taskwarrior-sync.nix + ./services/udiskie.nix + ./services/unclutter.nix + ./services/unison.nix + ./services/window-managers/awesome.nix + ./services/window-managers/bspwm/default.nix + ./services/window-managers/i3-sway/i3.nix + ./services/window-managers/i3-sway/sway.nix + ./services/window-managers/xmonad.nix + ./services/wlsunset.nix + ./services/xcape.nix + ./services/xembed-sni-proxy.nix + ./services/xidlehook.nix + ./services/xscreensaver.nix + ./services/xsettingsd.nix + ./services/xsuspender.nix + ./systemd.nix + ./targets/darwin + ./targets/generic-linux.nix + ./xcursor.nix + ./xresources.nix + ./xsession.nix + (pkgs.path + "/nixos/modules/misc/assertions.nix") + (pkgs.path + "/nixos/modules/misc/meta.nix") + ] ++ optional useNixpkgsModule ./misc/nixpkgs.nix; pkgsModule = { config, ... }: { config = { diff --git a/modules/programs/abook.nix b/modules/programs/abook.nix index 4ddc080ad..bdbf7e87d 100644 --- a/modules/programs/abook.nix +++ b/modules/programs/abook.nix @@ -27,7 +27,11 @@ in { }; config = mkIf cfg.enable { + assertions = + [ (hm.assertions.assertPlatform "programs.abook" pkgs platforms.linux) ]; + home.packages = [ pkgs.abook ]; + xdg.configFile."abook/abookrc" = mkIf (cfg.extraConfig != "") { text = '' # Generated by Home Manager. diff --git a/modules/programs/foot.nix b/modules/programs/foot.nix index 8df201fd9..f02c5b3ca 100644 --- a/modules/programs/foot.nix +++ b/modules/programs/foot.nix @@ -49,6 +49,9 @@ in { }; config = mkIf cfg.enable { + assertions = + [ (hm.assertions.assertPlatform "programs.foot" pkgs platforms.linux) ]; + home.packages = [ cfg.package ]; xdg.configFile."foot/foot.ini" = mkIf (cfg.settings != { }) { diff --git a/modules/programs/getmail.nix b/modules/programs/getmail.nix index eaf297cf2..53e39b439 100644 --- a/modules/programs/getmail.nix +++ b/modules/programs/getmail.nix @@ -55,6 +55,10 @@ in { }; config = mkIf getmailEnabled { + assertions = [ + (hm.assertions.assertPlatform "programs.getmail" pkgs platforms.linux) + ]; + home.file = foldl' (a: b: a // b) { } (map (a: { "${renderConfigFilepath a}".text = renderAccountConfig a; }) accounts); diff --git a/modules/programs/i3status-rust.nix b/modules/programs/i3status-rust.nix index 5d721cc50..b20b5f27b 100644 --- a/modules/programs/i3status-rust.nix +++ b/modules/programs/i3status-rust.nix @@ -249,6 +249,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (hm.assertions.assertPlatform "programs.i3status-rust" pkgs + platforms.linux) + ]; + home.packages = [ cfg.package ]; xdg.configFile = mapAttrs' (cfgFileSuffix: cfg: diff --git a/modules/programs/mangohud.nix b/modules/programs/mangohud.nix index 3a2158e3d..b85203e41 100644 --- a/modules/programs/mangohud.nix +++ b/modules/programs/mangohud.nix @@ -82,24 +82,25 @@ in { }; }; - config = mkIf cfg.enable (mkMerge [ - { - home.packages = [ cfg.package ]; + config = mkIf cfg.enable { + assertions = [ + (hm.assertions.assertPlatform "programs.mangohud" pkgs platforms.linux) + ]; - home.sessionVariables = mkIf cfg.enableSessionWide { - MANGOHUD = 1; - MANGOHUD_DLSYM = 1; - }; + home.packages = [ cfg.package ]; - xdg.configFile."MangoHud/MangoHud.conf" = + home.sessionVariables = mkIf cfg.enableSessionWide { + MANGOHUD = 1; + MANGOHUD_DLSYM = 1; + }; + + xdg.configFile = { + "MangoHud/MangoHud.conf" = mkIf (cfg.settings != { }) { text = renderSettings cfg.settings; }; - } - { - xdg.configFile = mapAttrs' - (n: v: nameValuePair "MangoHud/${n}.conf" { text = renderSettings v; }) - cfg.settingsPerApplication; - } - ]); + } // mapAttrs' + (n: v: nameValuePair "MangoHud/${n}.conf" { text = renderSettings v; }) + cfg.settingsPerApplication; + }; meta.maintainers = with maintainers; [ zeratax ]; } diff --git a/modules/programs/rofi.nix b/modules/programs/rofi.nix index f4f7594e1..2c06aae44 100644 --- a/modules/programs/rofi.nix +++ b/modules/programs/rofi.nix @@ -402,12 +402,15 @@ in { }; config = mkIf cfg.enable { - assertions = [{ - assertion = cfg.theme == null || cfg.colors == null; - message = '' - Cannot use the rofi options 'theme' and 'colors' simultaneously. - ''; - }]; + assertions = [ + (hm.assertions.assertPlatform "programs.rofi" pkgs platforms.linux) + { + assertion = cfg.theme == null || cfg.colors == null; + message = '' + Cannot use the rofi options 'theme' and 'colors' simultaneously. + ''; + } + ]; lib.formats.rasi.mkLiteral = value: { _type = "literal"; diff --git a/modules/programs/terminator.nix b/modules/programs/terminator.nix index d100a9cd9..831d7263d 100644 --- a/modules/programs/terminator.nix +++ b/modules/programs/terminator.nix @@ -63,7 +63,12 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (hm.assertions.assertPlatform "programs.terminator" pkgs platforms.linux) + ]; + home.packages = [ cfg.package ]; + xdg.configFile."terminator/config" = mkIf (cfg.config != { }) { text = toConfigObject cfg.config; }; }; diff --git a/modules/programs/waybar.nix b/modules/programs/waybar.nix index 3cf919cc7..207d311cd 100644 --- a/modules/programs/waybar.nix +++ b/modules/programs/waybar.nix @@ -353,16 +353,26 @@ in { in allWarnings; in mkIf cfg.enable (mkMerge [ - { home.packages = [ cfg.package ]; } + { + assertions = [ + (lib.hm.assertions.assertPlatform "programs.waybar" pkgs + lib.platforms.linux) + ]; + + home.packages = [ cfg.package ]; + } + (mkIf (cfg.settings != [ ]) { # Generate warnings about defined but unreferenced modules inherit warnings; xdg.configFile."waybar/config".source = configSource; }) + (mkIf (cfg.style != null) { xdg.configFile."waybar/style.css".text = cfg.style; }) + (mkIf cfg.systemd.enable { systemd.user.services.waybar = { Unit = { diff --git a/modules/services/barrier.nix b/modules/services/barrier.nix index ae9b7d936..5b34e1af6 100644 --- a/modules/services/barrier.nix +++ b/modules/services/barrier.nix @@ -51,6 +51,11 @@ in { }; config = mkIf cfg.client.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.barrier" pkgs + lib.platforms.linux) + ]; + systemd.user.services.barrierc = { Unit = { Description = "Barrier Client daemon"; diff --git a/modules/services/caffeine.nix b/modules/services/caffeine.nix index bb24a0e05..28ebc7f13 100644 --- a/modules/services/caffeine.nix +++ b/modules/services/caffeine.nix @@ -14,6 +14,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.caffeine" pkgs + lib.platforms.linux) + ]; + systemd.user.services.caffeine = { Unit = { Description = "caffeine"; }; diff --git a/modules/services/cbatticon.nix b/modules/services/cbatticon.nix index a86805ddc..1216878ca 100644 --- a/modules/services/cbatticon.nix +++ b/modules/services/cbatticon.nix @@ -98,6 +98,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.cbatticon" pkgs + lib.platforms.linux) + ]; + home.packages = [ package ]; systemd.user.services.cbatticon = { diff --git a/modules/services/clipmenu.nix b/modules/services/clipmenu.nix index 2e1c10e43..3f2055c9a 100644 --- a/modules/services/clipmenu.nix +++ b/modules/services/clipmenu.nix @@ -21,6 +21,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.clipmenu" pkgs + lib.platforms.linux) + ]; + home.packages = [ cfg.package ]; systemd.user.services.clipmenu = { diff --git a/modules/services/devilspie2.nix b/modules/services/devilspie2.nix index 4b93217cd..fa77153e7 100644 --- a/modules/services/devilspie2.nix +++ b/modules/services/devilspie2.nix @@ -27,6 +27,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.devilspie2" pkgs + lib.platforms.linux) + ]; + systemd.user.services.devilspie2 = { Service.ExecStart = "${pkgs.devilspie2}/bin/devilspie2"; Unit = { diff --git a/modules/services/dropbox.nix b/modules/services/dropbox.nix index bcf3ba2b4..81cf88818 100644 --- a/modules/services/dropbox.nix +++ b/modules/services/dropbox.nix @@ -28,6 +28,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.dropbox" pkgs + lib.platforms.linux) + ]; + home.packages = [ pkgs.dropbox-cli ]; systemd.user.services.dropbox = { diff --git a/modules/services/dwm-status.nix b/modules/services/dwm-status.nix index a0c2a7243..005e9dcaf 100644 --- a/modules/services/dwm-status.nix +++ b/modules/services/dwm-status.nix @@ -53,6 +53,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.dwm-status" pkgs + lib.platforms.linux) + ]; + systemd.user.services.dwm-status = { Unit = { Description = "DWM status service"; diff --git a/modules/services/emacs.nix b/modules/services/emacs.nix index 96c86ee78..fecb19f49 100644 --- a/modules/services/emacs.nix +++ b/modules/services/emacs.nix @@ -75,6 +75,11 @@ in { config = mkIf cfg.enable (mkMerge [ { + assertions = [ + (lib.hm.assertions.assertPlatform "services.emacs" pkgs + lib.platforms.linux) + ]; + systemd.user.services.emacs = { Unit = { Description = "Emacs text editor"; diff --git a/modules/services/etesync-dav.nix b/modules/services/etesync-dav.nix index 8bc5aa7a0..76819aafa 100644 --- a/modules/services/etesync-dav.nix +++ b/modules/services/etesync-dav.nix @@ -45,6 +45,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.etesync-dav" pkgs + lib.platforms.linux) + ]; + home.packages = [ cfg.package ]; systemd.user.services.etesync-dav = { diff --git a/modules/services/flameshot.nix b/modules/services/flameshot.nix index 13fb7ea20..ed523561d 100644 --- a/modules/services/flameshot.nix +++ b/modules/services/flameshot.nix @@ -13,6 +13,11 @@ in { options = { services.flameshot = { enable = mkEnableOption "Flameshot"; }; }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.flameshot" pkgs + lib.platforms.linux) + ]; + home.packages = [ package ]; systemd.user.services.flameshot = { diff --git a/modules/services/fluidsynth.nix b/modules/services/fluidsynth.nix index 18913fe54..1b5a0c5fd 100644 --- a/modules/services/fluidsynth.nix +++ b/modules/services/fluidsynth.nix @@ -37,6 +37,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.fluidsynth" pkgs + lib.platforms.linux) + ]; + systemd.user.services.fluidsynth = { Unit = { Description = "FluidSynth Daemon"; diff --git a/modules/services/getmail.nix b/modules/services/getmail.nix index e7a1b1a46..83ed4ed45 100644 --- a/modules/services/getmail.nix +++ b/modules/services/getmail.nix @@ -37,6 +37,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.getmail" pkgs + lib.platforms.linux) + ]; + systemd.user.services.getmail = { Unit = { Description = "getmail email fetcher"; }; Service = { ExecStart = "${pkgs.getmail}/bin/getmail ${configFiles}"; }; diff --git a/modules/services/gnome-keyring.nix b/modules/services/gnome-keyring.nix index 7e3f8bbce..7267129d7 100644 --- a/modules/services/gnome-keyring.nix +++ b/modules/services/gnome-keyring.nix @@ -25,6 +25,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.gnome-keyring" pkgs + lib.platforms.linux) + ]; + systemd.user.services.gnome-keyring = { Unit = { Description = "GNOME Keyring"; diff --git a/modules/services/grobi.nix b/modules/services/grobi.nix index 4dfc5d633..682458fd6 100644 --- a/modules/services/grobi.nix +++ b/modules/services/grobi.nix @@ -71,6 +71,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.grobi" pkgs + lib.platforms.linux) + ]; + systemd.user.services.grobi = { Unit = { Description = "grobi display auto config daemon"; diff --git a/modules/services/hound.nix b/modules/services/hound.nix index 07b5d4765..12c1f5d50 100644 --- a/modules/services/hound.nix +++ b/modules/services/hound.nix @@ -59,6 +59,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.hound" pkgs + lib.platforms.linux) + ]; + home.packages = [ pkgs.hound ]; systemd.user.services.hound = { diff --git a/modules/services/imapnotify.nix b/modules/services/imapnotify.nix index 4b3ebda71..5d7c5f4b8 100644 --- a/modules/services/imapnotify.nix +++ b/modules/services/imapnotify.nix @@ -77,6 +77,8 @@ in { + concatMapStringsSep ", " (a: a.name) badAccounts; }; in [ + (lib.hm.assertions.assertPlatform "services.imapnotify" pkgs + lib.platforms.linux) (checkAccounts (a: a.maildir == null) "maildir configuration") (checkAccounts (a: a.imap == null) "IMAP configuration") (checkAccounts (a: a.passwordCommand == null) "password command") diff --git a/modules/services/kanshi.nix b/modules/services/kanshi.nix index 8df32121a..ce6e25221 100644 --- a/modules/services/kanshi.nix +++ b/modules/services/kanshi.nix @@ -187,6 +187,10 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.kanshi" pkgs + lib.platforms.linux) + ]; xdg.configFile."kanshi/config".text = '' ${concatStringsSep "\n" (mapAttrsToList profileStr cfg.profiles)} diff --git a/modules/services/kbfs.nix b/modules/services/kbfs.nix index d4be2592c..4f1bfd8bf 100644 --- a/modules/services/kbfs.nix +++ b/modules/services/kbfs.nix @@ -32,6 +32,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.kbfs" pkgs + lib.platforms.linux) + ]; + systemd.user.services.kbfs = { Unit = { Description = "Keybase File System"; diff --git a/modules/services/keybase.nix b/modules/services/keybase.nix index 0aec0bbc8..f6e400866 100644 --- a/modules/services/keybase.nix +++ b/modules/services/keybase.nix @@ -10,6 +10,11 @@ in { options.services.keybase.enable = mkEnableOption "Keybase"; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.keybase" pkgs + lib.platforms.linux) + ]; + home.packages = [ pkgs.keybase ]; systemd.user.services.keybase = { diff --git a/modules/services/keynav.nix b/modules/services/keynav.nix index c7f1df373..d83252e53 100644 --- a/modules/services/keynav.nix +++ b/modules/services/keynav.nix @@ -10,6 +10,11 @@ in { options.services.keynav = { enable = mkEnableOption "keynav"; }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.keynav" pkgs + lib.platforms.linux) + ]; + systemd.user.services.keynav = { Unit = { Description = "keynav"; diff --git a/modules/services/lieer.nix b/modules/services/lieer.nix index 71f0a66e5..9dd8c15e8 100644 --- a/modules/services/lieer.nix +++ b/modules/services/lieer.nix @@ -61,6 +61,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.lieer" pkgs + lib.platforms.linux) + ]; + programs.lieer.enable = true; systemd.user.services = listToAttrs (map serviceUnit syncAccounts); systemd.user.timers = listToAttrs (map timerUnit syncAccounts); diff --git a/modules/services/lorri.nix b/modules/services/lorri.nix index 618369908..5e749532a 100644 --- a/modules/services/lorri.nix +++ b/modules/services/lorri.nix @@ -21,6 +21,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.lorri" pkgs + lib.platforms.linux) + ]; + home.packages = [ cfg.package ]; systemd.user = { diff --git a/modules/services/mako.nix b/modules/services/mako.nix index e8f4d38c2..b09f90a10 100644 --- a/modules/services/mako.nix +++ b/modules/services/mako.nix @@ -292,7 +292,11 @@ in { optionalString = name: val: lib.optionalString (val != null) "${name}=${val}"; in mkIf cfg.enable { + assertions = + [ (hm.assertions.assertPlatform "services.mako" pkgs platforms.linux) ]; + home.packages = [ pkgs.mako ]; + xdg.configFile."mako/config".text = '' ${optionalInteger "max-visible" cfg.maxVisible} ${optionalString "sort" cfg.sort} diff --git a/modules/services/mbsync.nix b/modules/services/mbsync.nix index ac6ac1ef7..b52b68857 100644 --- a/modules/services/mbsync.nix +++ b/modules/services/mbsync.nix @@ -76,6 +76,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.mbsync" pkgs + lib.platforms.linux) + ]; + systemd.user.services.mbsync = { Unit = { Description = "mbsync mailbox synchronization"; }; diff --git a/modules/services/mpd.nix b/modules/services/mpd.nix index a6ed0a483..5800a18c1 100644 --- a/modules/services/mpd.nix +++ b/modules/services/mpd.nix @@ -143,6 +143,10 @@ in { ###### implementation config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.mpd" pkgs + lib.platforms.linux) + ]; systemd.user.services.mpd = { Unit = { diff --git a/modules/services/mpdris2.nix b/modules/services/mpdris2.nix index cb8cefba6..88ea50afb 100644 --- a/modules/services/mpdris2.nix +++ b/modules/services/mpdris2.nix @@ -74,10 +74,15 @@ in { }; config = mkIf cfg.enable { - assertions = [{ - assertion = config.services.mpd.enable; - message = "The mpdris2 module requires 'services.mpd.enable = true'."; - }]; + assertions = [ + (lib.hm.assertions.assertPlatform "services.mpdris2" pkgs + lib.platforms.linux) + + { + assertion = config.services.mpd.enable; + message = "The mpdris2 module requires 'services.mpd.enable = true'."; + } + ]; xdg.configFile."mpDris2/mpDris2.conf".text = toIni mpdris2Conf; diff --git a/modules/services/mpris-proxy.nix b/modules/services/mpris-proxy.nix index 69f56c21f..9996b1376 100644 --- a/modules/services/mpris-proxy.nix +++ b/modules/services/mpris-proxy.nix @@ -13,6 +13,11 @@ in { "a proxy forwarding Bluetooth MIDI controls via MPRIS2 to control media players"; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.mpris-proxy" pkgs + lib.platforms.linux) + ]; + systemd.user.services.mpris-proxy = { Unit = { Description = diff --git a/modules/services/muchsync.nix b/modules/services/muchsync.nix index b7004418d..39899bfba 100644 --- a/modules/services/muchsync.nix +++ b/modules/services/muchsync.nix @@ -156,12 +156,16 @@ in { (name: remoteCfg: nameValuePair "muchsync-${name}" (gen name remoteCfg)) cfg.remotes; in mkIf (cfg.remotes != { }) { - assertions = [{ - assertion = config.programs.notmuch.enable; - message = '' - The muchsync module requires 'programs.notmuch.enable = true'. - ''; - }]; + assertions = [ + (hm.assertions.assertPlatform "services.muchsync" pkgs platforms.linux) + + { + assertion = config.programs.notmuch.enable; + message = '' + The muchsync module requires 'programs.notmuch.enable = true'. + ''; + } + ]; systemd.user.services = mapRemotes (name: remoteCfg: { Unit = { Description = "muchsync sync service (${name})"; }; diff --git a/modules/services/network-manager-applet.nix b/modules/services/network-manager-applet.nix index b84861a99..f4abe86e0 100644 --- a/modules/services/network-manager-applet.nix +++ b/modules/services/network-manager-applet.nix @@ -16,6 +16,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.network-manager-applet" pkgs + lib.platforms.linux) + ]; + systemd.user.services.network-manager-applet = { Unit = { Description = "Network Manager applet"; diff --git a/modules/services/nextcloud-client.nix b/modules/services/nextcloud-client.nix index 4e56c4f50..b787a6d6e 100644 --- a/modules/services/nextcloud-client.nix +++ b/modules/services/nextcloud-client.nix @@ -28,6 +28,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.nextcloud-client" pkgs + lib.platforms.linux) + ]; + systemd.user.services.nextcloud-client = { Unit = { Description = "Nextcloud Client"; diff --git a/modules/services/pantalaimon.nix b/modules/services/pantalaimon.nix index 38662a346..ac049e507 100644 --- a/modules/services/pantalaimon.nix +++ b/modules/services/pantalaimon.nix @@ -55,6 +55,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.pantalaimon" pkgs + lib.platforms.linux) + ]; + home.packages = [ cfg.package ]; systemd.user.services = { diff --git a/modules/services/parcellite.nix b/modules/services/parcellite.nix index dddb0631d..617fe6fba 100644 --- a/modules/services/parcellite.nix +++ b/modules/services/parcellite.nix @@ -22,6 +22,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.parcellite" pkgs + lib.platforms.linux) + ]; + home.packages = [ cfg.package ]; systemd.user.services.parcellite = { diff --git a/modules/services/pass-secret-service.nix b/modules/services/pass-secret-service.nix index d2ed11ee7..06b5be1f8 100644 --- a/modules/services/pass-secret-service.nix +++ b/modules/services/pass-secret-service.nix @@ -9,11 +9,16 @@ in { enable = mkEnableOption "Pass libsecret service"; }; config = mkIf serviceCfg.enable { - assertions = [{ - assertion = config.programs.password-store.enable; - message = "The 'services.pass-secret-service' module requires" - + " 'programs.password-store.enable = true'."; - }]; + assertions = [ + (hm.assertions.assertPlatform "services.pass-secret-service" pkgs + platforms.linux) + + { + assertion = config.programs.password-store.enable; + message = "The 'services.pass-secret-service' module requires" + + " 'programs.password-store.enable = true'."; + } + ]; systemd.user.services.pass-secret-service = { Unit = { Description = "Pass libsecret service"; }; diff --git a/modules/services/password-store-sync.nix b/modules/services/password-store-sync.nix index 819339149..c8dbe808f 100644 --- a/modules/services/password-store-sync.nix +++ b/modules/services/password-store-sync.nix @@ -33,11 +33,16 @@ in { }; config = mkIf serviceCfg.enable { - assertions = [{ - assertion = programCfg.enable; - message = "The 'services.password-store-sync' module requires" - + " 'programs.password-store.enable = true'."; - }]; + assertions = [ + (hm.assertions.assertPlatform "services.password-store-sync" pkgs + platforms.linux) + + { + assertion = programCfg.enable; + message = "The 'services.password-store-sync' module requires" + + " 'programs.password-store.enable = true'."; + } + ]; systemd.user.services.password-store-sync = { Unit = { Description = "Password store sync"; }; diff --git a/modules/services/pbgopy.nix b/modules/services/pbgopy.nix index f4fd4f53f..487aa4f36 100644 --- a/modules/services/pbgopy.nix +++ b/modules/services/pbgopy.nix @@ -50,6 +50,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.pbgopy" pkgs + lib.platforms.linux) + ]; + home.packages = [ package ]; systemd.user.services.pbgopy = { diff --git a/modules/services/picom.nix b/modules/services/picom.nix index 4c4da8de6..617c0756e 100644 --- a/modules/services/picom.nix +++ b/modules/services/picom.nix @@ -283,6 +283,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.picom" pkgs + lib.platforms.linux) + ]; + home.packages = [ cfg.package ]; systemd.user.services.picom = { diff --git a/modules/services/plan9port.nix b/modules/services/plan9port.nix index 0f5893f21..249804724 100644 --- a/modules/services/plan9port.nix +++ b/modules/services/plan9port.nix @@ -16,7 +16,10 @@ in { mkEnableOption "the Plan 9 file system for interprocess messaging"; }; - config = { + config = mkIf (cfg.fontsrv.enable || cfg.plumber.enable) { + assertions = [ + (hm.assertions.assertPlatform "services.plan9port" pkgs platforms.linux) + ]; systemd.user.services.fontsrv = mkIf cfg.fontsrv.enable { Unit.Description = "the Plan 9 file system access to host fonts"; diff --git a/modules/services/playerctld.nix b/modules/services/playerctld.nix index 63e7b8feb..5e48896b9 100644 --- a/modules/services/playerctld.nix +++ b/modules/services/playerctld.nix @@ -21,6 +21,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.playerctld" pkgs + lib.platforms.linux) + ]; + systemd.user.services.playerctld = { Unit.Description = "MPRIS media player daemon"; diff --git a/modules/services/polybar.nix b/modules/services/polybar.nix index 8a8e99942..9f7627779 100644 --- a/modules/services/polybar.nix +++ b/modules/services/polybar.nix @@ -191,6 +191,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.polybar" pkgs + lib.platforms.linux) + ]; + home.packages = [ cfg.package ]; xdg.configFile."polybar/config".source = configFile; diff --git a/modules/services/poweralertd.nix b/modules/services/poweralertd.nix index 39fffd7cd..cae44c753 100644 --- a/modules/services/poweralertd.nix +++ b/modules/services/poweralertd.nix @@ -11,6 +11,11 @@ in { mkEnableOption "the Upower-powered power alerterd"; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.poweralertd" pkgs + lib.platforms.linux) + ]; + systemd.user.services.poweralertd = { Unit = { Description = "UPower-powered power alerter"; diff --git a/modules/services/pulseeffects.nix b/modules/services/pulseeffects.nix index 184c2af79..bad04e4e1 100644 --- a/modules/services/pulseeffects.nix +++ b/modules/services/pulseeffects.nix @@ -33,6 +33,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.pulseeffects" pkgs + lib.platforms.linux) + ]; + # running pulseeffects will just attach itself to gapplication service # at-spi2-core is to minimize journalctl noise of: # "AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files" diff --git a/modules/services/redshift-gammastep/lib/options.nix b/modules/services/redshift-gammastep/lib/options.nix index 11ce9d7ce..e79c5df10 100644 --- a/modules/services/redshift-gammastep/lib/options.nix +++ b/modules/services/redshift-gammastep/lib/options.nix @@ -146,20 +146,25 @@ in { }; config = { - assertions = [{ - assertion = (cfg.settings ? ${mainSection}.dawn-time || cfg.settings - ? ${mainSection}.dusk-time) - || (cfg.settings.${mainSection}.location-provider) == "geoclue2" - || ((cfg.settings.${mainSection}.location-provider) == "manual" - && (cfg.settings ? manual.lat || cfg.settings ? manual.lon)); - message = '' - In order for ${programName} to know the time of action, you need to set one of - - services.${moduleName}.provider = "geoclue2" for automatically inferring your location - (you also need to enable Geoclue2 service separately) - - services.${moduleName}.longitude and .latitude for specifying your location manually - - services.${moduleName}.dawnTime and .duskTime for specifying the times manually - ''; - }]; + assertions = [ + (hm.assertions.assertPlatform "services.${moduleName}" pkgs + platforms.linux) + + { + assertion = (cfg.settings ? ${mainSection}.dawn-time || cfg.settings + ? ${mainSection}.dusk-time) + || (cfg.settings.${mainSection}.location-provider) == "geoclue2" + || ((cfg.settings.${mainSection}.location-provider) == "manual" + && (cfg.settings ? manual.lat || cfg.settings ? manual.lon)); + message = '' + In order for ${programName} to know the time of action, you need to set one of + - services.${moduleName}.provider = "geoclue2" for automatically inferring your location + (you also need to enable Geoclue2 service separately) + - services.${moduleName}.longitude and .latitude for specifying your location manually + - services.${moduleName}.dawnTime and .duskTime for specifying the times manually + ''; + } + ]; services.${moduleName}.settings = { ${mainSection} = { diff --git a/modules/services/rsibreak.nix b/modules/services/rsibreak.nix index 5f07e6a09..351632a02 100644 --- a/modules/services/rsibreak.nix +++ b/modules/services/rsibreak.nix @@ -14,6 +14,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.rsibreak" pkgs + lib.platforms.linux) + ]; + home.packages = [ pkgs.rsibreak ]; systemd.user.services.rsibreak = { Unit = { diff --git a/modules/services/screen-locker.nix b/modules/services/screen-locker.nix index 554d64f9a..4da24b74e 100644 --- a/modules/services/screen-locker.nix +++ b/modules/services/screen-locker.nix @@ -53,6 +53,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.screen-locker" pkgs + lib.platforms.linux) + ]; + systemd.user.services.xautolock-session = { Unit = { Description = "xautolock, session locker service"; diff --git a/modules/services/spotifyd.nix b/modules/services/spotifyd.nix index ee5af3451..f15954d73 100644 --- a/modules/services/spotifyd.nix +++ b/modules/services/spotifyd.nix @@ -43,6 +43,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.spotifyd" pkgs + lib.platforms.linux) + ]; + home.packages = [ cfg.package ]; systemd.user.services.spotifyd = { diff --git a/modules/services/status-notifier-watcher.nix b/modules/services/status-notifier-watcher.nix index 8ff1caceb..b5d1bcd4b 100644 --- a/modules/services/status-notifier-watcher.nix +++ b/modules/services/status-notifier-watcher.nix @@ -26,6 +26,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.status-notifier-watcher" pkgs + lib.platforms.linux) + ]; + systemd.user.services.status-notifier-watcher = { Unit = { Description = "SNI watcher"; diff --git a/modules/services/sxhkd.nix b/modules/services/sxhkd.nix index 9a2027a83..363c1fb2f 100644 --- a/modules/services/sxhkd.nix +++ b/modules/services/sxhkd.nix @@ -65,6 +65,11 @@ in }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.sxhkd" pkgs + lib.platforms.linux) + ]; + home.packages = [ cfg.package ]; xdg.configFile."sxhkd/sxhkdrc".text = concatStringsSep "\n" [ diff --git a/modules/services/taskwarrior-sync.nix b/modules/services/taskwarrior-sync.nix index d16c0681b..ddce6d6f0 100644 --- a/modules/services/taskwarrior-sync.nix +++ b/modules/services/taskwarrior-sync.nix @@ -29,6 +29,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.taskwarrior-sync" pkgs + lib.platforms.linux) + ]; + systemd.user.services.taskwarrior-sync = { Unit = { Description = "Taskwarrior sync"; }; Service = { diff --git a/modules/services/unclutter.nix b/modules/services/unclutter.nix index 5e7606395..3c70cd031 100644 --- a/modules/services/unclutter.nix +++ b/modules/services/unclutter.nix @@ -37,6 +37,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.unclutter" pkgs + lib.platforms.linux) + ]; + systemd.user.services.unclutter = { Unit = { Description = "unclutter"; diff --git a/modules/services/unison.nix b/modules/services/unison.nix index a9cf23fb6..40b63ad4b 100644 --- a/modules/services/unison.nix +++ b/modules/services/unison.nix @@ -93,6 +93,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.unison" pkgs + lib.platforms.linux) + ]; + systemd.user.services = makeDefs (name: pairCfg: { Unit = { Description = "Unison pair sync (${name})"; diff --git a/modules/services/window-managers/awesome.nix b/modules/services/window-managers/awesome.nix index d2e2903f8..15af2c2d1 100644 --- a/modules/services/window-managers/awesome.nix +++ b/modules/services/window-managers/awesome.nix @@ -45,7 +45,13 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (hm.assertions.assertPlatform "xsession.windowManager.awesome" pkgs + platforms.linux) + ]; + home.packages = [ awesome ]; + xsession.windowManager.command = "${awesome}/bin/awesome " + optionalString cfg.noArgb "--no-argb " + makeSearchPath cfg.luaModules; }; diff --git a/modules/services/window-managers/bspwm/default.nix b/modules/services/window-managers/bspwm/default.nix index c43be0740..c2b8fd49c 100644 --- a/modules/services/window-managers/bspwm/default.nix +++ b/modules/services/window-managers/bspwm/default.nix @@ -42,6 +42,11 @@ in { options = import ./options.nix { inherit pkgs lib; }; config = mkIf cfg.enable { + assertions = [ + (hm.assertions.assertPlatform "xsession.windowManager.bspwm" pkgs + platforms.linux) + ]; + home.packages = [ cfg.package ]; xdg.configFile."bspwm/bspwmrc".source = pkgs.writeShellScript "bspwmrc" '' diff --git a/modules/services/window-managers/i3-sway/i3.nix b/modules/services/window-managers/i3-sway/i3.nix index 5cba45bd0..e45d415d5 100644 --- a/modules/services/window-managers/i3-sway/i3.nix +++ b/modules/services/window-managers/i3-sway/i3.nix @@ -241,8 +241,15 @@ in { config = mkIf cfg.enable (mkMerge [ { + assertions = [ + (hm.assertions.assertPlatform "xsession.windowManager.i3" pkgs + platforms.linux) + ]; + home.packages = [ cfg.package ]; + xsession.windowManager.command = "${cfg.package}/bin/i3"; + xdg.configFile."i3/config" = { source = checkI3Config; onChange = '' diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index 61b430b89..6fed3701c 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -427,8 +427,14 @@ in { }) { + assertions = [ + (hm.assertions.assertPlatform "wayland.windowManager.sway" pkgs + platforms.linux) + ]; + home.packages = optional (cfg.package != null) cfg.package ++ optional cfg.xwayland pkgs.xwayland; + xdg.configFile."sway/config" = { source = configFile; onChange = '' @@ -439,6 +445,7 @@ in { fi ''; }; + systemd.user.targets.sway-session = mkIf cfg.systemdIntegration { Unit = { Description = "sway compositor session"; diff --git a/modules/services/window-managers/xmonad.nix b/modules/services/window-managers/xmonad.nix index 6d05d68ed..784160241 100644 --- a/modules/services/window-managers/xmonad.nix +++ b/modules/services/window-managers/xmonad.nix @@ -137,10 +137,23 @@ in { }/bin/xmonad-${pkgs.hostPlatform.system}"; in mkIf cfg.enable (mkMerge [ - { home.packages = [ (lowPrio xmonad) ]; } + { + assertions = [ + (hm.assertions.assertPlatform "xsession.windowManager.xmonad" pkgs + platforms.linux) + ]; + + home.packages = [ (lowPrio xmonad) ]; + + home.file = mapAttrs' (name: value: + attrsets.nameValuePair (".xmonad/lib/" + name) { source = value; }) + cfg.libFiles; + } + (mkIf (cfg.config == null) { xsession.windowManager.command = "${xmonad}/bin/xmonad"; }) + (mkIf (cfg.config != null) { xsession.windowManager.command = xmonadBin; home.file.".xmonad/xmonad.hs".source = cfg.config; @@ -156,10 +169,5 @@ in { }; }) - { - home.file = mapAttrs' (name: value: - attrsets.nameValuePair (".xmonad/lib/" + name) { source = value; }) - cfg.libFiles; - } ]); } diff --git a/modules/services/wlsunset.nix b/modules/services/wlsunset.nix index 084dbdb7c..28e595af9 100644 --- a/modules/services/wlsunset.nix +++ b/modules/services/wlsunset.nix @@ -73,6 +73,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.wlsunset" pkgs + lib.platforms.linux) + ]; + systemd.user.services.wlsunset = { Unit = { Description = "Day/night gamma adjustments for Wayland compositors."; diff --git a/modules/services/xcape.nix b/modules/services/xcape.nix index f4f77caa3..6b29d26e0 100644 --- a/modules/services/xcape.nix +++ b/modules/services/xcape.nix @@ -53,6 +53,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.xcape" pkgs + lib.platforms.linux) + ]; + systemd.user.services.xcape = { Unit = { Description = "xcape"; diff --git a/modules/services/xembed-sni-proxy.nix b/modules/services/xembed-sni-proxy.nix index ff63d108b..f0a7e29ef 100644 --- a/modules/services/xembed-sni-proxy.nix +++ b/modules/services/xembed-sni-proxy.nix @@ -26,6 +26,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.xembed-sni-proxy" pkgs + lib.platforms.linux) + ]; + systemd.user.services.xembed-sni-proxy = { Unit = { Description = "XEmbed SNI Proxy"; diff --git a/modules/services/xidlehook.nix b/modules/services/xidlehook.nix index da91de850..c39e3e3ab 100644 --- a/modules/services/xidlehook.nix +++ b/modules/services/xidlehook.nix @@ -132,6 +132,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.xidlehook" pkgs + lib.platforms.linux) + ]; + systemd.user.services.xidlehook = { Unit = { Description = "xidlehook service"; diff --git a/modules/services/xscreensaver.nix b/modules/services/xscreensaver.nix index ac6194e70..3c0661e89 100644 --- a/modules/services/xscreensaver.nix +++ b/modules/services/xscreensaver.nix @@ -29,6 +29,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.xscreensaver" pkgs + lib.platforms.linux) + ]; + # To make the xscreensaver-command tool available. home.packages = [ pkgs.xscreensaver ]; diff --git a/modules/services/xsettingsd.nix b/modules/services/xsettingsd.nix index 2ae846b64..86336b212 100644 --- a/modules/services/xsettingsd.nix +++ b/modules/services/xsettingsd.nix @@ -25,6 +25,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.xsettingsd" pkgs + lib.platforms.linux) + ]; + systemd.user.services.xsettingsd = { Unit = { Description = "xsettingsd"; diff --git a/modules/services/xsuspender.nix b/modules/services/xsuspender.nix index 7d855f05d..54f13c8d5 100644 --- a/modules/services/xsuspender.nix +++ b/modules/services/xsuspender.nix @@ -148,6 +148,11 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.xsuspender" pkgs + lib.platforms.linux) + ]; + services.xsuspender.iniContent = let mkSection = values: filterAttrs (_: v: v != null) { diff --git a/modules/targets/darwin/default.nix b/modules/targets/darwin/default.nix index b971e18d2..d2764bd1a 100644 --- a/modules/targets/darwin/default.nix +++ b/modules/targets/darwin/default.nix @@ -43,6 +43,11 @@ in { }; config = mkIf (activationCmds != [ ]) { + assertions = [ + (hm.assertions.assertPlatform "targets.darwin.defaults" pkgs + platforms.darwin) + ]; + home.activation.setDarwinDefaults = hm.dag.entryAfter [ "writeBoundary" ] '' $VERBOSE_ECHO "Configuring macOS user defaults" ${concatStringsSep "\n" activationCmds} diff --git a/modules/targets/darwin/fonts.nix b/modules/targets/darwin/fonts.nix index bc4042a8d..cd26fa087 100644 --- a/modules/targets/darwin/fonts.nix +++ b/modules/targets/darwin/fonts.nix @@ -12,16 +12,18 @@ let fonts = "${fontsEnv}/share/fonts"; in { # macOS won't recognize symlinked fonts - config.home.activation.copyFonts = hm.dag.entryAfter [ "writeBoundary" ] '' - copyFonts() { - rm -rf ${homeDir}/Library/Fonts/HomeManager || : + config = mkIf pkgs.hostPlatform.isDarwin { + home.activation.copyFonts = hm.dag.entryAfter [ "writeBoundary" ] '' + copyFonts() { + rm -rf ${homeDir}/Library/Fonts/HomeManager || : - local f - find -L "${fonts}" -type f -printf '%P\0' | while IFS= read -rd "" f; do - $DRY_RUN_CMD install $VERBOSE_ARG -Dm644 -T \ - "${fonts}/$f" "${homeDir}/Library/Fonts/HomeManager/$f" - done - } - copyFonts - ''; + local f + find -L "${fonts}" -type f -printf '%P\0' | while IFS= read -rd "" f; do + $DRY_RUN_CMD install $VERBOSE_ARG -Dm644 -T \ + "${fonts}/$f" "${homeDir}/Library/Fonts/HomeManager/$f" + done + } + copyFonts + ''; + }; } diff --git a/modules/targets/darwin/keybindings.nix b/modules/targets/darwin/keybindings.nix index 4481f33bd..824daa572 100644 --- a/modules/targets/darwin/keybindings.nix +++ b/modules/targets/darwin/keybindings.nix @@ -31,6 +31,11 @@ in { }; config = mkIf (cfg.keybindings != { }) { + assertions = [ + (hm.assertions.assertPlatform "targets.darwin.keybindings" pkgs + platforms.darwin) + ]; + # NOTE: just copy the files because symlinks won't be recognized by macOS home.activation.setCocoaKeybindings = hm.dag.entryAfter [ "writeBoundary" ] '' diff --git a/modules/targets/darwin/search.nix b/modules/targets/darwin/search.nix index 2afbae4af..8e0df3b20 100644 --- a/modules/targets/darwin/search.nix +++ b/modules/targets/darwin/search.nix @@ -20,6 +20,11 @@ in { }; config = mkIf (cfg.search != null) { + assertions = [ + (hm.assertions.assertPlatform "targets.darwin.search" pkgs + platforms.darwin) + ]; + targets.darwin.defaults = { NSGlobalDomain.NSPreferredWebServices = { NSWebServicesProviderWebSearch = { diff --git a/modules/targets/generic-linux.nix b/modules/targets/generic-linux.nix index 6e17bd282..b76808852 100644 --- a/modules/targets/generic-linux.nix +++ b/modules/targets/generic-linux.nix @@ -27,6 +27,10 @@ in { }; config = mkIf cfg.enable { + assertions = [ + (hm.assertions.assertPlatform "targets.genericLinux" pkgs platforms.linux) + ]; + xdg.systemDirs.data = [ # Nix profiles "\${NIX_STATE_DIR:-/nix/var/nix}/profiles/default/share" diff --git a/modules/xcursor.nix b/modules/xcursor.nix index 65b5c7706..620e2e28a 100644 --- a/modules/xcursor.nix +++ b/modules/xcursor.nix @@ -55,6 +55,10 @@ in { }; config = mkIf (cfg != null) { + assertions = [ + (hm.assertions.assertPlatform "xsession.pointerCursor" pkgs + platforms.linux) + ]; home.packages = [ cfg.package ]; diff --git a/modules/xsession.nix b/modules/xsession.nix index b79c81c47..215d691da 100644 --- a/modules/xsession.nix +++ b/modules/xsession.nix @@ -85,6 +85,9 @@ in { }; config = mkIf cfg.enable { + assertions = + [ (hm.assertions.assertPlatform "xsession" pkgs platforms.linux) ]; + xsession.importedVariables = [ "DBUS_SESSION_BUS_ADDRESS" "DISPLAY"