chore: remove old vm host entry since it is not used anymore
This commit is contained in:
+1
-1
@@ -75,7 +75,7 @@ fileSystems."/" =
|
|||||||
fileSystems."/boot" =
|
fileSystems."/boot" =
|
||||||
{ device = "/dev/disk/by-label/nixboot";
|
{ device = "/dev/disk/by-label/nixboot";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = [ "fmask=0022" "dmask=0022" ];
|
options = [ "fmask=0077" "dmask=0077" ]; # only root may read /boot
|
||||||
};
|
};
|
||||||
fileSystems."/home" =
|
fileSystems."/home" =
|
||||||
{ device = "/dev/disk/by-label/nixhome";
|
{ device = "/dev/disk/by-label/nixhome";
|
||||||
|
|||||||
@@ -1,17 +1,7 @@
|
|||||||
# argon: desktop with an amd gpu and three luks-encrypted data drives.
|
# argon: desktop with an amd gpu and three luks-encrypted data drives.
|
||||||
# The drives are unlocked in the initrd with keyfiles from /etc/nixos/keys.
|
|
||||||
|
|
||||||
{ lib, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
# luks name -> partition uuid, mounted at /mnt/<name>
|
|
||||||
drives = {
|
|
||||||
data1 = "dfae62cc-bad1-4879-bf9a-461bde833625";
|
|
||||||
data2 = "8312edae-9247-481b-a313-52a7f848f027";
|
|
||||||
nvmecache = "2352250e-4ebe-4f9a-bf66-0d4aaa961bd8";
|
|
||||||
};
|
|
||||||
key = name: "/etc/nixos/keys/${name}.key";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/nixos/appimage.nix
|
../../modules/nixos/appimage.nix
|
||||||
@@ -19,6 +9,7 @@ in
|
|||||||
../../modules/nixos/audio.nix
|
../../modules/nixos/audio.nix
|
||||||
../../modules/nixos/bootloader.nix
|
../../modules/nixos/bootloader.nix
|
||||||
../../modules/nixos/certificates.nix
|
../../modules/nixos/certificates.nix
|
||||||
|
../../modules/nixos/data-drives.nix
|
||||||
../../modules/nixos/gnupg.nix
|
../../modules/nixos/gnupg.nix
|
||||||
../../modules/nixos/greetd.nix
|
../../modules/nixos/greetd.nix
|
||||||
../../modules/nixos/locales.nix
|
../../modules/nixos/locales.nix
|
||||||
@@ -46,22 +37,12 @@ in
|
|||||||
};
|
};
|
||||||
hardware.amdgpu.initrd.enable = true;
|
hardware.amdgpu.initrd.enable = true;
|
||||||
|
|
||||||
# encrypted data drives
|
# encrypted data drives, see data-drives.nix
|
||||||
boot.initrd.secrets = lib.mapAttrs' (name: _: lib.nameValuePair (key name) (key name)) drives;
|
local.dataDrives = {
|
||||||
boot.initrd.luks.devices = lib.mapAttrs (name: uuid: {
|
data1 = "dfae62cc-bad1-4879-bf9a-461bde833625";
|
||||||
device = "/dev/disk/by-uuid/${uuid}";
|
data2 = "8312edae-9247-481b-a313-52a7f848f027";
|
||||||
keyFile = key name;
|
nvmecache = "2352250e-4ebe-4f9a-bf66-0d4aaa961bd8";
|
||||||
# trim for ssds, ignored by drives without discard support
|
};
|
||||||
allowDiscards = true;
|
|
||||||
}) drives;
|
|
||||||
fileSystems = lib.mapAttrs' (
|
|
||||||
name: _:
|
|
||||||
lib.nameValuePair "/mnt/${name}" {
|
|
||||||
device = "/dev/mapper/${name}";
|
|
||||||
fsType = "ext4";
|
|
||||||
options = [ "nofail" ];
|
|
||||||
}
|
|
||||||
) drives;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
amdgpu_top
|
amdgpu_top
|
||||||
|
|||||||
@@ -39,8 +39,8 @@
|
|||||||
device = "/dev/disk/by-label/nixboot";
|
device = "/dev/disk/by-label/nixboot";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = [
|
options = [
|
||||||
"fmask=0022"
|
"fmask=0077"
|
||||||
"dmask=0022"
|
"dmask=0077"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,8 @@
|
|||||||
device = "/dev/disk/by-label/nixboot";
|
device = "/dev/disk/by-label/nixboot";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = [
|
options = [
|
||||||
"fmask=0022"
|
"fmask=0077"
|
||||||
"dmask=0022"
|
"dmask=0077"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,8 @@
|
|||||||
device = "/dev/disk/by-label/nixboot";
|
device = "/dev/disk/by-label/nixboot";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = [
|
options = [
|
||||||
"fmask=0022"
|
"fmask=0077"
|
||||||
"dmask=0022"
|
"dmask=0077"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
# luks-encrypted data drives, unlocked after boot via /etc/crypttab with
|
||||||
|
# keyfiles from /etc/nixos/keys/<name>.key on the encrypted root.
|
||||||
|
# Not in boot.initrd.luks on purpose: keyfiles there end up in the initrd
|
||||||
|
# on the unencrypted /boot.
|
||||||
|
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
drives = config.local.dataDrives;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.local.dataDrives = lib.mkOption {
|
||||||
|
type = lib.types.attrsOf lib.types.str;
|
||||||
|
default = { };
|
||||||
|
example = {
|
||||||
|
data1 = "dfae62cc-bad1-4879-bf9a-461bde833625";
|
||||||
|
};
|
||||||
|
description = "luks name -> luks partition uuid, mounted at /mnt/<name>";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (drives != { }) {
|
||||||
|
environment.etc.crypttab.text = lib.concatStrings (
|
||||||
|
lib.mapAttrsToList (
|
||||||
|
name: uuid: "${name} /dev/disk/by-uuid/${uuid} /etc/nixos/keys/${name}.key luks,discard,nofail\n"
|
||||||
|
) drives
|
||||||
|
);
|
||||||
|
|
||||||
|
fileSystems = lib.mapAttrs' (
|
||||||
|
name: _:
|
||||||
|
lib.nameValuePair "/mnt/${name}" {
|
||||||
|
device = "/dev/mapper/${name}";
|
||||||
|
fsType = "ext4";
|
||||||
|
options = [ "nofail" ];
|
||||||
|
}
|
||||||
|
) drives;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user