Better colorscheme generation

This commit is contained in:
Agatha Lovelace 2023-04-11 19:49:24 +02:00
parent 161c096f49
commit 84191c1a37
Signed by: sorceress
GPG Key ID: 01D0B3AB10CED4F8
3 changed files with 185 additions and 78 deletions

View File

@ -1,8 +1,8 @@
{ lib, pkgs, ... }: { { lib, pkgs, ... }: {
colorscheme = name: image: rec { colorscheme = name: image: rec {
generate = pkgs.callPackage ({ runCommand, colorz }: generate = pkgs.callPackage ({ runCommand, colorpickle }:
runCommand "colors-${name}" { nativeBuildInputs = [ colorz ]; } '' runCommand "colors-${name}" { nativeBuildInputs = [ colorpickle ]; } ''
colorz ${image} --no-preview -n 8 --minv 0 --maxv 255 | awk '{print $1} {print $2}' > $out colorpickle ${image} --lighten 0.05 --bold-delta 0.1 > $out
'') { }; '') { };
colors = builtins.listToAttrs (lib.lists.imap0 (i: v: { colors = builtins.listToAttrs (lib.lists.imap0 (i: v: {

View File

@ -1,5 +1,25 @@
{ {
"nodes": { "nodes": {
"colorpickle": {
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"utils": "utils"
},
"locked": {
"lastModified": 1681058620,
"narHash": "sha256-dethIZN9+Tcu/FbcyQnS4e8Ly+S50tnjBdLQBscxcF4=",
"owner": "AgathaSorceress",
"repo": "colorpickle",
"rev": "06b6ae85e8a141ccee67f3597ccf37ca61f8dcc3",
"type": "github"
},
"original": {
"owner": "AgathaSorceress",
"repo": "colorpickle",
"type": "github"
}
},
"crane": { "crane": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -187,16 +207,16 @@
"helix": { "helix": {
"inputs": { "inputs": {
"nci": "nci", "nci": "nci",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_3",
"parts": "parts_2", "parts": "parts_2",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1680646269, "lastModified": 1680958354,
"narHash": "sha256-MRohWyeJJf3zwMWUt4XQnD1qbem0/3D0cbomvJ47YuE=", "narHash": "sha256-lU5r4RgrRmlqiRsefZFahvD/bsnKJbVHNRwRjBXg3fY=",
"owner": "helix-editor", "owner": "helix-editor",
"repo": "helix", "repo": "helix",
"rev": "531b745c54e5d316603601cc05ade50ab02066ab", "rev": "58e457a4e1037caf43c17dea93c5321c1ae74103",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -210,14 +230,14 @@
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"utils": "utils" "utils": "utils_2"
}, },
"locked": { "locked": {
"lastModified": 1680597706, "lastModified": 1680667162,
"narHash": "sha256-ZqJ3T+BxzjPH9TnmeUwS4Uu9ZQPeBXAFC9sUWlharT4=", "narHash": "sha256-2vgxK4j42y73S3XB2cThz1dSEyK9J9tfu4mhuEfAw68=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "ec06f419af79207b33d797064dfb3fc9dbe1df4a", "rev": "440faf5ae472657ef2d8cc7756d77b6ab0ace68d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -283,7 +303,26 @@
}, },
"naersk": { "naersk": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1679567394,
"narHash": "sha256-ZvLuzPeARDLiQUt6zSZFGOs+HZmE+3g4QURc8mkBsfM=",
"owner": "nix-community",
"repo": "naersk",
"rev": "88cd22380154a2c36799fe8098888f0f59861a15",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "naersk",
"type": "github"
}
},
"naersk_2": {
"inputs": {
"nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1679567394, "lastModified": 1679567394,
@ -331,7 +370,7 @@
"nix": { "nix": {
"inputs": { "inputs": {
"lowdown-src": "lowdown-src", "lowdown-src": "lowdown-src",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_4",
"nixpkgs-regression": "nixpkgs-regression" "nixpkgs-regression": "nixpkgs-regression"
}, },
"locked": { "locked": {
@ -350,18 +389,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1680213900, "lastModified": 1681002951,
"narHash": "sha256-cIDr5WZIj3EkKyCgj/6j3HBH4Jj1W296z7HTcWj1aMA=", "narHash": "sha256-nD9fXN7EVKGovtjrXIuA7Si9M6PD9b02GNtvQPTSuOk=",
"owner": "nixos", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e3652e0735fbec227f342712f180f4f21f0594f2", "rev": "431bf1e6cdd494e5230fbb72884afb4ca612c578",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "id": "nixpkgs",
"ref": "nixos-unstable", "type": "indirect"
"repo": "nixpkgs",
"type": "github"
} }
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
@ -414,6 +451,38 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1681002951,
"narHash": "sha256-nD9fXN7EVKGovtjrXIuA7Si9M6PD9b02GNtvQPTSuOk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "431bf1e6cdd494e5230fbb72884afb4ca612c578",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1680213900,
"narHash": "sha256-cIDr5WZIj3EkKyCgj/6j3HBH4Jj1W296z7HTcWj1aMA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e3652e0735fbec227f342712f180f4f21f0594f2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1657693803, "lastModified": 1657693803,
"narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=",
@ -429,13 +498,13 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1680588688, "lastModified": 1680865339,
"narHash": "sha256-SW95w50Pdw3nivgTuCebtbbPqaCTp9ctnFMNj24vdck=", "narHash": "sha256-H6rmJ1CyJ3Q5ZyoLMYq/UEYMS9Q1orJjRpWiQ47HudE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3e01f83884b8ed7cbafa784727fb343f1876d56f", "rev": "0040164e473509b4aee6aedb3b923e400d6df10b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -444,7 +513,7 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs_4": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1680273054, "lastModified": 1680273054,
"narHash": "sha256-Bs6/5LpvYp379qVqGt9mXxxx9GSE789k3oFc+OAL07M=", "narHash": "sha256-Bs6/5LpvYp379qVqGt9mXxxx9GSE789k3oFc+OAL07M=",
@ -458,7 +527,7 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs_5": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1680273054, "lastModified": 1680273054,
"narHash": "sha256-Bs6/5LpvYp379qVqGt9mXxxx9GSE789k3oFc+OAL07M=", "narHash": "sha256-Bs6/5LpvYp379qVqGt9mXxxx9GSE789k3oFc+OAL07M=",
@ -516,10 +585,11 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"colorpickle": "colorpickle",
"helix": "helix", "helix": "helix",
"home-manager": "home-manager", "home-manager": "home-manager",
"mms": "mms", "mms": "mms",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_5",
"url-eater": "url-eater" "url-eater": "url-eater"
} }
}, },
@ -545,11 +615,26 @@
"type": "github" "type": "github"
} }
}, },
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"url-eater": { "url-eater": {
"inputs": { "inputs": {
"naersk": "naersk", "naersk": "naersk_2",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_7",
"utils": "utils_2" "utils": "utils_3"
}, },
"locked": { "locked": {
"lastModified": 1680708368, "lastModified": 1680708368,
@ -566,12 +651,15 @@
} }
}, },
"utils": { "utils": {
"inputs": {
"systems": "systems"
},
"locked": { "locked": {
"lastModified": 1678901627, "lastModified": 1681037374,
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", "narHash": "sha256-XL6X3VGbEFJZDUouv2xpKg2Aljzu/etPLv5e1FPt1q0=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", "rev": "033b9f258ca96a10e543d4442071f614dc3f8412",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -594,6 +682,21 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "type": "github"
} }
},
"utils_3": {
"locked": {
"lastModified": 1678901627,
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -14,65 +14,69 @@
url-eater.url = "github:AgathaSorceress/url-eater"; url-eater.url = "github:AgathaSorceress/url-eater";
colorpickle.url = "github:AgathaSorceress/colorpickle";
helix.url = "github:helix-editor/helix"; helix.url = "github:helix-editor/helix";
}; };
outputs = { nixpkgs, home-manager, mms, helix, url-eater, ... }: { outputs =
colmena = { { nixpkgs, home-manager, mms, helix, url-eater, colorpickle, ... }: {
network = { colmena = {
description = "Agatha's Nix Infra"; network = {
description = "Agatha's Nix Infra";
nixpkgs = import nixpkgs { nixpkgs = import nixpkgs {
system = "x86_64-linux"; system = "x86_64-linux";
overlays = [ overlays = [
(final: prev: { (final: prev: {
helix = helix.packages.${final.system}.default; helix = helix.packages.${final.system}.default;
url-eater = url-eater.defaultPackage.${final.system}; url-eater = url-eater.defaultPackage.${final.system};
}) colorpickle = colorpickle.defaultPackage.${final.system};
]; })
];
};
}; };
};
bloodletting = { bloodletting = {
imports = [ imports = [
./common ./common
./hosts/bloodletting/configuration.nix ./hosts/bloodletting/configuration.nix
(import "${home-manager}/nixos") (import "${home-manager}/nixos")
mms.module mms.module
]; ];
deployment = { deployment = {
targetUser = "root"; targetUser = "root";
targetHost = "bloodletting"; targetHost = "bloodletting";
tags = [ "prod" ]; tags = [ "prod" ];
keys = { keys = {
"nyandroid-token" = { "nyandroid-token" = {
keyCommand = [ "cat" "./secrets/nyandroid-token" ]; keyCommand = [ "cat" "./secrets/nyandroid-token" ];
destDir = "/var/lib/secrets/"; destDir = "/var/lib/secrets/";
}; };
"rfc2136-technogothic-net" = { "rfc2136-technogothic-net" = {
keyCommand = [ "cat" "./secrets/rfc2136-technogothic-net" ]; keyCommand = [ "cat" "./secrets/rfc2136-technogothic-net" ];
destDir = "/var/lib/secrets/"; destDir = "/var/lib/secrets/";
};
}; };
}; };
}; };
};
ritual = { ritual = {
imports = [ imports = [
./common ./common
./hosts/ritual/configuration.nix ./hosts/ritual/configuration.nix
(import "${home-manager}/nixos") (import "${home-manager}/nixos")
]; ];
deployment = { deployment = {
targetUser = "root"; targetUser = "root";
targetHost = "ritual"; targetHost = "ritual";
allowLocalDeployment = true; allowLocalDeployment = true;
};
}; };
}; };
}; };
};
} }