From 44090d62577cfff44f5caf457bdcf4ea27c7753f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 2 Feb 2024 12:40:16 +0800 Subject: [PATCH] chore: reformat codebase --- configs/nixos/ni/hardware-configuration.nix | 3 +- .../modules/setups/snippets/snippets/all.lua | 48 ++-- .../setups/snippets/snippets/asciidoc.lua | 254 +++++++++--------- .../fiesta/modules/setups/treesitter.nix | 88 +++--- modules/flake-parts/setups/home-manager.nix | 7 +- modules/flake-parts/setups/nixos.nix | 222 +++++++-------- modules/flake-parts/setups/nixvim.nix | 17 +- modules/nixos/profiles/desktop/fonts.nix | 2 +- .../submodules/component-type.nix | 7 +- modules/nixos/programs/sessiond/default.nix | 20 +- modules/nixvim/keyunmaps.nix | 2 +- modules/nixvim/plugins/firenvim.nix | 2 +- 12 files changed, 345 insertions(+), 327 deletions(-) diff --git a/configs/nixos/ni/hardware-configuration.nix b/configs/nixos/ni/hardware-configuration.nix index 4bfe47e7..3595fcc6 100644 --- a/configs/nixos/ni/hardware-configuration.nix +++ b/configs/nixos/ni/hardware-configuration.nix @@ -22,5 +22,6 @@ boot.loader.efi.canTouchEfiVariables = true; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/configs/nixvim/fiesta/modules/setups/snippets/snippets/all.lua b/configs/nixvim/fiesta/modules/setups/snippets/snippets/all.lua index 25e04b30..9d5de8f9 100644 --- a/configs/nixvim/fiesta/modules/setups/snippets/snippets/all.lua +++ b/configs/nixvim/fiesta/modules/setups/snippets/snippets/all.lua @@ -1,31 +1,31 @@ return { - s( - "today", - f(function() - return os.date("%F") - end) - ), + s( + "today", + f(function() + return os.date("%F") + end) + ), - s( - "retrieve", - f(function() - return string.format("(retrieved %s)", os.date("%F")) - end) - ), + s( + "retrieve", + f(function() + return string.format("(retrieved %s)", os.date("%F")) + end) + ), - s( - { trig = 'reldate (-?%d+) "(.+)"', regTrig = true }, - f(function(_, snip) - -- The point is in number of days. - local point = 60 * 60 * 24 * snip.captures[1] + s( + { trig = 'reldate (-?%d+) "(.+)"', regTrig = true }, + f(function(_, snip) + -- The point is in number of days. + local point = 60 * 60 * 24 * snip.captures[1] - local now = os.time() - return os.date(snip.captures[2], now + point) - end) - ), + local now = os.time() + return os.date(snip.captures[2], now + point) + end) + ), - s("#!", fmt("#!{}", i(1, "/usr/bin/env bash"))), + s("#!", fmt("#!{}", i(1, "/usr/bin/env bash"))), - parse("ie", "(i.e., $1)"), - parse("eg", "(e.g., $1)"), + parse("ie", "(i.e., $1)"), + parse("eg", "(e.g., $1)"), } diff --git a/configs/nixvim/fiesta/modules/setups/snippets/snippets/asciidoc.lua b/configs/nixvim/fiesta/modules/setups/snippets/snippets/asciidoc.lua index 16ea6e1f..0371a22e 100644 --- a/configs/nixvim/fiesta/modules/setups/snippets/snippets/asciidoc.lua +++ b/configs/nixvim/fiesta/modules/setups/snippets/snippets/asciidoc.lua @@ -1,170 +1,170 @@ function max_asciidoc_header(level) - return math.min(level, 6) + return math.min(level, 6) end return { - parse("bf", "**$1**"), - parse("it", "__$1__"), - parse("sp", "^$1^"), - parse("sb", "~$1~"), - s( - "tt", - fmt("{}{}{}", { - c(1, { t("`"), t("`+") }), - i(2, "TEXT"), - rep(1), - }) - ), + parse("bf", "**$1**"), + parse("it", "__$1__"), + parse("sp", "^$1^"), + parse("sb", "~$1~"), + s( + "tt", + fmt("{}{}{}", { + c(1, { t("`"), t("`+") }), + i(2, "TEXT"), + rep(1), + }) + ), - parse("foot", "footnote:[$1]"), + parse("foot", "footnote:[$1]"), - s( - "link", - fmt("link:{}[{}]", { - i(1, "LINK"), - rep(1), - }) - ), + s( + "link", + fmt("link:{}[{}]", { + i(1, "LINK"), + rep(1), + }) + ), - parse("var", ":$1: $2"), + parse("var", ":$1: $2"), - parse("audio", "audio::$1[$2]"), - parse("video", "video::$1[$2]"), + parse("audio", "audio::$1[$2]"), + parse("video", "video::$1[$2]"), - s( - "img", - fmt( - [[ + s( + "img", + fmt( + [[ .{} image::{}[{}, {}] {} ]], - { - i(1, "CAPTION"), - i(2, "IMAGE_PATH"), - i(3, "ALT_TEXT"), - i(4, "width=100%,height=100%"), - i(0), - } - ) - ), + { + i(1, "CAPTION"), + i(2, "IMAGE_PATH"), + i(3, "ALT_TEXT"), + i(4, "width=100%,height=100%"), + i(0), + } + ) + ), - s( - "fmt", - fmt("{}{}{}", { - c(1, { - t("**"), - t("__"), - t("`"), - }), - i(2), - rep(1), - }) - ), + s( + "fmt", + fmt("{}{}{}", { + c(1, { + t("**"), + t("__"), + t("`"), + }), + i(2), + rep(1), + }) + ), - s( - "dt", - fmt( - [[ + s( + "dt", + fmt( + [[ {}:: {} ]], - { - i(1, "TERM"), - i(2, "DEFINITION"), - } - ) - ), + { + i(1, "TERM"), + i(2, "DEFINITION"), + } + ) + ), - s( - "src", - fmt( - [[ + s( + "src", + fmt( + [[ [source, {}] ---- {} ---- {} ]], - { - i(1, "LANGUAGE"), - i(2, "CODE"), - i(0), - } - ) - ), + { + i(1, "LANGUAGE"), + i(2, "CODE"), + i(0), + } + ) + ), - s( - { trig = "h(%d)", regTrig = true }, - fmt( - [[ + s( + { trig = "h(%d)", regTrig = true }, + fmt( + [[ {} {} {} {} ]], - { - f(function(_, snip) - local level = max_asciidoc_header(snip.captures[1]) - return string.rep("=", level) - end), - i(1, "CHAPTER"), - d(2, function(_, snip) - local nodes = {} - table.insert(nodes, t("")) + { + f(function(_, snip) + local level = max_asciidoc_header(snip.captures[1]) + return string.rep("=", level) + end), + i(1, "CHAPTER"), + d(2, function(_, snip) + local nodes = {} + table.insert(nodes, t("")) - local level = max_asciidoc_header(snip.captures[1]) + local level = max_asciidoc_header(snip.captures[1]) - if level == 1 then - table.insert(nodes, t(":toc:")) - end + if level == 1 then + table.insert(nodes, t(":toc:")) + end - local parent = c(1, nodes) - if level > 1 then - parent = t("") - end + local parent = c(1, nodes) + if level > 1 then + parent = t("") + end - return sn(nil, parent) - end, {}), - i(0), - } - ) - ), + return sn(nil, parent) + end, {}), + i(0), + } + ) + ), - s( - "admon", - fmt("{}: {}", { - c(1, { - t("NOTE"), - t("TIP"), - t("IMPORTANT"), - t("CAUTION"), - t("WARNING"), - }), - i(0), - }) - ), + s( + "admon", + fmt("{}: {}", { + c(1, { + t("NOTE"), + t("TIP"), + t("IMPORTANT"), + t("CAUTION"), + t("WARNING"), + }), + i(0), + }) + ), - s( - "admonB", - fmt( - [[ + s( + "admonB", + fmt( + [[ [{}] ==== {} ==== {} ]], - { - c(1, { - t("NOTE"), - t("TIP"), - t("IMPORTANT"), - t("CAUTION"), - t("WARNING"), - }), - i(2, "BODY"), - i(0), - } - ) - ), + { + c(1, { + t("NOTE"), + t("TIP"), + t("IMPORTANT"), + t("CAUTION"), + t("WARNING"), + }), + i(2, "BODY"), + i(0), + } + ) + ), } diff --git a/configs/nixvim/fiesta/modules/setups/treesitter.nix b/configs/nixvim/fiesta/modules/setups/treesitter.nix index e0632ad0..5edc17d3 100644 --- a/configs/nixvim/fiesta/modules/setups/treesitter.nix +++ b/configs/nixvim/fiesta/modules/setups/treesitter.nix @@ -60,10 +60,10 @@ in query = "@${query}.outer"; }; in - lib.mapAttrs' mkQueryMappings { - "function" = "f"; - "class" = "F"; - }; + lib.mapAttrs' mkQueryMappings { + "function" = "f"; + "class" = "F"; + }; }; move = lib.mkMerge ([{ enable = true; @@ -100,8 +100,9 @@ in # A set of bindings to be used for each jump direction. bindings: - let - mappings = builtins.map (motion: + let + mappings = builtins.map + (motion: let inherit (motion) region jumpDirection variant; jumpDirection' = lib.strings.toLower jumpDirection; @@ -115,19 +116,21 @@ in query = "@${query}.${variant}"; }; }; - }) motions; - in - acc ++ mappings; + }) + motions; + in + acc ++ mappings; in lib.foldlAttrs mkQueryMappings [ ] { - "function" = { previous = "M"; next = "m"; }; + "function" = { previous = "M"; next = "m"; }; "block" = { previous = "B"; next = "b"; }; "call" = { previous = "F"; next = "f"; }; "class" = { previous = "C"; next = "c"; }; "conditional" = { previous = "D"; next = "d"; }; "statement" = { previous = "S"; next = "s"; }; "loop" = { previous = "L"; next = "l"; }; - })); + } + )); select = { enable = true; lookahead = true; @@ -161,16 +164,17 @@ in let mappingsList = - builtins.map (variant: - let - prefixMap' = prefixMap.${variant}; - in - lib.nameValuePair "${prefixMap'.key}${binding}" { - query = "@${query}.${variant}"; - desc = prefixMap'.desc query; - }) [ "outer" "inner" ]; + builtins.map + (variant: + let + prefixMap' = prefixMap.${variant}; + in + lib.nameValuePair "${prefixMap'.key}${binding}" { + query = "@${query}.${variant}"; + desc = prefixMap'.desc query; + }) [ "outer" "inner" ]; in - lib.listToAttrs mappingsList; + lib.listToAttrs mappingsList; in lib.concatMapAttrs mkQueryMappings { "function" = "m"; @@ -203,29 +207,33 @@ in mkQueryMappings = acc: query: bindings: let - mappings = builtins.map (motion: - let - inherit (motion) jumpDirection variant; - jumpDirection' = lib.strings.toLower jumpDirection; - binding' = bindings.${jumpDirection'}; - bindingPrefix = motionMap."${variant}${jumpDirection}"; - in - { - "swap${jumpDirection}" = { - "${bindingPrefix}${binding'}" = { - desc = actionDesc variant jumpDirection' query; - query = "@${query}.${variant}"; + mappings = builtins.map + (motion: + let + inherit (motion) jumpDirection variant; + jumpDirection' = lib.strings.toLower jumpDirection; + binding' = bindings.${jumpDirection'}; + bindingPrefix = motionMap."${variant}${jumpDirection}"; + in + { + "swap${jumpDirection}" = { + "${bindingPrefix}${binding'}" = { + desc = actionDesc variant jumpDirection' query; + query = "@${query}.${variant}"; + }; }; - }; - }) motions; + }) + motions; in - acc ++ mappings; + acc ++ mappings; in - lib.foldlAttrs mkQueryMappings [ ] { - "function" = { next = "f"; previous = "F"; }; - "parameter" = { next = "a"; previous = "A"; }; - "conditional" = { next = "d"; previous = "D"; }; - })); + lib.foldlAttrs mkQueryMappings [ ] { + "function" = { next = "f"; previous = "F"; }; + "parameter" = { next = "a"; previous = "A"; }; + "conditional" = { next = "d"; previous = "D"; }; + } + ) + ); }; }; } diff --git a/modules/flake-parts/setups/home-manager.nix b/modules/flake-parts/setups/home-manager.nix index 7f26f892..d74ebcf0 100644 --- a/modules/flake-parts/setups/home-manager.nix +++ b/modules/flake-parts/setups/home-manager.nix @@ -7,7 +7,12 @@ let partsConfig = config; # A thin wrapper around the home-manager configuration function. - mkHome = { system, nixpkgsBranch ? "nixpkgs", homeManagerBranch ? "home-manager", extraModules ? [ ] }: + mkHome = + { system + , nixpkgsBranch ? "nixpkgs" + , homeManagerBranch ? "home-manager" + , extraModules ? [ ] + }: let pkgs = inputs.${nixpkgsBranch}.legacyPackages.${system}; in diff --git a/modules/flake-parts/setups/nixos.nix b/modules/flake-parts/setups/nixos.nix index 9aca5c36..2aa81c7a 100644 --- a/modules/flake-parts/setups/nixos.nix +++ b/modules/flake-parts/setups/nixos.nix @@ -41,7 +41,12 @@ let }; # A very very thin wrapper around `mkHost` to build with the given format. - mkImage = { system, nixpkgsBranch ? "nixpkgs", extraModules ? [ ], format ? "iso" }: + mkImage = + { system + , nixpkgsBranch ? "nixpkgs" + , extraModules ? [ ] + , format ? "iso" + }: let extraModules' = extraModules ++ [ inputs.nixos-generators.nixosModules.${format} ]; @@ -295,72 +300,71 @@ let }; }; - config = { - modules = [ - # Bring in the required modules. - inputs.${config.homeManagerBranch}.nixosModules.home-manager - ../../../configs/nixos/${name} + config.modules = [ + # Bring in the required modules. + inputs.${config.homeManagerBranch}.nixosModules.home-manager + ../../../configs/nixos/${name} - # Mapping the declarative home-manager users (if it has one) into NixOS - # users. - (lib.mkIf (config.homeManagerUsers.users != { }) - ( - let - setupConfig = config; - hasHomeManagerUsers = config.homeManagerUsers.users != { }; - inherit (config.homeManagerUsers) nixpkgsInstance; - isNixpkgs = state: hasHomeManagerUsers && nixpkgsInstance == state; - in - { config, lib, pkgs, ... }: { - config = lib.mkMerge [ - (lib.mkIf hasHomeManagerUsers { - users.users = - lib.mkMerge - (lib.mapAttrsToList - (name: hmUser: { ${name} = hmUser.userConfig; }) - setupConfig.homeManagerUsers.users); - - home-manager.users = lib.mkMerge + # Mapping the declarative home-manager users (if it has one) into NixOS + # users. + (lib.mkIf (config.homeManagerUsers.users != { }) + ( + let + setupConfig = config; + hasHomeManagerUsers = config.homeManagerUsers.users != { }; + inherit (config.homeManagerUsers) nixpkgsInstance; + isNixpkgs = state: hasHomeManagerUsers && nixpkgsInstance == state; + in + { config, lib, pkgs, ... }: { + config = lib.mkMerge [ + (lib.mkIf hasHomeManagerUsers { + users.users = + lib.mkMerge (lib.mapAttrsToList - (name: hmUser: { - ${name} = { lib, ... }: { - imports = - partsConfig.setups.home-manager.configs.${name}.modules - ++ hmUser.additionalModules; + (name: hmUser: { ${name} = hmUser.userConfig; }) + setupConfig.homeManagerUsers.users); + + home-manager.users = lib.mkMerge + (lib.mapAttrsToList + (name: hmUser: { + ${name} = { lib, ... }: { + imports = + partsConfig.setups.home-manager.configs.${name}.modules + ++ hmUser.additionalModules; + }; + }) + setupConfig.homeManagerUsers.users); + }) + + (lib.mkIf (isNixpkgs "global") { + home-manager.useGlobalPkgs = lib.mkForce true; + + # Disable all options that are going to be blocked once + # `home-manager.useGlobalPkgs` is used. + home-manager.users = + lib.mkMerge + (lib.mapAttrsToList + (name: _: { + ${name} = { + nixpkgs.overlays = lib.mkForce null; + nixpkgs.config = lib.mkForce null; }; }) setupConfig.homeManagerUsers.users); - }) - (lib.mkIf (isNixpkgs "global") { - home-manager.useGlobalPkgs = lib.mkForce true; + # Then apply all of the user overlays into the nixpkgs instance + # of the NixOS system. + nixpkgs.overlays = + let + hmUsersOverlays = + lib.mapAttrsToList + (name: _: + partsConfig.setups.home-manager.configs.${name}.overlays) + setupConfig.homeManagerUsers.users; - # Disable all options that are going to be blocked once - # `home-manager.useGlobalPkgs` is used. - home-manager.users = - lib.mkMerge - (lib.mapAttrsToList - (name: _: { - ${name} = { - nixpkgs.overlays = lib.mkForce null; - nixpkgs.config = lib.mkForce null; - }; - }) - setupConfig.homeManagerUsers.users); - - # Then apply all of the user overlays into the nixpkgs instance - # of the NixOS system. - nixpkgs.overlays = - let - hmUsersOverlays = - lib.mapAttrsToList - (name: _: - partsConfig.setups.home-manager.configs.${name}.overlays) - setupConfig.homeManagerUsers.users; - - overlays = lib.lists.flatten hmUsersOverlays; - in - # Most of the overlays are going to be imported from a + overlays = lib.lists.flatten hmUsersOverlays; + in + # Most of the overlays are going to be imported from a # variable anyways. This should massively reduce the step # needed for nixpkgs to do its thing. # @@ -368,64 +372,64 @@ let # overlay list is constructed. However, this is much more # preferable than letting a massive list with duplicated # overlays from different home-manager users to be applied. - lib.lists.unique overlays; - }) + lib.lists.unique overlays; + }) - (lib.mkIf (isNixpkgs "separate") { - home-manager.useGlobalPkgs = lib.mkForce false; - home-manager.users = - lib.mkMerge - (lib.mapAttrsToList - (name: _: { - ${name} = { - nixpkgs.overlays = - partsConfig.setups.home-manager.configs.${name}.overlays; - }; - }) - setupConfig.homeManagerUsers.users); - }) - ]; - })) + (lib.mkIf (isNixpkgs "separate") { + home-manager.useGlobalPkgs = lib.mkForce false; + home-manager.users = + lib.mkMerge + (lib.mapAttrsToList + (name: _: { + ${name} = { + nixpkgs.overlays = + partsConfig.setups.home-manager.configs.${name}.overlays; + }; + }) + setupConfig.homeManagerUsers.users); + }) + ]; + } + )) - # Next, we include the chosen NixVim configuration into NixOS. - (lib.mkIf (config.nixvim.instance != null) - ( - let - setupConfig = config; - in - { config, lib, ... }: { - imports = [ inputs.nixvim.nixosModules.nixvim ]; - - programs.nixvim = { - enable = true; - imports = - partsConfig.setups.nixvim.${config.nixvim.instance}.modules - ++ partsConfig.setups.nixvim.sharedModules - ++ setupConfig.nixvim.additionalModules; - }; - } - )) - - # Setting up the typical configuration. + # Next, we include the chosen NixVim configuration into NixOS. + (lib.mkIf (config.nixvim.instance != null) ( let setupConfig = config; in { config, lib, ... }: { - config = lib.mkMerge [ - { - nixpkgs.overlays = setupConfig.overlays; - networking.hostName = lib.mkDefault setupConfig.hostname; - } + imports = [ inputs.nixvim.nixosModules.nixvim ]; - (lib.mkIf (setupConfig.domain != null) { - networking.domain = lib.mkDefault setupConfig.domain; - }) - ]; + programs.nixvim = { + enable = true; + imports = + partsConfig.setups.nixvim.${config.nixvim.instance}.modules + ++ partsConfig.setups.nixvim.sharedModules + ++ setupConfig.nixvim.additionalModules; + }; } - ) - ]; - }; + )) + + # Setting up the typical configuration. + ( + let + setupConfig = config; + in + { config, lib, ... }: { + config = lib.mkMerge [ + { + nixpkgs.overlays = setupConfig.overlays; + networking.hostName = lib.mkDefault setupConfig.hostname; + } + + (lib.mkIf (setupConfig.domain != null) { + networking.domain = lib.mkDefault setupConfig.domain; + }) + ]; + } + ) + ]; }; in { diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index ad32dc3e..abdb3825 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -11,7 +11,7 @@ let cfg = config.setups.nixvim; nixvimModules = ../../nixvim; - mkNixvimConfig = { system, pkgs, modules ? [] }: + mkNixvimConfig = { system, pkgs, modules ? [ ] }: inputs.nixvim.legacyPackages.${system}.makeNixvimWithModule { inherit pkgs; module = { @@ -24,7 +24,7 @@ let modulesOption = lib.mkOption { type = with lib.types; listOf raw; - default = []; + default = [ ]; }; modulesOption' = configEnv: modulesOption // { description = '' @@ -84,7 +84,7 @@ in configType ]; }); - default = {}; + default = { }; description = '' A set of NixVim configurations to be integrated into the declarative setups configuration. Each of them will be available as part of @@ -101,14 +101,15 @@ in standaloneConfigModules = modulesOption' "standalone configuration"; }; - config = lib.mkIf (cfg.configs != {}) { + config = lib.mkIf (cfg.configs != { }) { setups.nixvim.sharedModules = [ nixvimModules ]; perSystem = { system, config, lib, ... }: ( let validConfigs = lib.filterAttrs - (_: metadata: lib.elem system metadata.systems) cfg.configs; + (_: metadata: lib.elem system metadata.systems) + cfg.configs; nixvimConfigurations = let @@ -135,7 +136,7 @@ in cfg.sharedModules ++ cfg.standaloneConfigModules ++ metadata.modules - ++ [ { package = neovimPkg; } ]; + ++ [{ package = neovimPkg; }]; }); in builtins.map mkNixvimConfig' neovimPackages; @@ -157,8 +158,8 @@ in lib.nameValuePair "nixvim-check-${name}" (inputs.nixvim.lib.${system}.check.mkTestDerivationFromNvim { - inherit nvim; - name = "${name} configuration"; + inherit nvim; + name = "${name} configuration"; })) nixvimConfigurations; } diff --git a/modules/nixos/profiles/desktop/fonts.nix b/modules/nixos/profiles/desktop/fonts.nix index 236ceacf..af88c16f 100644 --- a/modules/nixos/profiles/desktop/fonts.nix +++ b/modules/nixos/profiles/desktop/fonts.nix @@ -4,7 +4,7 @@ { fonts.enableDefaultPackages = lib.mkDefault true; fonts.fontDir.enable = lib.mkDefault true; - + fonts.fontconfig = { enable = lib.mkDefault true; includeUserConf = true; diff --git a/modules/nixos/programs/gnome-session/submodules/component-type.nix b/modules/nixos/programs/gnome-session/submodules/component-type.nix index 40f6e700..a0b663bf 100644 --- a/modules/nixos/programs/gnome-session/submodules/component-type.nix +++ b/modules/nixos/programs/gnome-session/submodules/component-type.nix @@ -142,7 +142,7 @@ in socketOptions unitConfig ]); - }; + }; pathUnit = optionalSystemdUnitOption "path" "paths" // { type = @@ -205,8 +205,9 @@ in TODO: Is `Type=notify` a good default? * `Service.Type=` is obviously not included since not all desktop components are the same either. Some of them could be a D-Bus service, - some of them are oneshots, etc. Not to mention, this is already implied - to be `Type=simple` by systemd anyways which is enough for most cases. + some of them are oneshots, etc. Though, it might be better to have this + as an explicit option set by the user instead of setting `Type=notify` as + a default. TODO: A good balance for this value, probably? * `Service.OOMScoreAdjust=` have different values for different diff --git a/modules/nixos/programs/sessiond/default.nix b/modules/nixos/programs/sessiond/default.nix index 11b35208..9a27a560 100644 --- a/modules/nixos/programs/sessiond/default.nix +++ b/modules/nixos/programs/sessiond/default.nix @@ -45,7 +45,7 @@ let inherit (utils.systemdUtils.lib) pathToUnit serviceToUnit targetToUnit timerToUnit socketToUnit; - sessionComponents = + sessionComponents = lib.foldlAttrs (acc: name: component: acc // { @@ -61,10 +61,10 @@ let { } session.components; in - sessionComponents // { - "${name}.service" = serviceToUnit name session.serviceUnit; - "${name}.target" = targetToUnit name session.targetUnit; - } + sessionComponents // { + "${name}.service" = serviceToUnit name session.serviceUnit; + "${name}.target" = targetToUnit name session.targetUnit; + } ) cfg.sessions; in @@ -173,12 +173,10 @@ in environment. ::: {.tip} - While you can make identifiers in any way, it is - encouraged to stick to a naming scheme. Here's two common ways to name - a desktop environment. - - * Reverse DNS-like scheme (e.g., `com.example.MoseyBranch`). - * Kebab-case (e.g., `mosey-branch`). + While you can make identifiers in any way, it is encouraged to stick to + a naming scheme. The recommended method is a reverse DNS-like scheme + preferably with a domain name you own (e.g., + `com.example.MoseyBranch`). ::: ''; default = { }; diff --git a/modules/nixvim/keyunmaps.nix b/modules/nixvim/keyunmaps.nix index ae54de24..a76e554c 100644 --- a/modules/nixvim/keyunmaps.nix +++ b/modules/nixvim/keyunmaps.nix @@ -3,7 +3,7 @@ let cfg = config.keyunmaps; - keyunmapOption = { config, lib, ...}: { + keyunmapOption = { config, lib, ... }: { options = { key = lib.mkOption { type = lib.types.str; diff --git a/modules/nixvim/plugins/firenvim.nix b/modules/nixvim/plugins/firenvim.nix index 9326a81e..6e9fbacb 100644 --- a/modules/nixvim/plugins/firenvim.nix +++ b/modules/nixvim/plugins/firenvim.nix @@ -9,7 +9,7 @@ in package = helpers.mkPackageOption "firenvim" pkgs.vimPlugins.firenvim; extraConfig = lib.mkOption { type = with lib.types; attrsOf anything; - default = {}; + default = { }; example = { globalSettings = { alt = "all"; }; localSettings = {