154 lines
4.2 KiB
Nix
154 lines
4.2 KiB
Nix
# 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, ... }:
|
||
|
||
let
|
||
impermanence = builtins.fetchTarball {
|
||
url = "https://github.com/nix-community/impermanence/archive/master.tar.gz";
|
||
};
|
||
in {
|
||
imports = [ # Include the results of the hardware scan.
|
||
./nixos/hardware-configuration/capibara.nix
|
||
./nixos/common.nix
|
||
"${impermanence}/nixos.nix"
|
||
];
|
||
|
||
fileSystems = {
|
||
"/" = {
|
||
device = "tmpfs";
|
||
fsType = "tmpfs";
|
||
options = [ "defaults" "size=2G" "mode=755" ];
|
||
};
|
||
|
||
"/persist/system" = {
|
||
device = "/dev/mapper/system";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=persist" "compress=zstd" ];
|
||
neededForBoot = true;
|
||
};
|
||
|
||
"/persist/user" = {
|
||
device = "/dev/mapper/user";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=persist" "compress=zstd" ];
|
||
neededForBoot = true;
|
||
};
|
||
|
||
"/nix" = {
|
||
device = "/dev/mapper/system";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=nix" "compress=zstd" ];
|
||
};
|
||
|
||
"/boot" = {
|
||
device = "/dev/mapper/system";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=boot" "compress=zstd" ];
|
||
};
|
||
|
||
"/swap" = {
|
||
device = "/dev/mapper/system";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=swap" ];
|
||
};
|
||
|
||
};
|
||
|
||
swapDevices = [{ device = "/swap/swapfile"; }];
|
||
|
||
environment.persistence."/persist/system" = {
|
||
directories = [
|
||
"/var/log"
|
||
"/var/lib/bluetooth"
|
||
"/var/lib/systemd/coredump"
|
||
"/var/lib/docker"
|
||
];
|
||
files = [
|
||
"/etc/machine-id"
|
||
#"/etc/nix/id_rsa"
|
||
"/etc/ssh/ssh_host_ed25519_key"
|
||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||
"/etc/ssh/ssh_host_rsa_key"
|
||
"/etc/ssh/ssh_host_rsa_key.pub"
|
||
"/etc/wireguard/wg0"
|
||
];
|
||
};
|
||
|
||
environment.persistence."/persist/user" = {
|
||
directories = [
|
||
"/etc/NetworkManager/system-connections"
|
||
"/etc/nixos"
|
||
"/var/lib/libvirt"
|
||
];
|
||
files = [
|
||
"/etc/wireguard/wg0"
|
||
];
|
||
};
|
||
|
||
networking.networkmanager.wifi.macAddress = "CC:AF:78:75:29:32";
|
||
|
||
nixpkgs.config.allowUnfree = true;
|
||
programs.steam.enable = true;
|
||
|
||
boot = {
|
||
|
||
loader = {
|
||
grub = {
|
||
efiSupport = false;
|
||
efiInstallAsRemovable = false;
|
||
enable = true;
|
||
version = 2;
|
||
device = "/dev/disk/by-id/ata-KINGSTON_SKC600MS512G_50026B7783FC3D2F";
|
||
enableCryptodisk = true;
|
||
};
|
||
};
|
||
initrd = {
|
||
luks.devices = {
|
||
system = {
|
||
device = "/dev/disk/by-uuid/a5837435-d55e-4506-b256-e5c707d205c3";
|
||
keyFile = "/root_keyfile.bin";
|
||
};
|
||
user = {
|
||
device = "/dev/disk/by-uuid/0fdb839e-dee8-4374-81e6-4455cfc3ae39";
|
||
keyFile = "/data_keyfile.bin";
|
||
};
|
||
};
|
||
secrets = {
|
||
"/root_keyfile.bin" = "/boot/root_keyfile.bin";
|
||
"/data_keyfile.bin" = "/boot/data_keyfile.bin";
|
||
};
|
||
};
|
||
};
|
||
|
||
networking = {
|
||
hostName = "capibara";
|
||
interfaces = {
|
||
eno0.useDHCP = true;
|
||
wlp2s0.useDHCP = true;
|
||
};
|
||
};
|
||
|
||
services.udev.extraRules = ''
|
||
# UDEV rules for Teensy USB devices
|
||
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
|
||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
|
||
KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
|
||
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="664", GROUP="plugdev"
|
||
'';
|
||
|
||
hardware.opengl.enable = true;
|
||
hardware.bluetooth.enable = true;
|
||
services.blueman.enable = 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. It‘s 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?
|
||
}
|