dotfiles/.justfile

44 lines
935 B
Makefile
Raw Normal View History

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-19 04:07:44 +02:00
# wrapper around {nixos,darwin}-rebuild, always taking the flake
2023-05-14 10:15:06 +02:00
[private]
2023-03-02 17:17:36 +01:00
[macos]
2023-05-14 11:55:36 +02:00
rebuild *args:
#!/usr/bin/env bash
set -euxo pipefail
dir="{{join(env_var('TMPDIR'), 'nix-darwin')}}"
2023-05-14 11:55:36 +02:00
! [[ -x "$dir/sw/bin/darwin-rebuild" ]] && nix build .\#darwinConfigurations.`hostname`.system -o "$dir"
"$dir/sw/bin/darwin-rebuild" --flake . {{args}}
2023-05-14 10:15:06 +02:00
[private]
2023-03-02 17:17:36 +01:00
[linux]
2023-05-14 11:55:36 +02:00
rebuild *args:
sudo nixos-rebuild --flake . {{args}}
2023-03-02 17:17:36 +01:00
2023-05-19 04:07:44 +02:00
# public commands
2023-05-14 11:55:36 +02:00
build *args:
@just rebuild build {{args}}
2023-03-02 17:17:36 +01:00
2023-06-15 01:40:55 +02:00
home *args:
nix run .\#homeConfigurations.winston.activationPackage
2023-03-02 17:17:36 +01:00
[linux]
2023-05-14 11:55:36 +02:00
boot *args:
@just rebuild boot {{args}}
2023-03-17 04:50:52 +01:00
2023-05-16 16:21:38 +02:00
[macos]
2023-05-14 11:55:36 +02:00
check *args:
@just rebuild check {{args}}
2023-04-21 05:59:56 +02:00
2023-05-16 16:21:38 +02:00
[linux]
check *args:
@just rebuild test {{args}}
2023-05-14 11:55:36 +02:00
switch *args:
@just rebuild switch {{args}}
2023-05-14 10:15:06 +02:00
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 ."