nix-config/startpage/default.nix

26 lines
635 B
Nix

{ pkgs, lib, ... }:
let
colors = import ../colors;
startpageDir = import ./dir.nix;
out = "${startpageDir}.tmp/";
in
{
home.file = {
"${out}" = {
source = ./html;
recursive = true;
};
"${out}colors.css".text = ":root {\n" + (colors.css lib) + "\n}";
};
# 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
'';
}