mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 08:06:00 +01:00
nix: add xdph to flake and enable it in the nixos module
This commit is contained in:
parent
ff12a41c40
commit
11a1a6c271
3 changed files with 39 additions and 7 deletions
|
@ -82,11 +82,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1670202338,
|
||||
"narHash": "sha256-StTfshdAoSxO+t0wRbq1I3YESLFIQWFjGJse5ICV8rk=",
|
||||
"lastModified": 1670593043,
|
||||
"narHash": "sha256-tsDs6FB+7PlBOt46dMQFBMH5yPY/fduf4cYbQYhauhA=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "xdg-desktop-portal-hyprland",
|
||||
"rev": "af840a9e0947a79a37a95a9f62062653721e43fa",
|
||||
"rev": "5f7eecff553d82f21e049d79d8fb3f1f46568da0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -77,6 +77,10 @@
|
|||
waybar-hyprland = prev.waybar.overrideAttrs (oldAttrs: {
|
||||
mesonFlags = oldAttrs.mesonFlags ++ ["-Dexperimental=true"];
|
||||
});
|
||||
|
||||
xdg-desktop-portal-hyprland = inputs.xdph.packages.${prev.system}.default.override {
|
||||
hyprland-share-picker = inputs.xdph.packages.${prev.system}.hyprland-share-picker.override {inherit hyprland;};
|
||||
};
|
||||
};
|
||||
|
||||
packages = genSystems (system:
|
||||
|
|
|
@ -7,6 +7,11 @@ inputs: {
|
|||
}:
|
||||
with lib; let
|
||||
cfg = config.programs.hyprland;
|
||||
|
||||
defaultHyprlandPackage = inputs.self.packages.${pkgs.system}.default.override {
|
||||
enableXWayland = cfg.xwayland.enable;
|
||||
hidpiXWayland = cfg.xwayland.hidpi;
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
(mkRemovedOptionModule ["programs" "hyprland" "extraPackages"] "extraPackages has been removed. Use environment.systemPackages instead.")
|
||||
|
@ -23,7 +28,7 @@ in {
|
|||
|
||||
package = mkOption {
|
||||
type = types.nullOr types.package;
|
||||
default = inputs.self.packages.${pkgs.system}.default;
|
||||
default = defaultHyprlandPackage;
|
||||
defaultText = literalExpression "<Hyprland flake>.packages.<system>.default";
|
||||
example = literalExpression "<Hyprland flake>.packages.<system>.default.override { }";
|
||||
description = ''
|
||||
|
@ -31,6 +36,23 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
xwayland = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Enable XWayland.
|
||||
'';
|
||||
};
|
||||
hidpi = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Enable HiDPI XWayland.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
recommendedEnvironment = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
@ -44,7 +66,7 @@ in {
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
environment = {
|
||||
systemPackages = lib.optional (cfg.package != null) cfg.package;
|
||||
systemPackages = lib.optional (cfg.package != null) defaultHyprlandPackage;
|
||||
|
||||
sessionVariables = mkIf cfg.recommendedEnvironment {
|
||||
NIXOS_OZONE_WL = "1";
|
||||
|
@ -57,11 +79,17 @@ in {
|
|||
xwayland.enable = mkDefault true;
|
||||
};
|
||||
security.polkit.enable = true;
|
||||
services.xserver.displayManager.sessionPackages = lib.optional (cfg.package != null) cfg.package;
|
||||
services.xserver.displayManager.sessionPackages = lib.optional (cfg.package != null) defaultHyprlandPackage;
|
||||
xdg.portal = {
|
||||
enable = mkDefault true;
|
||||
# xdg-desktop-portal-hyprland
|
||||
extraPortals = [inputs.xdph.packages.${pkgs.system}.default];
|
||||
extraPortals = lib.mkIf (cfg.package != null) [
|
||||
(inputs.xdph.packages.${pkgs.system}.xdg-desktop-portal-hyprland.override {
|
||||
hyprland-share-picker = inputs.xdph.packages.${pkgs.system}.hyprland-share-picker.override {
|
||||
hyprland = defaultHyprlandPackage;
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue