build: use home.activation
instead of just for fonts
This commit is contained in:
parent
2c7dd2d84c
commit
c6ff52199a
2 changed files with 18 additions and 11 deletions
|
@ -1,4 +1,21 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
config,
|
||||
flakePath,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home.activation = {
|
||||
installCustomFonts = let
|
||||
fontDirectory =
|
||||
if pkgs.stdenv.isDarwin
|
||||
then "${config.home.homeDirectory}/Library/Fonts"
|
||||
else "${config.xdg.dataHome}/fonts";
|
||||
in
|
||||
lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
install -Dm644 ${flakePath}/home/secrets/fonts/* "${fontDirectory}"
|
||||
'';
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
|
||||
victor-mono
|
||||
|
|
10
justfile
10
justfile
|
@ -33,15 +33,5 @@ check *args:
|
|||
switch *args:
|
||||
@just rebuild switch {{args}}
|
||||
|
||||
# these will fail, should variables not be set
|
||||
fontdir := if os() == "macos" {
|
||||
env_var('HOME') + "/Library/Fonts"
|
||||
} else {
|
||||
env_var_or_default('XDG_DATA_HOME', env_var('HOME') + "/.local/share") + "/fonts"
|
||||
}
|
||||
# TODO: move these to the home.activation hook
|
||||
install-fonts:
|
||||
install -Dm644 {{justfile_directory()}}/home/secrets/fonts/* "{{fontdir}}"
|
||||
|
||||
fetch:
|
||||
@nix shell nixpkgs\#onefetch nixpkgs\#scc -c sh -c "onefetch --true-color never --no-bots -d lines-of-code && scc --no-cocomo ."
|
||||
|
|
Loading…
Reference in a new issue