nix: Use lib.singleton where possible

This commit is contained in:
Donovan Glover 2024-04-02 18:01:13 -04:00
parent 39cdc4972e
commit b8ad062cec
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 28 additions and 29 deletions

View File

@ -1,5 +1,8 @@
{ config, ... }:
{ config, lib, ... }:
let
inherit (lib) singleton;
in
{
xdg.configFile."ironbar/config.json".text = builtins.toJSON {
name = "main";
@ -23,8 +26,7 @@
}
];
center = [
{
center = singleton {
type = "launcher";
icon_size = 39;
favorites = [
@ -35,8 +37,7 @@
"anki"
"Element"
];
}
];
};
end = [
{

View File

@ -1,7 +1,7 @@
{ pkgs, lib, ... }:
let
inherit (lib) getExe;
inherit (lib) getExe singleton;
inherit (builtins) toJSON;
inherit (pkgs) interception-tools;
inherit (pkgs.interception-tools-plugins) dual-function-keys;
@ -13,8 +13,7 @@ in
enable = true;
plugins = [ dual-function-keys ];
udevmonConfig = toJSON [
{
udevmonConfig = toJSON (singleton {
JOB = /* bash */ ''
${interception-tools}/bin/intercept -g $DEVNODE |
${getExe dual-function-keys} -c /etc/${configFile} |
@ -26,8 +25,7 @@ in
EV_KEY = [ "KEY_CAPSLOCK" "KEY_ESC" ];
};
};
}
];
});
};
environment.etc.${configFile}.text = toJSON {