🚀 add work host and profile

This commit is contained in:
Moritz Böhme 2022-08-31 12:11:44 +02:00
parent 590c3d41fe
commit d1df706826
4 changed files with 282 additions and 0 deletions

View file

@ -0,0 +1,96 @@
# 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" "thunderbolt" "vmd" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/23782fe8-86f7-4aa1-afc1-6586443d0d3e";
fsType = "btrfs";
options = [ "subvol=@" "compress=zstd" "noatime" ];
};
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/1958da8c-d506-49a6-b983-dc8477d25b7c";
fileSystems."/home" =
{
device = "/dev/disk/by-uuid/23782fe8-86f7-4aa1-afc1-6586443d0d3e";
fsType = "btrfs";
options = [ "subvol=@home" "compress=zstd" "noatime" ];
};
fileSystems."/swap" =
{
device = "/dev/disk/by-uuid/23782fe8-86f7-4aa1-afc1-6586443d0d3e";
fsType = "btrfs";
options = [ "subvol=@swap" "compress=zstd" "noatime" ];
};
fileSystems."/nix" =
{
device = "/dev/disk/by-uuid/23782fe8-86f7-4aa1-afc1-6586443d0d3e";
fsType = "btrfs";
options = [ "subvol=@nix" "compress=zstd" "noatime" ];
};
fileSystems."/var/log" =
{
device = "/dev/disk/by-uuid/23782fe8-86f7-4aa1-afc1-6586443d0d3e";
fsType = "btrfs";
options = [ "subvol=@log" "compress=zstd" "noatime" ];
};
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/8EFC-70D8";
fsType = "vfat";
};
swapDevices = [{
device = "/swap/swapfile";
size = (1024 * 16) + (1024 * 2); # RAM size + 2GB
}];
boot.kernelParams = [ "resume_offset=19579486208" ];
boot.resumeDevice = "/dev/disk/by-uuid/23782fe8-86f7-4aa1-afc1-6586443d0d3e";
systemd.services = {
create-swapfile = {
serviceConfig.Type = "oneshot";
wantedBy = [ "swap-swapfile.swap" ];
script = ''
swapfile="/swap/swapfile"
if [[ -f "$swapfile" ]]; then
echo "Swap file $swapfile already exists, taking no action."
else
echo "Setting up swap file $swapfile..."
${pkgs.coreutils}/bin/truncate -s 0 /swap/swapfile
${pkgs.e2fsprogs}/bin/chattr +C /swap/swapfile
echo "Done."
fi
'';
};
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s13f0u2u4.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}