From d0c6f19a097946b3ea5ee5b89315ed0808e8d4da Mon Sep 17 00:00:00 2001 From: monologiq Date: Tue, 23 Dec 2025 17:20:55 +0100 Subject: [PATCH] Switch to lix --- default.nix | 61 +++ flake.lock | 169 ++------ flake.nix | 58 ++- lib/default.nix | 3 + machines/hermes.nix | 24 ++ machines/hermes/audio.nix | 11 - machines/hermes/bluetooth.nix | 8 - machines/hermes/boot.nix | 6 - machines/hermes/bootloader.nix | 50 --- machines/hermes/cpu.nix | 5 - machines/hermes/default.nix | 115 +----- machines/hermes/filesystems.nix | 91 ----- machines/hermes/fonts.nix | 78 ---- machines/hermes/gpu.nix | 43 --- machines/mercure/default.nix | 13 - machines/persephone.nix | 364 ++++++++++++++++++ machines/{hermes => persephone}/hardware.nix | 0 .../{hermes => persephone}/networking.nix | 2 +- machines/{hermes => persephone}/off.orp | Bin .../remove_systemd_service.patch | 0 overlays/default.nix | 40 ++ users/pml.nix | 35 -- 22 files changed, 544 insertions(+), 632 deletions(-) create mode 100644 default.nix create mode 100644 lib/default.nix create mode 100644 machines/hermes.nix delete mode 100644 machines/hermes/audio.nix delete mode 100644 machines/hermes/bluetooth.nix delete mode 100644 machines/hermes/boot.nix delete mode 100644 machines/hermes/bootloader.nix delete mode 100644 machines/hermes/cpu.nix delete mode 100644 machines/hermes/filesystems.nix delete mode 100644 machines/hermes/fonts.nix delete mode 100644 machines/hermes/gpu.nix delete mode 100644 machines/mercure/default.nix create mode 100644 machines/persephone.nix rename machines/{hermes => persephone}/hardware.nix (100%) rename machines/{hermes => persephone}/networking.nix (95%) rename machines/{hermes => persephone}/off.orp (100%) rename machines/{hermes => persephone}/remove_systemd_service.patch (100%) delete mode 100644 users/pml.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..6571a79 --- /dev/null +++ b/default.nix @@ -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"; + }; + }; + }; + }; + }; +} diff --git a/flake.lock b/flake.lock index 1096374..8585b0e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,40 +1,12 @@ { "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": { "locked": { - "lastModified": 1765145449, - "narHash": "sha256-aBVHGWWRzSpfL++LubA0CwOOQ64WNLegrYHwsVuVN7A=", + "lastModified": 1765739568, + "narHash": "sha256-gQYx35Of4UDKUjAYvmxjUEh/DdszYeTtT6MDin4loGE=", "owner": "ipetkov", "repo": "crane", - "rev": "69f538cdce5955fcd47abfed4395dc6d5194c1c5", + "rev": "67d2baff0f9f677af35db61b32b5df6863bcc075", "type": "github" }, "original": { @@ -91,16 +63,16 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1765382359, - "narHash": "sha256-RJmgVDzjRI18BWVogG6wpsl1UCuV6ui8qr4DJ1LfWZ8=", + "lastModified": 1766225539, + "narHash": "sha256-0Y6o3oUmQCxrzLIvZTcUAQCPEXAc+tU+N3ZjmzdrC28=", "owner": "nix-community", "repo": "lanzaboote", - "rev": "e8c096ade12ec9130ff931b0f0e25d2f1bc63607", + "rev": "14455220bef50f8df94f05e5763cdf51bc704acd", "type": "github" }, "original": { "owner": "nix-community", - "ref": "v1.0.0", + "ref": "master", "repo": "lanzaboote", "type": "github" } @@ -128,28 +100,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1765311797, - "narHash": "sha256-mSD5Ob7a+T2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo=", - "rev": "09eb77e94fa25202af8f3e81ddc7353d9970ac1b", - "revCount": 903162, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2511.903162%2Brev-09eb77e94fa25202af8f3e81ddc7353d9970ac1b/019b095a-7dde-7122-8fd5-afa2e9e17894/source.tar.gz" + "lastModified": 1766473571, + "narHash": "sha256-5G1NDO2PulBx1RoaA6U1YoUDX0qZslpPxv+n5GX6Qto=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "76701a179d3a98b07653e2b0409847499b2a07d3", + "type": "github" }, "original": { - "type": "tarball", - "url": "https://flakehub.com/f/NixOS/nixpkgs/%2A" - } - }, - "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" + "owner": "nixos", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" } }, "pre-commit": { @@ -162,11 +124,11 @@ ] }, "locked": { - "lastModified": 1765016596, - "narHash": "sha256-rhSqPNxDVow7OQKi4qS5H8Au0P4S3AYbawBSmJNUtBQ=", + "lastModified": 1765464257, + "narHash": "sha256-dixPWKiHzh80PtD0aLuxYNQ0xP+843dfXG/yM3OzaYQ=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "548fc44fca28a5e81c5d6b846e555e6b9c2a5a3c", + "rev": "09e45f2598e1a8499c3594fe11ec2943f34fe509", "type": "github" }, "original": { @@ -177,7 +139,6 @@ }, "root": { "inputs": { - "apple-fonts": "apple-fonts", "lanzaboote": "lanzaboote", "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs" @@ -191,11 +152,11 @@ ] }, "locked": { - "lastModified": 1765075567, - "narHash": "sha256-KFDCdQcHJ0hE3Nt5Gm5enRIhmtEifAjpxgUQ3mzSJpA=", + "lastModified": 1765680428, + "narHash": "sha256-fyPmRof9SZeI14ChPk5rVPOm7ISiiGkwGCunkhM+eUg=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "769156779b41e8787a46ca3d7d76443aaf68be6f", + "rev": "eb3898d8ef143d4bf0f7f2229105fc51c7731b2f", "type": "github" }, "original": { @@ -203,90 +164,6 @@ "repo": "rust-overlay", "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", diff --git a/flake.nix b/flake.nix index d9260b0..80fb76c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,59 +1,54 @@ { - description = "monologiq's systems"; - 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"; - lanzaboote.url = "github:nix-community/lanzaboote/v1.0.0"; + lanzaboote.url = "github:nix-community/lanzaboote?ref=master"; lanzaboote.inputs.nixpkgs.follows = "nixpkgs"; - - apple-fonts.url = "github:Lyndeno/apple-fonts.nix"; - apple-fonts.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = - { self, ... }@inputs: + { self, nixpkgs, ... }@inputs: let supportedSystems = [ "x86_64-linux" - "aarch64-linux" "aarch64-darwin" ]; + lib = import ./lib { inherit (inputs.nixpkgs) lib; }; + pkgsFor = + system: + import inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + }; + forEachSupportedSystem = f: inputs.nixpkgs.lib.genAttrs supportedSystems ( system: f { inherit system; - pkgs = import inputs.nixpkgs { - inherit system; - config.allowUnfree = true; - }; + pkgs = pkgsFor system; } ); in { - nixosConfigurations."hermes" = inputs.nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; + nixosConfigurations."persephone" = nixpkgs.lib.nixosSystem { modules = [ - { nixpkgs.overlays = [ self.overlays.default ]; } - ./machines/hermes - ./users/pml.nix - ]; - }; - darwinConfigurations."mercure" = inputs.nix-darwin.lib.darwinSystem { - modules = [ - { system.configurationRevision = self.rev or self.dirtyRev or null; } - ./machines/mercure + inputs.lanzaboote.nixosModules.lanzaboote + ./machines/persephone.nix ]; }; - 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 ( { 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); }; } diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 0000000..3350e55 --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,3 @@ +{ lib, ... }: { + + } diff --git a/machines/hermes.nix b/machines/hermes.nix new file mode 100644 index 0000000..ff4f859 --- /dev/null +++ b/machines/hermes.nix @@ -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; +} diff --git a/machines/hermes/audio.nix b/machines/hermes/audio.nix deleted file mode 100644 index 777d027..0000000 --- a/machines/hermes/audio.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - security.rtkit.enable = true; - - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; -} diff --git a/machines/hermes/bluetooth.nix b/machines/hermes/bluetooth.nix deleted file mode 100644 index 9871363..0000000 --- a/machines/hermes/bluetooth.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - hardware.bluetooth = { - enable = true; - settings = { - General.Experimental = true; - }; - }; -} diff --git a/machines/hermes/boot.nix b/machines/hermes/boot.nix deleted file mode 100644 index 49fea31..0000000 --- a/machines/hermes/boot.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ inputs, ... }: -{ - imports = [ - inputs.lanzaboote.nixosModules.lanzaboote - ]; -} diff --git a/machines/hermes/bootloader.nix b/machines/hermes/bootloader.nix deleted file mode 100644 index ea691f1..0000000 --- a/machines/hermes/bootloader.nix +++ /dev/null @@ -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"; - }; -} diff --git a/machines/hermes/cpu.nix b/machines/hermes/cpu.nix deleted file mode 100644 index 1079ab8..0000000 --- a/machines/hermes/cpu.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, lib, ... }: - -{ - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/machines/hermes/default.nix b/machines/hermes/default.nix index ac223cf..918d775 100644 --- a/machines/hermes/default.nix +++ b/machines/hermes/default.nix @@ -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"; } diff --git a/machines/hermes/filesystems.nix b/machines/hermes/filesystems.nix deleted file mode 100644 index c3834f3..0000000 --- a/machines/hermes/filesystems.nix +++ /dev/null @@ -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 = [ ]; -} diff --git a/machines/hermes/fonts.nix b/machines/hermes/fonts.nix deleted file mode 100644 index f577145..0000000 --- a/machines/hermes/fonts.nix +++ /dev/null @@ -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"; - }; - }; - }) - ]; -} diff --git a/machines/hermes/gpu.nix b/machines/hermes/gpu.nix deleted file mode 100644 index cba3087..0000000 --- a/machines/hermes/gpu.nix +++ /dev/null @@ -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"; - }; -} diff --git a/machines/mercure/default.nix b/machines/mercure/default.nix deleted file mode 100644 index 918d775..0000000 --- a/machines/mercure/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ self, pkgs, ... }: - -{ - environment.systemPackages = [ - pkgs.vim - ]; - - nix.settings.experimental-features = "nix-command flakes"; - - system.stateVersion = 6; - - nixpkgs.hostPlatform = "aarch64-darwin"; -} diff --git a/machines/persephone.nix b/machines/persephone.nix new file mode 100644 index 0000000..325c328 --- /dev/null +++ b/machines/persephone.nix @@ -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"; +} diff --git a/machines/hermes/hardware.nix b/machines/persephone/hardware.nix similarity index 100% rename from machines/hermes/hardware.nix rename to machines/persephone/hardware.nix diff --git a/machines/hermes/networking.nix b/machines/persephone/networking.nix similarity index 95% rename from machines/hermes/networking.nix rename to machines/persephone/networking.nix index 22bb9b9..263f66b 100644 --- a/machines/hermes/networking.nix +++ b/machines/persephone/networking.nix @@ -2,7 +2,7 @@ { - networking.hostName = "hermes"; + networking.hostName = "persephone"; networking.useDHCP = lib.mkDefault true; diff --git a/machines/hermes/off.orp b/machines/persephone/off.orp similarity index 100% rename from machines/hermes/off.orp rename to machines/persephone/off.orp diff --git a/machines/hermes/remove_systemd_service.patch b/machines/persephone/remove_systemd_service.patch similarity index 100% rename from machines/hermes/remove_systemd_service.patch rename to machines/persephone/remove_systemd_service.patch diff --git a/overlays/default.nix b/overlays/default.nix index de540cd..23f0e54 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,3 +1,43 @@ final: prev: { 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; + }; + }; + } diff --git a/users/pml.nix b/users/pml.nix deleted file mode 100644 index 29b5639..0000000 --- a/users/pml.nix +++ /dev/null @@ -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 - ]; - }; -}