.files/Justfile
Léana 江 8cc6d2b71c
remove niv residue
```fish
for d in {.,**/*}
    if [ ! -d $d ]; continue; end

    set from ./nix/sources.nix
    set to   ./npins

    set from (realpath -s $from --relative-to $d)
    set to   (realpath -s $to   --relative-to $d)

    echo "($d, $from, $to)"

    for f in $d/*
        if [ ! -f $f ]; continue; end
        sed -i "s=$from=$to=" $f
    end
end
```
2025-07-03 08:39:28 +02:00

32 lines
1.2 KiB
Makefile

# Note:
# add `--option substitute false` to the command so it builds properly offline
# rfkill block all helps too
os host action:
#!/usr/bin/env bash
set -euo pipefail
nixpkgs=$(nix-instantiate --eval -E "let sources = import ./npins; in sources.nixpkgs.outPath" | jq -r .)
sudo nixos-rebuild {{ action }} \
-I nixpkgs=${nixpkgs} \
-I nixos-config=./nix/configurations/{{ host }}.nix \
--fast \
--file ./default.nix \
--attr "nixosConfigurations.{{ host }}"
install host:
#!/usr/bin/env bash
set -euo pipefail
nixpkgs=$(nix-instantiate --eval -E "let sources = import ./npins; in sources.nixpkgs.outPath" | jq -r .)
sudo nixos-install \
-I nixpkgs=${nixpkgs} \
-I nixos-config=./nix/configurations/{{ host }}.nix \
--file ./default.nix \
--attr "nixosConfigurations.{{ host }}"
cleanup:
sudo nix-env --delete-generations +10 -p /nix/var/nix/profiles/system
nix-env --delete-generations +10 -p ~/.local/state/nix/profiles/home-manager
update:
npins update