1
1
Fork 0
nixos/options/custom/scripts/flakegen.sh

17 lines
324 B
Bash
Raw Normal View History

#! /usr/bin/env bash
# Generate flake.nix via flakegen
# https://github.com/jorsn/flakegen
cd /etc/nixos || exit 1
if [[ "${1-}" == '-r' ]]; then
# Nuke and reinitialize
rm flake.nix
nix flake init --template github:jorsn/flakegen
else
# Generate and track all files
nix run .#genflake flake.nix
git add .
fi