46 lines
1.2 KiB
Makefile
46 lines
1.2 KiB
Makefile
##
|
|
# Nix Configuration
|
|
#
|
|
# @file
|
|
# @version 0.1
|
|
|
|
HOST ?= ziltis-desktop
|
|
DEVICE ?= nvme0n1
|
|
|
|
#configuration.nix: hosts/${HOST}.nix
|
|
# ln -s "$<" "$@"
|
|
|
|
disko: disko-config.nix
|
|
sed -i "s|.*DEVICE_NAME| device = \"/dev/$(DEVICE)\"; # DEVICE_NAME|g" disko-config.nix
|
|
nix run \
|
|
--extra-experimental-features nix-command \
|
|
--extra-experimental-features flakes \
|
|
github:nix-community/disko -- \
|
|
--mode disko \
|
|
./disko-config.nix
|
|
|
|
build-iso: iso.nix
|
|
nix-build '<nixpkgs/nixos>' -A config.system.build.isoImage -I nixos-config=iso.nix
|
|
|
|
install-system: configuration.nix
|
|
sed -i "s|.*DEVICE_HOSTNAME| networking.hostName = \"$(HOST)\"; # DEVICE_HOSTNAME|g" configuration.nix
|
|
nixos-generate-config --no-filesystems --root /mnt
|
|
cp configuration.nix /mnt/etc/nixos
|
|
cp disko-config.nix /mnt/etc/nixos
|
|
nixos-install
|
|
|
|
setup-fido:
|
|
systemd-cryptenroll --fido2-device=auto /dev/disk/by-partlabel/disk-main-luks
|
|
|
|
setup-desktop:
|
|
bw config server https://vaultwarden.lyrion.ch
|
|
echo "Bitwarden Login"
|
|
bw login | grep items | awk '{print $$6}' > ~/.vw-session-key
|
|
|
|
install:
|
|
touch ~/.vw-session-key
|
|
touch ~/.config/hypr/monitors.conf
|
|
nix-collect-garbage --delete-old
|
|
sudo env NIXPKGS_ALLOW_BROKEN=1 nixos-rebuild switch --flake .#ziltis-desktop --impure --show-trace
|
|
|
|
# end
|