mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-01-24 22:58:38 +01:00
nix: Use lib.singleton where possible
This commit is contained in:
parent
39cdc4972e
commit
b8ad062cec
@ -1,5 +1,8 @@
|
|||||||
{ config, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) singleton;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
xdg.configFile."ironbar/config.json".text = builtins.toJSON {
|
xdg.configFile."ironbar/config.json".text = builtins.toJSON {
|
||||||
name = "main";
|
name = "main";
|
||||||
@ -23,20 +26,18 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
center = [
|
center = singleton {
|
||||||
{
|
type = "launcher";
|
||||||
type = "launcher";
|
icon_size = 39;
|
||||||
icon_size = 39;
|
favorites = [
|
||||||
favorites = [
|
"librewolf"
|
||||||
"librewolf"
|
"kitty"
|
||||||
"kitty"
|
"thunar"
|
||||||
"thunar"
|
"org.qutebrowser.qutebrowser"
|
||||||
"org.qutebrowser.qutebrowser"
|
"anki"
|
||||||
"anki"
|
"Element"
|
||||||
"Element"
|
];
|
||||||
];
|
};
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
end = [
|
end = [
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) getExe;
|
inherit (lib) getExe singleton;
|
||||||
inherit (builtins) toJSON;
|
inherit (builtins) toJSON;
|
||||||
inherit (pkgs) interception-tools;
|
inherit (pkgs) interception-tools;
|
||||||
inherit (pkgs.interception-tools-plugins) dual-function-keys;
|
inherit (pkgs.interception-tools-plugins) dual-function-keys;
|
||||||
@ -13,21 +13,19 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
plugins = [ dual-function-keys ];
|
plugins = [ dual-function-keys ];
|
||||||
|
|
||||||
udevmonConfig = toJSON [
|
udevmonConfig = toJSON (singleton {
|
||||||
{
|
JOB = /* bash */ ''
|
||||||
JOB = /* bash */ ''
|
${interception-tools}/bin/intercept -g $DEVNODE |
|
||||||
${interception-tools}/bin/intercept -g $DEVNODE |
|
${getExe dual-function-keys} -c /etc/${configFile} |
|
||||||
${getExe dual-function-keys} -c /etc/${configFile} |
|
${interception-tools}/bin/uinput -d $DEVNODE
|
||||||
${interception-tools}/bin/uinput -d $DEVNODE
|
'';
|
||||||
'';
|
|
||||||
|
|
||||||
DEVICE = {
|
DEVICE = {
|
||||||
EVENTS = {
|
EVENTS = {
|
||||||
EV_KEY = [ "KEY_CAPSLOCK" "KEY_ESC" ];
|
EV_KEY = [ "KEY_CAPSLOCK" "KEY_ESC" ];
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
];
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc.${configFile}.text = toJSON {
|
environment.etc.${configFile}.text = toJSON {
|
||||||
|
Loading…
Reference in New Issue
Block a user