mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
qutebrowser: fix config location on darwin (#1925)
This commit is contained in:
parent
c0ba8c526d
commit
a513fbc395
3 changed files with 29 additions and 14 deletions
|
@ -260,16 +260,13 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."qutebrowser/config.py".text = concatStringsSep "\n" ([ ]
|
||||
++ [
|
||||
"${if cfg.loadAutoconfig then
|
||||
"config.load_autoconfig()"
|
||||
else
|
||||
"config.load_autoconfig(False)"}"
|
||||
] ++ mapAttrsToList (formatLine "c.") cfg.settings
|
||||
config = let
|
||||
qutebrowserConfig = concatStringsSep "\n" ([
|
||||
(if cfg.loadAutoconfig then
|
||||
"config.load_autoconfig()"
|
||||
else
|
||||
"config.load_autoconfig(False)")
|
||||
] ++ mapAttrsToList (formatLine "c.") cfg.settings
|
||||
++ mapAttrsToList (formatDictLine "c.aliases") cfg.aliases
|
||||
++ mapAttrsToList (formatDictLine "c.url.searchengines") cfg.searchEngines
|
||||
++ mapAttrsToList (formatDictLine "c.bindings.key_mappings")
|
||||
|
@ -277,5 +274,13 @@ in {
|
|||
++ optional (!cfg.enableDefaultBindings) "c.bindings.default = {}"
|
||||
++ mapAttrsToList formatKeyBindings cfg.keyBindings
|
||||
++ optional (cfg.extraConfig != "") cfg.extraConfig);
|
||||
in mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
home.file.".qutebrowser/config.py" =
|
||||
mkIf pkgs.stdenv.hostPlatform.isDarwin { text = qutebrowserConfig; };
|
||||
|
||||
xdg.configFile."qutebrowser/config.py" =
|
||||
mkIf pkgs.stdenv.hostPlatform.isLinux { text = qutebrowserConfig; };
|
||||
};
|
||||
}
|
||||
|
|
|
@ -24,9 +24,14 @@ with lib;
|
|||
})
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
nmt.script = let
|
||||
qutebrowserConfig = if pkgs.stdenv.hostPlatform.isDarwin then
|
||||
".qutebrowser/config.py"
|
||||
else
|
||||
".config/qutebrowser/config.py";
|
||||
in ''
|
||||
assertFileContent \
|
||||
home-files/.config/qutebrowser/config.py \
|
||||
home-files/${qutebrowserConfig} \
|
||||
${
|
||||
pkgs.writeText "qutebrowser-expected-config.py" ''
|
||||
config.load_autoconfig(False)
|
||||
|
|
|
@ -30,9 +30,14 @@ with lib;
|
|||
})
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
nmt.script = let
|
||||
qutebrowserConfig = if pkgs.stdenv.hostPlatform.isDarwin then
|
||||
".qutebrowser/config.py"
|
||||
else
|
||||
".config/qutebrowser/config.py";
|
||||
in ''
|
||||
assertFileContent \
|
||||
home-files/.config/qutebrowser/config.py \
|
||||
home-files/${qutebrowserConfig} \
|
||||
${
|
||||
pkgs.writeText "qutebrowser-expected-config.py" ''
|
||||
config.load_autoconfig(False)
|
||||
|
|
Loading…
Reference in a new issue