dotfiles/justfile

47 lines
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-05-14 10:15:06 +02:00
[private]
2023-03-17 04:50:52 +01:00
default:
@just --choose
2023-02-15 16:03:38 +01:00
2023-05-14 10:15:06 +02:00
# wrapper around {nixos,darwin}-rebuild, always taking the flake {{{
[private]
2023-03-02 17:17:36 +01:00
[macos]
2023-05-14 10:15:06 +02:00
rebuild args:
#!/usr/bin/env bash
set -euxo pipefail
2023-05-14 10:15:06 +02:00
! [[ -x "./result/sw/bin/darwin-rebuild" ]] && nix build .\#darwinConfigurations.`hostname`.system
./result/sw/bin/darwin-rebuild "{{args}}" --flake .
2023-05-14 10:15:06 +02:00
[private]
2023-03-02 17:17:36 +01:00
[linux]
2023-05-14 10:15:06 +02:00
rebuild args:
sudo nixos-rebuild "{{args}}" --flake .
2023-03-17 04:50:52 +01:00
# }}}
2023-03-02 17:17:36 +01:00
2023-05-14 10:15:06 +02:00
build:
just rebuild build
2023-03-02 17:17:36 +01:00
[linux]
2023-05-13 13:20:47 +02:00
boot:
2023-05-14 10:15:06 +02:00
just rebuild boot
2023-03-17 04:50:52 +01:00
2023-05-14 10:15:06 +02:00
check:
just rebuild check
2023-04-21 05:59:56 +02:00
2023-05-14 10:15:06 +02:00
switch:
just rebuild switch
# 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:
2023-05-14 10:15:06 +02:00
install -Dm644 {{justfile_directory()}}/home/secrets/fonts/* "{{fontdir}}"
2023-03-24 02:52:41 +01:00
fetch:
2023-05-14 10:15:06 +02:00
@nix shell nixpkgs\#onefetch nixpkgs\#scc -c sh -c "onefetch --true-color never --no-bots -d lines-of-code && scc --no-cocomo ."