nixos-config: add live MMC system and extract commons

This commit is contained in:
steveej 2018-10-29 00:54:49 +01:00
parent 68ca11e4db
commit f75ab8d271
15 changed files with 771 additions and 40 deletions

View file

@ -0,0 +1,51 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
let
deviceId = "mmc-SL32G_0x259093f6";
volumeGroup = deviceId;
bootGrubDevice = lib.concatStrings [ "/dev/disk/by-id/" deviceId ];
bootFsDevice = lib.concatStrings [ "/dev/disk/by-partlabel/" deviceId "-part2" ];
bootLuksDevice = lib.concatStrings [ "/dev/disk/by-partlabel/" deviceId "-part3" ];
rootFsDevice = lib.concatStrings [ "/dev/" volumeGroup "/root" ];
swapFsDevice = lib.concatStrings [ "/dev/" volumeGroup "/swap" ];
in {
fileSystems."/boot" = {
device = bootFsDevice;
fsType = "vfat";
};
fileSystems."/" = {
device = rootFsDevice;
fsType = "btrfs";
options = [ "subvol=nixos" ];
};
fileSystems."/home" = {
device = rootFsDevice;
fsType = "btrfs";
options = [ "subvol=home" ];
};
swapDevices = [ { device = swapFsDevice; } ];
boot.loader.grub = {
device = bootGrubDevice;
efiSupport = true;
efiInstallAsRemovable = true;
};
boot.initrd.luks.devices = [
{
name = "cryptliveusb";
device = bootLuksDevice;
preLVM = true;
allowDiscards = true;
}
];
}