2023-07-14 21:34:21 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-07-15 00:19:47 -07:00
|
|
|
# Begin: curl https://git.sovransystems.com/Sovran_Systems/Sovran_SystemsOS/raw/branch/main/for_new_sovran_pros/psp.sh -o psp.sh
|
|
|
|
|
2023-07-14 21:34:21 -07:00
|
|
|
GREEN="\e[32m"
|
|
|
|
LIGHTBLUE="\e[94m"
|
|
|
|
ENDCOLOR="\e[0m"
|
|
|
|
|
|
|
|
lsblk
|
|
|
|
|
2024-01-26 21:15:31 -08:00
|
|
|
echo -e "${GREEN}What block for file-tree-root of drive (usually nvme0n1)?${ENDCOLOR}";read commitroot
|
2023-07-14 21:34:21 -07:00
|
|
|
|
|
|
|
parted /dev/"$commitroot" -- mklabel gpt
|
2024-01-26 21:15:31 -08:00
|
|
|
parted /dev/"$commitroot" -- mkpart primary 512MB -16GB
|
|
|
|
parted /dev/"$commitroot" -- mkpart swap linux-swap -16GB 100%
|
2023-07-14 21:34:21 -07:00
|
|
|
parted /dev/"$commitroot" -- mkpart ESP fat32 1MB 512MB
|
2024-01-26 21:15:31 -08:00
|
|
|
parted /dev/"$commitroot" -- set 3 esp on
|
2023-07-14 21:34:21 -07:00
|
|
|
|
|
|
|
lsblk
|
|
|
|
|
2024-01-26 21:15:31 -08:00
|
|
|
echo -e "${GREEN}What partition for Boot-Partition (usually nvme0n1p1)?${ENDCOLOR}";read commitbootpartition
|
2023-07-14 21:34:21 -07:00
|
|
|
|
2024-01-26 21:15:31 -08:00
|
|
|
echo -e "${GREEN}What partition for Main-Partition (usually nvme0n1p2)?${ENDCOLOR}";read commitmainpartition
|
2023-07-14 21:34:21 -07:00
|
|
|
|
2024-01-26 21:15:31 -08:00
|
|
|
echo -e "${GREEN}What partition for Swap-Partition (usually nvme0n1p3)?${ENDCOLOR}";read commitswappartition
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mkfs.ext4 -L nixos /dev/"$commitmainpartition"
|
|
|
|
|
|
|
|
mkswap -L swap /dev/"$commitswappartition"
|
2023-07-14 21:34:21 -07:00
|
|
|
|
|
|
|
mkfs.fat -F 32 -n boot /dev/"$commitbootpartition"
|
|
|
|
|
|
|
|
mount /dev/disk/by-label/nixos /mnt
|
|
|
|
|
|
|
|
mkdir -p /mnt/boot/efi
|
|
|
|
|
|
|
|
mount /dev/disk/by-label/boot /mnt/boot/efi
|
|
|
|
|
2024-01-26 21:15:31 -08:00
|
|
|
|
|
|
|
|
2023-07-14 21:34:21 -07:00
|
|
|
nixos-generate-config --root /mnt
|
|
|
|
|
|
|
|
rm /mnt/etc/nixos/configuration.nix
|
|
|
|
|
|
|
|
cat <<EOT >> /mnt/etc/nixos/configuration.nix
|
|
|
|
{ config, pkgs, ... }: {
|
2023-07-15 14:06:32 -07:00
|
|
|
|
2023-07-14 21:34:21 -07:00
|
|
|
imports = [
|
2023-07-15 14:06:32 -07:00
|
|
|
|
2023-07-14 21:34:21 -07:00
|
|
|
./hardware-configuration.nix
|
2023-07-15 14:06:32 -07:00
|
|
|
|
2023-07-14 21:34:21 -07:00
|
|
|
];
|
|
|
|
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
|
|
|
|
2024-01-26 21:15:31 -08:00
|
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
2023-07-14 21:34:21 -07:00
|
|
|
|
2023-07-15 09:50:54 -07:00
|
|
|
users.users = {
|
|
|
|
free = {
|
|
|
|
isNormalUser = true;
|
|
|
|
description = "free";
|
|
|
|
extraGroups = [ "networkmanager" ];
|
|
|
|
};
|
2023-07-15 14:06:32 -07:00
|
|
|
};
|
2023-07-15 09:50:54 -07:00
|
|
|
|
2023-07-14 21:34:21 -07:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
wget
|
|
|
|
git
|
|
|
|
ranger
|
|
|
|
fish
|
2023-07-14 23:50:43 -07:00
|
|
|
pwgen
|
2023-07-15 00:13:18 -07:00
|
|
|
openssl
|
2023-07-14 21:34:21 -07:00
|
|
|
];
|
|
|
|
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
permitRootLogin = "yes";
|
2023-07-15 14:06:32 -07:00
|
|
|
};
|
2023-07-14 21:34:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOT
|
|
|
|
|
|
|
|
nixos-install
|
|
|
|
|
2023-07-14 21:35:59 -07:00
|
|
|
reboot
|