Automate palette.nix generation
This commit is contained in:
parent
4e42cc7957
commit
397e0a08b1
3 changed files with 2779 additions and 2686 deletions
55
flake.lock
generated
55
flake.lock
generated
|
|
@ -1,6 +1,59 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"root": {}
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1766070988,
|
||||||
|
"narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "c6245e83d836d0433170a16eb185cefe0572f8b8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"palette": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1742245182,
|
||||||
|
"narHash": "sha256-R52Q1FVAclvBk7xNgj/Jl+GPCIbORNf6YbJ1nxH3Gzs=",
|
||||||
|
"owner": "catppuccin",
|
||||||
|
"repo": "palette",
|
||||||
|
"rev": "0df7db6fe201b437d91e7288fa22807bb0e44701",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "catppuccin",
|
||||||
|
"repo": "palette",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"palette": "palette",
|
||||||
|
"systems": "systems"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
"version": 7
|
"version": 7
|
||||||
|
|
|
||||||
50
flake.nix
50
flake.nix
|
|
@ -1,9 +1,49 @@
|
||||||
{
|
{
|
||||||
description = "Catppuccin Color Palette";
|
description = "Catppuccin Color Palette";
|
||||||
|
|
||||||
outputs = { self, ... }: {
|
inputs = {
|
||||||
lib = {
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
palette = import ./palette.nix;
|
systems.url = "github:nix-systems/default";
|
||||||
};
|
|
||||||
|
palette.url = "github:catppuccin/palette";
|
||||||
|
palette.flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{
|
||||||
|
nixpkgs,
|
||||||
|
systems,
|
||||||
|
palette,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
forEachSystem = nixpkgs.lib.genAttrs (import systems);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
lib = {
|
||||||
|
palette = import ./palette.nix;
|
||||||
|
};
|
||||||
|
|
||||||
|
apps = forEachSystem (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
rawPalette = builtins.fromJSON (builtins.readFile "${palette}/palette.json");
|
||||||
|
paletteNix = nixpkgs.lib.generators.toPretty { } rawPalette;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
generate-palette = {
|
||||||
|
type = "app";
|
||||||
|
program = toString (
|
||||||
|
pkgs.writeShellScript "generate-palette" ''
|
||||||
|
echo 'Updating palette.nix ...'
|
||||||
|
cat > palette.nix << EOF
|
||||||
|
${paletteNix}
|
||||||
|
EOF
|
||||||
|
''
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5360
palette.nix
5360
palette.nix
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue