From b4752b0eda6302b92a6d5dd554c83f188bc3ae6d Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Wed, 23 Jul 2025 10:00:12 -0500 Subject: [PATCH] treewide: format with latest stable formatter Signed-off-by: Austin Horstman --- modules/default.nix | 3 +- modules/home-environment.nix | 27 ++- modules/i18n/input-method/fcitx5.nix | 25 ++- modules/lib/strings.nix | 21 +-- modules/misc/gtk/lib.nix | 58 +++--- modules/misc/nixgl.nix | 35 ++-- modules/misc/qt.nix | 13 +- modules/misc/xdg-desktop-entries.nix | 3 +- modules/modules.nix | 176 +++++++++--------- modules/programs/aerc/default.nix | 53 +++--- modules/programs/alot/default.nix | 9 +- modules/programs/eclipse.nix | 3 +- modules/programs/firefox/mkFirefoxModule.nix | 108 ++++++----- modules/programs/fish.nix | 11 +- modules/programs/fzf.nix | 3 +- modules/programs/hyprlock.nix | 3 +- modules/programs/jetbrains-remote.nix | 9 +- modules/programs/kitty.nix | 35 ++-- modules/programs/mangohud.nix | 13 +- modules/programs/mcfly.nix | 47 +++-- modules/programs/mercurial.nix | 21 +-- modules/programs/ne.nix | 3 +- modules/programs/nh.nix | 3 +- modules/programs/obsidian.nix | 13 +- modules/programs/offlineimap/default.nix | 82 ++++---- modules/programs/sketchybar.nix | 9 +- modules/programs/streamlink.nix | 82 ++++---- modules/programs/thunderbird.nix | 19 +- modules/programs/tmux.nix | 9 +- modules/programs/urxvt.nix | 43 +++-- modules/programs/vscode/default.nix | 28 +-- modules/programs/vscode/haskell.nix | 3 +- modules/programs/yazi.nix | 55 +++--- modules/services/dunst.nix | 6 +- modules/services/dwm-status.nix | 3 +- modules/services/emacs.nix | 106 ++++++----- modules/services/gpg-agent.nix | 47 +++-- modules/services/hyprsunset.nix | 3 +- modules/services/imapnotify/default.nix | 40 ++-- modules/services/ludusavi.nix | 15 +- modules/services/mbsync.nix | 30 +-- modules/services/mpd.nix | 3 +- modules/services/mpdris2.nix | 17 +- modules/services/nix-gc.nix | 3 +- .../redshift-gammastep/lib/options.nix | 7 +- modules/services/restic.nix | 140 +++++++------- modules/services/window-managers/hyprland.nix | 6 +- .../window-managers/i3-sway/lib/options.nix | 63 +++---- .../services/window-managers/i3-sway/sway.nix | 3 +- modules/services/window-managers/river.nix | 3 +- modules/services/xidlehook.nix | 3 +- nixos/common.nix | 6 +- tests/integration/standalone/restic.nix | 12 +- .../programs/htop/example-settings.nix | 81 ++++---- .../programs/kitty/example-settings.nix | 23 ++- .../espanso/linux/basic-configuration.nix | 3 +- 56 files changed, 816 insertions(+), 832 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index b68e7cf2e..1e55b0b3f 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -32,7 +32,8 @@ let class = "homeManager"; specialArgs = { modulesPath = builtins.toString ./.; - } // extraSpecialArgs; + } + // extraSpecialArgs; }; moduleChecks = diff --git a/modules/home-environment.nix b/modules/home-environment.nix index 08488f3e9..151c103d9 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -615,21 +615,20 @@ in home.sessionVariablesPackage = pkgs.writeTextFile { name = "hm-session-vars.sh"; destination = "/etc/profile.d/hm-session-vars.sh"; - text = - '' - # Only source this once. - if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi - export __HM_SESS_VARS_SOURCED=1 + text = '' + # Only source this once. + if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi + export __HM_SESS_VARS_SOURCED=1 - ${config.lib.shell.exportAll cfg.sessionVariables} - '' - + lib.concatStringsSep "\n" ( - lib.mapAttrsToList ( - env: values: config.lib.shell.export env (config.lib.shell.prependToVar ":" env values) - ) cfg.sessionSearchVariables - ) - + "\n" - + cfg.sessionVariablesExtra; + ${config.lib.shell.exportAll cfg.sessionVariables} + '' + + lib.concatStringsSep "\n" ( + lib.mapAttrsToList ( + env: values: config.lib.shell.export env (config.lib.shell.prependToVar ":" env values) + ) cfg.sessionSearchVariables + ) + + "\n" + + cfg.sessionVariablesExtra; }; home.sessionSearchVariables.PATH = lib.mkIf (cfg.sessionPath != [ ]) cfg.sessionPath; diff --git a/modules/i18n/input-method/fcitx5.nix b/modules/i18n/input-method/fcitx5.nix index 33c449322..74bd35bfe 100644 --- a/modules/i18n/input-method/fcitx5.nix +++ b/modules/i18n/input-method/fcitx5.nix @@ -199,19 +199,18 @@ in }; home = { - sessionVariables = - { - GLFW_IM_MODULE = "ibus"; # IME support in kitty - SDL_IM_MODULE = "fcitx"; - XMODIFIERS = "@im=fcitx"; - } - // lib.optionalAttrs (!cfg.waylandFrontend) { - GTK_IM_MODULE = "fcitx"; - QT_IM_MODULE = "fcitx"; - } - // lib.optionalAttrs cfg.ignoreUserConfig { - SKIP_FCITX_USER_PATH = "1"; - }; + sessionVariables = { + GLFW_IM_MODULE = "ibus"; # IME support in kitty + SDL_IM_MODULE = "fcitx"; + XMODIFIERS = "@im=fcitx"; + } + // lib.optionalAttrs (!cfg.waylandFrontend) { + GTK_IM_MODULE = "fcitx"; + QT_IM_MODULE = "fcitx"; + } + // lib.optionalAttrs cfg.ignoreUserConfig { + SKIP_FCITX_USER_PATH = "1"; + }; sessionSearchVariables.QT_PLUGIN_PATH = [ "${fcitx5Package}/${pkgs.qt6.qtbase.qtPluginPrefix}" ]; }; diff --git a/modules/lib/strings.nix b/modules/lib/strings.nix index 2e2179a0c..b8dd6baa4 100644 --- a/modules/lib/strings.nix +++ b/modules/lib/strings.nix @@ -18,17 +18,16 @@ rec { # All characters that are considered safe. Note "-" is not # included to avoid "-" followed by digit being interpreted as a # version. - safeChars = - [ - "+" - "." - "_" - "?" - "=" - ] - ++ lowerChars - ++ upperChars - ++ stringToCharacters "0123456789"; + safeChars = [ + "+" + "." + "_" + "?" + "=" + ] + ++ lowerChars + ++ upperChars + ++ stringToCharacters "0123456789"; empties = l: genList (x: "") (length l); diff --git a/modules/misc/gtk/lib.nix b/modules/misc/gtk/lib.nix index 5a6e64503..d524f15f0 100644 --- a/modules/misc/gtk/lib.nix +++ b/modules/misc/gtk/lib.nix @@ -20,38 +20,36 @@ in nameExample ? "Adwaita", }: types.submodule { - options = - { - package = mkOption { - type = types.nullOr types.package; - default = null; - example = literalExpression packageExample; - description = - '' - Package providing the ${typeName}. This package will be installed - to your profile. If `null` then the ${typeName} - is assumed to already be available in your profile. - '' - + optionalString (typeName == "theme") '' + options = { + package = mkOption { + type = types.nullOr types.package; + default = null; + example = literalExpression packageExample; + description = '' + Package providing the ${typeName}. This package will be installed + to your profile. If `null` then the ${typeName} + is assumed to already be available in your profile. + '' + + optionalString (typeName == "theme") '' - For the theme to apply to GTK 4, this option is mandatory. - ''; - }; - - name = mkOption { - type = types.str; - example = nameExample; - description = "The name of the ${typeName} within the package."; - }; - } - // optionalAttrs hasSize { - size = mkOption { - type = types.nullOr types.int; - default = null; - example = 16; - description = "The size of the cursor."; - }; + For the theme to apply to GTK 4, this option is mandatory. + ''; }; + + name = mkOption { + type = types.str; + example = nameExample; + description = "The name of the ${typeName} within the package."; + }; + } + // optionalAttrs hasSize { + size = mkOption { + type = types.nullOr types.int; + default = null; + example = 16; + description = "The size of the cursor."; + }; + }; }; # Helper function to generate the settings attribute set for a given version diff --git a/modules/misc/nixgl.nix b/modules/misc/nixgl.nix index fc66d4e24..0cc3fe4d7 100644 --- a/modules/misc/nixgl.nix +++ b/modules/misc/nixgl.nix @@ -190,24 +190,23 @@ in "DRI_PRIME" = "${cfg.prime.card}"; }; - nvOffloadEnv = - { - "DRI_PRIME" = "${cfg.prime.card}"; - "__NV_PRIME_RENDER_OFFLOAD" = "1"; - "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; - "__VK_LAYER_NV_optimus" = "NVIDIA_only"; - } - // ( - let - provider = cfg.prime.nvidiaProvider; - in - if !isNull provider then - { - "__NV_PRIME_RENDER_OFFLOAD_PROVIDER" = "${provider}"; - } - else - { } - ); + nvOffloadEnv = { + "DRI_PRIME" = "${cfg.prime.card}"; + "__NV_PRIME_RENDER_OFFLOAD" = "1"; + "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; + "__VK_LAYER_NV_optimus" = "NVIDIA_only"; + } + // ( + let + provider = cfg.prime.nvidiaProvider; + in + if !isNull provider then + { + "__NV_PRIME_RENDER_OFFLOAD_PROVIDER" = "${provider}"; + } + else + { } + ); makePackageWrapper = vendor: environment: pkg: diff --git a/modules/misc/qt.nix b/modules/misc/qt.nix index d93db205d..1410299e8 100644 --- a/modules/misc/qt.nix +++ b/modules/misc/qt.nix @@ -386,12 +386,11 @@ in ) ++ (lib.optionals (cfg.style.package != null) (lib.toList cfg.style.package)); - xsession.importedVariables = - [ - "QT_PLUGIN_PATH" - "QML2_IMPORT_PATH" - ] - ++ lib.optionals (platformTheme.name != null) [ "QT_QPA_PLATFORMTHEME" ] - ++ lib.optionals (cfg.style.name != null) [ "QT_STYLE_OVERRIDE" ]; + xsession.importedVariables = [ + "QT_PLUGIN_PATH" + "QML2_IMPORT_PATH" + ] + ++ lib.optionals (platformTheme.name != null) [ "QT_QPA_PLATFORMTHEME" ] + ++ lib.optionals (cfg.style.name != null) [ "QT_STYLE_OVERRIDE" ]; }; } diff --git a/modules/misc/xdg-desktop-entries.nix b/modules/misc/xdg-desktop-entries.nix index d13471f20..c954bca40 100644 --- a/modules/misc/xdg-desktop-entries.nix +++ b/modules/misc/xdg-desktop-entries.nix @@ -229,7 +229,8 @@ in config = lib.mkIf (config.xdg.desktopEntries != { }) { assertions = [ (lib.hm.assertions.assertPlatform "xdg.desktopEntries" pkgs lib.platforms.linux) - ] ++ lib.flatten (lib.catAttrs "assertions" (lib.attrValues config.xdg.desktopEntries)); + ] + ++ lib.flatten (lib.catAttrs "assertions" (lib.attrValues config.xdg.desktopEntries)); home.packages = ( map lib.hiPrio # we need hiPrio to override existing entries diff --git a/modules/modules.nix b/modules/modules.nix index d8c0274b8..1ce6b1b07 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -13,102 +13,100 @@ let - modules = - [ - # keep-sorted start case=no numeric=yes - ./accounts/calendar.nix - ./accounts/contacts.nix - ./accounts/email.nix - ./config/home-cursor.nix - ./config/i18n.nix - ./dbus.nix - ./files.nix - ./home-environment.nix - ./i18n/input-method/default.nix - ./launchd/default.nix - ./manual.nix - ./misc/dconf.nix - ./misc/debug.nix - ./misc/editorconfig.nix - ./misc/fontconfig.nix - ./misc/gtk.nix - ./misc/lib.nix - ./misc/mozilla-messaging-hosts.nix - ./misc/news.nix - ./misc/nix.nix - ./misc/nixgl.nix - ./misc/numlock.nix - ./misc/pam.nix - ./misc/qt.nix - ./misc/qt/kconfig.nix - ./misc/shell.nix - ./misc/specialisation.nix - ./misc/submodule-support.nix - ./misc/tmpfiles.nix - ./misc/uninstall.nix - ./misc/version.nix - ./misc/vte.nix - ./misc/xdg-autostart.nix - ./misc/xdg-desktop-entries.nix - ./misc/xdg-mime-apps.nix - ./misc/xdg-mime.nix - ./misc/xdg-portal.nix - ./misc/xdg-system-dirs.nix - ./misc/xdg-user-dirs.nix - ./misc/xdg.nix - ./misc/xfconf.nix - ./systemd.nix - ./targets/darwin - ./targets/generic-linux.nix - ./wayland.nix - ./xresources.nix - ./xsession.nix - # keep-sorted end - (pkgs.path + "/nixos/modules/misc/assertions.nix") - (pkgs.path + "/nixos/modules/misc/meta.nix") + modules = [ + # keep-sorted start case=no numeric=yes + ./accounts/calendar.nix + ./accounts/contacts.nix + ./accounts/email.nix + ./config/home-cursor.nix + ./config/i18n.nix + ./dbus.nix + ./files.nix + ./home-environment.nix + ./i18n/input-method/default.nix + ./launchd/default.nix + ./manual.nix + ./misc/dconf.nix + ./misc/debug.nix + ./misc/editorconfig.nix + ./misc/fontconfig.nix + ./misc/gtk.nix + ./misc/lib.nix + ./misc/mozilla-messaging-hosts.nix + ./misc/news.nix + ./misc/nix.nix + ./misc/nixgl.nix + ./misc/numlock.nix + ./misc/pam.nix + ./misc/qt.nix + ./misc/qt/kconfig.nix + ./misc/shell.nix + ./misc/specialisation.nix + ./misc/submodule-support.nix + ./misc/tmpfiles.nix + ./misc/uninstall.nix + ./misc/version.nix + ./misc/vte.nix + ./misc/xdg-autostart.nix + ./misc/xdg-desktop-entries.nix + ./misc/xdg-mime-apps.nix + ./misc/xdg-mime.nix + ./misc/xdg-portal.nix + ./misc/xdg-system-dirs.nix + ./misc/xdg-user-dirs.nix + ./misc/xdg.nix + ./misc/xfconf.nix + ./systemd.nix + ./targets/darwin + ./targets/generic-linux.nix + ./wayland.nix + ./xresources.nix + ./xsession.nix + # keep-sorted end + (pkgs.path + "/nixos/modules/misc/assertions.nix") + (pkgs.path + "/nixos/modules/misc/meta.nix") - (lib.mkRemovedOptionModule [ "services" "password-store-sync" ] '' - Use services.git-sync instead. - '') - (lib.mkRemovedOptionModule [ "services" "keepassx" ] '' - KeePassX is no longer maintained. - '') - ] - ++ (lib.concatMap - ( - dir: - lib.pipe (builtins.readDir dir) [ - (lib.filterAttrs (path: _kind: !lib.hasPrefix "_" path)) - (lib.filterAttrs ( - _path: kind: kind == "directory" || (kind == "regular" && lib.hasSuffix ".nix" _path) - )) - (lib.mapAttrsToList (path: _kind: lib.path.append dir path)) - ] - ) - [ - ./services - ./programs + (lib.mkRemovedOptionModule [ "services" "password-store-sync" ] '' + Use services.git-sync instead. + '') + (lib.mkRemovedOptionModule [ "services" "keepassx" ] '' + KeePassX is no longer maintained. + '') + ] + ++ (lib.concatMap + ( + dir: + lib.pipe (builtins.readDir dir) [ + (lib.filterAttrs (path: _kind: !lib.hasPrefix "_" path)) + (lib.filterAttrs ( + _path: kind: kind == "directory" || (kind == "regular" && lib.hasSuffix ".nix" _path) + )) + (lib.mapAttrsToList (path: _kind: lib.path.append dir path)) ] ) - ++ lib.optional useNixpkgsModule ./misc/nixpkgs.nix - ++ lib.optional (!useNixpkgsModule) ./misc/nixpkgs-disabled.nix; + [ + ./services + ./programs + ] + ) + ++ lib.optional useNixpkgsModule ./misc/nixpkgs.nix + ++ lib.optional (!useNixpkgsModule) ./misc/nixpkgs-disabled.nix; pkgsModule = { config, ... }: { - config = - { - _module.args.baseModules = modules; - _module.args.pkgsPath = lib.mkDefault ( - if lib.versionAtLeast config.home.stateVersion "20.09" then pkgs.path else - ); - _module.args.pkgs = lib.mkDefault pkgs; - _module.check = check; - lib = lib.hm; - } - // lib.optionalAttrs useNixpkgsModule { - nixpkgs.system = lib.mkDefault pkgs.stdenv.hostPlatform.system; - }; + config = { + _module.args.baseModules = modules; + _module.args.pkgsPath = lib.mkDefault ( + if lib.versionAtLeast config.home.stateVersion "20.09" then pkgs.path else + ); + _module.args.pkgs = lib.mkDefault pkgs; + _module.check = check; + lib = lib.hm; + } + // lib.optionalAttrs useNixpkgsModule { + nixpkgs.system = lib.mkDefault pkgs.stdenv.hostPlatform.system; + }; }; in diff --git a/modules/programs/aerc/default.nix b/modules/programs/aerc/default.nix index 0f70ef03f..6caa10183 100644 --- a/modules/programs/aerc/default.nix +++ b/modules/programs/aerc/default.nix @@ -254,34 +254,33 @@ in home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; - home.file = - { - "${configDir}/accounts.conf" = mkIf genAccountsConf { - text = joinCfg [ - header - (mkINI cfg.extraAccounts) - (mkINI primaryAccountAccounts) - (mkINI accountsExtraAccounts) - ]; - }; + home.file = { + "${configDir}/accounts.conf" = mkIf genAccountsConf { + text = joinCfg [ + header + (mkINI cfg.extraAccounts) + (mkINI primaryAccountAccounts) + (mkINI accountsExtraAccounts) + ]; + }; - "${configDir}/aerc.conf" = mkIf genAercConf { - text = joinCfg [ - header - (mkINI cfg.extraConfig) - (joinContextual accountsExtraConfig) - ]; - }; + "${configDir}/aerc.conf" = mkIf genAercConf { + text = joinCfg [ + header + (mkINI cfg.extraConfig) + (joinContextual accountsExtraConfig) + ]; + }; - "${configDir}/binds.conf" = mkIf genBindsConf { - text = joinCfg [ - header - (mkINI cfg.extraBinds) - (joinContextual accountsExtraBinds) - ]; - }; - } - // (mkStyleset cfg.stylesets) - // (mkTemplates cfg.templates); + "${configDir}/binds.conf" = mkIf genBindsConf { + text = joinCfg [ + header + (mkINI cfg.extraBinds) + (joinContextual accountsExtraBinds) + ]; + }; + } + // (mkStyleset cfg.stylesets) + // (mkTemplates cfg.templates); }; } diff --git a/modules/programs/alot/default.nix b/modules/programs/alot/default.nix index 25ca17b3c..7453a0ec5 100644 --- a/modules/programs/alot/default.nix +++ b/modules/programs/alot/default.nix @@ -281,11 +281,10 @@ in xdg.configFile."alot/config".text = configFile; xdg.configFile."alot/hooks.py" = lib.mkIf (cfg.hooks != "") { - text = - '' - # Generated by Home Manager. - '' - + cfg.hooks; + text = '' + # Generated by Home Manager. + '' + + cfg.hooks; }; }; } diff --git a/modules/programs/eclipse.nix b/modules/programs/eclipse.nix index e2b4ce100..c65c800cf 100644 --- a/modules/programs/eclipse.nix +++ b/modules/programs/eclipse.nix @@ -53,8 +53,7 @@ in (pkgs.eclipses.eclipseWithPlugins { eclipse = cfg.package; jvmArgs = - cfg.jvmArgs - ++ lib.optional cfg.enableLombok "-javaagent:${pkgs.lombok}/share/java/lombok.jar"; + cfg.jvmArgs ++ lib.optional cfg.enableLombok "-javaagent:${pkgs.lombok}/share/java/lombok.jar"; plugins = cfg.plugins; }) ]; diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index b86de9f51..2f0a00f56 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -63,13 +63,12 @@ let } ) // { - General = - { - StartWithLastProfile = 1; - } - // lib.optionalAttrs (cfg.profileVersion != null) { - Version = cfg.profileVersion; - }; + General = { + StartWithLastProfile = 1; + } + // lib.optionalAttrs (cfg.profileVersion != null) { + Version = cfg.profileVersion; + }; }; profilesIni = lib.generators.toINI { } profiles; @@ -168,11 +167,10 @@ let in { assertion = duplicates == { }; - message = - '' - Must not have a ${appName} ${entityKind} with an existing ID but - '' - + concatStringsSep "\n" (mapAttrsToList mkMsg duplicates); + message = '' + Must not have a ${appName} ${entityKind} with an existing ID but + '' + + concatStringsSep "\n" (mapAttrsToList mkMsg duplicates); } ); @@ -784,54 +782,53 @@ in }; config = { - assertions = + assertions = [ + (mkNoDuplicateAssertion config.containers "container") + { + assertion = !(extensionSettingsNeedForce config.extensions.settings) || config.extensions.force; + message = '' + Using '${lib.showOption profilePath}.extensions.settings' will override all + previous extensions settings. Enable + '${lib.showOption profilePath}.extensions.force' to acknowledge this. + ''; + } + ] + ++ (builtins.concatMap ( + { name, value }: + let + packages = builtins.filter (pkg: pkg.addonId == name) config.extensions.packages; + package = builtins.head packages; + unauthorized = lib.subtractLists value.permissions package.meta.mozPermissions; + in [ - (mkNoDuplicateAssertion config.containers "container") { - assertion = !(extensionSettingsNeedForce config.extensions.settings) || config.extensions.force; + assertion = value.permissions == null || length packages == 1; message = '' - Using '${lib.showOption profilePath}.extensions.settings' will override all - previous extensions settings. Enable - '${lib.showOption profilePath}.extensions.force' to acknowledge this. + Must have exactly one extension with addonId '${name}' + in '${lib.showOption profilePath}.extensions.packages' but found ${toString (length packages)}. + ''; + } + + { + assertion = value.permissions == null || length packages != 1 || unauthorized == [ ]; + message = '' + Extension ${name} requests permissions that weren't + authorized: ${builtins.toJSON unauthorized}. + Consider adding the missing permissions to + '${ + lib.showAttrPath ( + profilePath + ++ [ + "extensions" + name + ] + ) + }.permissions'. ''; } ] - ++ (builtins.concatMap ( - { name, value }: - let - packages = builtins.filter (pkg: pkg.addonId == name) config.extensions.packages; - package = builtins.head packages; - unauthorized = lib.subtractLists value.permissions package.meta.mozPermissions; - in - [ - { - assertion = value.permissions == null || length packages == 1; - message = '' - Must have exactly one extension with addonId '${name}' - in '${lib.showOption profilePath}.extensions.packages' but found ${toString (length packages)}. - ''; - } - - { - assertion = value.permissions == null || length packages != 1 || unauthorized == [ ]; - message = '' - Extension ${name} requests permissions that weren't - authorized: ${builtins.toJSON unauthorized}. - Consider adding the missing permissions to - '${ - lib.showAttrPath ( - profilePath - ++ [ - "extensions" - name - ] - ) - }.permissions'. - ''; - } - ] - ) (lib.attrsToList config.extensions.settings)) - ++ config.bookmarks.assertions; + ) (lib.attrsToList config.extensions.settings)) + ++ config.bookmarks.assertions; }; } ) @@ -902,7 +899,8 @@ in } (mkNoDuplicateAssertion cfg.profiles "profile") - ] ++ (lib.concatMap (profile: profile.assertions) (attrValues cfg.profiles)); + ] + ++ (lib.concatMap (profile: profile.assertions) (attrValues cfg.profiles)); warnings = optional (cfg.enableGnomeExtensions or false) '' diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 4ea398803..006fb53d1 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -566,11 +566,12 @@ in package: pkgs.runCommand "${getName package}-fish-completions" { - srcs = - [ package ] - ++ lib.filter (p: p != null) ( - builtins.map (outName: package.${outName} or null) config.home.extraOutputsToInstall - ); + srcs = [ + package + ] + ++ lib.filter (p: p != null) ( + builtins.map (outName: package.${outName} or null) config.home.extraOutputsToInstall + ); nativeBuildInputs = [ pkgs.python3 ]; buildInputs = [ cfg.package ]; preferLocalBuild = true; diff --git a/modules/programs/fzf.nix b/modules/programs/fzf.nix index f165d9ae5..37da15620 100644 --- a/modules/programs/fzf.nix +++ b/modules/programs/fzf.nix @@ -203,8 +203,7 @@ in FZF_CTRL_T_OPTS = cfg.fileWidgetOptions; FZF_DEFAULT_COMMAND = cfg.defaultCommand; FZF_DEFAULT_OPTS = - cfg.defaultOptions - ++ lib.optionals (cfg.colors != { }) [ "--color ${renderedColors cfg.colors}" ]; + cfg.defaultOptions ++ lib.optionals (cfg.colors != { }) [ "--color ${renderedColors cfg.colors}" ]; FZF_TMUX = if cfg.tmux.enableShellIntegration then "1" else null; FZF_TMUX_OPTS = cfg.tmux.shellIntegrationOptions; } diff --git a/modules/programs/hyprlock.nix b/modules/programs/hyprlock.nix index 24a1b6410..a634c7c66 100644 --- a/modules/programs/hyprlock.nix +++ b/modules/programs/hyprlock.nix @@ -120,7 +120,8 @@ in "bezier" "monitor" "size" - ] ++ lib.optionals cfg.sourceFirst [ "source" ]; + ] + ++ lib.optionals cfg.sourceFirst [ "source" ]; example = [ "$" "bezier" diff --git a/modules/programs/jetbrains-remote.nix b/modules/programs/jetbrains-remote.nix index c5e3790bb..330abb4eb 100644 --- a/modules/programs/jetbrains-remote.nix +++ b/modules/programs/jetbrains-remote.nix @@ -28,11 +28,10 @@ in # Errors out if the symlink already exists "${ide}/bin/${ide.meta.mainProgram}-remote-dev-server registerBackendLocationForGateway || true"; lines = map mkLine cfg.ides; - linesStr = - '' - rm $HOME/.cache/JetBrains/RemoteDev/userProvidedDist/_nix_store* || true - '' - + lib.concatStringsSep "\n" lines; + linesStr = '' + rm $HOME/.cache/JetBrains/RemoteDev/userProvidedDist/_nix_store* || true + '' + + lib.concatStringsSep "\n" lines; in lib.hm.dag.entryAfter [ "writeBoundary" ] linesStr; }; diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index 6d7f75cc2..6eb896bf8 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -301,24 +301,23 @@ in (mkOrder 570 (toKittyEnv cfg.environment)) ]; - xdg.configFile."kitty/kitty.conf" = - { - text = '' - # Generated by Home Manager. - # See https://sw.kovidgoyal.net/kitty/conf.html - ${cfg.extraConfig} - ''; - } - // lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { - onChange = '' - ${pkgs.procps}/bin/pkill -USR1 -u $USER kitty || true - ''; - } - // lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin { - onChange = '' - /usr/bin/pkill -USR1 -u $USER kitty || true - ''; - }; + xdg.configFile."kitty/kitty.conf" = { + text = '' + # Generated by Home Manager. + # See https://sw.kovidgoyal.net/kitty/conf.html + ${cfg.extraConfig} + ''; + } + // lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { + onChange = '' + ${pkgs.procps}/bin/pkill -USR1 -u $USER kitty || true + ''; + } + // lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin { + onChange = '' + /usr/bin/pkill -USR1 -u $USER kitty || true + ''; + }; home.activation.checkKittyTheme = mkIf (cfg.themeFile != null) ( let diff --git a/modules/programs/mangohud.nix b/modules/programs/mangohud.nix index 0b77a1b3e..9e0c3d608 100644 --- a/modules/programs/mangohud.nix +++ b/modules/programs/mangohud.nix @@ -106,13 +106,12 @@ in MANGOHUD_DLSYM = 1; }; - xdg.configFile = - { - "MangoHud/MangoHud.conf" = mkIf (cfg.settings != { }) { text = renderSettings cfg.settings; }; - } - // lib.mapAttrs' ( - n: v: lib.nameValuePair "MangoHud/${n}.conf" { text = renderSettings v; } - ) cfg.settingsPerApplication; + xdg.configFile = { + "MangoHud/MangoHud.conf" = mkIf (cfg.settings != { }) { text = renderSettings cfg.settings; }; + } + // lib.mapAttrs' ( + n: v: lib.nameValuePair "MangoHud/${n}.conf" { text = renderSettings v; } + ) cfg.settingsPerApplication; }; meta.maintainers = with lib.maintainers; [ zeratax ]; diff --git a/modules/programs/mcfly.nix b/modules/programs/mcfly.nix index 4529ff9d5..5ff0d7580 100644 --- a/modules/programs/mcfly.nix +++ b/modules/programs/mcfly.nix @@ -22,33 +22,30 @@ let # See: https://github.com/nix-community/home-manager/issues/6663 # and https://github.com/bnprks/mcfly-fzf/issues/10 - bashIntegration = - '' - eval "$(${getExe cfg.package} init bash)" - '' - + optionalString cfg.fzf.enable '' - if [[ $- =~ i ]]; then - eval "$(${getExe cfg.mcflyFzfPackage} init bash)" - fi - ''; + bashIntegration = '' + eval "$(${getExe cfg.package} init bash)" + '' + + optionalString cfg.fzf.enable '' + if [[ $- =~ i ]]; then + eval "$(${getExe cfg.mcflyFzfPackage} init bash)" + fi + ''; - fishIntegration = - '' - ${getExe cfg.package} init fish | source - '' - + optionalString cfg.fzf.enable '' - ${getExe cfg.mcflyFzfPackage} init fish | source - ''; + fishIntegration = '' + ${getExe cfg.package} init fish | source + '' + + optionalString cfg.fzf.enable '' + ${getExe cfg.mcflyFzfPackage} init fish | source + ''; - zshIntegration = - '' - eval "$(${getExe cfg.package} init zsh)" - '' - + optionalString cfg.fzf.enable '' - if [[ -o interactive ]]; then - eval "$(${getExe cfg.mcflyFzfPackage} init zsh)" - fi - ''; + zshIntegration = '' + eval "$(${getExe cfg.package} init zsh)" + '' + + optionalString cfg.fzf.enable '' + if [[ -o interactive ]]; then + eval "$(${getExe cfg.mcflyFzfPackage} init zsh)" + fi + ''; in { diff --git a/modules/programs/mercurial.nix b/modules/programs/mercurial.nix index 3905236dc..410229d0d 100644 --- a/modules/programs/mercurial.nix +++ b/modules/programs/mercurial.nix @@ -84,17 +84,16 @@ in (mkIf (cfg.ignores != [ ] || cfg.ignoresRegexp != [ ]) { programs.mercurial.iniContent.ui.ignore = "${config.xdg.configHome}/hg/hgignore_global"; - xdg.configFile."hg/hgignore_global".text = - '' - syntax: glob - '' - + lib.concatStringsSep "\n" cfg.ignores - + "\n" - + '' - syntax: regexp - '' - + lib.concatStringsSep "\n" cfg.ignoresRegexp - + "\n"; + xdg.configFile."hg/hgignore_global".text = '' + syntax: glob + '' + + lib.concatStringsSep "\n" cfg.ignores + + "\n" + + '' + syntax: regexp + '' + + lib.concatStringsSep "\n" cfg.ignoresRegexp + + "\n"; }) (mkIf (cfg.aliases != { }) { diff --git a/modules/programs/ne.nix b/modules/programs/ne.nix index 693f450d7..0ca9e0e4d 100644 --- a/modules/programs/ne.nix +++ b/modules/programs/ne.nix @@ -99,6 +99,7 @@ in ".ne/.keys" = mkIf (cfg.keybindings != "") { text = cfg.keybindings; }; ".ne/.extensions" = mkIf (cfg.virtualExtensions != "") { text = cfg.virtualExtensions; }; ".ne/.menus" = mkIf (cfg.menus != "") { text = cfg.menus; }; - } // autoPrefFiles; + } + // autoPrefFiles; }; } diff --git a/modules/programs/nh.nix b/modules/programs/nh.nix index 23b2cfa8b..0f0283f08 100644 --- a/modules/programs/nh.nix +++ b/modules/programs/nh.nix @@ -109,7 +109,8 @@ in "${lib.getExe cfg.package}" "clean" "user" - ] ++ lib.optional (cfg.clean.extraArgs != "") cfg.clean.extraArgs; + ] + ++ lib.optional (cfg.clean.extraArgs != "") cfg.clean.extraArgs; StartCalendarInterval = lib.hm.darwin.mkCalendarInterval cfg.clean.dates; diff --git a/modules/programs/obsidian.nix b/modules/programs/obsidian.nix index 8a9ae53d3..787a917d6 100644 --- a/modules/programs/obsidian.nix +++ b/modules/programs/obsidian.nix @@ -532,13 +532,12 @@ in vaults = builtins.listToAttrs ( builtins.map (vault: { name = builtins.hashString "md5" vault.target; - value = - { - path = "${config.home.homeDirectory}/${vault.target}"; - } - // (lib.attrsets.optionalAttrs ((builtins.length vaults) == 1) { - open = true; - }); + value = { + path = "${config.home.homeDirectory}/${vault.target}"; + } + // (lib.attrsets.optionalAttrs ((builtins.length vaults) == 1) { + open = true; + }); }) vaults ); updateDisabled = true; diff --git a/modules/programs/offlineimap/default.nix b/modules/programs/offlineimap/default.nix index 022f28110..d8f1a829f 100644 --- a/modules/programs/offlineimap/default.nix +++ b/modules/programs/offlineimap/default.nix @@ -65,29 +65,28 @@ let }; in toIni { - "Account ${name}" = - { - localrepository = "${name}-local"; - remoterepository = "${name}-remote"; - } - // postSyncHook - // offlineimap.extraConfig.account; + "Account ${name}" = { + localrepository = "${name}-local"; + remoterepository = "${name}-remote"; + } + // postSyncHook + // offlineimap.extraConfig.account; "Repository ${name}-local" = { type = localType; localfolders = account.maildir.absPath; - } // offlineimap.extraConfig.local; + } + // offlineimap.extraConfig.local; - "Repository ${name}-remote" = - { - type = remoteType; - remoteuser = account.userName; - } - // remoteHost - // remotePort - // remotePassEval - // ssl - // offlineimap.extraConfig.remote; + "Repository ${name}-remote" = { + type = remoteType; + remoteuser = account.userName; + } + // remoteHost + // remotePort + // remotePassEval + // ssl + // offlineimap.extraConfig.remote; }; extraConfigType = with lib.types; attrsOf (either (either str int) bool); @@ -189,30 +188,31 @@ in '' }/bin/get_settings.pyc"; - xdg.configFile."offlineimap/config".text = - '' - # Generated by Home Manager. - # See https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf - # for an exhaustive list of options. - '' - + toIni ( - { - general = { - accounts = lib.concatMapStringsSep "," (a: a.name) accounts; - pythonfile = "${config.xdg.configHome}/offlineimap/get_settings.py"; - metadata = "${config.xdg.dataHome}/offlineimap"; - } // cfg.extraConfig.general; + xdg.configFile."offlineimap/config".text = '' + # Generated by Home Manager. + # See https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf + # for an exhaustive list of options. + '' + + toIni ( + { + general = { + accounts = lib.concatMapStringsSep "," (a: a.name) accounts; + pythonfile = "${config.xdg.configHome}/offlineimap/get_settings.py"; + metadata = "${config.xdg.dataHome}/offlineimap"; } - // lib.optionalAttrs (cfg.extraConfig.mbnames != { }) { - mbnames = { - enabled = true; - } // cfg.extraConfig.mbnames; + // cfg.extraConfig.general; + } + // lib.optionalAttrs (cfg.extraConfig.mbnames != { }) { + mbnames = { + enabled = true; } - // lib.optionalAttrs (cfg.extraConfig.default != { }) { - DEFAULT = cfg.extraConfig.default; - } - ) - + "\n" - + lib.concatStringsSep "\n" (map accountStr accounts); + // cfg.extraConfig.mbnames; + } + // lib.optionalAttrs (cfg.extraConfig.default != { }) { + DEFAULT = cfg.extraConfig.default; + } + ) + + "\n" + + lib.concatStringsSep "\n" (map accountStr accounts); }; } diff --git a/modules/programs/sketchybar.nix b/modules/programs/sketchybar.nix index 26e2c95f1..5f388d064 100644 --- a/modules/programs/sketchybar.nix +++ b/modules/programs/sketchybar.nix @@ -176,10 +176,11 @@ in let resolvedExtraLuaPackages = cfg.extraLuaPackages pkgs.lua54Packages; - pathPackages = - [ cfg.package ] - ++ cfg.extraPackages - ++ lib.optional (cfg.configType == "lua" && cfg.luaPackage != null) cfg.luaPackage; + pathPackages = [ + cfg.package + ] + ++ cfg.extraPackages + ++ lib.optional (cfg.configType == "lua" && cfg.luaPackage != null) cfg.luaPackage; luaPaths = lib.filter (x: x != "") [ (lib.optionalString (cfg.configType == "lua" && resolvedExtraLuaPackages != [ ]) ( diff --git a/modules/programs/streamlink.nix b/modules/programs/streamlink.nix index 4371082cd..d87f20d61 100644 --- a/modules/programs/streamlink.nix +++ b/modules/programs/streamlink.nix @@ -135,20 +135,19 @@ in { home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; } (lib.mkIf pkgs.stdenv.hostPlatform.isLinux { - xdg.configFile = - { - "streamlink/config" = lib.mkIf (cfg.settings != { }) { - text = renderSettings cfg.settings; - }; - } - // (lib.mapAttrs' ( - name: value: - lib.nameValuePair "streamlink/config.${name}" ( - lib.mkIf (value.settings != { }) { - text = renderSettings value.settings; - } - ) - ) cfg.plugins); + xdg.configFile = { + "streamlink/config" = lib.mkIf (cfg.settings != { }) { + text = renderSettings cfg.settings; + }; + } + // (lib.mapAttrs' ( + name: value: + lib.nameValuePair "streamlink/config.${name}" ( + lib.mkIf (value.settings != { }) { + text = renderSettings value.settings; + } + ) + ) cfg.plugins); xdg.dataFile = lib.mapAttrs' ( name: value: @@ -168,35 +167,34 @@ in }) (lib.mkIf pkgs.stdenv.hostPlatform.isDarwin { - home.file = - { - "Library/Application Support/streamlink/config" = lib.mkIf (cfg.settings != { }) { - text = renderSettings cfg.settings; - }; - } - // (lib.mapAttrs' ( - name: value: - lib.nameValuePair "Library/Application Support/streamlink/config.${name}" ( - lib.mkIf (value.settings != { }) { - text = renderSettings value.settings; - } + home.file = { + "Library/Application Support/streamlink/config" = lib.mkIf (cfg.settings != { }) { + text = renderSettings cfg.settings; + }; + } + // (lib.mapAttrs' ( + name: value: + lib.nameValuePair "Library/Application Support/streamlink/config.${name}" ( + lib.mkIf (value.settings != { }) { + text = renderSettings value.settings; + } + ) + ) cfg.plugins) + // (lib.mapAttrs' ( + name: value: + lib.nameValuePair "Library/Application Support/streamlink/plugins/${name}.py" ( + lib.mkIf (value.src != null) ( + if (builtins.isPath value.src) then + { + source = value.src; + } + else + { + text = value.src; + } ) - ) cfg.plugins) - // (lib.mapAttrs' ( - name: value: - lib.nameValuePair "Library/Application Support/streamlink/plugins/${name}.py" ( - lib.mkIf (value.src != null) ( - if (builtins.isPath value.src) then - { - source = value.src; - } - else - { - text = value.src; - } - ) - ) - ) cfg.plugins); + ) + ) cfg.plugins); }) ] ); diff --git a/modules/programs/thunderbird.nix b/modules/programs/thunderbird.nix index 0085d95ad..d245efd52 100644 --- a/modules/programs/thunderbird.nix +++ b/modules/programs/thunderbird.nix @@ -54,13 +54,12 @@ let profilesIni = lib.foldl lib.recursiveUpdate { - General = - { - StartWithLastProfile = 1; - } - // lib.optionalAttrs (cfg.profileVersion != null) { - Version = cfg.profileVersion; - }; + General = { + StartWithLastProfile = 1; + } + // lib.optionalAttrs (cfg.profileVersion != null) { + Version = cfg.profileVersion; + }; } ( lib.flip map profilesWithId (profile: { @@ -882,11 +881,13 @@ in home.packages = [ cfg.package - ] ++ lib.optional (lib.any (p: p.withExternalGnupg) (attrValues cfg.profiles)) pkgs.gpgme; + ] + ++ lib.optional (lib.any (p: p.withExternalGnupg) (attrValues cfg.profiles)) pkgs.gpgme; mozilla.thunderbirdNativeMessagingHosts = [ cfg.package # package configured native messaging hosts (entire mail app actually) - ] ++ cfg.nativeMessagingHosts; # user configured native messaging hosts + ] + ++ cfg.nativeMessagingHosts; # user configured native messaging hosts home.file = lib.mkMerge ( [ diff --git a/modules/programs/tmux.nix b/modules/programs/tmux.nix index 8f1c70e5a..46df37634 100644 --- a/modules/programs/tmux.nix +++ b/modules/programs/tmux.nix @@ -357,10 +357,11 @@ in config = lib.mkIf cfg.enable ( lib.mkMerge [ { - home.packages = - [ cfg.package ] - ++ lib.optional cfg.tmuxinator.enable pkgs.tmuxinator - ++ lib.optional cfg.tmuxp.enable pkgs.tmuxp; + home.packages = [ + cfg.package + ] + ++ lib.optional cfg.tmuxinator.enable pkgs.tmuxinator + ++ lib.optional cfg.tmuxp.enable pkgs.tmuxp; } { xdg.configFile."tmux/tmux.conf".text = lib.mkBefore tmuxConf; } diff --git a/modules/programs/urxvt.nix b/modules/programs/urxvt.nix index 8a7868af3..37ab93524 100644 --- a/modules/programs/urxvt.nix +++ b/modules/programs/urxvt.nix @@ -142,27 +142,26 @@ in config = lib.mkIf cfg.enable { home.packages = [ cfg.package ]; - xresources.properties = - { - "URxvt.scrollBar" = cfg.scroll.bar.enable; - "URxvt.scrollstyle" = cfg.scroll.bar.style; - "URxvt.scrollBar_align" = cfg.scroll.bar.align; - "URxvt.scrollBar_right" = cfg.scroll.bar.position == "right"; - "URxvt.scrollBar_floating" = cfg.scroll.bar.floating; - "URxvt.saveLines" = cfg.scroll.lines; - "URxvt.scrollWithBuffer" = cfg.scroll.keepPosition; - "URxvt.scrollTtyKeypress" = cfg.scroll.scrollOnKeystroke; - "URxvt.scrollTtyOutput" = cfg.scroll.scrollOnOutput; - "URxvt.transparent" = cfg.transparent; - "URxvt.shading" = cfg.shading; - "URxvt.iso14755" = cfg.iso14755; - } - // lib.flip lib.mapAttrs' cfg.keybindings ( - kb: action: lib.nameValuePair "URxvt.keysym.${kb}" action - ) - // lib.optionalAttrs (cfg.fonts != [ ]) { - "URxvt.font" = lib.concatStringsSep "," cfg.fonts; - } - // lib.flip lib.mapAttrs' cfg.extraConfig (k: v: lib.nameValuePair "URxvt.${k}" v); + xresources.properties = { + "URxvt.scrollBar" = cfg.scroll.bar.enable; + "URxvt.scrollstyle" = cfg.scroll.bar.style; + "URxvt.scrollBar_align" = cfg.scroll.bar.align; + "URxvt.scrollBar_right" = cfg.scroll.bar.position == "right"; + "URxvt.scrollBar_floating" = cfg.scroll.bar.floating; + "URxvt.saveLines" = cfg.scroll.lines; + "URxvt.scrollWithBuffer" = cfg.scroll.keepPosition; + "URxvt.scrollTtyKeypress" = cfg.scroll.scrollOnKeystroke; + "URxvt.scrollTtyOutput" = cfg.scroll.scrollOnOutput; + "URxvt.transparent" = cfg.transparent; + "URxvt.shading" = cfg.shading; + "URxvt.iso14755" = cfg.iso14755; + } + // lib.flip lib.mapAttrs' cfg.keybindings ( + kb: action: lib.nameValuePair "URxvt.keysym.${kb}" action + ) + // lib.optionalAttrs (cfg.fonts != [ ]) { + "URxvt.font" = lib.concatStringsSep "," cfg.fonts; + } + // lib.flip lib.mapAttrs' cfg.extraConfig (k: v: lib.nameValuePair "URxvt.${k}" v); }; } diff --git a/modules/programs/vscode/default.nix b/modules/programs/vscode/default.nix index c680ba489..98fd2a5f3 100644 --- a/modules/programs/vscode/default.nix +++ b/modules/programs/vscode/default.nix @@ -259,20 +259,20 @@ let allProfilesExceptDefault = removeAttrs cfg.profiles [ "default" ]; in { - imports = - [ - ./haskell.nix - (lib.mkChangedOptionModule - [ - "programs" - "vscode" - "immutableExtensionsDir" - ] - [ "programs" "vscode" "mutableExtensionsDir" ] - (config: !config.programs.vscode.immutableExtensionsDir) - ) - ] - ++ map + imports = [ + ./haskell.nix + (lib.mkChangedOptionModule + [ + "programs" + "vscode" + "immutableExtensionsDir" + ] + [ "programs" "vscode" "mutableExtensionsDir" ] + (config: !config.programs.vscode.immutableExtensionsDir) + ) + ] + ++ + map ( v: lib.mkRenamedOptionModule diff --git a/modules/programs/vscode/haskell.nix b/modules/programs/vscode/haskell.nix index 004786286..c363d6967 100644 --- a/modules/programs/vscode/haskell.nix +++ b/modules/programs/vscode/haskell.nix @@ -62,6 +62,7 @@ in programs.vscode.profiles.default.extensions = [ pkgs.vscode-extensions.justusadam.language-haskell - ] ++ lib.optional cfg.hie.enable pkgs.vscode-extensions.alanz.vscode-hie-server; + ] + ++ lib.optional cfg.hie.enable pkgs.vscode-extensions.alanz.vscode-hie-server; }; } diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index 8b689bb2f..96a52b91c 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -227,34 +227,33 @@ in nushell.extraConfig = mkIf cfg.enableNushellIntegration nushellIntegration; }; - xdg.configFile = - { - "yazi/keymap.toml" = mkIf (cfg.keymap != { }) { - source = tomlFormat.generate "yazi-keymap" cfg.keymap; - }; - "yazi/yazi.toml" = mkIf (cfg.settings != { }) { - source = tomlFormat.generate "yazi-settings" cfg.settings; - }; - "yazi/theme.toml" = mkIf (cfg.theme != { }) { - source = tomlFormat.generate "yazi-theme" cfg.theme; - }; - "yazi/init.lua" = mkIf (cfg.initLua != null) ( - if builtins.isPath cfg.initLua then - { - source = cfg.initLua; - } - else - { - text = cfg.initLua; - } - ); - } - // (lib.mapAttrs' ( - name: value: lib.nameValuePair "yazi/flavors/${name}.yazi" { source = value; } - ) cfg.flavors) - // (lib.mapAttrs' ( - name: value: lib.nameValuePair "yazi/plugins/${name}.yazi" { source = value; } - ) cfg.plugins); + xdg.configFile = { + "yazi/keymap.toml" = mkIf (cfg.keymap != { }) { + source = tomlFormat.generate "yazi-keymap" cfg.keymap; + }; + "yazi/yazi.toml" = mkIf (cfg.settings != { }) { + source = tomlFormat.generate "yazi-settings" cfg.settings; + }; + "yazi/theme.toml" = mkIf (cfg.theme != { }) { + source = tomlFormat.generate "yazi-theme" cfg.theme; + }; + "yazi/init.lua" = mkIf (cfg.initLua != null) ( + if builtins.isPath cfg.initLua then + { + source = cfg.initLua; + } + else + { + text = cfg.initLua; + } + ); + } + // (lib.mapAttrs' ( + name: value: lib.nameValuePair "yazi/flavors/${name}.yazi" { source = value; } + ) cfg.flavors) + // (lib.mapAttrs' ( + name: value: lib.nameValuePair "yazi/plugins/${name}.yazi" { source = value; } + ) cfg.plugins); warnings = lib.filter (s: s != "") ( lib.concatLists [ diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index 2e7113d5b..69813fe07 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -154,11 +154,13 @@ in "/run/current-system/sw" config.home.profileDirectory cfg.iconTheme.package - ] ++ optional useCustomTheme hicolorTheme.package; + ] + ++ optional useCustomTheme hicolorTheme.package; themes = [ cfg.iconTheme - ] ++ optional useCustomTheme (hicolorTheme // { size = cfg.iconTheme.size; }); + ] + ++ optional useCustomTheme (hicolorTheme // { size = cfg.iconTheme.size; }); categories = [ "actions" diff --git a/modules/services/dwm-status.nix b/modules/services/dwm-status.nix index 5bdd117de..fb2db86b8 100644 --- a/modules/services/dwm-status.nix +++ b/modules/services/dwm-status.nix @@ -22,7 +22,8 @@ let finalConfig = { inherit (cfg) order; - } // cfg.extraConfig; + } + // cfg.extraConfig; configFile = jsonFormat.generate "dwm-status.json" finalConfig; diff --git a/modules/services/emacs.nix b/modules/services/emacs.nix index f319041b5..117c3b72c 100644 --- a/modules/services/emacs.nix +++ b/modules/services/emacs.nix @@ -129,64 +129,61 @@ in } (mkIf pkgs.stdenv.isLinux { - systemd.user.services.emacs = - { - Unit = - { - Description = "Emacs text editor"; - Documentation = "info:emacs man:emacs(1) https://gnu.org/software/emacs/"; + systemd.user.services.emacs = { + Unit = { + Description = "Emacs text editor"; + Documentation = "info:emacs man:emacs(1) https://gnu.org/software/emacs/"; - After = optional (cfg.startWithUserSession == "graphical") "graphical-session.target"; - PartOf = optional (cfg.startWithUserSession == "graphical") "graphical-session.target"; + After = optional (cfg.startWithUserSession == "graphical") "graphical-session.target"; + PartOf = optional (cfg.startWithUserSession == "graphical") "graphical-session.target"; - # Avoid killing the Emacs session, which may be full of - # unsaved buffers. - X-RestartIfChanged = false; - } - // optionalAttrs needsSocketWorkaround { - # Emacs deletes its socket when shutting down, which systemd doesn't - # handle, resulting in a server without a socket. - # See https://github.com/nix-community/home-manager/issues/2018 - RefuseManualStart = true; - }; - - Service = - { - Type = "notify"; - - # We wrap ExecStart in a login shell so Emacs starts with the user's - # environment, most importantly $PATH and $NIX_PROFILES. It may be - # worth investigating a more targeted approach for user services to - # import the user environment. - ExecStart = ''${pkgs.runtimeShell} -l -c "${emacsBinPath}/emacs --fg-daemon${ - # In case the user sets 'server-directory' or 'server-name' in - # their Emacs config, we want to specify the socket path explicitly - # so launching 'emacs.service' manually doesn't break emacsclient - # when using socket activation. - lib.optionalString cfg.socketActivation.enable "=${lib.escapeShellArg socketPath}" - } ${lib.escapeShellArgs cfg.extraOptions}"''; - - # Emacs will exit with status 15 after having received SIGTERM, which - # is the default "KillSignal" value systemd uses to stop services. - SuccessExitStatus = 15; - - Restart = "on-failure"; - } - // optionalAttrs needsSocketWorkaround { - # Use read-only directory permissions to prevent emacs from - # deleting systemd's socket file before exiting. - ExecStartPost = "${pkgs.coreutils}/bin/chmod --changes -w ${socketDir}"; - ExecStopPost = "${pkgs.coreutils}/bin/chmod --changes +w ${socketDir}"; - }; + # Avoid killing the Emacs session, which may be full of + # unsaved buffers. + X-RestartIfChanged = false; } - // optionalAttrs (cfg.startWithUserSession != false) { - Install = { - WantedBy = [ - (if cfg.startWithUserSession == true then "default.target" else "graphical-session.target") - ]; - }; + // optionalAttrs needsSocketWorkaround { + # Emacs deletes its socket when shutting down, which systemd doesn't + # handle, resulting in a server without a socket. + # See https://github.com/nix-community/home-manager/issues/2018 + RefuseManualStart = true; }; + Service = { + Type = "notify"; + + # We wrap ExecStart in a login shell so Emacs starts with the user's + # environment, most importantly $PATH and $NIX_PROFILES. It may be + # worth investigating a more targeted approach for user services to + # import the user environment. + ExecStart = ''${pkgs.runtimeShell} -l -c "${emacsBinPath}/emacs --fg-daemon${ + # In case the user sets 'server-directory' or 'server-name' in + # their Emacs config, we want to specify the socket path explicitly + # so launching 'emacs.service' manually doesn't break emacsclient + # when using socket activation. + lib.optionalString cfg.socketActivation.enable "=${lib.escapeShellArg socketPath}" + } ${lib.escapeShellArgs cfg.extraOptions}"''; + + # Emacs will exit with status 15 after having received SIGTERM, which + # is the default "KillSignal" value systemd uses to stop services. + SuccessExitStatus = 15; + + Restart = "on-failure"; + } + // optionalAttrs needsSocketWorkaround { + # Use read-only directory permissions to prevent emacs from + # deleting systemd's socket file before exiting. + ExecStartPost = "${pkgs.coreutils}/bin/chmod --changes -w ${socketDir}"; + ExecStopPost = "${pkgs.coreutils}/bin/chmod --changes +w ${socketDir}"; + }; + } + // optionalAttrs (cfg.startWithUserSession != false) { + Install = { + WantedBy = [ + (if cfg.startWithUserSession == true then "default.target" else "graphical-session.target") + ]; + }; + }; + home.packages = optional cfg.client.enable (lib.hiPrio clientDesktopItem); }) @@ -227,7 +224,8 @@ in ProgramArguments = [ "${cfg.package}/bin/emacs" "--fg-daemon" - ] ++ cfg.extraOptions; + ] + ++ cfg.extraOptions; RunAtLoad = true; KeepAlive = { Crashed = true; diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index 71b6a67fb..81de2afa0 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -23,34 +23,30 @@ let ${gpgPkg}/bin/gpg-connect-agent --quiet updatestartuptty /bye > /dev/null ''; - gpgInitStr = - '' - GPG_TTY="$(tty)" - export GPG_TTY - '' - + optionalString cfg.enableSshSupport gpgSshSupportStr; + gpgInitStr = '' + GPG_TTY="$(tty)" + export GPG_TTY + '' + + optionalString cfg.enableSshSupport gpgSshSupportStr; - gpgZshInitStr = - '' - export GPG_TTY=$TTY - '' - + optionalString cfg.enableSshSupport gpgSshSupportStr; + gpgZshInitStr = '' + export GPG_TTY=$TTY + '' + + optionalString cfg.enableSshSupport gpgSshSupportStr; - gpgFishInitStr = - '' - set -gx GPG_TTY (tty) - '' - + optionalString cfg.enableSshSupport gpgSshSupportStr; + gpgFishInitStr = '' + set -gx GPG_TTY (tty) + '' + + optionalString cfg.enableSshSupport gpgSshSupportStr; - gpgNushellInitStr = - '' - $env.GPG_TTY = (tty) - '' - + optionalString cfg.enableSshSupport '' - ${gpgPkg}/bin/gpg-connect-agent --quiet updatestartuptty /bye | ignore + gpgNushellInitStr = '' + $env.GPG_TTY = (tty) + '' + + optionalString cfg.enableSshSupport '' + ${gpgPkg}/bin/gpg-connect-agent --quiet updatestartuptty /bye | ignore - $env.SSH_AUTH_SOCK = ($env.SSH_AUTH_SOCK? | default (${gpgPkg}/bin/gpgconf --list-dirs agent-ssh-socket)) - ''; + $env.SSH_AUTH_SOCK = ($env.SSH_AUTH_SOCK? | default (${gpgPkg}/bin/gpgconf --list-dirs agent-ssh-socket)) + ''; # mimic `gpgconf` output for use in the service definitions. # we cannot use `gpgconf` directly because it heavily depends on system @@ -439,7 +435,8 @@ in ProgramArguments = [ "${gpgPkg}/bin/gpg-agent" "--supervised" - ] ++ optional cfg.verbose "--verbose"; + ] + ++ optional cfg.verbose "--verbose"; EnvironmentVariables = { GNUPGHOME = homedir; }; diff --git a/modules/services/hyprsunset.nix b/modules/services/hyprsunset.nix index c2298685a..811d3117d 100644 --- a/modules/services/hyprsunset.nix +++ b/modules/services/hyprsunset.nix @@ -131,7 +131,8 @@ in RestartSec = "10"; }; }; - } // transitionServices; + } + // transitionServices; timers = lib.mapAttrs' ( name: transitionCfg: diff --git a/modules/services/imapnotify/default.nix b/modules/services/imapnotify/default.nix index e5d1311bb..39231df97 100644 --- a/modules/services/imapnotify/default.nix +++ b/modules/services/imapnotify/default.nix @@ -44,9 +44,10 @@ let Restart = "always"; RestartSec = 30; Type = "simple"; - Environment = - [ "PATH=${cfg.path}" ] - ++ lib.optional account.notmuch.enable "NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/default/config"; + Environment = [ + "PATH=${cfg.path}" + ] + ++ lib.optional account.notmuch.enable "NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/default/config"; }; Install = { @@ -64,23 +65,22 @@ let name = "imapnotify-${name}"; value = { enable = true; - config = - { - # Use the nix store path for config to ensure service restarts when it changes - ProgramArguments = [ - "${lib.getExe cfg.package}" - "-conf" - "${genAccountConfig account}" - ]; - KeepAlive = true; - ThrottleInterval = 30; - ExitTimeOut = 0; - ProcessType = "Background"; - RunAtLoad = true; - } - // optionalAttrs account.notmuch.enable { - EnvironmentVariables.NOTMUCH_CONFIG = "${config.xdg.configHome}/notmuch/default/config"; - }; + config = { + # Use the nix store path for config to ensure service restarts when it changes + ProgramArguments = [ + "${lib.getExe cfg.package}" + "-conf" + "${genAccountConfig account}" + ]; + KeepAlive = true; + ThrottleInterval = 30; + ExitTimeOut = 0; + ProcessType = "Background"; + RunAtLoad = true; + } + // optionalAttrs account.notmuch.enable { + EnvironmentVariables.NOTMUCH_CONFIG = "${config.xdg.configHome}/notmuch/default/config"; + }; }; }; diff --git a/modules/services/ludusavi.nix b/modules/services/ludusavi.nix index f5e6f7a29..7b6d430dd 100644 --- a/modules/services/ludusavi.nix +++ b/modules/services/ludusavi.nix @@ -90,14 +90,13 @@ in systemd.user = { services.ludusavi = { Unit.Description = "Run a game save backup with Ludusavi"; - Service = - { - Type = "oneshot"; - ExecStart = "${lib.getExe cfg.package} backup --force"; - } - // lib.optionalAttrs cfg.backupNotification { - ExecStartPost = "${lib.getExe pkgs.libnotify} 'Ludusavi' 'Backup completed' -i com.mtkennerly.ludusavi -a 'Ludusavi'"; - }; + Service = { + Type = "oneshot"; + ExecStart = "${lib.getExe cfg.package} backup --force"; + } + // lib.optionalAttrs cfg.backupNotification { + ExecStartPost = "${lib.getExe pkgs.libnotify} 'Ludusavi' 'Backup completed' -i com.mtkennerly.ludusavi -a 'Ludusavi'"; + }; }; timers.ludusavi = { Unit.Description = "Run a game save backup with Ludusavi"; diff --git a/modules/services/mbsync.nix b/modules/services/mbsync.nix index e336da9c9..39ff7feda 100644 --- a/modules/services/mbsync.nix +++ b/modules/services/mbsync.nix @@ -9,10 +9,11 @@ let cfg = config.services.mbsync; - mbsyncOptions = - [ "--all" ] - ++ lib.optional (cfg.verbose) "--verbose" - ++ lib.optional (cfg.configFile != null) "--config ${cfg.configFile}"; + mbsyncOptions = [ + "--all" + ] + ++ lib.optional (cfg.verbose) "--verbose" + ++ lib.optional (cfg.configFile != null) "--config ${cfg.configFile}"; in { @@ -82,17 +83,16 @@ in Description = "mbsync mailbox synchronization"; }; - Service = - { - Type = "oneshot"; - ExecStart = "${cfg.package}/bin/mbsync ${lib.concatStringsSep " " mbsyncOptions}"; - } - // (lib.optionalAttrs (cfg.postExec != null) { - ExecStartPost = cfg.postExec; - }) - // (lib.optionalAttrs (cfg.preExec != null) { - ExecStartPre = cfg.preExec; - }); + Service = { + Type = "oneshot"; + ExecStart = "${cfg.package}/bin/mbsync ${lib.concatStringsSep " " mbsyncOptions}"; + } + // (lib.optionalAttrs (cfg.postExec != null) { + ExecStartPost = cfg.postExec; + }) + // (lib.optionalAttrs (cfg.preExec != null) { + ExecStartPre = cfg.preExec; + }); }; systemd.user.timers.mbsync = { diff --git a/modules/services/mpd.nix b/modules/services/mpd.nix index e4fd61141..1e12a1b9e 100644 --- a/modules/services/mpd.nix +++ b/modules/services/mpd.nix @@ -228,7 +228,8 @@ in (lib.getExe cfg.package) "--no-daemon" "${mpdConf}" - ] ++ cfg.extraArgs; + ] + ++ cfg.extraArgs; KeepAlive = true; ProcessType = "Interactive"; }; diff --git a/modules/services/mpdris2.nix b/modules/services/mpdris2.nix index 102ec0a02..e2f52af3a 100644 --- a/modules/services/mpdris2.nix +++ b/modules/services/mpdris2.nix @@ -19,15 +19,14 @@ let }; mpdris2Conf = { - Connection = - { - host = cfg.mpd.host; - port = cfg.mpd.port; - music_dir = cfg.mpd.musicDirectory; - } - // lib.optionalAttrs (cfg.mpd.password != null) { - password = cfg.mpd.password; - }; + Connection = { + host = cfg.mpd.host; + port = cfg.mpd.port; + music_dir = cfg.mpd.musicDirectory; + } + // lib.optionalAttrs (cfg.mpd.password != null) { + password = cfg.mpd.password; + }; Bling = { notify = cfg.notifications; diff --git a/modules/services/nix-gc.nix b/modules/services/nix-gc.nix index 437e01505..ad667e571 100644 --- a/modules/services/nix-gc.nix +++ b/modules/services/nix-gc.nix @@ -118,7 +118,8 @@ in config = { ProgramArguments = [ "${nixPackage}/bin/nix-collect-garbage" - ] ++ lib.optional (cfg.options != null) cfg.options; + ] + ++ lib.optional (cfg.options != null) cfg.options; StartCalendarInterval = lib.hm.darwin.mkCalendarInterval cfg.frequency; }; }; diff --git a/modules/services/redshift-gammastep/lib/options.nix b/modules/services/redshift-gammastep/lib/options.nix index 60c8fa24a..436dfc173 100644 --- a/modules/services/redshift-gammastep/lib/options.nix +++ b/modules/services/redshift-gammastep/lib/options.nix @@ -218,8 +218,11 @@ in { Description = "${programName} colour temperature adjuster"; Documentation = serviceDocumentation; - After = - [ "graphical-session.target" ] ++ (lib.optional cfg.tray "tray.target") ++ geoclueAgentService; + After = [ + "graphical-session.target" + ] + ++ (lib.optional cfg.tray "tray.target") + ++ geoclueAgentService; Wants = geoclueAgentService; Requires = lib.mkIf cfg.tray "tray.target"; PartOf = [ "graphical-session.target" ]; diff --git a/modules/services/restic.nix b/modules/services/restic.nix index df2207c99..20ea8772b 100644 --- a/modules/services/restic.nix +++ b/modules/services/restic.nix @@ -395,87 +395,85 @@ in After = [ "network-online.target" ]; }; - Service = - { - Type = "oneshot"; + Service = { + Type = "oneshot"; - X-RestartIfChanged = true; - RuntimeDirectory = serviceName; - CacheDirectory = serviceName; - CacheDirectoryMode = "0700"; - PrivateTmp = true; + X-RestartIfChanged = true; + RuntimeDirectory = serviceName; + CacheDirectory = serviceName; + CacheDirectoryMode = "0700"; + PrivateTmp = true; - Environment = - [ - "RESTIC_CACHE_DIR=%C" - "PATH=${backup.ssh-package}/bin" - ] - ++ attrsToEnvs ( - { - RESTIC_PROGRESS_FPS = backup.progressFps; - RESTIC_PASSWORD_FILE = backup.passwordFile; - RESTIC_REPOSITORY = backup.repository; - RESTIC_REPOSITORY_FILE = backup.repositoryFile; - } - // backup.rcloneOptions - ); + Environment = [ + "RESTIC_CACHE_DIR=%C" + "PATH=${backup.ssh-package}/bin" + ] + ++ attrsToEnvs ( + { + RESTIC_PROGRESS_FPS = backup.progressFps; + RESTIC_PASSWORD_FILE = backup.passwordFile; + RESTIC_REPOSITORY = backup.repository; + RESTIC_REPOSITORY_FILE = backup.repositoryFile; + } + // backup.rcloneOptions + ); - ExecStart = - lib.optional doBackup backupCmd - ++ lib.optionals doPrune [ - unlockCmd - forgetCmd - ] - ++ lib.optional doCheck checkCmd; + ExecStart = + lib.optional doBackup backupCmd + ++ lib.optionals doPrune [ + unlockCmd + forgetCmd + ] + ++ lib.optional doCheck checkCmd; - ExecStartPre = lib.getExe ( - pkgs.writeShellApplication { - name = "${serviceName}-exec-start-pre"; - inherit runtimeInputs; - text = '' - set -x + ExecStartPre = lib.getExe ( + pkgs.writeShellApplication { + name = "${serviceName}-exec-start-pre"; + inherit runtimeInputs; + text = '' + set -x - ${lib.optionalString (backup.backupPrepareCommand != null) '' - ${pkgs.writeScript "backupPrepareCommand" backup.backupPrepareCommand} - ''} + ${lib.optionalString (backup.backupPrepareCommand != null) '' + ${pkgs.writeScript "backupPrepareCommand" backup.backupPrepareCommand} + ''} - ${lib.optionalString (backup.initialize) '' - ${ - mkResticCmd [ - "cat" - "config" - ] - } 2>/dev/null || ${mkResticCmd "init"} - ''} + ${lib.optionalString (backup.initialize) '' + ${ + mkResticCmd [ + "cat" + "config" + ] + } 2>/dev/null || ${mkResticCmd "init"} + ''} - ${lib.optionalString (backup.paths != null && backup.paths != [ ]) '' - cat ${pkgs.writeText "staticPaths" (lib.concatLines backup.paths)} >> ${filesFromTmpFile} - ''} + ${lib.optionalString (backup.paths != null && backup.paths != [ ]) '' + cat ${pkgs.writeText "staticPaths" (lib.concatLines backup.paths)} >> ${filesFromTmpFile} + ''} - ${lib.optionalString (backup.dynamicFilesFrom != null) '' - ${pkgs.writeScript "dynamicFilesFromScript" backup.dynamicFilesFrom} >> ${filesFromTmpFile} - ''} - ''; - } - ); + ${lib.optionalString (backup.dynamicFilesFrom != null) '' + ${pkgs.writeScript "dynamicFilesFromScript" backup.dynamicFilesFrom} >> ${filesFromTmpFile} + ''} + ''; + } + ); - ExecStopPost = lib.getExe ( - pkgs.writeShellApplication { - name = "${serviceName}-exec-stop-post"; - inherit runtimeInputs; - text = '' - set -x + ExecStopPost = lib.getExe ( + pkgs.writeShellApplication { + name = "${serviceName}-exec-stop-post"; + inherit runtimeInputs; + text = '' + set -x - ${lib.optionalString (backup.backupCleanupCommand != null) '' - ${pkgs.writeScript "backupCleanupCommand" backup.backupCleanupCommand} - ''} - ''; - } - ); - } - // lib.optionalAttrs (backup.environmentFile != null) { - EnvironmentFile = backup.environmentFile; - }; + ${lib.optionalString (backup.backupCleanupCommand != null) '' + ${pkgs.writeScript "backupCleanupCommand" backup.backupCleanupCommand} + ''} + ''; + } + ); + } + // lib.optionalAttrs (backup.environmentFile != null) { + EnvironmentFile = backup.environmentFile; + }; } ) cfg.backups; diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 5fff1c3a0..e41a6add4 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -250,7 +250,8 @@ in "$" "bezier" "name" - ] ++ lib.optionals cfg.sourceFirst [ "source" ]; + ] + ++ lib.optionals cfg.sourceFirst [ "source" ]; example = [ "$" "bezier" @@ -334,7 +335,8 @@ in BindsTo = [ "graphical-session.target" ]; Wants = [ "graphical-session-pre.target" - ] ++ lib.optional cfg.systemd.enableXdgAutostart "xdg-desktop-autostart.target"; + ] + ++ lib.optional cfg.systemd.enableXdgAutostart "xdg-desktop-autostart.target"; After = [ "graphical-session-pre.target" ]; Before = lib.mkIf cfg.systemd.enableXdgAutostart [ "xdg-desktop-autostart.target" ]; }; diff --git a/modules/services/window-managers/i3-sway/lib/options.nix b/modules/services/window-managers/i3-sway/lib/options.nix index ec1c6bc2b..534a41622 100644 --- a/modules/services/window-managers/i3-sway/lib/options.nix +++ b/modules/services/window-managers/i3-sway/lib/options.nix @@ -48,40 +48,39 @@ let }; startupModule = types.submodule { - options = - { - command = mkOption { - type = types.str; - description = "Command that will be executed on startup."; - }; - - always = mkOption { - type = types.bool; - default = false; - description = "Whether to run command on each ${moduleName} restart."; - }; - } - // lib.optionalAttrs isI3 { - notification = mkOption { - type = types.bool; - default = true; - description = '' - Whether to enable startup-notification support for the command. - See {option}`--no-startup-id` option description in the i3 user guide. - ''; - }; - - workspace = mkOption { - type = types.nullOr types.str; - default = null; - description = '' - Launch application on a particular workspace. DEPRECATED: - Use [](#opt-xsession.windowManager.i3.config.assigns) - instead. See . - ''; - }; + options = { + command = mkOption { + type = types.str; + description = "Command that will be executed on startup."; }; + always = mkOption { + type = types.bool; + default = false; + description = "Whether to run command on each ${moduleName} restart."; + }; + } + // lib.optionalAttrs isI3 { + notification = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable startup-notification support for the command. + See {option}`--no-startup-id` option description in the i3 user guide. + ''; + }; + + workspace = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + Launch application on a particular workspace. DEPRECATED: + Use [](#opt-xsession.windowManager.i3.config.assigns) + instead. See . + ''; + }; + }; + }; barModule = types.submodule { diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index 2d8a2cd6e..c3d8cafff 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -718,7 +718,8 @@ in BindsTo = [ "graphical-session.target" ]; Wants = [ "graphical-session-pre.target" - ] ++ optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target"; + ] + ++ optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target"; After = [ "graphical-session-pre.target" ]; Before = optional cfg.systemd.xdgAutostart "xdg-desktop-autostart.target"; }; diff --git a/modules/services/window-managers/river.nix b/modules/services/window-managers/river.nix index db08de260..4909a60c1 100644 --- a/modules/services/window-managers/river.nix +++ b/modules/services/window-managers/river.nix @@ -201,8 +201,7 @@ in ]; home.packages = - lib.optional (cfg.package != null) cfg.package - ++ lib.optional cfg.xwayland.enable pkgs.xwayland; + lib.optional (cfg.package != null) cfg.package ++ lib.optional cfg.xwayland.enable pkgs.xwayland; # Configuration file ~/.config/river/init xdg.configFile."river/init".source = pkgs.writeShellScript "init" ( diff --git a/modules/services/xidlehook.nix b/modules/services/xidlehook.nix index 1e8081504..22696eacb 100644 --- a/modules/services/xidlehook.nix +++ b/modules/services/xidlehook.nix @@ -167,7 +167,8 @@ in Service = { Type = if cfg.once then "oneshot" else "simple"; ExecStart = "${script}"; - } // lib.optionalAttrs (!cfg.once) { Restart = "always"; }; + } + // lib.optionalAttrs (!cfg.once) { Restart = "always"; }; Install.WantedBy = [ "graphical-session.target" ]; }; }; diff --git a/nixos/common.nix b/nixos/common.nix index 4dd3c1061..0c6613db5 100644 --- a/nixos/common.nix +++ b/nixos/common.nix @@ -31,7 +31,8 @@ let osConfig = config; osClass = _class; modulesPath = builtins.toString ../modules; - } // cfg.extraSpecialArgs; + } + // cfg.extraSpecialArgs; modules = [ ( { name, ... }: @@ -62,7 +63,8 @@ let }; } ) - ] ++ cfg.sharedModules; + ] + ++ cfg.sharedModules; }; in diff --git a/tests/integration/standalone/restic.nix b/tests/integration/standalone/restic.nix index c7e9fea68..7b0dc3700 100644 --- a/tests/integration/standalone/restic.nix +++ b/tests/integration/standalone/restic.nix @@ -13,13 +13,11 @@ let dynDir = testDir.overrideAttrs ( final: prev: { - buildCommand = - prev.buildCommand - + '' - echo more secret data > $out/top-secret - echo shhhh > $out/top-secret-v2 - echo this isnt secret > $out/metadata - ''; + buildCommand = prev.buildCommand + '' + echo more secret data > $out/top-secret + echo shhhh > $out/top-secret-v2 + echo this isnt secret > $out/metadata + ''; } ); in diff --git a/tests/modules/programs/htop/example-settings.nix b/tests/modules/programs/htop/example-settings.nix index fd626b13c..5eedfbf5c 100644 --- a/tests/modules/programs/htop/example-settings.nix +++ b/tests/modules/programs/htop/example-settings.nix @@ -3,47 +3,46 @@ { config = { programs.htop.enable = true; - programs.htop.settings = - { - color_scheme = 6; - cpu_count_from_one = 0; - delay = 15; - fields = with config.lib.htop.fields; [ - PID - USER - PRIORITY - NICE - M_SIZE - M_RESIDENT - M_SHARE - STATE - PERCENT_CPU - PERCENT_MEM - TIME - COMM - ]; - highlight_base_name = 1; - highlight_megabytes = 1; - highlight_threads = 1; - } - // ( - with config.lib.htop; - leftMeters [ - (bar "AllCPUs2") - (bar "Memory") - (bar "Swap") - (text "Zram") - ] - ) - // ( - with config.lib.htop; - rightMeters [ - (text "Tasks") - (text "LoadAverage") - (text "Uptime") - (text "Systemd") - ] - ); + programs.htop.settings = { + color_scheme = 6; + cpu_count_from_one = 0; + delay = 15; + fields = with config.lib.htop.fields; [ + PID + USER + PRIORITY + NICE + M_SIZE + M_RESIDENT + M_SHARE + STATE + PERCENT_CPU + PERCENT_MEM + TIME + COMM + ]; + highlight_base_name = 1; + highlight_megabytes = 1; + highlight_threads = 1; + } + // ( + with config.lib.htop; + leftMeters [ + (bar "AllCPUs2") + (bar "Memory") + (bar "Swap") + (text "Zram") + ] + ) + // ( + with config.lib.htop; + rightMeters [ + (text "Tasks") + (text "LoadAverage") + (text "Uptime") + (text "Systemd") + ] + ); nmt.script = '' htoprc=home-files/.config/htop/htoprc diff --git a/tests/modules/programs/kitty/example-settings.nix b/tests/modules/programs/kitty/example-settings.nix index d68baa6cd..484dacda6 100644 --- a/tests/modules/programs/kitty/example-settings.nix +++ b/tests/modules/programs/kitty/example-settings.nix @@ -35,17 +35,16 @@ }; }; - nmt.script = - '' - assertFileExists home-files/.config/kitty/kitty.conf - assertFileContent \ - home-files/.config/kitty/kitty.conf \ - ${./example-settings-expected.conf} - '' - + lib.optionalString pkgs.stdenv.hostPlatform.isDarwin '' - assertFileContent \ - home-files/.config/kitty/macos-launch-services-cmdline \ - ${./example-macos-launch-services-cmdline} - ''; + nmt.script = '' + assertFileExists home-files/.config/kitty/kitty.conf + assertFileContent \ + home-files/.config/kitty/kitty.conf \ + ${./example-settings-expected.conf} + '' + + lib.optionalString pkgs.stdenv.hostPlatform.isDarwin '' + assertFileContent \ + home-files/.config/kitty/macos-launch-services-cmdline \ + ${./example-macos-launch-services-cmdline} + ''; }; } diff --git a/tests/modules/services/espanso/linux/basic-configuration.nix b/tests/modules/services/espanso/linux/basic-configuration.nix index 9cf030994..c92a1cc10 100644 --- a/tests/modules/services/espanso/linux/basic-configuration.nix +++ b/tests/modules/services/espanso/linux/basic-configuration.nix @@ -42,7 +42,8 @@ espansoExtraArgs: { ]; }; }; - } // espansoExtraArgs; + } + // espansoExtraArgs; nmt.script = '' serviceFile=home-files/.config/systemd/user/espanso.service