dotfiles/system/devices/oneplus-6-phone.nix

65 lines
1.7 KiB
Nix
Raw Permalink Normal View History

2023-12-19 11:12:34 +07:00
{ config
, ...
}:
let
uuids.enc = "e2abdea5-71dc-4a9e-aff3-242117342d60";
uuids.boot = "9DA3-28AC";
2024-09-17 08:33:17 +07:00
uuids.root = "5fadc23c-f374-442d-8b05-fb76611c9eb7";
2023-12-19 11:12:34 +07:00
parts = builtins.mapAttrs (k: v: "/dev/disk/by-uuid/${v}") uuids;
in
{
imports = [
../hardware/oneplus-enchilada
../hosts/phone
];
# https://gitlab.com/postmarketOS/pmaports/-/issues/2440
# networking.wireless.iwd.enable = true;
networking.networkmanager.enable = true;
boot.loader = {
grub.enable = false;
systemd-boot.enable = true;
efi.canTouchEfiVariables = false;
};
boot.initrd = {
luks.devices.cryptroot = {
device = parts.enc;
allowDiscards = true;
};
network.ssh = {
enable = true;
port = 22;
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
hostKeys = [ "/secrets/initrd/ssh_host_ed25519_key" "/secrets/initrd/ssh_host_rsa_key" ];
};
2023-12-19 11:12:34 +07:00
};
fileSystems = let
neededForBoot = true;
in {
"/" = { device = "none"; fsType = "tmpfs"; inherit neededForBoot;
options = [ "defaults" "size=2G" "mode=755" ]; };
"/persist" =
2024-09-17 08:33:17 +07:00
{ device = parts.root; fsType = "btrfs"; inherit neededForBoot;
options = [ "discard=async" "compress=zstd:15" ]; };
2023-12-19 11:12:34 +07:00
"/boot" = { device = parts.boot; fsType = "vfat"; inherit neededForBoot; };
};
zramSwap.enable = true;
impermanence = {
enable = true;
path = /persist;
directories = [
{ directory = /home/${config.common.mainUsername}; user = config.common.mainUsername; group = "users"; mode = "0700"; }
{ directory = /root; mode = "0700"; }
{ directory = /nix; }
{ directory = /secrets; mode = "0000"; }
];
};
}