From 32ab590cf15c0c3e3e1f8d72098cf6c066e15f5a Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Tue, 13 Aug 2024 23:13:20 +0300 Subject: [PATCH] Nix: revamp --- pages/Nix/Contributing and Debugging.md | 9 +++++++-- pages/Nix/Options & Overrides.md | 9 +++++++++ pages/Nix/_index.md | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pages/Nix/Contributing and Debugging.md b/pages/Nix/Contributing and Debugging.md index 2c9f36e..c37bb2f 100644 --- a/pages/Nix/Contributing and Debugging.md +++ b/pages/Nix/Contributing and Debugging.md @@ -2,8 +2,8 @@ title: Contributing and Debugging --- -Everything needed to build and debug Hyprland is included inside the provided -`devShell`. +Everything needed to build and debug Hyprland and other hyprwm programs is +included inside the provided `devShell`s. To use it in the cloned repo, simply run `nix develop`. @@ -12,6 +12,11 @@ To use it in the cloned repo, simply run `nix develop`. A debug build is already provided through `hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland-debug`. +Most hyprwm apps also provide their own `-debug` versions. For those that don't, +one can build the debug version from the CLI by using +[overrideAttrs](../Options-Overrides/#using-nix-repl) with +`cmakeBuildType = "debug";`. + ## Bisecting an issue Follow the diff --git a/pages/Nix/Options & Overrides.md b/pages/Nix/Options & Overrides.md index a108f8e..317a561 100644 --- a/pages/Nix/Options & Overrides.md +++ b/pages/Nix/Options & Overrides.md @@ -51,3 +51,12 @@ nix-repl> :bl outputs.packages.x86_64-linux.hyprland.override { /* flag here */ ``` Then you can run Hyprland from the built path. + +You can also use `overrideAttrs` to override `mkDerivation`'s arguments, such as +`cmakeBuildType`: + +```nix +$ nix repl +nix-repl> :lf git+https://github.com/hyprwm/Hyprland?submodules=1 +nix-repl> :bl outputs.packages.x86_64-linux.hyprland.overrideAttrs (self: super: { cmakeBuildType = "debug" }) +``` diff --git a/pages/Nix/_index.md b/pages/Nix/_index.md index 97508f8..14a48f2 100644 --- a/pages/Nix/_index.md +++ b/pages/Nix/_index.md @@ -35,7 +35,7 @@ For more options, see For other NixOS options, see [Hyprland on NixOS](./Hyprland-on-NixOS). -## Home-manager module +## Home Manager module Read [Hyprland on Home Manager](./Hyprland-on-Home-Manager).