Compare commits

...

6 Commits

Author SHA1 Message Date
Austin Horstman
a97b0a0999 hyprland: add note about xwayland option
Add small blurb about how the option works and recommends settings

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-07 10:48:08 -05:00
Austin Horstman
a4a571c2d6 Revert "hyprland: dont recompile when disabling xwayland"
This reverts commit c91dbdf61a.
2026-01-07 10:48:08 -05:00
Sefa Eyeoglu
aea57993a8 direnv: make Fish integration read-write
As https://github.com/NixOS/nixpkgs/pull/475992 is merged, we can make
this option read-write.

Depends-on: https://github.com/NixOS/nixpkgs/pull/475992

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2026-01-07 14:22:49 +01:00
home-manager-ci[bot]
1c7be243ea flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c0b0e0fddf73fd517c3471e546c0df87a42d53f4?narHash=sha256-coBu0ONtFzlwwVBzmjacUQwj3G%2BlybcZ1oeNSQkgC0M%3D' (2025-12-28)
  → 'github:NixOS/nixpkgs/9f0c42f8bc7151b8e7e5840fb3bd454ad850d8c5?narHash=sha256-UWYqmD7JFBEDBHWYcqE6s6c77pWdcU/i%2BbwD6XxMb8A%3D' (2026-01-05)
2026-01-07 14:06:45 +01:00
James Hobson
93da26b426 xmonad: removed buildScriptPackages and cleaned up
From the code-review, buildScriptPackages was deemed unnecessary and so
has been removed. The ghc package with dependencies was not needed when
building without a custom build script so this build dependency has been
made contingent on the presence of a custom build script. The install
command is used instead of cp and chmod. Finally, an example has been
added for the documentation.
2026-01-07 13:31:23 +01:00
James Hobson
0d3183953c xmonad: Added buildScript and buildScriptPackages
If you need to change ghc args, or maybe want to use cabal or stack to
build xmonad, a way of doing this is write a script called build which
overrides xmonad's default build behaviour.

This patch adds two extra (optional) config options to xmonad:
- buildScript, a path to said build script
- buildScriptPackages, any additional dependencies it may need
2026-01-07 13:31:23 +01:00
4 changed files with 55 additions and 34 deletions

6
flake.lock generated
View File

@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1766902085,
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
"lastModified": 1767640445,
"narHash": "sha256-UWYqmD7JFBEDBHWYcqE6s6c77pWdcU/i+bwD6XxMb8A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
"rev": "9f0c42f8bc7151b8e7e5840fb3bd454ad850d8c5",
"type": "github"
},
"original": {

View File

@@ -75,25 +75,7 @@ in
enableBashIntegration = lib.hm.shell.mkBashIntegrationOption { inherit config; };
enableFishIntegration =
lib.hm.shell.mkFishIntegrationOption {
inherit config;
extraDescription = ''
Note, enabling the direnv module will always activate its functionality
for Fish since the direnv package automatically gets loaded in Fish.
If this is not the case try adding
```nix
environment.pathsToLink = [ "/share/fish" ];
```
to the system configuration.
'';
}
// {
default = true;
readOnly = true;
};
enableFishIntegration = lib.hm.shell.mkFishIntegrationOption { inherit config; };
enableNushellIntegration = lib.hm.shell.mkNushellIntegrationOption { inherit config; };

View File

@@ -48,11 +48,6 @@ in
[ "wayland" "windowManager" "hyprland" "systemdIntegration" ] # \
[ "wayland" "windowManager" "hyprland" "systemd" "enable" ]
)
(lib.mkRenamedOptionModule # \
[ "wayland" "windowManager" "hyprland" "xwayland" "enable" ] # \
[ "wayland" "windowManager" "hyprland" "settings" "xwayland" "enable" ]
)
];
options.wayland.windowManager.hyprland = {
@@ -84,7 +79,11 @@ in
finalPackage = lib.mkOption {
type = with lib.types; nullOr package;
readOnly = true;
default = if cfg.package != null then cfg.package else null;
default =
if cfg.package != null then
cfg.package.override { enableXWayland = cfg.xwayland.enable; }
else
null;
defaultText = lib.literalMD "`wayland.windowManager.hyprland.package` with applied configuration";
description = ''
The Hyprland package after applying configuration.
@@ -163,6 +162,18 @@ in
{manpage}`systemd-xdg-autostart-generator(8)`'';
};
xwayland.enable = lib.mkEnableOption "XWayland" // {
default = true;
description = ''
Whether or not to enable XWayland.
Overrides the `enableXWayland` option of the Hyprland package.
In newer versions of Hyprland, you can use the {option}`wayland.windowManager.hyprland.settings.xwayland`
option to avoid recompiling Hyprland.
'';
};
settings = lib.mkOption {
type =
with lib.types;
@@ -354,10 +365,7 @@ in
submapWarnings ++ lib.optional inconsistent warning;
home.packages = lib.mkIf (cfg.package != null) (
[ cfg.finalPackage ]
++ lib.optional (
(lib.hasAttrByPath [ "settings" "xwayland" "enable" ] cfg) && cfg.settings.xwayland.enable
) pkgs.xwayland
[ cfg.finalPackage ] ++ lib.optional cfg.xwayland.enable pkgs.xwayland
);
xdg.configFile."hypr/hyprland.conf" =

View File

@@ -19,6 +19,15 @@ let
self.xmonad-extras
];
};
ghc-builder = cfg.haskellPackages.ghcWithPackages (
self:
[ self.xmonad ]
++ (cfg.extraPackages self)
++ lib.optionals cfg.enableContribAndExtras [
self.xmonad-contrib
self.xmonad-extras
]
);
in
{
@@ -104,6 +113,21 @@ in
contents of the files.
'';
};
buildScript = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
Build script for your xmonad configuration.
'';
example = literalExpression ''
pkgs.writeText "build" '''
#!/bin/sh
# Enable -threaded
ghc --make xmonad.hs -threaded -i -ilib -fforce-recomp -main-is main -v0 -O2 -o "$1"
'''
'';
};
};
};
@@ -119,7 +143,12 @@ in
xmonadBin = "${
pkgs.runCommandLocal "xmonad-compile"
{
nativeBuildInputs = [ xmonad ];
nativeBuildInputs = [
xmonad
]
++ lib.optional (cfg.buildScript != null) [
ghc-builder
];
}
''
mkdir -p $out/bin
@@ -131,7 +160,9 @@ in
mkdir -p "$XMONAD_CONFIG_DIR/lib" "$XMONAD_CACHE_DIR" "$XMONAD_DATA_DIR"
cp ${cfg.config} xmonad-config/xmonad.hs
${lib.optionalString (cfg.buildScript != null) ''
install -m 555 ${cfg.buildScript} xmonad-config/build
''}
declare -A libFiles
libFiles=(${
lib.concatStringsSep " " (lib.mapAttrsToList (name: value: "['${name}']='${value}'") cfg.libFiles)