I have the following environment:
❯ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 1.8T 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 1.8T 0 part
└─root 254:0 0 1.8T 0 crypt
├─nixos--vg-swap 254:1 0 16G 0 lvm [SWAP]
├─nixos--vg-root 254:2 0 200G 0 lvm /
├─nixos--vg-var 254:3 0 200G 0 lvm /var
├─nixos--vg-nix 254:4 0 200G 0 lvm /nix
└─nixos--vg-home 254:5 0 1.2T 0 lvm /home
This the generated hardware-configuration.nix
:
# 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, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/d5f672ab-6578-4f63-9c01-2798813eba84";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/7B9A-3132";
fsType = "vfat";
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/5bbf03fa-558a-453d-9554-b2a4e5df3fc2";
fsType = "ext4";
};
fileSystems."/var" =
{ device = "/dev/disk/by-uuid/f246ec0f-3dd9-426c-92a9-3791b4a6e77f";
fsType = "ext4";
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/e6a4daaa-dfc4-4082-aff0-482cf51c0f16";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/8d192ac1-7b4d-44ec-b5e1-7dcb685c00ef"; }
];
# high-resolution display
hardware.video.hidpi.enable = lib.mkDefault true;
}
To ask for password before mouting /dev/sda2
when booting my system:
boot.initrd.luks.devices = {
root = {
device = "/dev/sda2";
preLVM = true;
};
};
However, every time I shutdown my system it seems I get error warnings from systemd that it can’t umount /nix/store
.
nix-shell -p nix-info --run "nix-info -m"
these paths will be fetched (0.05 MiB download, 0.28 MiB unpacked):
/nix/store/a9g7p6fwanw66j5djzila7ql1hky759z-bash-interactive-4.4-p23-dev
copying path '/nix/store/a9g7p6fwanw66j5djzila7ql1hky759z-bash-interactive-4.4-p23-dev' from 'https://cache.nixos.org'...
- system: `"x86_64-linux"`
- host os: `Linux 5.4.108, NixOS, 20.09.3686.da7f4c48425 (Nightingale)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3.10`
- channels(root): `"nixos-20.09.3728.cadb0637829"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`