mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
bahaghari/utils/tinted-theming: init
This commit is contained in:
parent
df345c8b51
commit
f4b1db09f3
@ -11,12 +11,6 @@ let
|
||||
(pkgs.lib.count (name: pkgs.lib.elem name schemeNames) paletteNames) == i;
|
||||
in
|
||||
{
|
||||
# TODO: Return a derivation containing all of the template output from the
|
||||
# given schemes.
|
||||
generateOutputFromSchemes = schemes: template:
|
||||
pkgs.runCommand "generate-templates" { } ''
|
||||
'';
|
||||
|
||||
# TODO: Return a Nix object to generate a Tinted Theming color scheme from an
|
||||
# image.
|
||||
generateScheme = image: { };
|
||||
|
8
subprojects/bahaghari/lib/utils/default.nix
Normal file
8
subprojects/bahaghari/lib/utils/default.nix
Normal file
@ -0,0 +1,8 @@
|
||||
{ config, lib, pkgs, bahaghariLib }:
|
||||
|
||||
let
|
||||
callLib = path: import path { inherit config lib pkgs bahaghariLib; };
|
||||
in
|
||||
{
|
||||
tinted-theming = callLib ./tinted-theming.nix;
|
||||
}
|
32
subprojects/bahaghari/lib/utils/tinted-theming.nix
Normal file
32
subprojects/bahaghari/lib/utils/tinted-theming.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{ config, lib, pkgs, bahaghariLib }:
|
||||
|
||||
let
|
||||
cfg = config.bahaghari.tinted-theming;
|
||||
in
|
||||
rec {
|
||||
# Return a derivation containing all of the template output from the given
|
||||
# schemes.
|
||||
generateOutputFromSchemes = { schemes ? {}, template }:
|
||||
let
|
||||
schemesDir = pkgs.runCommand "aggregate-schemes" { }
|
||||
''
|
||||
mkdir -p "$out"
|
||||
${
|
||||
lib.concatMapStrings (scheme: ''
|
||||
echo <<EOF > "$out/${scheme.name}.yml"
|
||||
${bahaghariLib.toYAML scheme}
|
||||
EOF
|
||||
'') lib.attrNames schemes
|
||||
}
|
||||
'';
|
||||
in
|
||||
pkgs.runCommand "generate-templates" { } (cfg.builder.script {
|
||||
inherit schemesDir;
|
||||
templateDir = template;
|
||||
});
|
||||
|
||||
# Return a derivation containing the generated template with the given
|
||||
# builder script with all of the Tinted Theming schemes.
|
||||
generateOutputFromAllSchemes = { template }:
|
||||
generateOutputFromSchemes { schemes = cfg.schemes; inherit template; };
|
||||
}
|
Loading…
Reference in New Issue
Block a user