chore: reformat codebase

This commit is contained in:
Gabriel Arazas 2024-02-02 12:40:16 +08:00
parent 2f389641cd
commit 44090d6257
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
12 changed files with 345 additions and 327 deletions

View File

@ -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;
}

View File

@ -101,7 +101,8 @@ in
# A set of bindings to be used for each jump direction.
bindings:
let
mappings = builtins.map (motion:
mappings = builtins.map
(motion:
let
inherit (motion) region jumpDirection variant;
jumpDirection' = lib.strings.toLower jumpDirection;
@ -115,7 +116,8 @@ in
query = "@${query}.${variant}";
};
};
}) motions;
})
motions;
in
acc ++ mappings;
in
@ -127,7 +129,8 @@ in
"conditional" = { previous = "D"; next = "d"; };
"statement" = { previous = "S"; next = "s"; };
"loop" = { previous = "L"; next = "l"; };
}));
}
));
select = {
enable = true;
lookahead = true;
@ -161,7 +164,8 @@ in
let
mappingsList =
builtins.map (variant:
builtins.map
(variant:
let
prefixMap' = prefixMap.${variant};
in
@ -203,7 +207,8 @@ in
mkQueryMappings = acc: query: bindings:
let
mappings = builtins.map (motion:
mappings = builtins.map
(motion:
let
inherit (motion) jumpDirection variant;
jumpDirection' = lib.strings.toLower jumpDirection;
@ -217,7 +222,8 @@ in
query = "@${query}.${variant}";
};
};
}) motions;
})
motions;
in
acc ++ mappings;
in
@ -225,7 +231,9 @@ in
"function" = { next = "f"; previous = "F"; };
"parameter" = { next = "a"; previous = "A"; };
"conditional" = { next = "d"; previous = "D"; };
}));
}
)
);
};
};
}

View File

@ -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

View File

@ -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,8 +300,7 @@ let
};
};
config = {
modules = [
config.modules = [
# Bring in the required modules.
inputs.${config.homeManagerBranch}.nixosModules.home-manager
../../../configs/nixos/${name}
@ -385,7 +389,8 @@ let
setupConfig.homeManagerUsers.users);
})
];
}))
}
))
# Next, we include the chosen NixVim configuration into NixOS.
(lib.mkIf (config.nixvim.instance != null)
@ -426,7 +431,6 @@ let
)
];
};
};
in
{
options.setups.nixos = {

View File

@ -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;

View File

@ -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

View File

@ -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 = { };

View File

@ -3,7 +3,7 @@
let
cfg = config.keyunmaps;
keyunmapOption = { config, lib, ...}: {
keyunmapOption = { config, lib, ... }: {
options = {
key = lib.mkOption {
type = lib.types.str;

View File

@ -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 = {