Switch to lix

This commit is contained in:
monologiq 2025-12-23 17:20:55 +01:00
parent 764a05c73c
commit d0c6f19a09
22 changed files with 544 additions and 632 deletions

24
machines/hermes.nix Normal file
View file

@ -0,0 +1,24 @@
{ config, pkgs, ... }:
{
environment.systemPackages = [
pkgs.vim
];
nix = {
channel.enable = false;
package = pkgs.lixPackageSets.stable.lix;
settings.experimental-features = [
"nix-command"
"flakes"
];
};
environment.darwinConfig = "/Users/${config.system.primaryUser}/Development/systems";
system.primaryUser = "pml";
nixpkgs.hostPlatform = "aarch64-darwin";
system.stateVersion = 6;
}

View file

@ -1,11 +0,0 @@
{
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
}

View file

@ -1,8 +0,0 @@
{
hardware.bluetooth = {
enable = true;
settings = {
General.Experimental = true;
};
};
}

View file

@ -1,6 +0,0 @@
{ inputs, ... }:
{
imports = [
inputs.lanzaboote.nixosModules.lanzaboote
];
}

View file

@ -1,50 +0,0 @@
{
inputs,
lib,
pkgs,
...
}:
{
imports = [
inputs.lanzaboote.nixosModules.lanzaboote
];
environment.systemPackages = with pkgs; [
sbctl
];
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";
};
}

View file

@ -1,5 +0,0 @@
{ config, lib, ... }:
{
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,116 +1,13 @@
{
inputs,
lib,
pkgs,
...
}:
{ self, pkgs, ... }:
{
imports = [
./bootloader.nix
./filesystems.nix
./gpu.nix
./cpu.nix
./audio.nix
./bluetooth.nix
./networking.nix
./hardware.nix
./fonts.nix
environment.systemPackages = [
pkgs.vim
];
boot.kernelPackages = pkgs.linuxPackages_6_17;
nix.settings.experimental-features = "nix-command flakes";
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
system.stateVersion = 6;
time.timeZone = "Europe/Paris";
console = {
keyMap = "us";
font = "${pkgs.terminus_font}/share/consolefonts/ter-v28b.psf.gz";
};
i18n.defaultLocale = "en_US.UTF-8";
nixpkgs.config.allowUnfree = true;
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
substituters = [ "https://cache.nixos-cuda.org" ];
trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
};
# Enable required services for Wayland
security.polkit.enable = true;
programs.dconf.enable = true;
# List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options).
environment.systemPackages = with pkgs; [
wget
firefox
adwaita-icon-theme
gsettings-desktop-schemas
];
programs._1password.enable = true;
programs._1password-gui = {
enable = true;
# Certain features, including CLI integration and system authentication support,
# require enabling PolKit integration on some desktop environments (e.g. Plasma).
polkitPolicyOwners = [ "pml" ];
};
environment.etc = {
"1password/custom_allowed_browsers" = {
text = ''
firefox
'';
mode = "0755";
};
};
# Enable greetd
# services.greetd = {
# enable = true;
# settings = {
# default_session = {
# command = "${pkgs.niri}/bin/niri --config /etc/greetd/niri.kdl";
# user = "greeter";
# };
# };
# }
# Enable regreet
programs.regreet = {
enable = true;
font.name = "SF Pro";
font.size = 16;
font.package = inputs.apple-fonts.packages."${pkgs.stdenv.hostPlatform.system}".sf-pro;
settings = {
GTK = {
font_name = lib.mkForce "SF Pro 16";
};
};
};
# Create the niri config for greetd
# environment.etc."greetd/niri.kdl".text = ''
# spawn-sh-at-startup "regreet; niri msg action quit --skip-confirmation"
#
# hotkey-overlay {
# skip-at-startup
# }
#
# cursor {
# xcursor-theme "Adwaita"
# xcursor-size 24
# }
# '';
# Optional: Enable niri for user sessions
programs.niri.enable = true;
environment.sessionVariables.NIXOS_OZONE_WL = "1";
system.stateVersion = "25.05"; # Did you read the comment?
nixpkgs.hostPlatform = "aarch64-darwin";
}

View file

@ -1,91 +0,0 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
let
bootUUID = "4402ec25-129b-43f5-a043-185e99078f73";
efiUUID = "268B-0081";
luuksUUID = "fbd9a17b-42aa-4f41-aaf9-eaf9fc62340b";
cryptrootUUID = "74224da5-7f95-48a7-9897-8ce6c2e1414d";
in
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
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 = [ ];
}

View file

@ -1,78 +0,0 @@
{ inputs, pkgs, ... }:
let
apple-fonts = inputs.apple-fonts.packages."${pkgs.stdenv.hostPlatform.system}";
in
{
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";
};
};
})
];
}

View file

@ -1,43 +0,0 @@
{
config,
pkgs,
...
}:
{
environment.systemPackages = with pkgs; [
libva-utils
vdpauinfo
];
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";
};
}

View file

@ -1,13 +0,0 @@
{ self, pkgs, ... }:
{
environment.systemPackages = [
pkgs.vim
];
nix.settings.experimental-features = "nix-command flakes";
system.stateVersion = 6;
nixpkgs.hostPlatform = "aarch64-darwin";
}

364
machines/persephone.nix Normal file
View file

@ -0,0 +1,364 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
let
bootUUID = "972a8171-eab9-4d23-889c-f8df6f23b034";
efiUUID = "A7B7-5AC1";
luuksUUID = "ff905a47-8c35-4112-8321-983012be0f71";
cryptrootUUID = "db593235-f14f-45fa-adc3-ee7a550763a4";
in
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
./persephone/hardware.nix
./persephone/networking.nix
];
nix.package = pkgs.lixPackageSets.stable.lix;
nixpkgs.overlays = [
(import ../overlays)
];
# 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
wget
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";
nixpkgs.config.allowUnfree = true;
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
substituters = [ "https://cache.nixos-cuda.org" ];
trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
};
# Enable required services for Wayland
security.polkit.enable = true;
programs.dconf.enable = true;
programs._1password.enable = true;
programs._1password-gui = {
enable = true;
# Certain features, including CLI integration and system authentication support,
# require enabling PolKit integration on some desktop environments (e.g. Plasma).
polkitPolicyOwners = [ "pml" ];
};
environment.etc = {
"1password/custom_allowed_browsers" = {
text = ''
firefox
'';
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";
}

View file

@ -2,7 +2,7 @@
{
networking.hostName = "hermes";
networking.hostName = "persephone";
networking.useDHCP = lib.mkDefault true;