nix-config/trantor.nix

109 lines
2.8 KiB
Nix
Raw Normal View History

2022-01-18 09:32:55 +01:00
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix
./common.nix
];
fileSystems = {
"/" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
options = [ "subvol=root" "compress-force=zstd" ];
};
"/nix" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
options = [ "subvol=nix" "compress-force=zstd" ];
};
"/var/log" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
options = [ "subvol=log" "compress-force=zstd" ];
};
"/home" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
options = [ "subvol=home" "compress-force=zstd" ];
};
"/boot" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
options = [ "subvol=boot" "compress-force=zstd" ];
};
"/swap" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
options = [ "subvol=swap" ];
};
"/boot/efi" = {
device = "/dev/disk/by-uuid/0BFA-9A66";
fsType = "vfat";
};
};
swapDevices = [{ device = "/swap/swapfile"; }];
nixpkgs.config.allowUnfree = true;
boot = {
loader = {
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
grub = {
enable = true;
version = 2;
device = "nodev";
efiSupport = true;
enableCryptodisk = true;
};
};
initrd = {
luks.devices = {
"cryptroot" = {
device = "/dev/disk/by-uuid/b9778e01-a86c-4c6b-beb3-f97888d4a6eb";
keyFile = "/root_keyfile.bin";
};
"crypthome" = {
device = "/dev/disk/by-uuid/d8e9b35d-704a-4f66-bc19-0dd3e158de36";
keyFile = "/home_keyfile.bin";
};
};
secrets = {
"/root_keyfile.bin" = "/boot/root_keyfile.bin";
"/home_keyfile.bin" = "/boot/home_keyfile.bin";
};
};
};
networking = {
hostName = "trantor";
interfaces = {
enp3s0f1.useDHCP = true;
wlp4s0.useDHCP = true;
};
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.05"; # Did you read the comment?
}