dotfiles/justfile

52 lines
1.1 KiB
Makefile
Raw Normal View History

2023-03-17 04:50:52 +01:00
# vim:ft=just:fdm=marker
2023-03-02 17:17:36 +01:00
2023-03-17 04:50:52 +01:00
default:
@just --choose
2023-02-15 16:03:38 +01:00
2023-03-17 04:50:52 +01:00
# check flake syntax {{{
2023-03-02 17:17:36 +01:00
[macos]
check:
#!/usr/bin/env bash
set -euxo pipefail
if [[ -x "./result/sw/bin/darwin-rebuild" ]]; then
./result/sw/bin/darwin-rebuild check --flake .
else
2023-04-17 06:43:01 +02:00
nix build .\#darwinConfigurations.`hostname`.system
./result/sw/bin/darwin-rebuild check --flake .
fi
2023-03-02 17:17:36 +01:00
[linux]
check:
2023-03-10 02:45:17 +01:00
nix flake check .
2023-03-17 04:50:52 +01:00
# }}}
2023-03-02 17:17:36 +01:00
2023-03-17 04:50:52 +01:00
# build {{{
2023-03-02 17:17:36 +01:00
[macos]
2023-05-13 13:20:47 +02:00
switch:
#!/usr/bin/env bash
set -euxo pipefail
if [[ -x "./result/sw/bin/darwin-rebuild" ]]; then
./result/sw/bin/darwin-rebuild switch --flake .
else
2023-04-17 06:43:01 +02:00
nix build .\#darwinConfigurations.`hostname`.system
./result/sw/bin/darwin-rebuild switch --flake .
fi
2023-03-02 17:17:36 +01:00
[linux]
2023-05-13 13:20:47 +02:00
switch:
2023-03-02 17:17:36 +01:00
sudo nixos-rebuild switch --flake .
[linux]
2023-05-13 13:20:47 +02:00
boot:
2023-03-17 04:50:52 +01:00
sudo nixos-rebuild boot --flake .
# }}}
2023-04-21 05:59:56 +02:00
secretExists := path_exists("./home/secrets/default.nix")
2023-03-17 04:50:52 +01:00
fontdir := if os() == "macos" {"$HOME/Library/Fonts"} else {"${XDG_DATA_HOME:-$HOME/.local/share}/fonts"}
install-fonts:
2023-05-13 13:20:47 +02:00
install -Dm644 home/secrets/fonts/* "{{fontdir}}"
2023-03-24 02:52:41 +01:00
fetch:
@nix run nixpkgs\#onefetch -- --true-color never --no-bots -d lines-of-code
@nix run nixpkgs\#scc -- . --no-cocomo