1
1
Fork 0

nix: use lib where possible

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-12-26 19:07:03 -05:00
parent 48e84a857d
commit 654b594643
Signed by: Myned
GPG key ID: C7224454F7881A34
5 changed files with 11 additions and 9 deletions

View file

@ -158,7 +158,7 @@ in {
merge = field: expr: rules: merge = field: expr: rules:
map ( map (
rule: rule:
if builtins.isAttrs field if isAttrs field
then "${rule}, ${lib.concatStringsSep ", " (lib.mapAttrsToList (f: e: format f e) field)}" then "${rule}, ${lib.concatStringsSep ", " (lib.mapAttrsToList (f: e: format f e) field)}"
else "${rule}, ${format field expr}" else "${rule}, ${format field expr}"
) )

View file

@ -122,7 +122,7 @@ in {
src = "${pkgs.writeShellApplication { src = "${pkgs.writeShellApplication {
name = "search"; name = "search";
text = builtins.readFile ./search.sh; text = readFile ./search.sh;
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
coreutils coreutils
@ -145,7 +145,7 @@ in {
font: larger ${config.custom.font.monospace}; font: larger ${config.custom.font.monospace};
} }
${builtins.readFile ./style.css} ${readFile ./style.css}
''; '';
#!! Inherit from default layout #!! Inherit from default layout

View file

@ -26,7 +26,7 @@ in {
-- # TODO: Remove when using Wayland -- # TODO: Remove when using Wayland
config.font_size = ${toString (14 * config.custom.scale)} config.font_size = ${toString (14 * config.custom.scale)}
${builtins.readFile ./config.lua} ${readFile ./config.lua}
return config return config
''; '';

View file

@ -25,7 +25,7 @@ in {
#// excludeShellChecks = ["SC2154"]; # argc evaluates variables at runtime #// excludeShellChecks = ["SC2154"]; # argc evaluates variables at runtime
runtimeInputs = dependencies; runtimeInputs = dependencies;
text = builtins.readFile ./${name}.sh; text = readFile ./${name}.sh;
} }
+ "/bin/${name}"; + "/bin/${name}";
}; };
@ -38,7 +38,7 @@ in {
pkgs.writers.writePython3Bin name {libraries = dependencies;} pkgs.writers.writePython3Bin name {libraries = dependencies;}
# Disable linting # Disable linting
# https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#ignoring-entire-files # https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#ignoring-entire-files
("# flake8: noqa\n" + builtins.readFile ./${name}.py) ("# flake8: noqa\n" + readFile ./${name}.py)
+ "/bin/${name}"; + "/bin/${name}";
}; };
in in

View file

@ -17,13 +17,15 @@ in {
package = pkgs.google-cursor; package = pkgs.google-cursor;
}; };
gtk = { gtk = let
css = readFile ./style.css;
in {
enable = true; enable = true;
gtk3.extraCss = builtins.readFile ./style.css; gtk3.extraCss = css;
gtk4 = { gtk4 = {
extraConfig.gtk-hint-font-metrics = 1; # Fix blurry fonts extraConfig.gtk-hint-font-metrics = 1; # Fix blurry fonts
extraCss = builtins.readFile ./style.css; extraCss = css;
}; };
font = { font = {