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

61
default.nix Normal file
View file

@ -0,0 +1,61 @@
{
system ? builtins.currentSystem,
sources ? import ./npins,
}:
let
pkgs = import sources.nixpkgs { };
nixos = import (sources.nixpkgs + "/nixos");
darwin = import sources.nix-darwin;
lanzaboote = import sources.lanzaboote { inherit pkgs; };
inherit (pkgs.lib) mkOption types;
in
{
persephone = nixos {
configuration = {
imports = [
lanzaboote.nixosModules.lanzaboote
./machines/persephone.nix
];
options = {
machine = {
hostName = mkOption {
type = types.str;
description = "The hostname for the machine.";
default = "persephone";
};
};
};
};
};
hermes = darwin {
system = "aarch64-darwin";
nixpkgs = "${sources.nixpkgs}";
configuration = {
imports = [
./machines/hermes.nix
{
nix.registry.nixpkgs.to = {
type = "path";
path = sources.nixpkgs;
};
}
];
options = {
machine = {
hostName = mkOption {
type = types.str;
description = "The hostname for the machine.";
default = "hermes";
};
};
};
};
};
}

169
flake.lock generated
View file

@ -1,40 +1,12 @@
{ {
"nodes": { "nodes": {
"apple-fonts": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"ny": "ny",
"sf-arabic": "sf-arabic",
"sf-armenian": "sf-armenian",
"sf-compact": "sf-compact",
"sf-georgian": "sf-georgian",
"sf-hebrew": "sf-hebrew",
"sf-mono": "sf-mono",
"sf-pro": "sf-pro"
},
"locked": {
"lastModified": 1758228441,
"narHash": "sha256-3mA9oFuhJ1EHyhPd17g/EuJi4jDYPGhyxkEitdh3Kmc=",
"owner": "Lyndeno",
"repo": "apple-fonts.nix",
"rev": "aba9944f6606a69ebedf7bfb723316139eec3f72",
"type": "github"
},
"original": {
"owner": "Lyndeno",
"repo": "apple-fonts.nix",
"type": "github"
}
},
"crane": { "crane": {
"locked": { "locked": {
"lastModified": 1765145449, "lastModified": 1765739568,
"narHash": "sha256-aBVHGWWRzSpfL++LubA0CwOOQ64WNLegrYHwsVuVN7A=", "narHash": "sha256-gQYx35Of4UDKUjAYvmxjUEh/DdszYeTtT6MDin4loGE=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "69f538cdce5955fcd47abfed4395dc6d5194c1c5", "rev": "67d2baff0f9f677af35db61b32b5df6863bcc075",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -91,16 +63,16 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1765382359, "lastModified": 1766225539,
"narHash": "sha256-RJmgVDzjRI18BWVogG6wpsl1UCuV6ui8qr4DJ1LfWZ8=", "narHash": "sha256-0Y6o3oUmQCxrzLIvZTcUAQCPEXAc+tU+N3ZjmzdrC28=",
"owner": "nix-community", "owner": "nix-community",
"repo": "lanzaboote", "repo": "lanzaboote",
"rev": "e8c096ade12ec9130ff931b0f0e25d2f1bc63607", "rev": "14455220bef50f8df94f05e5763cdf51bc704acd",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "v1.0.0", "ref": "master",
"repo": "lanzaboote", "repo": "lanzaboote",
"type": "github" "type": "github"
} }
@ -128,28 +100,18 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1765311797, "lastModified": 1766473571,
"narHash": "sha256-mSD5Ob7a+T2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo=", "narHash": "sha256-5G1NDO2PulBx1RoaA6U1YoUDX0qZslpPxv+n5GX6Qto=",
"rev": "09eb77e94fa25202af8f3e81ddc7353d9970ac1b", "owner": "nixos",
"revCount": 903162, "repo": "nixpkgs",
"type": "tarball", "rev": "76701a179d3a98b07653e2b0409847499b2a07d3",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2511.903162%2Brev-09eb77e94fa25202af8f3e81ddc7353d9970ac1b/019b095a-7dde-7122-8fd5-afa2e9e17894/source.tar.gz" "type": "github"
}, },
"original": { "original": {
"type": "tarball", "owner": "nixos",
"url": "https://flakehub.com/f/NixOS/nixpkgs/%2A" "ref": "nixos-25.11",
} "repo": "nixpkgs",
}, "type": "github"
"ny": {
"flake": false,
"locked": {
"narHash": "sha256-3257NAH4qlan2YHVLpNRy7x8IJqR2pal3OzFo/ykqXs=",
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg"
},
"original": {
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg"
} }
}, },
"pre-commit": { "pre-commit": {
@ -162,11 +124,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1765016596, "lastModified": 1765464257,
"narHash": "sha256-rhSqPNxDVow7OQKi4qS5H8Au0P4S3AYbawBSmJNUtBQ=", "narHash": "sha256-dixPWKiHzh80PtD0aLuxYNQ0xP+843dfXG/yM3OzaYQ=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "548fc44fca28a5e81c5d6b846e555e6b9c2a5a3c", "rev": "09e45f2598e1a8499c3594fe11ec2943f34fe509",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -177,7 +139,6 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"apple-fonts": "apple-fonts",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
@ -191,11 +152,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1765075567, "lastModified": 1765680428,
"narHash": "sha256-KFDCdQcHJ0hE3Nt5Gm5enRIhmtEifAjpxgUQ3mzSJpA=", "narHash": "sha256-fyPmRof9SZeI14ChPk5rVPOm7ISiiGkwGCunkhM+eUg=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "769156779b41e8787a46ca3d7d76443aaf68be6f", "rev": "eb3898d8ef143d4bf0f7f2229105fc51c7731b2f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -203,90 +164,6 @@
"repo": "rust-overlay", "repo": "rust-overlay",
"type": "github" "type": "github"
} }
},
"sf-arabic": {
"flake": false,
"locked": {
"narHash": "sha256-/0gjRimqvZyE60xYxxPdlU+7Q2LJnnvtbmwOP0YmS9U=",
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg"
},
"original": {
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg"
}
},
"sf-armenian": {
"flake": false,
"locked": {
"narHash": "sha256-rRoDkbNMYkzOHZmQm96Zv80TZvRlAeoxkv4pMHP5nUg=",
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Armenian.dmg"
},
"original": {
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Armenian.dmg"
}
},
"sf-compact": {
"flake": false,
"locked": {
"narHash": "sha256-WeqT80cdK/XzTLSaJs5DHodzxoeAzwL/xTgdq0YwQbM=",
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg"
},
"original": {
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg"
}
},
"sf-georgian": {
"flake": false,
"locked": {
"narHash": "sha256-IevVNOC28IiR45YfI3PsZzXLMRxuB5u7UiE53Zn6tRU=",
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Georgian.dmg"
},
"original": {
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Georgian.dmg"
}
},
"sf-hebrew": {
"flake": false,
"locked": {
"narHash": "sha256-Dw84kYwMpCtKKKqm8cZcQ9TZ7GayU5MO7W0LJw0Rcwk=",
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Hebrew.dmg"
},
"original": {
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Hebrew.dmg"
}
},
"sf-mono": {
"flake": false,
"locked": {
"narHash": "sha256-ICdHRFdNL7PM/fXJUzS7LgZxZiqcyIuCMHLze4En4vg=",
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg"
},
"original": {
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg"
}
},
"sf-pro": {
"flake": false,
"locked": {
"narHash": "sha256-vprahHpCUf9O8RualBrEuLEfuLfzI/2d8AQmwlCGPPk=",
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg"
},
"original": {
"type": "file",
"url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -1,59 +1,54 @@
{ {
description = "monologiq's systems";
inputs = { inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*"; nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.11";
nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-25.11"; nix-darwin.url = "github:nix-darwin/nix-darwin?ref=nix-darwin-25.11";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
lanzaboote.url = "github:nix-community/lanzaboote/v1.0.0"; lanzaboote.url = "github:nix-community/lanzaboote?ref=master";
lanzaboote.inputs.nixpkgs.follows = "nixpkgs"; lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
apple-fonts.url = "github:Lyndeno/apple-fonts.nix";
apple-fonts.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = outputs =
{ self, ... }@inputs: { self, nixpkgs, ... }@inputs:
let let
supportedSystems = [ supportedSystems = [
"x86_64-linux" "x86_64-linux"
"aarch64-linux"
"aarch64-darwin" "aarch64-darwin"
]; ];
lib = import ./lib { inherit (inputs.nixpkgs) lib; };
pkgsFor =
system:
import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
forEachSupportedSystem = forEachSupportedSystem =
f: f:
inputs.nixpkgs.lib.genAttrs supportedSystems ( inputs.nixpkgs.lib.genAttrs supportedSystems (
system: system:
f { f {
inherit system; inherit system;
pkgs = import inputs.nixpkgs { pkgs = pkgsFor system;
inherit system;
config.allowUnfree = true;
};
} }
); );
in in
{ {
nixosConfigurations."hermes" = inputs.nixpkgs.lib.nixosSystem { nixosConfigurations."persephone" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ modules = [
{ nixpkgs.overlays = [ self.overlays.default ]; } inputs.lanzaboote.nixosModules.lanzaboote
./machines/hermes ./machines/persephone.nix
./users/pml.nix
];
};
darwinConfigurations."mercure" = inputs.nix-darwin.lib.darwinSystem {
modules = [
{ system.configurationRevision = self.rev or self.dirtyRev or null; }
./machines/mercure
]; ];
}; };
overlays.default = import ./overlays; darwinConfigurations."hermes" = inputs.nix-darwin.lib.darwinSystem {
modules = [
{ system.configurationRevision = self.rev or self.dirtyRev or null; }
./machines/hermes.nix
];
};
devShells = forEachSupportedSystem ( devShells = forEachSupportedSystem (
{ pkgs, system }: { pkgs, system }:
@ -67,15 +62,6 @@
} }
); );
# Nix formatter
# This applies the formatter that follows RFC 166, which defines a standard format:
# https://github.com/NixOS/rfcs/pull/166
# To format all Nix files:
# git ls-files -z '*.nix' | xargs -0 -r nix fmt
# To check formatting:
# git ls-files -z '*.nix' | xargs -0 -r nix develop --command nixfmt --check
formatter = forEachSupportedSystem ({ pkgs, ... }: pkgs.nixfmt-rfc-style); formatter = forEachSupportedSystem ({ pkgs, ... }: pkgs.nixfmt-rfc-style);
}; };
} }

