Want to contribute? Fork me on Codeberg.org!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
946 B

{ 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;
"${out}nixos.svg".source = ./nixos.svg;
};
# 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
'';
}