Skip to content
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
2 changes: 1 addition & 1 deletion modules/programs/hexchat.nix
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ let
# Note: Missing option `D=`.
transformChannel = channelName:
let channel = cfg.channels.${channelName};
in concatStringsSep "\n" (filter (v: v != null) [
in concatStringsSep "\n" (remove null [
"" # leave a space between one server and another
(transformField "N" channelName)
(loginMethod channel)
Expand Down
5 changes: 2 additions & 3 deletions modules/programs/lf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,8 @@ in {
"${k} ${if isInt v then toString v else ''"${v}"''}"
}";

settingsStr = concatStringsSep "\n" (filter (x: x != "")
(mapAttrsToList fmtSetting
(builtins.intersectAttrs knownSettings cfg.settings)));
settingsStr = concatStringsSep "\n" (remove "" (mapAttrsToList fmtSetting
(builtins.intersectAttrs knownSettings cfg.settings)));

fmtCmdMap = before: k: v:
"${before} ${k}${optionalString (v != null && v != "") " ${v}"}";
Expand Down
10 changes: 5 additions & 5 deletions modules/programs/mbsync.nix
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ let
genGroupsChannels = group:
concatStringsSep "\n" (genChannelStrings group.name group.channels);
# Generate all channel configurations for all groups for this account.
in concatStringsSep "\n" (filter (s: s != "")
(mapAttrsToList (name: group: genGroupsChannels group) groups));
in concatStringsSep "\n"
(remove "" (mapAttrsToList (name: group: genGroupsChannels group) groups));

# Given the attr set of groups, return a string which maps channels to groups
genAccountGroups = groups:
Expand All @@ -177,9 +177,9 @@ let
# of the groups and its consituent channels.
genGroupsStrings = mapAttrsToList (name: info:
concatStringsSep "\n" (genGroupChannelString groups.${name})) groups;
in concatStringsSep "\n\n" (filter (s: s != "")
genGroupsStrings) # filter for the cases of empty groups
+ "\n"; # Put all strings together.
# Join all non-empty groups.
combined = concatStringsSep "\n\n" (remove "" genGroupsStrings) + "\n";
in combined;

genGroupConfig = name: channels:
let
Expand Down
4 changes: 2 additions & 2 deletions modules/programs/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ let

moduleConfigure = {
packages.home-manager = {
start = filter (f: f != null) (map
start = remove null (map
(x: if x ? plugin && x.optional == true then null else (x.plugin or x))
cfg.plugins);
opt = filter (f: f != null)
opt = remove null
(map (x: if x ? plugin && x.optional == true then x.plugin else null)
cfg.plugins);
};
Expand Down
2 changes: 1 addition & 1 deletion modules/programs/vim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ in {

config = (let
customRC = ''
${concatStringsSep "\n" (filter (v: v != "") (mapAttrsToList setExpr
${concatStringsSep "\n" (remove "" (mapAttrsToList setExpr
(builtins.intersectAttrs knownSettings cfg.settings)))}

${cfg.extraConfig}
Expand Down
3 changes: 1 addition & 2 deletions modules/services/fnott.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ with lib;
let
cfg = config.services.fnott;

concatStringsSep' = sep: list:
concatStringsSep sep (filter (x: x != "") list);
concatStringsSep' = sep: list: concatStringsSep sep (remove "" list);

iniFormat = pkgs.formats.ini { };
in {
Expand Down
8 changes: 2 additions & 6 deletions modules/services/window-managers/i3-sway/lib/functions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,8 @@ rec {

fontConfigStr = let
toFontStr = { names, style ? "", size ? "" }:
optionalString (names != [ ]) concatStringsSep " " (filter (x: x != "") [
"font"
"pango:${concatStringsSep ", " names}"
style
size
]);
optionalString (names != [ ]) concatStringsSep " "
(remove "" [ "font" "pango:${concatStringsSep ", " names}" style size ]);
in fontCfg:
if isList fontCfg then
toFontStr { names = fontCfg; }
Expand Down