Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shorten lib.attrsets to just lib #98

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/files.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let

# Helper function to prepend the appropriate path prefix (e.g. XDG_CONFIG_HOME) to file
prependPath = prefix: attrset:
lib.attrsets.mapAttrs'
lib.mapAttrs'
(path: config: { name = "${prefix}/${path}"; value = config; })
attrset;
plasmaCfg = config.programs.plasma;
Expand All @@ -34,16 +34,16 @@ let
);
fileSettingsModify =
(name: value: (if (!isFinalValue value) then
(lib.attrsets.nameValuePair name (lib.attrsets.mapAttrs' fileSettingsModify value)) else
(lib.attrsets.nameValuePair "${name}${calculateKeyMarking value}" value.value)));
(lib.nameValuePair name (lib.mapAttrs' fileSettingsModify value)) else
(lib.nameValuePair "${name}${calculateKeyMarking value}" value.value)));


fileSettingsType = with lib.types; attrsOf (attrsOf (attrsOf advancedSettingsType));

##############################################################################
# Generate a script that will use write_config.py to update all
# settings.
script = pkgs.writeScript "plasma-config" (writeConfig (lib.attrsets.mapAttrs' fileSettingsModify cfg));
script = pkgs.writeScript "plasma-config" (writeConfig (lib.mapAttrs' fileSettingsModify cfg));

##############################################################################
# Generate a script that will remove all the current config files.
Expand Down
2 changes: 1 addition & 1 deletion modules/hotkeys.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ in

programs.plasma.configFile."kglobalshortcutsrc"."${group.desktop}" = {
_k_friendly_name.value = group.description;
} // lib.attrsets.mapAttrs
} // lib.mapAttrs
(_: command:
let
keys = command.keys ++ lib.optionals (command.key != "") [ command.key ];
Expand Down
Loading