mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-21 22:13:56 -05:00
flake: add install script support for aarch64-linux
This commit is contained in:
parent
63a1f5a3b1
commit
e4e9c20504
44
flake.nix
44
flake.nix
|
@ -47,30 +47,36 @@
|
|||
"x86_64-linux"
|
||||
] (system: inputs.nixpkgs.legacyPackages.${system}.alejandra);
|
||||
|
||||
packages."x86_64-linux".default = inputs.nixpkgs.legacyPackages."x86_64-linux".writeShellScriptBin "clean-install" ''
|
||||
# Check if an argument is provided
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Error: Please provide a valid hostname as an argument."
|
||||
exit 1
|
||||
fi
|
||||
packages =
|
||||
inputs.nixpkgs.lib.genAttrs [
|
||||
"aarch64-linux"
|
||||
"x86_64-linux"
|
||||
] (system: {
|
||||
default = inputs.nixpkgs.legacyPackages."${system}".writeShellScriptBin "clean-install" ''
|
||||
# Check if an argument is provided
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Error: Please provide a valid hostname as an argument."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
HOST=$1
|
||||
FLAKE=github:alyraffauf/nixcfg#$HOST
|
||||
HOST=$1
|
||||
FLAKE=github:alyraffauf/nixcfg#$HOST
|
||||
|
||||
echo "Warning: Running this script will wipe the currently installed system."
|
||||
read -p "Do you want to continue? (y/n): " answer
|
||||
echo "Warning: Running this script will wipe the currently installed system."
|
||||
read -p "Do you want to continue? (y/n): " answer
|
||||
|
||||
if [ "$answer" != "y" ]; then
|
||||
echo "Aborted."
|
||||
exit 0
|
||||
fi
|
||||
if [ "$answer" != "y" ]; then
|
||||
echo "Aborted."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sudo nix --experimental-features "nix-command flakes" run \
|
||||
github:nix-community/disko -- --mode disko --flake $FLAKE
|
||||
sudo nix --experimental-features "nix-command flakes" run \
|
||||
github:nix-community/disko -- --mode disko --flake $FLAKE
|
||||
|
||||
# Install NixOS with the updated flake input and root settings
|
||||
sudo nixos-install --no-root-password --root /mnt --flake $FLAKE
|
||||
'';
|
||||
# Install NixOS with the updated flake input and root settings
|
||||
sudo nixos-install --no-root-password --root /mnt --flake $FLAKE
|
||||
'';
|
||||
});
|
||||
|
||||
nixosModules.default =
|
||||
import ./nixosModules inputs;
|
||||
|
|
Loading…
Reference in a new issue