3
lib/default.nix Normal file
View file

@ -0,0 +1,3 @@
{ lib, ... }: {
}

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 @@
{ { self, pkgs, ... }:
inputs,
lib,
pkgs,
...
}:
{ {
imports = [ environment.systemPackages = [
./bootloader.nix pkgs.vim
./filesystems.nix
./gpu.nix
./cpu.nix
./audio.nix
./bluetooth.nix
./networking.nix
./hardware.nix
./fonts.nix
]; ];
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"; nixpkgs.hostPlatform = "aarch64-darwin";
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?
} }

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; networking.useDHCP = lib.mkDefault true;

View file

@ -1,3 +1,43 @@
final: prev: { final: prev: {
openrgb = final.callPackage ./openrgb/package.nix { openrgb = prev.openrgb; }; openrgb = final.callPackage ./openrgb/package.nix { openrgb = prev.openrgb; };
apple-fonts.sf-pro = final.stdenvNoCC.mkDerivation {
pname = "sf-pro";
version = "latest";
src = prev.fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg";
sha256 = "Lk14U5iLc03BrzO5IdjUwORADqwxKSSg6rS3OlH9aa4=";
};
nativeBuildInputs = [
prev.undmg
prev.p7zip
];
unpackPhase = ''
runHook preUnpack
undmg "$src"
7z x "SF Pro Fonts.pkg"
7z x "Payload~"
runHook postUnpack
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/fonts/opentype
mkdir -p $out/share/fonts/truetype
find . -name '*.otf' -exec mv {} $out/share/fonts/opentype/ \;
find . -name '*.ttf' -exec mv {} $out/share/fonts/truetype/ \;
runHook postInstall
'';
meta = with prev.lib; {
description = "Apple SF Pro font family";
platforms = platforms.all;
};
};
} }

View file

@ -1,35 +0,0 @@
{ lib, pkgs, ... }:
{
programs.zsh.enable = true;
users.users.pml = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [
"i2c"
"wheel"
];
packages =
with pkgs;
[
alacritty
chezmoi
direnv
git
mpv
vim
(vscode-with-extensions.override {
vscode = vscodium;
vscodeExtensions = with vscode-extensions; [
jnoortheen.nix-ide
mkhl.direnv
yzhang.markdown-all-in-one
];
})
]
++ lib.optionals stdenv.hostPlatform.isLinux [
fuzzel
];
};
}