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