systems/machines/persephone.nix

358 lines
7 KiB
Nix

{
config,
lib,
pkgs,
modulesPath,
...
}:
let
bootUUID = "9c2d7380-571d-4bc5-9ad2-e4888ce351be";
efiUUID = "71E7-7A63";
luuksUUID = "b0ace3a0-64f0-461e-a604-7f6788384d12";
cryptrootUUID = "769362f6-43d4-4b83-a12c-d006c9bd6613";
in
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
./persephone/hardware.nix
./persephone/networking.nix
../profiles/minimal.nix
../profiles/desktop.linux.nix
];
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"1password"
"1password-cli"
"nvidia-x11"
"nvidia-settings"
];
# FILE SYSTEM
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/${bootUUID}";
fsType = "ext4";
};
fileSystems."/efi" = {
device = "/dev/disk/by-uuid/${efiUUID}";
fsType = "vfat";
options = [
"fmask=0137"
"dmask=0027"
];
};
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/${luuksUUID}";
fileSystems."/" = {
device = "/dev/disk/by-uuid/${cryptrootUUID}";
fsType = "btrfs";
options = [ "subvol=@root" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/${cryptrootUUID}";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/${cryptrootUUID}";
fsType = "btrfs";
options = [ "subvol=@nix" ];
};
fileSystems."/var/cache" = {
device = "/dev/disk/by-uuid/${cryptrootUUID}";
fsType = "btrfs";
options = [ "subvol=@var_cache" ];
};
fileSystems."/var/log" = {
device = "/dev/disk/by-uuid/${cryptrootUUID}";
fsType = "btrfs";
options = [ "subvol=@var_log" ];
};
fileSystems."/var/spool" = {
device = "/dev/disk/by-uuid/${cryptrootUUID}";
fsType = "btrfs";
options = [ "subvol=@var_spool" ];
};
fileSystems."/var/tmp" = {
device = "/dev/disk/by-uuid/${cryptrootUUID}";
fsType = "btrfs";
options = [ "subvol=@var_tmp" ];
};
fileSystems."/var/lib/machines" = {
device = "/dev/disk/by-uuid/${cryptrootUUID}";
fsType = "btrfs";
options = [ "subvol=@var_lib_machines" ];
};
fileSystems."/var/lib/portables" = {
device = "/dev/disk/by-uuid/${cryptrootUUID}";
fsType = "btrfs";
options = [ "subvol=@var_lib_portables" ];
};
swapDevices = [ ];
environment.systemPackages = with pkgs; [
sbctl
libva-utils
vdpauinfo
adwaita-icon-theme
gsettings-desktop-schemas
ddcutil
mesa-demos
];
# BOOTLOADER
boot.bootspec.enable = true;
boot.initrd = {
availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"ahci"
"usbhid"
"sd_mod"
];
kernelModules = [ ];
systemd.enable = true;
};
boot.extraModulePackages = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.lanzaboote = {
enable = true;
pkiBundle = "/var/lib/sbctl";
};
boot.loader.efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "efi";
};
boot.loader.systemd-boot = {
enable = lib.mkForce false;
xbootldrMountPoint = "/boot";
};
# CPU
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.enableRedistributableFirmware = true;
# GPU
boot.kernelParams = [ "i915.enable_guc=3" ];
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vpl-gpu-rt
];
};
hardware.nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.stable;
open = true;
nvidiaSettings = true;
};
hardware.nvidia.prime = {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:2:0:0";
};
services.xserver.videoDrivers = [
"modesetting"
"nvidia"
];
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "iHD";
VDPAU_DRIVER = "va_gl";
};
# AUDIO
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
# BLUETOOTH
hardware.bluetooth = {
enable = true;
settings = {
General.Experimental = true;
};
};
# MISC
boot.kernelPackages = pkgs.linuxPackages_6_17;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
time.timeZone = "Europe/Paris";
console = {
keyMap = "us";
font = "${pkgs.terminus_font}/share/consolefonts/ter-v28b.psf.gz";
};
i18n.defaultLocale = "en_US.UTF-8";
nix.settings = {
substituters = [ "https://cache.nixos-cuda.org" ];
trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
};
programs._1password.enable = true;
programs._1password-gui = {
enable = true;
polkitPolicyOwners = [ "pml" ];
};
environment.etc = {
"1password/custom_allowed_browsers" = {
text = ''
firefox
brave
'';
mode = "0755";
};
};
# Enable regreet
programs.regreet = {
enable = true;
font.name = "SF Pro";
font.size = 16;
font.package = pkgs.apple-fonts.sf-pro;
settings = {
GTK = {
font_name = lib.mkForce "SF Pro 16";
};
};
};
programs.niri.enable = true;
environment.sessionVariables.NIXOS_OZONE_WL = "1";
# FONTS
fonts.fontconfig = {
enable = true;
antialias = true;
hinting = {
enable = true;
style = "slight";
};
subpixel = {
rgba = "rgb";
lcdfilter = "default";
};
defaultFonts = {
serif = [
"SF Pro"
"DejaVu Serif"
];
sansSerif = [
"SF Pro"
"DejaVu Sans"
];
monospace = [
"Iosevka Cavalier"
"DejaVu Sans Mono"
];
emoji = [ "Noto Color Emoji" ];
};
};
fonts.packages = with pkgs; [
apple-fonts.sf-pro
noto-fonts-cjk-sans
noto-fonts-color-emoji
(iosevka.override {
set = "cavalier";
privateBuildPlan = {
family = "Iosevka Cavalier";
spacing = "normal";
serifs = "sans";
noCvSs = false;
exportGlyphNames = true;
variants.inherits = "ss08";
variants.weights.Regular = {
shape = 400;
menu = 400;
css = 400;
};
variants.weights.Bold = {
shape = 700;
menu = 700;
css = 700;
};
variants.weights.Italic = {
angle = 9.4;
shape = "italic";
menu = "italic";
css = "italic";
};
variants.weights.Upright = {
angle = 0;
shape = "upright";
menu = "upright";
css = "upright";
};
};
})
];
# USERSPACE
programs.zsh.enable = true;
users.users.pml = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [
"i2c"
"wheel"
];
packages = with pkgs; [
vim
(vscode-with-extensions.override {
vscode = vscodium;
vscodeExtensions = with vscode-extensions; [
jnoortheen.nix-ide
mkhl.direnv
yzhang.markdown-all-in-one
];
})
];
};
# DO NOT EDIT
system.stateVersion = "25.05";
}