mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 09:29:41 +08:00
Compare commits
6 Commits
4e8b7bef66
...
a97b0a0999
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a97b0a0999 | ||
|
|
a4a571c2d6 | ||
|
|
aea57993a8 | ||
|
|
1c7be243ea | ||
|
|
93da26b426 | ||
|
|
0d3183953c |
6
flake.lock
generated
6
flake.lock
generated
@@ -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": {
|
||||
|
||||
@@ -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; };
|
||||
|
||||
|
||||
@@ -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" =
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user