mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +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": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766902085,
|
"lastModified": 1767640445,
|
||||||
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
|
"narHash": "sha256-UWYqmD7JFBEDBHWYcqE6s6c77pWdcU/i+bwD6XxMb8A=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
|
"rev": "9f0c42f8bc7151b8e7e5840fb3bd454ad850d8c5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -75,25 +75,7 @@ in
|
|||||||
|
|
||||||
enableBashIntegration = lib.hm.shell.mkBashIntegrationOption { inherit config; };
|
enableBashIntegration = lib.hm.shell.mkBashIntegrationOption { inherit config; };
|
||||||
|
|
||||||
enableFishIntegration =
|
enableFishIntegration = lib.hm.shell.mkFishIntegrationOption { inherit config; };
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
enableNushellIntegration = lib.hm.shell.mkNushellIntegrationOption { inherit config; };
|
enableNushellIntegration = lib.hm.shell.mkNushellIntegrationOption { inherit config; };
|
||||||
|
|
||||||
|
|||||||
@@ -48,11 +48,6 @@ in
|
|||||||
[ "wayland" "windowManager" "hyprland" "systemdIntegration" ] # \
|
[ "wayland" "windowManager" "hyprland" "systemdIntegration" ] # \
|
||||||
[ "wayland" "windowManager" "hyprland" "systemd" "enable" ]
|
[ "wayland" "windowManager" "hyprland" "systemd" "enable" ]
|
||||||
)
|
)
|
||||||
|
|
||||||
(lib.mkRenamedOptionModule # \
|
|
||||||
[ "wayland" "windowManager" "hyprland" "xwayland" "enable" ] # \
|
|
||||||
[ "wayland" "windowManager" "hyprland" "settings" "xwayland" "enable" ]
|
|
||||||
)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
options.wayland.windowManager.hyprland = {
|
options.wayland.windowManager.hyprland = {
|
||||||
@@ -84,7 +79,11 @@ in
|
|||||||
finalPackage = lib.mkOption {
|
finalPackage = lib.mkOption {
|
||||||
type = with lib.types; nullOr package;
|
type = with lib.types; nullOr package;
|
||||||
readOnly = true;
|
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";
|
defaultText = lib.literalMD "`wayland.windowManager.hyprland.package` with applied configuration";
|
||||||
description = ''
|
description = ''
|
||||||
The Hyprland package after applying configuration.
|
The Hyprland package after applying configuration.
|
||||||
@@ -163,6 +162,18 @@ in
|
|||||||
{manpage}`systemd-xdg-autostart-generator(8)`'';
|
{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 {
|
settings = lib.mkOption {
|
||||||
type =
|
type =
|
||||||
with lib.types;
|
with lib.types;
|
||||||
@@ -354,10 +365,7 @@ in
|
|||||||
submapWarnings ++ lib.optional inconsistent warning;
|
submapWarnings ++ lib.optional inconsistent warning;
|
||||||
|
|
||||||
home.packages = lib.mkIf (cfg.package != null) (
|
home.packages = lib.mkIf (cfg.package != null) (
|
||||||
[ cfg.finalPackage ]
|
[ cfg.finalPackage ] ++ lib.optional cfg.xwayland.enable pkgs.xwayland
|
||||||
++ lib.optional (
|
|
||||||
(lib.hasAttrByPath [ "settings" "xwayland" "enable" ] cfg) && cfg.settings.xwayland.enable
|
|
||||||
) pkgs.xwayland
|
|
||||||
);
|
);
|
||||||
|
|
||||||
xdg.configFile."hypr/hyprland.conf" =
|
xdg.configFile."hypr/hyprland.conf" =
|
||||||
|
|||||||
@@ -19,6 +19,15 @@ let
|
|||||||
self.xmonad-extras
|
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
|
in
|
||||||
{
|
{
|
||||||
@@ -104,6 +113,21 @@ in
|
|||||||
contents of the files.
|
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 = "${
|
xmonadBin = "${
|
||||||
pkgs.runCommandLocal "xmonad-compile"
|
pkgs.runCommandLocal "xmonad-compile"
|
||||||
{
|
{
|
||||||
nativeBuildInputs = [ xmonad ];
|
nativeBuildInputs = [
|
||||||
|
xmonad
|
||||||
|
]
|
||||||
|
++ lib.optional (cfg.buildScript != null) [
|
||||||
|
ghc-builder
|
||||||
|
];
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
@@ -131,7 +160,9 @@ in
|
|||||||
mkdir -p "$XMONAD_CONFIG_DIR/lib" "$XMONAD_CACHE_DIR" "$XMONAD_DATA_DIR"
|
mkdir -p "$XMONAD_CONFIG_DIR/lib" "$XMONAD_CACHE_DIR" "$XMONAD_DATA_DIR"
|
||||||
|
|
||||||
cp ${cfg.config} xmonad-config/xmonad.hs
|
cp ${cfg.config} xmonad-config/xmonad.hs
|
||||||
|
${lib.optionalString (cfg.buildScript != null) ''
|
||||||
|
install -m 555 ${cfg.buildScript} xmonad-config/build
|
||||||
|
''}
|
||||||
declare -A libFiles
|
declare -A libFiles
|
||||||
libFiles=(${
|
libFiles=(${
|
||||||
lib.concatStringsSep " " (lib.mapAttrsToList (name: value: "['${name}']='${value}'") cfg.libFiles)
|
lib.concatStringsSep " " (lib.mapAttrsToList (name: value: "['${name}']='${value}'") cfg.libFiles)
|
||||||
|
|||||||
Reference in New Issue
Block a user