l hilum.r: add usb-flash stick, update disko config

This commit is contained in:
lassulus 2023-07-08 15:14:05 +02:00
parent 76848d24c2
commit add9f31613
3 changed files with 15 additions and 16 deletions

View File

@ -10,18 +10,14 @@
partitions = [ partitions = [
{ {
name = "boot"; name = "boot";
type = "partition";
start = "0"; start = "0";
end = "1M"; end = "1M";
part-type = "primary";
flags = ["bios_grub"]; flags = ["bios_grub"];
} }
{ {
type = "partition";
name = "ESP"; name = "ESP";
start = "1MiB"; start = "1M";
end = "50%"; end = "50%";
fs-type = "fat32";
bootable = true; bootable = true;
content = { content = {
type = "filesystem"; type = "filesystem";
@ -31,19 +27,13 @@
} }
{ {
name = "root"; name = "root";
type = "partition";
start = "50%"; start = "50%";
end = "100%"; end = "100%";
content = {
type = "luks";
name = "hilum_luks";
keyFile = keyFile;
content = { content = {
type = "filesystem"; type = "filesystem";
format = "xfs"; format = "ext4";
mountpoint = "/"; mountpoint = "/";
}; };
};
} }
]; ];
}; };

View File

@ -3,9 +3,13 @@ set -efux
disk=$1 disk=$1
cd "$(dirname "$0")"
export NIXPKGS_ALLOW_UNFREE=1 export NIXPKGS_ALLOW_UNFREE=1
(umask 077; pass show admin/hilum/luks > /tmp/hilum.luks) (umask 077; pass show admin/hilum/luks > /tmp/hilum.luks)
trap 'rm -f /tmp/hilum.luks' EXIT trap 'rm -f /tmp/hilum.luks' EXIT
echo "$disk" > /tmp/hilum-disk
trap 'rm -f /tmp/hilum-disk' EXIT
stockholm_root=$(git rev-parse --show-toplevel) stockholm_root=$(git rev-parse --show-toplevel)
ssh root@localhost -t -- $(nix-build \ ssh root@localhost -t -- $(nix-build \
--no-out-link \ --no-out-link \
@ -31,7 +35,9 @@ $(nix-build \
--arg force true --arg force true
) )
ssh root@localhost << SSH ssh root@localhost << SSH
NIXOS_CONFIG=/mnt/hilum/var/src/nixos-config nixos-install --no-root-password --root /mnt/hilum -I /var/src set -efux
mkdir -p /mnt/hilum/etc
NIXOS_CONFIG=/mnt/hilum/var/src/nixos-config nixos-install --no-bootloader --no-root-password --root /mnt/hilum -I /var/src
nixos-enter --root /mnt/hilum -- nixos-rebuild -I /var/src switch --install-bootloader nixos-enter --root /mnt/hilum -- nixos-rebuild -I /var/src switch --install-bootloader
umount -Rv /mnt/hilum umount -Rv /mnt/hilum
SSH SSH

View File

@ -15,7 +15,7 @@
; ;
in lib.mkOption { in lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = tryFile "/etc/hilum-disk" "/dev/sdz"; default = tryFile "/etc/hilum-disk" (tryFile "/tmp/hilum-disk" "/dev/sdz");
}; };
config.environment.etc.hilum-disk.text = config.mainDisk; config.environment.etc.hilum-disk.text = config.mainDisk;
} }
@ -47,4 +47,7 @@
nix.maxJobs = lib.mkDefault 4; nix.maxJobs = lib.mkDefault 4;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
#weird bug with nixos-enter
services.logrotate.enable = false;
} }