41 Commits
Author SHA1 Message Date
marc 64ae9acfe9 Merge branch 'custom' into custom-p 2023-12-15 19:36:19 +01:00
marc 4492652779 stdin 2023-12-15 19:36:05 +01:00
marc 898d2dadc1 Merge branch 'custom' into custom-p 2023-12-15 19:33:40 +01:00
marc 7bd70b4fe1 env 2023-12-15 19:33:30 +01:00
marc f8666e735e Merge branch 'custom' into custom-p 2023-12-15 18:27:38 +01:00
marc 631e7cdc33 40 2023-12-15 18:25:39 +01:00
marc ff3c3271bf Merge branch 'custom' into custom-p 2023-12-13 18:46:20 +01:00
marc d27f4791df abcd1234 2023-12-13 18:46:13 +01:00
marc bd294d5252 Merge branch 'custom' into custom-p 2023-12-12 19:13:26 +01:00
marc dc243f0d5a true 2023-12-12 19:13:07 +01:00
marc e9f1162c77 Merge branch 'custom' into custom-p 2023-12-12 19:04:20 +01:00
marc e6ed033165 install packages 2023-12-12 19:04:09 +01:00
marc ffacaf1e12 Merge branch 'custom' into custom-p 2023-12-12 19:02:16 +01:00
marc a5d847843e nixos no laptop 2023-12-12 19:02:11 +01:00
marc c7fbc2a853 Merge branch 'custom' into custom-p 2023-11-14 17:05:00 +08:00
marc 196ff1291e Merge branch 'custom' into custom-p 2023-11-14 16:59:26 +08:00
marc 9551320771 Merge branch 'custom' into custom-p 2023-11-14 16:57:46 +08:00
marc 837a9181b4 Merge branch 'custom' into custom-p 2023-11-14 16:50:38 +08:00
marc c2b92b213e fix 2023-11-14 16:46:53 +08:00
marc ad9f105731 with p 2023-11-14 16:46:20 +08:00
marc e16c9cc6eb Merge branch 'custom' into custom-p 2023-11-14 16:46:10 +08:00
marc fbeab0dbc4 fix 2023-11-14 16:45:56 +08:00
marc eeb540a7b4 Merge branch 'custom' into custom-p 2023-11-14 16:31:59 +08:00
marc 922b6efdfe Merge branch 'custom' into custom-p 2023-11-14 16:28:52 +08:00
marc 09d0f341c1 Merge branch 'custom' into custom-p 2023-11-14 16:26:03 +08:00
marc 424b88aec6 Merge branch 'custom' into custom-p 2023-11-14 16:19:47 +08:00
marc e587aa5781 Merge branch 'custom' into custom-p 2023-11-14 16:12:37 +08:00
marc 5fd6591d19 Merge branch 'custom' into custom-p 2023-11-14 16:10:47 +08:00
marc 6385c467b8 Merge branch 'custom' into custom-p 2023-11-14 16:09:12 +08:00
marc 4a461b6237 Merge branch 'custom' into custom-p 2023-11-14 16:07:38 +08:00
marc e3f5ab60f0 Merge branch 'custom' into custom-p 2023-11-14 16:06:54 +08:00
marc 614e552eb9 fix 2023-11-14 16:05:15 +08:00
marc f1e4854d72 root and connectivity 2023-11-14 16:02:14 +08:00
marc 7b4ff30ef9 Merge branch 'custom' into custom-p 2023-11-14 15:55:17 +08:00
marc 084877a661 fix 2023-11-14 15:54:36 +08:00
marc 793f015374 Merge branch 'custom' into custom-p 2023-11-14 15:54:27 +08:00
marc 5a2dfdb13c Merge branch 'custom' into custom-p 2023-11-14 15:51:53 +08:00
marc 2f61558a1d loading zfs module first 2023-11-14 15:51:43 +08:00
marc 1f2133e0be custom with docker 2023-11-14 15:49:56 +08:00
marc b03687fd1f fix p in install.sh 2023-11-14 15:29:54 +08:00
marc b78cedddcb p 2023-11-14 15:28:23 +08:00
4 changed files with 23 additions and 24 deletions
+1 -1
View File
@@ -55,7 +55,7 @@
};
in {
nixosConfigurations = {
laptop = mkHost "laptop" "x86_64-linux";
nixos = mkHost "nixos" "x86_64-linux";
};
};
}
+3 -3
View File
@@ -5,14 +5,14 @@
bootDevices = [ "bootDevices_placeholder" ];
immutable.enable = false;
removableEfi = true;
luks.enable = True;
luks.enable = true;
};
};
boot.initrd.availableKernelModules = [ "kernelModules_placeholder" ];
boot.kernelParams = [ ];
networking.hostId = "nixos";
networking.hostId = "abcd1234";
# read changeHostName.txt file.
networking.hostName = "laptop";
networking.hostName = "nixos";
time.timeZone = "Europe/Paris";
# import preconfigured profiles
+14 -15
View File
@@ -1,4 +1,4 @@
#!/bin/env bash
#!/usr/bin/env bash
log() { echo -e "\n\033[1m${@}\033[0m"; }
@@ -15,6 +15,9 @@ curl -s google.com > /dev/null || exit 1
log Loading zfs module first
modprobe zfs || exit 1
log Installing packages
nix-env -f '<nixpkgs>' -iA git jq parted fzf
echo ""
lsblk
echo ""
@@ -57,10 +60,6 @@ echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
log Installing programs needed for system installation
# ---
if ! command -v git; then nix-env -f '<nixpkgs>' -iA git; fi
if ! command -v jq; then nix-env -f '<nixpkgs>' -iA jq; fi
if ! command -v partprobe; then nix-env -f '<nixpkgs>' -iA parted; fi
log Partition the disks
@@ -73,8 +72,8 @@ partition_disk () {
mklabel gpt \
mkpart swap 1MiB $((SWAPSIZE + 1))MiB \
mkpart rpool $((SWAPSIZE + 1))MiB -$((RESERVE + 100))MiB \
mkpart bpool -$((RESERVE + 100))MiB -$((RESERVE + 3))MiB \
mkpart EFI -$((RESERVE + 3))MiB -$((RESERVE + 2))MiB \
mkpart bpool -$((RESERVE + 100))MiB -$((RESERVE + 40))MiB \
mkpart EFI -$((RESERVE + 40))MiB -$((RESERVE + 2))MiB \
mkpart BIOS -$((RESERVE + 2))MiB -$((RESERVE + 1))MiB \
set 4 esp on \
set 5 bios_grub on \
@@ -109,7 +108,7 @@ createbpool="zpool create \
-R $MNT \
bpool \
`for i in $DISK; do
printf '%s ' ${i}3
printf '%s ' ${i}p3
done`"
echo $createbpool
eval $createbpool
@@ -175,9 +174,9 @@ zfs snapshot rpool/nixos/empty@start
log Formatting and mounting ESP
# ---
for i in ${DISK}; do
mkfs.vfat -n EFI "${i}"4
mkdir -p "${MNT}"/boot/efis/"${i##*/}"4
mount -t vfat -o iocharset=iso8859-1 "${i}"4 "${MNT}"/boot/efis/"${i##*/}"4
mkfs.vfat -n EFI "${i}"p4
mkdir -p "${MNT}"/boot/efis/"${i##*/}"p4
mount -t vfat -o iocharset=iso8859-1 "${i}"p4 "${MNT}"/boot/efis/"${i##*/}"p4
done
@@ -232,7 +231,7 @@ sed -i "s|\"kernelModules_placeholder\"|${kernelModules}|g" \
log Setting root password
# ---
rootPwd=$(mkpasswd2 -m SHA-512)
rootPwd=$(echo $POOLPASS | mkpasswd -sm SHA-512)
sed -i \
"s|rootHash_placeholder|${rootPwd}|" \
"${MNT}"/etc/nixos/configuration.nix
@@ -258,9 +257,9 @@ nixos-install \
log Setuping encrypted swap. This is useful if the available memory is small
# ---
for i in ${DISK}; do
cryptsetup open --type plain --key-file /dev/random "${i}"1 "${i##*/}"1
mkswap /dev/mapper/"${i##*/}"1
swapon /dev/mapper/"${i##*/}"1
cryptsetup open --type plain --key-file /dev/random "${i}"p1 "${i##*/}"p1
mkswap /dev/mapper/"${i##*/}"p1
swapon /dev/mapper/"${i##*/}"p1
done
log Unmounting filesystems
+5 -5
View File
@@ -41,11 +41,11 @@ in {
};
partitionScheme = mkOption {
default = {
swap = "1";
rootPool = "2";
bootPool = "3";
efiBoot = "4";
biosBoot = "5";
swap = "p1";
rootPool = "p2";
bootPool = "p3";
efiBoot = "p4";
biosBoot = "p5";
};
description = "Describe on disk partitions";
type = types.attrsOf types.str;