feat(desktop): make portals installation configurable
This commit is contained in:
parent
308d6fca81
commit
c7e8ec0628
2 changed files with 28 additions and 6 deletions
|
@ -42,6 +42,7 @@
|
||||||
inputFilename = "temp1_input";
|
inputFilename = "temp1_input";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
xdg.useDistributionPortals = true;
|
||||||
};
|
};
|
||||||
web.firefox = {
|
web.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -23,6 +23,16 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
xdg.useDistributionPortals = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
This prevent installing xdg-desktop-portal from nixpkgs. These
|
||||||
|
Useful when using Home-Manager on third-party distribution with old
|
||||||
|
version of portals (coucou Ubuntu LTS)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
wallpapers = {
|
wallpapers = {
|
||||||
lockscreen = mkOption {
|
lockscreen = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -170,16 +180,16 @@ in
|
||||||
desktop = "${config.home.homeDirectory}/documents";
|
desktop = "${config.home.homeDirectory}/documents";
|
||||||
publicShare = "${config.home.homeDirectory}/tmp/public";
|
publicShare = "${config.home.homeDirectory}/tmp/public";
|
||||||
};
|
};
|
||||||
portal = {
|
portal = mkIf (cfg.xdg.useDistributionPortals == false) {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPortals = with pkgs; [
|
extraPortals = with pkgs; [
|
||||||
xdg-desktop-portal
|
|
||||||
xdg-desktop-portal-wlr
|
xdg-desktop-portal-wlr
|
||||||
xdg-desktop-portal-gtk
|
xdg-desktop-portal-gtk
|
||||||
];
|
];
|
||||||
xdgOpenUsePortal = true;
|
xdgOpenUsePortal = true;
|
||||||
config = {
|
config = {
|
||||||
sway.default = [
|
sway = {
|
||||||
|
default = [
|
||||||
"wlr"
|
"wlr"
|
||||||
"gtk"
|
"gtk"
|
||||||
];
|
];
|
||||||
|
@ -187,4 +197,15 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# When using `useDistributionPackage`, create wlr configuration to let user
|
||||||
|
# choose the right screen. This is a workarount to not have to configure
|
||||||
|
# it manually.
|
||||||
|
home.file."${config.xdg.configHome}/xdg-desktop-portal-wlr/config".text = mkIf cfg.xdg.useDistributionPortals ''
|
||||||
|
[screencast]
|
||||||
|
max_fps=30
|
||||||
|
chooser_type=simple
|
||||||
|
chooser_cmd=${pkgs.slurp}/bin/slurp -f %o -or
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue