mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 01:19:32 +08:00
treewide: nixf-diagnose cleanup
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
@@ -110,8 +110,7 @@ let
|
|||||||
in
|
in
|
||||||
pkgs.buildPackages.nixosOptionsDoc (
|
pkgs.buildPackages.nixosOptionsDoc (
|
||||||
{
|
{
|
||||||
options =
|
options = if includeModuleSystemOptions then options else removeAttrs options [ "_module" ];
|
||||||
if includeModuleSystemOptions then options else builtins.removeAttrs options [ "_module" ];
|
|
||||||
transformOptions =
|
transformOptions =
|
||||||
opt:
|
opt:
|
||||||
opt
|
opt
|
||||||
@@ -133,7 +132,7 @@ let
|
|||||||
) opt.declarations;
|
) opt.declarations;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// builtins.removeAttrs args [
|
// removeAttrs args [
|
||||||
"modules"
|
"modules"
|
||||||
"includeModuleSystemOptions"
|
"includeModuleSystemOptions"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ let
|
|||||||
modules = [ configuration ] ++ hmModules;
|
modules = [ configuration ] ++ hmModules;
|
||||||
class = "homeManager";
|
class = "homeManager";
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
modulesPath = builtins.toString ./.;
|
modulesPath = toString ./.;
|
||||||
}
|
}
|
||||||
// extraSpecialArgs;
|
// extraSpecialArgs;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ in
|
|||||||
++ lib.optionals (cfg.quickPhraseFiles != { }) [
|
++ lib.optionals (cfg.quickPhraseFiles != { }) [
|
||||||
(pkgs.linkFarm "quickPhraseFiles" (
|
(pkgs.linkFarm "quickPhraseFiles" (
|
||||||
lib.mapAttrs' (
|
lib.mapAttrs' (
|
||||||
name: value: lib.nameValuePair ("share/fcitx5/data/quickphrase.d/${name}.mb") value
|
name: value: lib.nameValuePair "share/fcitx5/data/quickphrase.d/${name}.mb" value
|
||||||
) cfg.quickPhraseFiles
|
) cfg.quickPhraseFiles
|
||||||
))
|
))
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -13,12 +13,9 @@ let
|
|||||||
mergeDefinitions
|
mergeDefinitions
|
||||||
;
|
;
|
||||||
inherit (builtins)
|
inherit (builtins)
|
||||||
map
|
|
||||||
filter
|
filter
|
||||||
length
|
length
|
||||||
deepSeq
|
deepSeq
|
||||||
throw
|
|
||||||
toString
|
|
||||||
concatLists
|
concatLists
|
||||||
;
|
;
|
||||||
inherit (lib.options) showDefs;
|
inherit (lib.options) showDefs;
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ in
|
|||||||
else if builtins.isString value then
|
else if builtins.isString value then
|
||||||
"<const>${value}</const>"
|
"<const>${value}</const>"
|
||||||
else
|
else
|
||||||
throw ("expected bool or string but got ${builtins.typeOf value}: ${toString value}");
|
throw "expected bool or string but got ${builtins.typeOf value}: ${toString value}";
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
<match target="font">
|
<match target="font">
|
||||||
@@ -338,7 +338,7 @@ in
|
|||||||
|
|
||||||
xdg.configFile = lib.mapAttrs' (
|
xdg.configFile = lib.mapAttrs' (
|
||||||
name: config:
|
name: config:
|
||||||
lib.nameValuePair "fontconfig/conf.d/${builtins.toString config.priority}-hm-${config.label}.conf" {
|
lib.nameValuePair "fontconfig/conf.d/${toString config.priority}-hm-${config.label}.conf" {
|
||||||
inherit (config) enable text;
|
inherit (config) enable text;
|
||||||
source = lib.mkIf (config.source != null) config.source;
|
source = lib.mkIf (config.source != null) config.source;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ let
|
|||||||
fileList ++ subdirFiles;
|
fileList ++ subdirFiles;
|
||||||
|
|
||||||
newsFiles = collectNixFiles ./news;
|
newsFiles = collectNixFiles ./news;
|
||||||
newsEntries = builtins.map (
|
newsEntries = map (
|
||||||
newsFile:
|
newsFile:
|
||||||
let
|
let
|
||||||
imported = import newsFile;
|
imported = import newsFile;
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ in
|
|||||||
desktop: terminals:
|
desktop: terminals:
|
||||||
# Map desktop name such as GNOME to `.config/gnome-xdg-terminals.list`,
|
# Map desktop name such as GNOME to `.config/gnome-xdg-terminals.list`,
|
||||||
# default to `.config/xdg-terminals.list`.
|
# default to `.config/xdg-terminals.list`.
|
||||||
lib.nameValuePair (
|
lib.nameValuePair "${
|
||||||
"${if desktop == "default" then "" else "${lib.toLower desktop}-"}xdg-terminals.list"
|
if desktop == "default" then "" else "${lib.toLower desktop}-"
|
||||||
) { text = lib.concatLines terminals; }
|
}xdg-terminals.list" { text = lib.concatLines terminals; }
|
||||||
) cfg.settings;
|
) cfg.settings;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
stylesets = mkOption {
|
stylesets = mkOption {
|
||||||
type = with types; attrsOf (sectionsOrLines);
|
type = with types; attrsOf sectionsOrLines;
|
||||||
default = { };
|
default = { };
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
{ default = { ui = { "tab.selected.reverse" = "toggle"; }; }; };
|
{ default = { ui = { "tab.selected.reverse" = "toggle"; }; }; };
|
||||||
|
|||||||
@@ -6,9 +6,7 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (builtins)
|
inherit (builtins)
|
||||||
map
|
|
||||||
toJSON
|
toJSON
|
||||||
toString
|
|
||||||
substring
|
substring
|
||||||
stringLength
|
stringLength
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ in
|
|||||||
) supportedBrowsers;
|
) supportedBrowsers;
|
||||||
|
|
||||||
config = lib.mkMerge (
|
config = lib.mkMerge (
|
||||||
builtins.map (browser: browserConfig browser config.programs.${browser}) (
|
map (browser: browserConfig browser config.programs.${browser}) (
|
||||||
builtins.attrNames supportedBrowsers
|
builtins.attrNames supportedBrowsers
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ let
|
|||||||
|
|
||||||
generateConfig = lib.generators.toKeyValue {
|
generateConfig = lib.generators.toKeyValue {
|
||||||
mkKeyValue =
|
mkKeyValue =
|
||||||
name: value:
|
name: value: if lib.isString value then ''${name}="${value}"'' else "${name}=${toString value}";
|
||||||
if lib.isString value then ''${name}="${value}"'' else "${name}=${builtins.toString value}";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
iniFormat = pkgs.formats.ini { listsAsDuplicateKeys = true; };
|
iniFormat = pkgs.formats.ini { listsAsDuplicateKeys = true; };
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ in
|
|||||||
{
|
{
|
||||||
name = path;
|
name = path;
|
||||||
value = {
|
value = {
|
||||||
source = jsonFormat.generate "config.json" (ctx);
|
source = jsonFormat.generate "config.json" ctx;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
) cfg.contexts;
|
) cfg.contexts;
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ in
|
|||||||
|
|
||||||
order = mkOption {
|
order = mkOption {
|
||||||
type = with types; uniq (listOf str);
|
type = with types; uniq (listOf str);
|
||||||
apply = builtins.map migrateEngineNameToIdV7;
|
apply = map migrateEngineNameToIdV7;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
example = [
|
example = [
|
||||||
"ddg"
|
"ddg"
|
||||||
|
|||||||
@@ -627,7 +627,7 @@ in
|
|||||||
package
|
package
|
||||||
]
|
]
|
||||||
++ lib.filter (p: p != null) (
|
++ lib.filter (p: p != null) (
|
||||||
builtins.map (outName: package.${outName} or null) config.home.extraOutputsToInstall
|
map (outName: package.${outName} or null) config.home.extraOutputsToInstall
|
||||||
);
|
);
|
||||||
nativeBuildInputs = [ pkgs.python3 ];
|
nativeBuildInputs = [ pkgs.python3 ];
|
||||||
buildInputs = [ cfg.package ];
|
buildInputs = [ cfg.package ];
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ in
|
|||||||
|
|
||||||
xdg.dataFile."gh/extensions" = mkIf (cfg.extensions != [ ]) {
|
xdg.dataFile."gh/extensions" = mkIf (cfg.extensions != [ ]) {
|
||||||
source = pkgs.linkFarm "gh-extensions" (
|
source = pkgs.linkFarm "gh-extensions" (
|
||||||
builtins.map (p: {
|
map (p: {
|
||||||
name = p.pname;
|
name = p.pname;
|
||||||
path = "${p}/bin";
|
path = "${p}/bin";
|
||||||
}) cfg.extensions
|
}) cfg.extensions
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ let
|
|||||||
iniFormat = pkgs.formats.ini { };
|
iniFormat = pkgs.formats.ini { };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
meta.maintainers = with lib.maintainers; [ ];
|
meta.maintainers = [ ];
|
||||||
|
|
||||||
options.programs.havoc = {
|
options.programs.havoc = {
|
||||||
enable = lib.mkEnableOption "Havoc terminal";
|
enable = lib.mkEnableOption "Havoc terminal";
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ in
|
|||||||
"mako"
|
"mako"
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
builtins.map (name: {
|
map (name: {
|
||||||
assertion = !config.services.${name}.enable;
|
assertion = !config.services.${name}.enable;
|
||||||
message = ''
|
message = ''
|
||||||
Only one notification daemon can be enabled at once. You have enabled
|
Only one notification daemon can be enabled at once. You have enabled
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ in
|
|||||||
in
|
in
|
||||||
lib.hm.dag.entryAfter [ "linkGeneration" ] ''
|
lib.hm.dag.entryAfter [ "linkGeneration" ] ''
|
||||||
# Ensure that settings.json exists.
|
# Ensure that settings.json exists.
|
||||||
mkdir -p ${builtins.dirOf configPath}
|
mkdir -p ${dirOf configPath}
|
||||||
touch ${configPath}
|
touch ${configPath}
|
||||||
# Config has to be written to temporary variable because jq cannot edit files in place.
|
# Config has to be written to temporary variable because jq cannot edit files in place.
|
||||||
config="$(jq -s '.[0] + .[1]' ${configPath} ${newConfig})"
|
config="$(jq -s '.[0] + .[1]' ${configPath} ${newConfig})"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ let
|
|||||||
renderSettings =
|
renderSettings =
|
||||||
with lib.generators;
|
with lib.generators;
|
||||||
toINI {
|
toINI {
|
||||||
mkKeyValue = mkKeyValueDefault rec {
|
mkKeyValue = mkKeyValueDefault {
|
||||||
mkValueString =
|
mkValueString =
|
||||||
v:
|
v:
|
||||||
if lib.isList v then
|
if lib.isList v then
|
||||||
@@ -139,7 +139,7 @@ in
|
|||||||
let
|
let
|
||||||
makePath =
|
makePath =
|
||||||
baseDir: subDir:
|
baseDir: subDir:
|
||||||
builtins.toString (
|
toString (
|
||||||
/.
|
/.
|
||||||
+ lib.concatStringsSep "/" [
|
+ lib.concatStringsSep "/" [
|
||||||
baseDir
|
baseDir
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ let
|
|||||||
plugins:
|
plugins:
|
||||||
pkgs.linkFarm "lapce-plugins" (
|
pkgs.linkFarm "lapce-plugins" (
|
||||||
builtins.listToAttrs (
|
builtins.listToAttrs (
|
||||||
builtins.map (
|
map (
|
||||||
{
|
{
|
||||||
author,
|
author,
|
||||||
name,
|
name,
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ in
|
|||||||
package = lib.mkPackageOption pkgs "meli" { };
|
package = lib.mkPackageOption pkgs "meli" { };
|
||||||
|
|
||||||
includes = mkOption {
|
includes = mkOption {
|
||||||
type = with types; listOf (str);
|
type = with types; listOf str;
|
||||||
description = "Paths of the various meli configuration files to include.";
|
description = "Paths of the various meli configuration files to include.";
|
||||||
default = [ ];
|
default = [ ];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ let
|
|||||||
|
|
||||||
renderSettings = settings: lib.concatStringsSep ";" (lib.mapAttrsToList renderSetting settings);
|
renderSettings = settings: lib.concatStringsSep ";" (lib.mapAttrsToList renderSetting settings);
|
||||||
|
|
||||||
pluginModule = types.submodule ({
|
pluginModule = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
src = mkOption {
|
src = mkOption {
|
||||||
type = with types; nullOr path;
|
type = with types; nullOr path;
|
||||||
@@ -46,7 +46,7 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
meta.maintainers = with lib.maintainers; [ thiagokokada ];
|
meta.maintainers = with lib.maintainers; [ thiagokokada ];
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ in
|
|||||||
cssSnippets =
|
cssSnippets =
|
||||||
let
|
let
|
||||||
checkCssPath = path: lib.filesystem.pathIsRegularFile path && lib.strings.hasSuffix ".css" path;
|
checkCssPath = path: lib.filesystem.pathIsRegularFile path && lib.strings.hasSuffix ".css" path;
|
||||||
toCssName = path: lib.strings.removeSuffix ".css" (builtins.baseNameOf path);
|
toCssName = path: lib.strings.removeSuffix ".css" (baseNameOf path);
|
||||||
cssSnippetsOptions =
|
cssSnippetsOptions =
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
@@ -423,7 +423,7 @@ in
|
|||||||
source = (pkgs.formats.json { }).generate "appearance.json" (
|
source = (pkgs.formats.json { }).generate "appearance.json" (
|
||||||
vault.settings.appearance
|
vault.settings.appearance
|
||||||
// {
|
// {
|
||||||
enabledCssSnippets = builtins.map (snippet: snippet.name) enabledCssSnippets;
|
enabledCssSnippets = map (snippet: snippet.name) enabledCssSnippets;
|
||||||
}
|
}
|
||||||
// lib.attrsets.optionalAttrs (activeTheme != null) {
|
// lib.attrsets.optionalAttrs (activeTheme != null) {
|
||||||
cssTheme = getManifest activeTheme;
|
cssTheme = getManifest activeTheme;
|
||||||
@@ -438,14 +438,14 @@ in
|
|||||||
{
|
{
|
||||||
name = "${vault.target}/.obsidian/core-plugins.json";
|
name = "${vault.target}/.obsidian/core-plugins.json";
|
||||||
value.source = (pkgs.formats.json { }).generate "core-plugins.json" (
|
value.source = (pkgs.formats.json { }).generate "core-plugins.json" (
|
||||||
builtins.map (plugin: plugin.name) vault.settings.corePlugins
|
map (plugin: plugin.name) vault.settings.corePlugins
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "${vault.target}/.obsidian/core-plugins-migration.json";
|
name = "${vault.target}/.obsidian/core-plugins-migration.json";
|
||||||
value.source = (pkgs.formats.json { }).generate "core-plugins-migration.json" (
|
value.source = (pkgs.formats.json { }).generate "core-plugins-migration.json" (
|
||||||
builtins.listToAttrs (
|
builtins.listToAttrs (
|
||||||
builtins.map (name: {
|
map (name: {
|
||||||
inherit name;
|
inherit name;
|
||||||
value = builtins.any (plugin: name == plugin.name && plugin.enable) vault.settings.corePlugins;
|
value = builtins.any (plugin: name == plugin.name && plugin.enable) vault.settings.corePlugins;
|
||||||
}) corePlugins
|
}) corePlugins
|
||||||
@@ -453,7 +453,7 @@ in
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
++ builtins.map (plugin: {
|
++ map (plugin: {
|
||||||
name = "${vault.target}/.obsidian/${plugin.name}.json";
|
name = "${vault.target}/.obsidian/${plugin.name}.json";
|
||||||
value.source = (pkgs.formats.json { }).generate "${plugin.name}.json" plugin.settings;
|
value.source = (pkgs.formats.json { }).generate "${plugin.name}.json" plugin.settings;
|
||||||
}) (builtins.filter (plugin: plugin.settings != { }) vault.settings.corePlugins);
|
}) (builtins.filter (plugin: plugin.settings != { }) vault.settings.corePlugins);
|
||||||
@@ -464,25 +464,25 @@ in
|
|||||||
{
|
{
|
||||||
name = "${vault.target}/.obsidian/community-plugins.json";
|
name = "${vault.target}/.obsidian/community-plugins.json";
|
||||||
value.source = (pkgs.formats.json { }).generate "community-plugins.json" (
|
value.source = (pkgs.formats.json { }).generate "community-plugins.json" (
|
||||||
builtins.map getManifest (builtins.filter (plugin: plugin.enable) vault.settings.communityPlugins)
|
map getManifest (builtins.filter (plugin: plugin.enable) vault.settings.communityPlugins)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
++ builtins.map (plugin: {
|
++ map (plugin: {
|
||||||
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}";
|
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}";
|
||||||
value = {
|
value = {
|
||||||
source = plugin.pkg;
|
source = plugin.pkg;
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
}) vault.settings.communityPlugins
|
}) vault.settings.communityPlugins
|
||||||
++ builtins.map (plugin: {
|
++ map (plugin: {
|
||||||
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}/data.json";
|
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}/data.json";
|
||||||
value.source = (pkgs.formats.json { }).generate "data.json" plugin.settings;
|
value.source = (pkgs.formats.json { }).generate "data.json" plugin.settings;
|
||||||
}) (builtins.filter (plugin: plugin.settings != { }) vault.settings.communityPlugins);
|
}) (builtins.filter (plugin: plugin.settings != { }) vault.settings.communityPlugins);
|
||||||
|
|
||||||
mkCssSnippets =
|
mkCssSnippets =
|
||||||
vault:
|
vault:
|
||||||
builtins.map (snippet: {
|
map (snippet: {
|
||||||
name = "${vault.target}/.obsidian/snippets/${snippet.name}.css";
|
name = "${vault.target}/.obsidian/snippets/${snippet.name}.css";
|
||||||
value =
|
value =
|
||||||
if snippet.source != null then
|
if snippet.source != null then
|
||||||
@@ -497,7 +497,7 @@ in
|
|||||||
|
|
||||||
mkThemes =
|
mkThemes =
|
||||||
vault:
|
vault:
|
||||||
builtins.map (theme: {
|
map (theme: {
|
||||||
name = "${vault.target}/.obsidian/themes/${getManifest theme}";
|
name = "${vault.target}/.obsidian/themes/${getManifest theme}";
|
||||||
value.source = theme.pkg;
|
value.source = theme.pkg;
|
||||||
}) vault.settings.themes;
|
}) vault.settings.themes;
|
||||||
@@ -509,7 +509,7 @@ in
|
|||||||
|
|
||||||
mkExtraFiles =
|
mkExtraFiles =
|
||||||
vault:
|
vault:
|
||||||
builtins.map (file: {
|
map (file: {
|
||||||
name = "${vault.target}/.obsidian/${file.target}";
|
name = "${vault.target}/.obsidian/${file.target}";
|
||||||
value =
|
value =
|
||||||
if file.source != null then
|
if file.source != null then
|
||||||
@@ -524,7 +524,7 @@ in
|
|||||||
in
|
in
|
||||||
builtins.listToAttrs (
|
builtins.listToAttrs (
|
||||||
lib.lists.flatten (
|
lib.lists.flatten (
|
||||||
builtins.map (vault: [
|
map (vault: [
|
||||||
(mkApp vault)
|
(mkApp vault)
|
||||||
(mkAppearance vault)
|
(mkAppearance vault)
|
||||||
(mkCorePlugins vault)
|
(mkCorePlugins vault)
|
||||||
@@ -540,7 +540,7 @@ in
|
|||||||
|
|
||||||
xdg.configFile."obsidian/obsidian.json".source = (pkgs.formats.json { }).generate "obsidian.json" {
|
xdg.configFile."obsidian/obsidian.json".source = (pkgs.formats.json { }).generate "obsidian.json" {
|
||||||
vaults = builtins.listToAttrs (
|
vaults = builtins.listToAttrs (
|
||||||
builtins.map (vault: {
|
map (vault: {
|
||||||
name = builtins.hashString "md5" vault.target;
|
name = builtins.hashString "md5" vault.target;
|
||||||
value = {
|
value = {
|
||||||
path = "${config.home.homeDirectory}/${vault.target}";
|
path = "${config.home.homeDirectory}/${vault.target}";
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ let
|
|||||||
valueToString =
|
valueToString =
|
||||||
value:
|
value:
|
||||||
if builtins.isList value then
|
if builtins.isList value then
|
||||||
builtins.concatStringsSep "," (builtins.map valueToString value)
|
builtins.concatStringsSep "," (map valueToString value)
|
||||||
else if builtins.isAttrs value then
|
else if builtins.isAttrs value then
|
||||||
valueToString (lib.mapAttrsToList (key: val: "${valueToString key}=${valueToString val}") value)
|
valueToString (lib.mapAttrsToList (key: val: "${valueToString key}=${valueToString val}") value)
|
||||||
else
|
else
|
||||||
builtins.toString value;
|
toString value;
|
||||||
|
|
||||||
modulesArgument = optionalString (cfg.modules != null) " -modules ${valueToString cfg.modules}";
|
modulesArgument = optionalString (cfg.modules != null) " -modules ${valueToString cfg.modules}";
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ let
|
|||||||
else if builtins.isList v then
|
else if builtins.isList v then
|
||||||
"[${concatStringsSep ", " (map pythonize v)}]"
|
"[${concatStringsSep ", " (map pythonize v)}]"
|
||||||
else
|
else
|
||||||
builtins.toString v;
|
toString v;
|
||||||
|
|
||||||
formatDictLine =
|
formatDictLine =
|
||||||
o: n: v:
|
o: n: v:
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ in
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
assertion = cfg.uri.web-rad.enable -> cfg.uri.web-rad.browser != null;
|
assertion = cfg.uri.web-rad.enable -> cfg.uri.web-rad.browser != null;
|
||||||
message = "Could not detect preferred browser. Please set `${builtins.toString opt.uri.web-rad.browser}`.";
|
message = "Could not detect preferred browser. Please set `${toString opt.uri.web-rad.browser}`.";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
assertion =
|
assertion =
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ in
|
|||||||
|
|
||||||
home.file.".rbenv/plugins" = mkIf (cfg.plugins != [ ]) {
|
home.file.".rbenv/plugins" = mkIf (cfg.plugins != [ ]) {
|
||||||
source = pkgs.linkFarm "rbenv-plugins" (
|
source = pkgs.linkFarm "rbenv-plugins" (
|
||||||
builtins.map (p: {
|
map (p: {
|
||||||
name = p.name;
|
name = p.name;
|
||||||
path = p.src;
|
path = p.src;
|
||||||
}) cfg.plugins
|
}) cfg.plugins
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ let
|
|||||||
modes = map (mode: if isString mode then mode else "${mode.name}:${mode.path}") cfg.modes;
|
modes = map (mode: if isString mode then mode else "${mode.name}:${mode.path}") cfg.modes;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
meta.maintainers = with lib.maintainers; [ ];
|
meta.maintainers = [ ];
|
||||||
|
|
||||||
options.programs.rofi = {
|
options.programs.rofi = {
|
||||||
enable = lib.mkEnableOption "Rofi: A window switcher, application launcher and dmenu replacement";
|
enable = lib.mkEnableOption "Rofi: A window switcher, application launcher and dmenu replacement";
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ in
|
|||||||
prjConf =
|
prjConf =
|
||||||
lib.attrsets.mapAttrs' (
|
lib.attrsets.mapAttrs' (
|
||||||
name: value:
|
name: value:
|
||||||
(lib.attrsets.nameValuePair (if name == "beforeStart" then "before_start" else name) (value))
|
(lib.attrsets.nameValuePair (if name == "beforeStart" then "before_start" else name) value)
|
||||||
) v
|
) v
|
||||||
// {
|
// {
|
||||||
session = k;
|
session = k;
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ let
|
|||||||
if (builtins.isBool value) then
|
if (builtins.isBool value) then
|
||||||
if value then name else ""
|
if value then name else ""
|
||||||
else if (builtins.isList value) then
|
else if (builtins.isList value) then
|
||||||
lib.concatStringsSep "\n" (builtins.map (item: "${name}=${builtins.toString item}") value)
|
lib.concatStringsSep "\n" (map (item: "${name}=${toString item}") value)
|
||||||
else
|
else
|
||||||
"${name}=${builtins.toString value}"
|
"${name}=${toString value}"
|
||||||
) settings
|
) settings
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -85,8 +85,7 @@ in
|
|||||||
if v == false then
|
if v == false then
|
||||||
""
|
""
|
||||||
else
|
else
|
||||||
(if v == true then n else n + "=" + (if builtins.isPath v then "${v}" else builtins.toString v))
|
(if v == true then n else n + "=" + (if builtins.isPath v then "${v}" else toString v)) + "\n"
|
||||||
+ "\n"
|
|
||||||
) cfg.settings
|
) cfg.settings
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -183,14 +183,12 @@ let
|
|||||||
3;
|
3;
|
||||||
"mail.smtpserver.smtp_${id}.username" = account.userName;
|
"mail.smtpserver.smtp_${id}.username" = account.userName;
|
||||||
}
|
}
|
||||||
// builtins.foldl' (a: b: a // b) { } (
|
// builtins.foldl' (a: b: a // b) { } (map (address: toThunderbirdSMTP account address) addresses)
|
||||||
builtins.map (address: toThunderbirdSMTP account address) addresses
|
|
||||||
)
|
|
||||||
// optionalAttrs (account.smtp != null && account.primary) {
|
// optionalAttrs (account.smtp != null && account.primary) {
|
||||||
"mail.smtp.defaultserver" = "smtp_${id}";
|
"mail.smtp.defaultserver" = "smtp_${id}";
|
||||||
}
|
}
|
||||||
// builtins.foldl' (a: b: a // b) { } (
|
// builtins.foldl' (a: b: a // b) { } (
|
||||||
builtins.map (address: toThunderbirdIdentity account address) addresses
|
map (address: toThunderbirdIdentity account address) addresses
|
||||||
)
|
)
|
||||||
// account.thunderbird.settings id;
|
// account.thunderbird.settings id;
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ in
|
|||||||
let
|
let
|
||||||
conf =
|
conf =
|
||||||
optional (cfg.host != null) ''set -g tmate-server-host "${cfg.host}"''
|
optional (cfg.host != null) ''set -g tmate-server-host "${cfg.host}"''
|
||||||
++ optional (cfg.port != null) "set -g tmate-server-port ${builtins.toString cfg.port}"
|
++ optional (cfg.port != null) "set -g tmate-server-port ${toString cfg.port}"
|
||||||
++ optional (
|
++ optional (
|
||||||
cfg.dsaFingerprint != null
|
cfg.dsaFingerprint != null
|
||||||
) ''set -g tmate-server-ed25519-fingerprint "${cfg.dsaFingerprint}"''
|
) ''set -g tmate-server-ed25519-fingerprint "${cfg.dsaFingerprint}"''
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ in
|
|||||||
|
|
||||||
dataFile =
|
dataFile =
|
||||||
builtins.listToAttrs (
|
builtins.listToAttrs (
|
||||||
builtins.map (item: {
|
map (item: {
|
||||||
name = "vicinae/extensions/${item.name}";
|
name = "vicinae/extensions/${item.name}";
|
||||||
value.source = item;
|
value.source = item;
|
||||||
}) cfg.extensions
|
}) cfg.extensions
|
||||||
@@ -263,7 +263,7 @@ in
|
|||||||
KillMode = "process";
|
KillMode = "process";
|
||||||
EnvironmentFile = lib.mkIf (!versionPost0_17) (
|
EnvironmentFile = lib.mkIf (!versionPost0_17) (
|
||||||
pkgs.writeText "vicinae-env" ''
|
pkgs.writeText "vicinae-env" ''
|
||||||
USE_LAYER_SHELL=${if cfg.useLayerShell then builtins.toString 1 else builtins.toString 0}
|
USE_LAYER_SHELL=${if cfg.useLayerShell then toString 1 else toString 0}
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -517,7 +517,7 @@ in
|
|||||||
else
|
else
|
||||||
{ };
|
{ };
|
||||||
# Merge MCP servers: transformed servers + user servers, with user servers taking precedence
|
# Merge MCP servers: transformed servers + user servers, with user servers taking precedence
|
||||||
mergedServers = transformedMcpServers // ((v.userMcp.servers or { }));
|
mergedServers = transformedMcpServers // (v.userMcp.servers or { });
|
||||||
# Merge all MCP config
|
# Merge all MCP config
|
||||||
mergedMcpConfig =
|
mergedMcpConfig =
|
||||||
v.userMcp // (lib.optionalAttrs (mergedServers != { }) { servers = mergedServers; });
|
v.userMcp // (lib.optionalAttrs (mergedServers != { }) { servers = mergedServers; });
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ in
|
|||||||
{
|
{
|
||||||
assertions = [
|
assertions = [
|
||||||
(lib.hm.assertions.assertPlatform "programs.waybar" pkgs lib.platforms.linux)
|
(lib.hm.assertions.assertPlatform "programs.waybar" pkgs lib.platforms.linux)
|
||||||
({
|
{
|
||||||
assertion =
|
assertion =
|
||||||
if lib.versionAtLeast config.home.stateVersion "22.05" then
|
if lib.versionAtLeast config.home.stateVersion "22.05" then
|
||||||
all (x: !hasAttr "modules" x || x.modules == null) settings
|
all (x: !hasAttr "modules" x || x.modules == null) settings
|
||||||
@@ -311,7 +311,7 @@ in
|
|||||||
The `programs.waybar.settings.[].modules` option has been removed.
|
The `programs.waybar.settings.[].modules` option has been removed.
|
||||||
It is now possible to declare modules in the configuration without nesting them under the `modules` option.
|
It is now possible to declare modules in the configuration without nesting them under the `modules` option.
|
||||||
'';
|
'';
|
||||||
})
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ in
|
|||||||
xdg.configFile."waylogout/config" = lib.mkIf (cfg.settings != { }) {
|
xdg.configFile."waylogout/config" = lib.mkIf (cfg.settings != { }) {
|
||||||
text = lib.concatStrings (
|
text = lib.concatStrings (
|
||||||
lib.mapAttrsToList (
|
lib.mapAttrsToList (
|
||||||
n: v: if v == false then "" else (if v == true then n else n + "=" + builtins.toString v) + "\n"
|
n: v: if v == false then "" else (if v == true then n else n + "=" + toString v) + "\n"
|
||||||
) cfg.settings
|
) cfg.settings
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ let
|
|||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
builtins.dirOf value;
|
dirOf value;
|
||||||
|
|
||||||
makePluginSearchPath = p: "${p}/?/init.lua;${p}/?.lua";
|
makePluginSearchPath = p: "${p}/?/init.lua;${p}/?.lua";
|
||||||
|
|
||||||
@@ -46,9 +46,9 @@ let
|
|||||||
searchPaths = map makePluginSearchPath wrappedPlugins;
|
searchPaths = map makePluginSearchPath wrappedPlugins;
|
||||||
pluginSearchPath = lib.concatStringsSep ";" searchPaths;
|
pluginSearchPath = lib.concatStringsSep ";" searchPaths;
|
||||||
in
|
in
|
||||||
(''
|
''
|
||||||
package.path = "${pluginSearchPath};" .. package.path
|
package.path = "${pluginSearchPath};" .. package.path
|
||||||
'')
|
''
|
||||||
else
|
else
|
||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Environment = with pkgs; "PATH=${makeBinPath cfg.extraPackages}";
|
Environment = "PATH=${makeBinPath cfg.extraPackages}";
|
||||||
ExecStart = "${cfg.package}/bin/fusuma";
|
ExecStart = "${cfg.package}/bin/fusuma";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ in
|
|||||||
packages = [ cfg.package ];
|
packages = [ cfg.package ];
|
||||||
sessionVariables = mkIf cfg.enableSessionVariables (
|
sessionVariables = mkIf cfg.enableSessionVariables (
|
||||||
{
|
{
|
||||||
MPD_PORT = builtins.toString cfg.network.port;
|
MPD_PORT = toString cfg.network.port;
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (cfg.network.listenAddress != "any") {
|
// lib.optionalAttrs (cfg.network.listenAddress != "any") {
|
||||||
MPD_HOST = cfg.network.listenAddress;
|
MPD_HOST = cfg.network.listenAddress;
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ let
|
|||||||
|
|
||||||
${k}='' (mapAttrsToList normalizeKeyValue v))
|
${k}='' (mapAttrsToList normalizeKeyValue v))
|
||||||
else
|
else
|
||||||
builtins.toString v;
|
toString v;
|
||||||
in
|
in
|
||||||
if builtins.isNull v then "" else "${k}=${v'}";
|
if isNull v then "" else "${k}=${v'}";
|
||||||
|
|
||||||
primitiveAttrs = with types; attrsOf (either primitive (listOf primitive));
|
primitiveAttrs = with types; attrsOf (either primitive (listOf primitive));
|
||||||
primitiveList = with types; listOf primitive;
|
primitiveList = with types; listOf primitive;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ let
|
|||||||
''}
|
''}
|
||||||
|
|
||||||
USE_BACKUP="${if cfg.useBackup then "yes" else "no"}"
|
USE_BACKUP="${if cfg.useBackup then "yes" else "no"}"
|
||||||
BACKUP_LIMIT=${builtins.toString cfg.backupLimit}
|
BACKUP_LIMIT=${toString cfg.backupLimit}
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ in
|
|||||||
StopWhenUnneeded = cfg.node.lazy.enable;
|
StopWhenUnneeded = cfg.node.lazy.enable;
|
||||||
ConditionPathExists = radicleKeyPair;
|
ConditionPathExists = radicleKeyPair;
|
||||||
};
|
};
|
||||||
Service = mkMerge ([
|
Service = mkMerge [
|
||||||
{
|
{
|
||||||
Slice = "session.slice";
|
Slice = "session.slice";
|
||||||
ExecStart = "${getExe' cfg.node.package "radicle-node"} ${cfg.node.args}";
|
ExecStart = "${getExe' cfg.node.package "radicle-node"} ${cfg.node.args}";
|
||||||
@@ -182,7 +182,7 @@ in
|
|||||||
"~@setuid"
|
"~@setuid"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
]);
|
];
|
||||||
};
|
};
|
||||||
"radicle-node-proxy" = mkIf cfg.node.lazy.enable {
|
"radicle-node-proxy" = mkIf cfg.node.lazy.enable {
|
||||||
Unit = {
|
Unit = {
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ in
|
|||||||
) cfg.submaps;
|
) cfg.submaps;
|
||||||
|
|
||||||
submapWarnings = lib.mapAttrsToList (submapName: nonBinds: ''
|
submapWarnings = lib.mapAttrsToList (submapName: nonBinds: ''
|
||||||
wayland.windowManager.hyprland.submaps."${submapName}".settings: found non-bind entries: [${builtins.toString nonBinds}], which will have no effect in a submap
|
wayland.windowManager.hyprland.submaps."${submapName}".settings: found non-bind entries: [${toString nonBinds}], which will have no effect in a submap
|
||||||
'') (lib.filterAttrs (n: v: v != [ ]) submapWarningsAttrset);
|
'') (lib.filterAttrs (n: v: v != [ ]) submapWarningsAttrset);
|
||||||
in
|
in
|
||||||
submapWarnings ++ lib.optional inconsistent warning;
|
submapWarnings ++ lib.optional inconsistent warning;
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ let
|
|||||||
attrName = builtins.substring 1 999 k; # Remove "@" prefix
|
attrName = builtins.substring 1 999 k; # Remove "@" prefix
|
||||||
attrValue = value.${k};
|
attrValue = value.${k};
|
||||||
in
|
in
|
||||||
" ${attrName}=\"${escape (builtins.toString attrValue)}\""
|
" ${attrName}=\"${escape (toString attrValue)}\""
|
||||||
) attrKeys
|
) attrKeys
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ let
|
|||||||
|
|
||||||
# All other primitive values: wrap in start/end tag
|
# All other primitive values: wrap in start/end tag
|
||||||
else
|
else
|
||||||
"<${name}>${escape (builtins.toString value)}</${name}>";
|
"<${name}>${escape (toString value)}</${name}>";
|
||||||
|
|
||||||
generateXML = name: config: extraConfig: ''
|
generateXML = name: config: extraConfig: ''
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
@@ -139,7 +139,7 @@ let
|
|||||||
else if name == "labwc_config" then
|
else if name == "labwc_config" then
|
||||||
lib.mapAttrsToList generateRc
|
lib.mapAttrsToList generateRc
|
||||||
else
|
else
|
||||||
builtins.throw "error ${name} is neither openbox_menu nor labwc_config"
|
throw "error ${name} is neither openbox_menu nor labwc_config"
|
||||||
)
|
)
|
||||||
config
|
config
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ let
|
|||||||
buildServices =
|
buildServices =
|
||||||
style: serviceCfgs: lib.concatLists (lib.mapAttrsToList (buildService style) serviceCfgs);
|
style: serviceCfgs: lib.concatLists (lib.mapAttrsToList (buildService style) serviceCfgs);
|
||||||
|
|
||||||
servicesStartTimeoutMs = builtins.toString cfg.servicesStartTimeoutMs;
|
servicesStartTimeoutMs = toString cfg.servicesStartTimeoutMs;
|
||||||
|
|
||||||
unitBaseType =
|
unitBaseType =
|
||||||
unitKind: mod:
|
unitKind: mod:
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ in
|
|||||||
|
|
||||||
makePackageWrapper =
|
makePackageWrapper =
|
||||||
vendor: environment: pkg:
|
vendor: environment: pkg:
|
||||||
if builtins.isNull cfg.packages then
|
if isNull cfg.packages then
|
||||||
pkg
|
pkg
|
||||||
else
|
else
|
||||||
# Wrap the package's binaries with nixGL, while preserving the rest of
|
# Wrap the package's binaries with nixGL, while preserving the rest of
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ let
|
|||||||
lib = extendedLib;
|
lib = extendedLib;
|
||||||
osConfig = config;
|
osConfig = config;
|
||||||
osClass = _class;
|
osClass = _class;
|
||||||
modulesPath = builtins.toString ../modules;
|
modulesPath = toString ../modules;
|
||||||
}
|
}
|
||||||
// cfg.extraSpecialArgs;
|
// cfg.extraSpecialArgs;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ let
|
|||||||
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
xdgRuntimeDir = "/run/user/${builtins.toString config.nodes.machine.users.users.alice.uid}";
|
xdgRuntimeDir = "/run/user/${toString config.nodes.machine.users.users.alice.uid}";
|
||||||
httpHeadersSecret = pkgs.writeText "http-headers" "Cookie,secret_password=aliceiscool";
|
httpHeadersSecret = pkgs.writeText "http-headers" "Cookie,secret_password=aliceiscool";
|
||||||
|
|
||||||
shellVar = mkHttpModule "\\\${XDG_RUNTIME_DIR}/http-headers";
|
shellVar = mkHttpModule "\\\${XDG_RUNTIME_DIR}/http-headers";
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(self: super: rec {
|
(self: super: {
|
||||||
openshift = config.lib.test.mkStubPackage {
|
openshift = config.lib.test.mkStubPackage {
|
||||||
name = "openshift";
|
name = "openshift";
|
||||||
version = "4.16.0";
|
version = "4.16.0";
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
# plugins without associated config should not trigger the creation of init.vim
|
# plugins without associated config should not trigger the creation of init.vim
|
||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
vim-fugitive
|
vim-fugitive
|
||||||
({ plugin = vim-sensible; })
|
{ plugin = vim-sensible; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user