dotfiles/justfile

61 lines
1.4 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]
switch: secret-stage && secret-unstage
#!/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]
switch: secret-stage && secret-unstage
sudo nixos-rebuild switch --flake .
[linux]
2023-03-17 04:50:52 +01:00
boot: secret-stage && secret-unstage
sudo nixos-rebuild boot --flake .
# }}}
# secrets {{{
secret-stage:
git add -f home/secrets/default.nix
secret-unstage:
git restore --staged home/secrets/default.nix
fontdir := if os() == "macos" {"$HOME/Library/Fonts"} else {"${XDG_DATA_HOME:-$HOME/.local/share}/fonts"}
install-fonts:
#!/usr/bin/env bash
set -euxo pipefail
2023-03-17 04:50:52 +01:00
mkdir -p "{{fontdir}}"
gpg --decrypt home/secrets/fonts.tgz.gpg | tar -xz -C "{{fontdir}}" --strip-components=1
# }}}
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