Merge branch 'nixos' into nixos-work

This commit is contained in:
Moritz Böhme 2024-11-05 09:38:52 +01:00
commit 988789346c
27 changed files with 4918 additions and 249 deletions

View file

@ -14,6 +14,7 @@
];
my = {
ai.enable = true;
profiles = {
desktop.enable = true;
gaming.enable = true;
@ -21,16 +22,9 @@
impermanence.enable = true;
webis.enable = true;
};
programs.hyprland.enable = true;
programs.hyprland.nvidiaSupport = true;
programs.hyprland.keyboardLayouts = [ "us" "de" ];
programs.hyprland.monitors."HDMI-A-2" = { scale = 1.2; };
programs.exercism.enable = true;
services.wallpaper.enable = true;
};
virtualisation.containers.cdi.dynamic.nvidia.enable = true;
home-manager.users.moritz.home.packages = with pkgs; [
anki
stable.calibre # NOTE: breaks often in unstable
@ -38,10 +32,14 @@
hardware = {
keyboard.qmk.enable = true;
nvidia.modesetting.enable = true;
opengl = {
nvidia = {
modesetting.enable = true;
open = true;
};
nvidia-container-toolkit.enable = true;
graphics = {
enable = true;
driSupport32Bit = true;
enable32Bit = true;
};
# sensors
@ -50,9 +48,6 @@
};
boot = {
# KERNEL
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; # NOTE: use latest zfs compatible kernel
# BOOT
supportedFilesystems = [ "zfs" "btrfs" "ntfs" ];
loader = {

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib, pkgs, ... }:
{
# needed for zfs pool
@ -83,9 +83,27 @@
};
};
# rollback to blank
boot.initrd.postDeviceCommands = lib.mkAfter ''
zfs rollback -r zroot/encrypted/root@blank && echo "rollback complete"
'';
boot.initrd.systemd.services.rollback = {
description = "Rollback ZFS datasets to a pristine state";
wantedBy = [
"initrd.target"
];
after = [
"zfs-import-zroot.service"
];
before = [
"sysroot.mount"
];
path = with pkgs; [
zfs
];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
zfs rollback -r zroot/encrypted/root@blank && echo "rollback complete"
'';
};
boot.initrd.systemd.enable = true;
fileSystems."/persist".neededForBoot = true;
# HACK: to fix issue of agenix running before impermanence
age.identityPaths = [

View file

@ -6,11 +6,11 @@
, ...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
./disko.nix
];
facter.reportPath = ./facter.json;
my = {
virtualisation.libvirtd.enable = true;
yubikey.luksSupport.enable = false;
@ -20,8 +20,7 @@
webis.enable = true;
impermanence.enable = true;
};
programs.river.enable = true;
programs.hyprland.enable = false;
terminal.package = pkgs.kitty;
programs.exercism.enable = true;
};
@ -35,7 +34,6 @@
criteria = "eDP-1";
}
];
}
{
profile.name = "docked";
@ -142,6 +140,7 @@
supportedFilesystems = [ "zfs" ];
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
initrd.availableKernelModules = [ "rtsx_pci_sdmmc" ];
};
# SERVICES
@ -151,7 +150,6 @@
printing.enable = true;
logind.lidSwitch = "hybrid-sleep";
};
hardware.bluetooth.enable = true;
# NETWORKING
networking = {
@ -172,6 +170,7 @@
# Powersaving
services.tlp.enable = true;
powerManagement.enable = true;
powerManagement.powertop.enable = true;
systemd = {
# Hibernare on low battery

File diff suppressed because it is too large Load diff

View file

@ -1,17 +0,0 @@
# 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.
{ modulesPath
, lib
, ...
}: {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "rtsx_pci_sdmmc" ];
initrd.kernelModules = [ ];
kernelModules = [ "kvm-amd" ];
extraModulePackages = [ ];
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}