mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
treewide: use inherit for attribute assignments
This change converts redundant attribute assignments of the form `a = a;` or `a = someSet.a;` into cleaner `inherit` statements. This reduces verbosity and follows common Nix style for bringing attributes into scope. Statix Codes: W03 (manual_inherit), W04 (manual_inherit_from) Also include statix and the rule in our configuration.
This commit is contained in:
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -22,7 +22,7 @@ Also make sure to read the guidelines found at
|
||||
- [ ] Change is backwards compatible.
|
||||
|
||||
- [ ] Code formatted with `nix fmt` or
|
||||
`nix-shell -p treefmt nixfmt deadnix keep-sorted nixf-diagnose --run treefmt`.
|
||||
`nix-shell -A dev --run treefmt`.
|
||||
|
||||
- [ ] Code tested through `nix run .#tests -- test-all` or
|
||||
`nix-shell --pure tests -A run.all`.
|
||||
|
||||
@@ -153,11 +153,15 @@ let
|
||||
config = lib.listToAttrs (map poisonAttr (lib.filter (n: n != "_module") (lib.attrNames options)));
|
||||
};
|
||||
|
||||
options =
|
||||
(docsLib.evalModules {
|
||||
modules = modules ++ [ poisonModule ];
|
||||
class = "homeManager";
|
||||
}).options;
|
||||
inherit
|
||||
(
|
||||
(docsLib.evalModules {
|
||||
modules = modules ++ [ poisonModule ];
|
||||
class = "homeManager";
|
||||
})
|
||||
)
|
||||
options
|
||||
;
|
||||
in
|
||||
pkgs.buildPackages.nixosOptionsDoc (
|
||||
{
|
||||
|
||||
@@ -75,8 +75,7 @@
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
docs = import ./default.nix {
|
||||
inherit pkgs lib;
|
||||
release = releaseInfo.release;
|
||||
isReleaseBranch = releaseInfo.isReleaseBranch;
|
||||
inherit (releaseInfo) isReleaseBranch release;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
legacyPackages = forAllPkgs (
|
||||
pkgs:
|
||||
let
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
in
|
||||
(buildTests system)
|
||||
// (integrationTestPackages system)
|
||||
|
||||
@@ -68,7 +68,7 @@ in
|
||||
{
|
||||
meta = {
|
||||
numUnread = length newsUnread;
|
||||
display = newsJson.display;
|
||||
inherit (newsJson) display;
|
||||
ids = concatStringsSep "\n" (map (e: e.id) newsJson.entries);
|
||||
};
|
||||
news = {
|
||||
|
||||
@@ -6,6 +6,7 @@ mkShell {
|
||||
name = "devShell";
|
||||
packages = [
|
||||
pkgs.coreutils
|
||||
pkgs.statix
|
||||
formatter
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,7 +1,20 @@
|
||||
{ pkgs }:
|
||||
let
|
||||
statixFormatter = pkgs.writeShellApplication {
|
||||
name = "treefmt-statix";
|
||||
text = ''
|
||||
set -eu
|
||||
|
||||
for file in "$@"; do
|
||||
${pkgs.statix}/bin/statix fix --config ${../statix.toml} -- "$file"
|
||||
done
|
||||
'';
|
||||
};
|
||||
in
|
||||
pkgs.treefmt.withConfig {
|
||||
runtimeInputs = with pkgs; [
|
||||
nixfmt
|
||||
statixFormatter
|
||||
deadnix
|
||||
keep-sorted
|
||||
nixf-diagnose
|
||||
|
||||
@@ -10,8 +10,7 @@ let
|
||||
env = import ../modules {
|
||||
configuration =
|
||||
if confAttr == "" || confAttr == null then confPath else (import confPath).${confAttr};
|
||||
pkgs = pkgs;
|
||||
check = check;
|
||||
inherit check pkgs;
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ lib }:
|
||||
{
|
||||
hm = (import ../modules/lib/stdlib-extended.nix lib).hm;
|
||||
inherit ((import ../modules/lib/stdlib-extended.nix lib)) hm;
|
||||
|
||||
homeManagerConfiguration =
|
||||
{
|
||||
|
||||
@@ -127,7 +127,7 @@ let
|
||||
};
|
||||
|
||||
config = {
|
||||
name = name;
|
||||
inherit name;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ let
|
||||
};
|
||||
|
||||
config = {
|
||||
name = name;
|
||||
inherit name;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -535,7 +535,7 @@ let
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
name = name;
|
||||
inherit name;
|
||||
maildir = lib.mkOptionDefault { path = "${name}"; };
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ let
|
||||
in
|
||||
module
|
||||
// {
|
||||
activationPackage = module.config.home.activationPackage;
|
||||
inherit (module.config.home) activationPackage;
|
||||
|
||||
# For backwards compatibility. Please use activationPackage instead.
|
||||
activation-script = module.config.home.activationPackage;
|
||||
|
||||
@@ -30,14 +30,16 @@ let
|
||||
in
|
||||
sortedFiles;
|
||||
|
||||
fileOverlapResolution = config.home.fileOverlapResolution;
|
||||
inherit (config.home) fileOverlapResolution homeDirectory;
|
||||
|
||||
homeDirectory = config.home.homeDirectory;
|
||||
|
||||
fileType =
|
||||
(import lib/file-type.nix {
|
||||
inherit homeDirectory lib pkgs;
|
||||
}).fileType;
|
||||
inherit
|
||||
(
|
||||
(import lib/file-type.nix {
|
||||
inherit homeDirectory lib pkgs;
|
||||
})
|
||||
)
|
||||
fileType
|
||||
;
|
||||
|
||||
sourceStorePath =
|
||||
file:
|
||||
|
||||
@@ -89,7 +89,7 @@ in
|
||||
dagBefore = dag: name: builtins.attrNames (filterAttrs (n: v: builtins.elem name v.before) dag);
|
||||
normalizedDag = mapAttrs (n: v: {
|
||||
name = n;
|
||||
data = v.data;
|
||||
inherit (v) data;
|
||||
after = v.after ++ dagBefore dag n;
|
||||
}) dag;
|
||||
before = a: b: builtins.elem a.name b.after;
|
||||
|
||||
@@ -67,7 +67,7 @@ rec {
|
||||
description = "DAG of ${elemType.description}";
|
||||
inherit (attrEquivalent) check merge emptyValue;
|
||||
getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "<name>" ]);
|
||||
getSubModules = elemType.getSubModules;
|
||||
inherit (elemType) getSubModules;
|
||||
substSubModules = m: dagOf (elemType.substSubModules m);
|
||||
functor = (defaultFunctor name) // {
|
||||
wrapped = elemType;
|
||||
|
||||
@@ -116,7 +116,7 @@ rec {
|
||||
+ " ${showFiles (getFiles defs)}."
|
||||
)
|
||||
else if gvar.isArray sharedDefType && allChecked then
|
||||
gvar.mkValue ((types.listOf gvariant).merge loc (map (d: d // { value = d.value.value; }) vdefs))
|
||||
gvar.mkValue ((types.listOf gvariant).merge loc (map (d: d // { inherit (d.value) value; }) vdefs))
|
||||
// {
|
||||
type = sharedDefType;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ in
|
||||
enable = lib.mkEnableOption "EditorConfig home configuration file";
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = iniFormat.type;
|
||||
inherit (iniFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to {file}`$HOME/.editorconfig`.
|
||||
|
||||
@@ -13,7 +13,7 @@ let
|
||||
|
||||
cfg = config.fonts.fontconfig;
|
||||
|
||||
profileDirectory = config.home.profileDirectory;
|
||||
inherit (config.home) profileDirectory;
|
||||
|
||||
fontConfigFileType = lib.types.submodule (
|
||||
{ name, ... }:
|
||||
|
||||
@@ -349,7 +349,7 @@ in
|
||||
{
|
||||
option = "qt.platformTheme.name";
|
||||
name = deprecateKde6 cfg.platformTheme.name "qt.platformTheme.name";
|
||||
package = cfg.platformTheme.package;
|
||||
inherit (cfg.platformTheme) package;
|
||||
};
|
||||
|
||||
# Necessary because home.sessionVariables doesn't support mkIf
|
||||
|
||||
@@ -15,11 +15,15 @@ let
|
||||
|
||||
cfg = config.xdg;
|
||||
|
||||
fileType =
|
||||
(import ../lib/file-type.nix {
|
||||
inherit (config.home) homeDirectory;
|
||||
inherit lib pkgs;
|
||||
}).fileType;
|
||||
inherit
|
||||
(
|
||||
(import ../lib/file-type.nix {
|
||||
inherit (config.home) homeDirectory;
|
||||
inherit lib pkgs;
|
||||
})
|
||||
)
|
||||
fileType
|
||||
;
|
||||
|
||||
defaultCacheHome = "${config.home.homeDirectory}/.cache";
|
||||
defaultConfigHome = "${config.home.homeDirectory}/.config";
|
||||
|
||||
@@ -216,7 +216,7 @@ in
|
||||
};
|
||||
|
||||
launchd.agents.aerospace = {
|
||||
enable = cfg.launchd.enable;
|
||||
inherit (cfg.launchd) enable;
|
||||
config = {
|
||||
Program = "${cfg.package}/Applications/AeroSpace.app/Contents/MacOS/AeroSpace";
|
||||
KeepAlive = cfg.launchd.keepAlive;
|
||||
|
||||
@@ -34,7 +34,7 @@ in
|
||||
};
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -93,7 +93,7 @@ let
|
||||
[ "[[${name}]]" ]
|
||||
++ mapAttrsToList (n: v: n + "=" + v) (
|
||||
{
|
||||
address = address;
|
||||
inherit address;
|
||||
realname = realName;
|
||||
sendmail_command = optionalString (alot.sendMailCommand != null) alot.sendMailCommand;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "aria2" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = keyValueFormat.type;
|
||||
inherit (keyValueFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Options to add to {file}`aria2.conf` file.
|
||||
|
||||
@@ -18,7 +18,7 @@ in
|
||||
package = lib.mkPackageOption pkgs [ "python3Packages" "aria2p" ] { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = {
|
||||
key_bindings = {
|
||||
|
||||
@@ -108,7 +108,7 @@ in
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = jsonFormat.type;
|
||||
inherit (jsonFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ let
|
||||
"*"
|
||||
]
|
||||
);
|
||||
getSubModules = elemType.getSubModules;
|
||||
inherit (elemType) getSubModules;
|
||||
substSubModules = mod: matrixOf n m (elemType.substSubModules mod);
|
||||
functor = (lib.defaultFunctor name) // {
|
||||
wrapped = elemType;
|
||||
|
||||
@@ -26,7 +26,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "bacon" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = settingsFormat.type;
|
||||
inherit (settingsFormat) type;
|
||||
default = { };
|
||||
example = {
|
||||
jobs.default = {
|
||||
|
||||
@@ -61,7 +61,7 @@ in
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
@@ -101,8 +101,7 @@ in
|
||||
|
||||
(mkIf (cfg.mpdIntegration.enableStats || cfg.mpdIntegration.enableUpdate) {
|
||||
programs.beets.settings.mpd = {
|
||||
host = cfg.mpdIntegration.host;
|
||||
port = cfg.mpdIntegration.port;
|
||||
inherit (cfg.mpdIntegration) host port;
|
||||
};
|
||||
})
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "bluetuith" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = jsonFormat.type;
|
||||
inherit (jsonFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ let
|
||||
};
|
||||
|
||||
extraConfigOption = mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
description = "Extra settings.";
|
||||
};
|
||||
@@ -248,8 +248,8 @@ let
|
||||
removeNullValues (
|
||||
{
|
||||
source_directories = config.location.sourceDirectories;
|
||||
patterns = config.location.patterns;
|
||||
repositories = config.location.repositories;
|
||||
inherit (config.location) patterns repositories;
|
||||
inherit (config.consistency) checks;
|
||||
encryption_passcommand = config.storage.encryptionPasscommand;
|
||||
keep_within = config.retention.keepWithin;
|
||||
keep_secondly = config.retention.keepSecondly;
|
||||
@@ -259,7 +259,6 @@ let
|
||||
keep_weekly = config.retention.keepWeekly;
|
||||
keep_monthly = config.retention.keepMonthly;
|
||||
keep_yearly = config.retention.keepYearly;
|
||||
checks = config.consistency.checks;
|
||||
}
|
||||
// config.location.extraConfig
|
||||
// config.storage.extraConfig
|
||||
|
||||
@@ -23,7 +23,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "bottom" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
|
||||
@@ -111,7 +111,7 @@ in
|
||||
];
|
||||
|
||||
home.file = lib.mkIf (cfg.rules != [ ]) {
|
||||
"${configPath}".source = settingsFormat.generate "boxxy-config.yaml" { rules = cfg.rules; };
|
||||
"${configPath}".source = settingsFormat.generate "boxxy-config.yaml" { inherit (cfg) rules; };
|
||||
};
|
||||
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
@@ -18,7 +18,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "bun" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "cava" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = iniFmt.type;
|
||||
inherit (iniFmt) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ in
|
||||
|
||||
settings = {
|
||||
general = mkOption {
|
||||
type = jsonFmt.type;
|
||||
inherit (jsonFmt) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
@@ -57,7 +57,7 @@ in
|
||||
};
|
||||
|
||||
cava = mkOption {
|
||||
type = iniFmt.type;
|
||||
inherit (iniFmt) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -253,7 +253,7 @@ let
|
||||
}
|
||||
// lib.optionalAttrs (cfg.plasmaSupport or false) {
|
||||
plasmaSupport = true;
|
||||
kdePackages = pkgs.kdePackages;
|
||||
inherit (pkgs) kdePackages;
|
||||
}
|
||||
)
|
||||
else
|
||||
|
||||
@@ -18,7 +18,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "clock-rs" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
description = "The configuration file to be used for clock-rs";
|
||||
example = lib.literalExpression ''
|
||||
|
||||
@@ -75,7 +75,7 @@ in
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = jsonFormat.type;
|
||||
inherit (jsonFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "earthly" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to ~/.earthly/config.yml file.
|
||||
|
||||
@@ -54,7 +54,7 @@ in
|
||||
eclipse = cfg.package;
|
||||
jvmArgs =
|
||||
cfg.jvmArgs ++ lib.optional cfg.enableLombok "-javaagent:${pkgs.lombok}/share/java/lombok.jar";
|
||||
plugins = cfg.plugins;
|
||||
inherit (cfg) plugins;
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ in
|
||||
enable = mkEnableOption "element-desktop";
|
||||
package = mkPackageOption pkgs "element-desktop" { nullable = true; };
|
||||
settings = mkOption {
|
||||
type = formatter.type;
|
||||
inherit (formatter) type;
|
||||
default = { };
|
||||
example = ''
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ let
|
||||
in
|
||||
epkgs.overrideScope cfg.overrides;
|
||||
|
||||
emacsWithPackages = emacsPackages.emacsWithPackages;
|
||||
inherit (emacsPackages) emacsWithPackages;
|
||||
|
||||
extraPackages =
|
||||
epkgs:
|
||||
|
||||
@@ -107,7 +107,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "eza" { nullable = true; };
|
||||
|
||||
theme = mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Written to {file}`$XDG_CONFIG_HOME/eza/theme.yml`
|
||||
|
||||
@@ -30,7 +30,7 @@ in
|
||||
package = mkPackageOption pkgs "fastfetch" { nullable = true; };
|
||||
|
||||
settings = mkOption {
|
||||
type = jsonFormat.type;
|
||||
inherit (jsonFormat) type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
|
||||
@@ -113,9 +113,7 @@ let
|
||||
let
|
||||
containerToIdentity = _: container: {
|
||||
userContextId = container.id;
|
||||
name = container.name;
|
||||
icon = container.icon;
|
||||
color = container.color;
|
||||
inherit (container) color icon name;
|
||||
public = true;
|
||||
};
|
||||
in
|
||||
@@ -178,7 +176,7 @@ let
|
||||
let
|
||||
# The configuration expected by the Firefox wrapper.
|
||||
fcfg = {
|
||||
enableGnomeExtensions = cfg.enableGnomeExtensions;
|
||||
inherit (cfg) enableGnomeExtensions;
|
||||
};
|
||||
|
||||
# A bit of hackery to force a config into the wrapper.
|
||||
@@ -1062,14 +1060,13 @@ in
|
||||
};
|
||||
|
||||
"${cfg.profilesPath}/${profile.path}/search.json.mozlz4" = mkIf (profile.search.enable) {
|
||||
enable = profile.search.enable;
|
||||
force = profile.search.force;
|
||||
inherit (profile.search) enable force;
|
||||
source = profile.search.file;
|
||||
};
|
||||
|
||||
"${cfg.profilesPath}/${profile.path}/handlers.json" = mkIf (profile.handlers.enable) {
|
||||
source = profile.handlers.configFile;
|
||||
force = profile.handlers.force;
|
||||
inherit (profile.handlers) force;
|
||||
};
|
||||
|
||||
"${cfg.profilesPath}/${profile.path}/extensions" = mkIf (profile.extensions.packages != [ ]) {
|
||||
|
||||
@@ -182,7 +182,7 @@ in
|
||||
};
|
||||
|
||||
finalSettings = lib.mkOption {
|
||||
type = jsonFormat.type;
|
||||
inherit (jsonFormat) type;
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
default = {
|
||||
|
||||
@@ -49,7 +49,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "firefoxpwa" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = jsonFmt.type;
|
||||
inherit (jsonFmt) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Settings to be written to the configuration file. See
|
||||
@@ -147,7 +147,7 @@ in
|
||||
};
|
||||
};
|
||||
settings = lib.mkOption {
|
||||
type = jsonFmt.type;
|
||||
inherit (jsonFmt) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Settings for this site. See
|
||||
@@ -166,12 +166,12 @@ in
|
||||
ulid = name;
|
||||
profile = profile.name;
|
||||
config = {
|
||||
name = config.name;
|
||||
inherit (config) name;
|
||||
document_url = config.url;
|
||||
manifest_url = config.manifestUrl;
|
||||
};
|
||||
manifest = {
|
||||
name = config.name;
|
||||
inherit (config) name;
|
||||
start_url = config.url;
|
||||
};
|
||||
};
|
||||
@@ -181,7 +181,7 @@ in
|
||||
);
|
||||
};
|
||||
settings = lib.mkOption {
|
||||
type = jsonFmt.type;
|
||||
inherit (jsonFmt) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Settings for this profile. See
|
||||
@@ -193,7 +193,7 @@ in
|
||||
|
||||
config.settings = {
|
||||
ulid = name;
|
||||
name = config.name;
|
||||
inherit (config) name;
|
||||
sites = builtins.attrNames config.sites;
|
||||
};
|
||||
}
|
||||
@@ -239,7 +239,7 @@ in
|
||||
lib.mapAttrsToList (name: site: {
|
||||
"FFPWA-${name}" = lib.mkIf site.desktopEntry.enable {
|
||||
inherit (site.desktopEntry) icon categories;
|
||||
name = site.settings.manifest.name;
|
||||
inherit (site.settings.manifest) name;
|
||||
exec = "firefoxpwa site launch ${name} --protocol %u";
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ in
|
||||
server.enable = lib.mkEnableOption "Foot terminal server";
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = iniFormat.type;
|
||||
inherit (iniFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
|
||||
@@ -29,7 +29,7 @@ in
|
||||
package = mkPackageOption pkgs "fuzzel" { nullable = true; };
|
||||
|
||||
settings = mkOption {
|
||||
type = iniFormat.type;
|
||||
inherit (iniFormat) type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "gallery-dl" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = jsonFormat.type;
|
||||
inherit (jsonFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "gh-dash" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "git-cliff" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -257,7 +257,7 @@ let
|
||||
else
|
||||
{
|
||||
use-system-font = false;
|
||||
font = pcfg.font;
|
||||
inherit (pcfg) font;
|
||||
}
|
||||
)
|
||||
// (
|
||||
@@ -271,7 +271,7 @@ let
|
||||
use-theme-colors = false;
|
||||
foreground-color = pcfg.colors.foregroundColor;
|
||||
background-color = pcfg.colors.backgroundColor;
|
||||
palette = pcfg.colors.palette;
|
||||
inherit (pcfg.colors) palette;
|
||||
}
|
||||
// lib.optionalAttrs (pcfg.allowBold != null) {
|
||||
allow-bold = pcfg.allowBold;
|
||||
|
||||
@@ -17,7 +17,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "havoc" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = iniFormat.type;
|
||||
inherit (iniFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
|
||||
@@ -55,7 +55,7 @@ in
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ let
|
||||
|
||||
# Needed for notmuch config, because the DB is here, and not in each
|
||||
# account's dir
|
||||
maildirBasePath = config.accounts.email.maildirBasePath;
|
||||
inherit (config.accounts.email) maildirBasePath;
|
||||
|
||||
# make encryption config based on the given home-manager email
|
||||
# account TLS config
|
||||
@@ -43,10 +43,10 @@ let
|
||||
display-name = account.realName;
|
||||
default = account.primary;
|
||||
folder.aliases = {
|
||||
inbox = account.folders.inbox;
|
||||
sent = account.folders.sent;
|
||||
drafts = account.folders.drafts;
|
||||
trash = account.folders.trash;
|
||||
inherit (account.folders) inbox;
|
||||
inherit (account.folders) sent;
|
||||
inherit (account.folders) drafts;
|
||||
inherit (account.folders) trash;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "hyfetch" { };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = jsonFormat.type;
|
||||
inherit (jsonFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "hyprpanel" { };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = jsonFormat.type;
|
||||
inherit (jsonFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
bar.battery.label = true;
|
||||
|
||||
@@ -22,7 +22,7 @@ in
|
||||
enable = mkEnableOption "i3bar-river";
|
||||
package = mkPackageOption pkgs "i3bar-river" { nullable = true; };
|
||||
settings = mkOption {
|
||||
type = formatter.type;
|
||||
inherit (formatter) type;
|
||||
default = { };
|
||||
example = {
|
||||
background = "#282828ff";
|
||||
|
||||
@@ -26,7 +26,7 @@ in
|
||||
options = {
|
||||
|
||||
blocks = mkOption {
|
||||
type = settingsFormat.type;
|
||||
inherit (settingsFormat) type;
|
||||
default = [
|
||||
{ block = "cpu"; }
|
||||
{
|
||||
@@ -93,7 +93,7 @@ in
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = settingsFormat.type;
|
||||
inherit (settingsFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Any extra options to add to i3status-rust
|
||||
@@ -259,14 +259,14 @@ in
|
||||
theme =
|
||||
if lib.versionAtLeast cfg.package.version "0.30.0" then
|
||||
{
|
||||
theme = cfgBar.theme;
|
||||
inherit (cfgBar) theme;
|
||||
}
|
||||
else
|
||||
cfgBar.theme;
|
||||
icons =
|
||||
if lib.versionAtLeast cfg.package.version "0.30.0" then
|
||||
{
|
||||
icons = cfgBar.icons;
|
||||
inherit (cfgBar) icons;
|
||||
}
|
||||
else
|
||||
cfgBar.icons;
|
||||
|
||||
@@ -20,7 +20,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "iamb" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ in
|
||||
enable = lib.mkEnableOption "infat";
|
||||
package = lib.mkPackageOption pkgs "infat" { nullable = true; };
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ in
|
||||
package = mkPackageOption pkgs "inori" { nullable = true; };
|
||||
|
||||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "joshuto" { };
|
||||
|
||||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
@@ -31,7 +31,7 @@ in
|
||||
};
|
||||
|
||||
keymap = mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
@@ -43,7 +43,7 @@ in
|
||||
};
|
||||
|
||||
mimetype = mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
@@ -55,7 +55,7 @@ in
|
||||
};
|
||||
|
||||
theme = mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
|
||||
@@ -16,7 +16,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "jqp" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
example = {
|
||||
theme = {
|
||||
|
||||
@@ -52,7 +52,7 @@ in
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = {
|
||||
user = {
|
||||
|
||||
@@ -43,7 +43,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "k9s" { nullable = true; };
|
||||
|
||||
settings = mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to {file}`$XDG_CONFIG_HOME/k9s/config.yaml` (linux)
|
||||
@@ -80,7 +80,7 @@ in
|
||||
};
|
||||
|
||||
aliases = mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Aliases written to {file}`$XDG_CONFIG_HOME/k9s/aliases.yaml` (linux)
|
||||
@@ -96,7 +96,7 @@ in
|
||||
};
|
||||
|
||||
hotKeys = mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Hotkeys written to {file}`$XDG_CONFIG_HOME/k9s/hotkeys.yaml` (linux)
|
||||
@@ -115,7 +115,7 @@ in
|
||||
};
|
||||
|
||||
plugins = mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Plugins written to {file}`$XDG_CONFIG_HOME/k9s/plugins.yaml (linux)`
|
||||
@@ -147,7 +147,7 @@ in
|
||||
};
|
||||
|
||||
views = mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Resource column views written to
|
||||
|
||||
@@ -543,7 +543,7 @@ let
|
||||
|
||||
kakouneWithPlugins = pkgs.wrapKakoune cfg.package {
|
||||
configure = {
|
||||
plugins = cfg.plugins;
|
||||
inherit (cfg) plugins;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "keepassxc" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = iniFormat.type;
|
||||
inherit (iniFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -213,7 +213,7 @@ in
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = iniFormat.type;
|
||||
inherit (iniFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ in
|
||||
enable = mkEnableOption "kickoff";
|
||||
package = mkPackageOption pkgs "kickoff" { nullable = true; };
|
||||
settings = mkOption {
|
||||
type = formatter.type;
|
||||
inherit (formatter) type;
|
||||
default = { };
|
||||
example = ''
|
||||
padding = 100;
|
||||
|
||||
@@ -25,7 +25,7 @@ in
|
||||
package = mkPackageOption pkgs "kraft" { nullable = true; };
|
||||
|
||||
settings = mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to {file}`$XDG_CONFIG_HOME/kraftkit/config.yaml`.
|
||||
|
||||
@@ -31,7 +31,7 @@ in
|
||||
enableZshIntegration = lib.hm.shell.mkZshIntegrationOption { inherit config; };
|
||||
|
||||
settings = mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
kubectl = lib.getExe pkgs.kubectl
|
||||
|
||||
@@ -30,7 +30,7 @@ in
|
||||
enableZshIntegration = lib.hm.shell.mkZshIntegrationOption { inherit config; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
example = {
|
||||
kind = "SwitchConfig";
|
||||
|
||||
@@ -30,7 +30,7 @@ let
|
||||
'';
|
||||
};
|
||||
settings = mkOption {
|
||||
type = settingsFormat.type;
|
||||
inherit (settingsFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to {file}`$XDG_CONFIG_HOME/lapce/settings.toml`.
|
||||
@@ -115,7 +115,7 @@ let
|
||||
'';
|
||||
};
|
||||
keymaps = mkOption {
|
||||
type = settingsFormat.type;
|
||||
inherit (settingsFormat) type;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Keymaps written to {file}`$XDG_CONFIG_HOME/lapce/keymaps.toml`.
|
||||
@@ -231,7 +231,7 @@ in
|
||||
{
|
||||
configFile = {
|
||||
"${dir}/settings.toml".source = settingsFormat.generate "settings.toml" cfg.settings;
|
||||
"${dir}/keymaps.toml".source = settingsFormat.generate "keymaps.toml" { keymaps = cfg.keymaps; };
|
||||
"${dir}/keymaps.toml".source = settingsFormat.generate "keymaps.toml" { inherit (cfg) keymaps; };
|
||||
};
|
||||
dataFile."${dir}/plugins".source = pluginsFromRegistry cfg.plugins;
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "lazydocker" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = {
|
||||
commandTemplates.dockerCompose = "docker compose"; # Lazydocker uses docker-compose by default which will not work
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "lazygit" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
defaultText = lib.literalExpression "{ }";
|
||||
example = lib.literalExpression ''
|
||||
|
||||
@@ -23,7 +23,7 @@ in
|
||||
enable = mkEnableOption "lazysql";
|
||||
package = mkPackageOption pkgs "lazysql" { nullable = true; };
|
||||
settings = mkOption {
|
||||
type = formatter.type;
|
||||
inherit (formatter) type;
|
||||
default = { };
|
||||
example = { };
|
||||
description = ''
|
||||
|
||||
@@ -17,7 +17,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "looking-glass-client" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = settingsFormat.type;
|
||||
inherit (settingsFormat) type;
|
||||
default = { };
|
||||
description = "looking-glass-client settings.";
|
||||
example = lib.literalExpression ''
|
||||
|
||||
@@ -35,7 +35,7 @@ in
|
||||
enableZshIntegration = lib.hm.shell.mkZshIntegrationOption { inherit config; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
example = {
|
||||
date = "relative";
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
let
|
||||
cfg = config.programs.mc;
|
||||
type = (pkgs.formats.ini { }).type;
|
||||
inherit ((pkgs.formats.ini { })) type;
|
||||
in
|
||||
{
|
||||
options.programs.mc = {
|
||||
|
||||
@@ -73,7 +73,7 @@ in
|
||||
mcflyFzfPackage = lib.mkPackageOption pkgs "mcfly-fzf" { };
|
||||
|
||||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ let
|
||||
|
||||
mkSmtp = account: {
|
||||
hostname = account.smtp.host;
|
||||
port = account.smtp.port;
|
||||
inherit (account.smtp) port;
|
||||
auth = {
|
||||
type = "auto";
|
||||
username = account.userName;
|
||||
|
||||
@@ -43,7 +43,7 @@ in
|
||||
};
|
||||
|
||||
iniContent = mkOption {
|
||||
type = iniFormat.type;
|
||||
inherit (iniFormat) type;
|
||||
internal = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "micro" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = jsonFormat.type;
|
||||
inherit (jsonFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "mistral-vibe" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = settingsFormat.type;
|
||||
inherit (settingsFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "mods" { };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
example = ''
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "mr" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = iniFormat.type;
|
||||
inherit (iniFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to {file}`$HOME/.mrconfig`
|
||||
|
||||
@@ -22,7 +22,7 @@ let
|
||||
[ "account ${name}" ]
|
||||
++ lib.mapAttrsToList (n: v: n + " " + v) (
|
||||
{
|
||||
host = smtp.host;
|
||||
inherit (smtp) host;
|
||||
from = address;
|
||||
auth = "on";
|
||||
user = userName;
|
||||
|
||||
@@ -20,7 +20,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "mypy" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = iniFormat.type;
|
||||
inherit (iniFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "navi" { };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "ncspot" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -326,7 +326,7 @@ let
|
||||
notmuchSection =
|
||||
account:
|
||||
let
|
||||
virtualMailboxes = account.notmuch.neomutt.virtualMailboxes;
|
||||
inherit (account.notmuch.neomutt) virtualMailboxes;
|
||||
in
|
||||
''
|
||||
# notmuch section
|
||||
|
||||
@@ -20,7 +20,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "neovide" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = settingsFormat.type;
|
||||
inherit (settingsFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "nheko" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = iniFmt.type;
|
||||
inherit (iniFmt) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ in
|
||||
enable = lib.mkEnableOption "nix-init";
|
||||
package = lib.mkPackageOption pkgs "nix-init" { nullable = true; };
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "nix-search-tv" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = jsonFormat.type;
|
||||
inherit (jsonFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to {file}`$XDG_CONFIG_HOME/nix-search-tv/config.json`.
|
||||
|
||||
@@ -41,8 +41,7 @@ let
|
||||
};
|
||||
|
||||
new = {
|
||||
ignore = cfg.new.ignore;
|
||||
tags = cfg.new.tags;
|
||||
inherit (cfg.new) ignore tags;
|
||||
};
|
||||
|
||||
user =
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user