Set up startpage

This commit is contained in:
Elnu 2023-01-10 20:19:20 -08:00
parent 602e6a4d6b
commit bda6b363a1
22 changed files with 488 additions and 48 deletions

29
startpage/default.nix Normal file
View file

@ -0,0 +1,29 @@
{ pkgs, lib, ... }:
let
colors = import ../colors;
startpageDir = import ./dir.nix;
out = "${startpageDir}.tmp/";
in
{
home.file = {
"${out}index.html".source = ./index.html;
"${out}colors.css".text = ":root {\n" + (colors.css lib) + "\n}";
"${out}style.css".source = ./style.css;
"${out}anilist.svg".source = ./anilist.svg;
"${out}envelope-regular.svg".source = ./envelope-regular.svg;
"${out}git.svg".source = ./git.svg;
"${out}jellyfin.svg".source = ./jellyfin.svg;
"${out}nyaa.webp".source = ./nyaa.webp;
};
# Make files not symlinks, this causes issues displaying in Firefox
home.activation.startpage = lib.hm.dag.entryAfter["writeBoundary"] ''
mkdir -p ${startpageDir}
mv ${out}* ${startpageDir}
rmdir ${out}
cd ${startpageDir}
for file in `find -type l`; do
cp --remove-destination `readlink $file` $file
done
'';
}