parent
318ccef645
commit
85348d1a6c
13 changed files with 414 additions and 173 deletions
lib
|
@ -3,15 +3,15 @@
|
|||
inputs,
|
||||
}: let
|
||||
flake = import ./flake inputs;
|
||||
hypr = import ./hypr inputs.nixpkgs.lib;
|
||||
strings = import ./strings inputs.nixpkgs.lib;
|
||||
|
||||
lib = flake // strings;
|
||||
lib = flake // hypr // strings;
|
||||
in
|
||||
# Expose main attrs
|
||||
lib
|
||||
# Expose all funcs
|
||||
// strings
|
||||
// flake
|
||||
// {inherit flake hypr strings;}
|
||||
# Expose funcs that require pkgs
|
||||
// perSystem (
|
||||
pkgs:
|
||||
|
|
57
lib/hypr/default.nix
Normal file
57
lib/hypr/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
concatStringsSep,
|
||||
elemAt,
|
||||
optionals,
|
||||
...
|
||||
}: rec {
|
||||
pointToStr = p: "${toString (elemAt p 0)}, ${toString (elemAt p 1)}";
|
||||
|
||||
mkBezier = {
|
||||
name,
|
||||
p0,
|
||||
p1,
|
||||
}:
|
||||
concatStringsSep "," [name (pointToStr p0) (pointToStr p1)];
|
||||
|
||||
mkAnimation = {
|
||||
name,
|
||||
enable ? true,
|
||||
duration ? 0, # in ds (100ms)
|
||||
bezier ? "default",
|
||||
style ? null,
|
||||
}:
|
||||
concatStringsSep "," (
|
||||
[
|
||||
name
|
||||
(
|
||||
if enable
|
||||
then "1"
|
||||
else "0"
|
||||
)
|
||||
]
|
||||
++ optionals enable (
|
||||
[
|
||||
(toString duration)
|
||||
bezier
|
||||
]
|
||||
++ optionals (style != null) [style]
|
||||
)
|
||||
);
|
||||
|
||||
mkLayerRule = {
|
||||
rule,
|
||||
namespace,
|
||||
}:
|
||||
concatStringsSep "," [rule namespace];
|
||||
|
||||
mkBind = {
|
||||
modifier ? "",
|
||||
key,
|
||||
dispatcher ? "exec",
|
||||
command ? null,
|
||||
}:
|
||||
concatStringsSep "," (
|
||||
[modifier key dispatcher]
|
||||
++ optionals (command != null) [command]
|
||||
);
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
concatStringsSep,
|
||||
concatStrings,
|
||||
stringToCharacters,
|
||||
substring,
|
||||
tail,
|
||||
|
@ -7,5 +7,5 @@
|
|||
...
|
||||
}: {
|
||||
mkVersion = src: "0.0.0+" + src.shortRev;
|
||||
capitalise = str: (toUpper (substring 0 1 str) + (concatStringsSep "" (tail (stringToCharacters str))));
|
||||
capitalise = str: (toUpper (substring 0 1 str) + (concatStrings (tail (stringToCharacters str))));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue