Test disk layout

This commit is contained in:
iFargle 2023-09-22 10:45:07 +09:00
parent 2c57539f9f
commit fd59a1df25
4 changed files with 46 additions and 48 deletions

View file

@ -4,6 +4,8 @@
* Installing a system from the ISO:
```
nixos-install <Hostname> [<Username>]
HOSTNAME='YourHostnameHere'
curl https://git.sysctl.io/albert/nix/raw/branch/main/nixos/hosts/${HOSTNAME}/disks.nix >> /tmp/disks.nix
echo 'LUKSEncryptionKeyHere' >> /tmp/secret.key
@ -32,7 +34,7 @@ nixos-install --flake /etc/nixos/git#${HOSTNAME} -v --show-trace --no-root-passw
* [ ] Add bracket auto-completion
* [ ] Find a way to have magit save login credentials
* [x] Try disko - [Link](https://github.com/nix-community/disko)
* [ ] btrfs snapshots
* [ ] btrfs snapshotsd
* [ ] vscodium and user-config.js file?
* [ ] rofi - bitwarden-cli / bitwarden-menu ([Link](https://search.nixos.org/packages?channel=23.05&show=bitwarden-menu&from=0&size=50&sort=relevance&type=packages&query=bitwarden))

View file

@ -59,7 +59,7 @@
];
};
# Combines mkHost and mkHome for image building
# Combines mkHost and mkHome for image building - Uses minimal to make a smaller image
mkMinImage = {
hostname ,
username ? "albert",

View file

@ -2,58 +2,54 @@
disko.devices = {
disk = {
sda = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
ESP = {
label = "EFI";
name = "ESP";
size = "512M";
type = "EF00";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
type = "table";
format = "gpt";
partitions = [
{
name = "BOOT";
label = "BOOT";
start = "0%";
end = "550MiB";
bootable = true;
flags = [ "esp" ];
fs-type = "fat32";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
luks = {
size = "100%";
}
{
name = "ROOT";
label = "ROOT";
size = "100%";
content = {
type = "luks";
name = "LUKS-ROOT";
extraOpenArgs = [ "--allow-discards" ];
settings.keyFile = "/tmp/secret.key";
content = {
type = "luks";
name = "crypted";
extraOpenArgs = [ "--allow-discards" ];
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
#passwordFile = "/tmp/secret.key"; # Interactive
settings.keyFile = "/tmp/secret.key";
# additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
};
};
};
};
}
];
};
};
};