mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-31 04:04:32 +00:00
Merge d3ebdb59a3
into 171915bfce
This commit is contained in:
commit
1b53c9c5ce
10 changed files with 65 additions and 67 deletions
|
@ -16,8 +16,7 @@ let
|
||||||
|
|
||||||
supportedPlatforms = flatten (attrVals (attrNames platforms) lib.platforms);
|
supportedPlatforms = flatten (attrVals (attrNames platforms) lib.platforms);
|
||||||
|
|
||||||
isWrapped = versionAtLeast config.home.stateVersion "19.09"
|
isWrapped = wrappedPackageName != null;
|
||||||
&& wrappedPackageName != null;
|
|
||||||
|
|
||||||
defaultPackageName =
|
defaultPackageName =
|
||||||
if isWrapped then wrappedPackageName else unwrappedPackageName;
|
if isWrapped then wrappedPackageName else unwrappedPackageName;
|
||||||
|
@ -192,10 +191,8 @@ in {
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
The ${appName} package to use. If state version ≥ 19.09 then
|
The ${appName} package to use. This should be a wrapped ${appName}
|
||||||
this should be a wrapped ${appName} package. For earlier state
|
package. Set to `null` to disable installing ${appName}.
|
||||||
versions it should be an unwrapped ${appName} package.
|
|
||||||
Set to `null` to disable installing ${appName}.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -304,6 +304,10 @@ in import nmtSrc {
|
||||||
./modules/programs/emacs
|
./modules/programs/emacs
|
||||||
./modules/programs/fastfetch
|
./modules/programs/fastfetch
|
||||||
./modules/programs/feh
|
./modules/programs/feh
|
||||||
|
./modules/programs/firefox
|
||||||
|
./modules/programs/firefox/firefox.nix
|
||||||
|
./modules/programs/firefox/floorp.nix
|
||||||
|
./modules/programs/firefox/librewolf.nix
|
||||||
./modules/programs/fish
|
./modules/programs/fish
|
||||||
./modules/programs/gallery-dl
|
./modules/programs/gallery-dl
|
||||||
./modules/programs/gh
|
./modules/programs/gh
|
||||||
|
@ -451,10 +455,6 @@ in import nmtSrc {
|
||||||
./modules/programs/cavalier
|
./modules/programs/cavalier
|
||||||
./modules/programs/distrobox
|
./modules/programs/distrobox
|
||||||
./modules/programs/eww
|
./modules/programs/eww
|
||||||
./modules/programs/firefox
|
|
||||||
./modules/programs/firefox/firefox.nix
|
|
||||||
./modules/programs/firefox/floorp.nix
|
|
||||||
./modules/programs/firefox/librewolf.nix
|
|
||||||
./modules/programs/foot
|
./modules/programs/foot
|
||||||
./modules/programs/freetube
|
./modules/programs/freetube
|
||||||
./modules/programs/fuzzel
|
./modules/programs/fuzzel
|
||||||
|
|
|
@ -16,6 +16,5 @@ builtins.mapAttrs (test: module: import module [ "programs" name ]) {
|
||||||
"${name}-profiles-overwrite" = ./profiles/overwrite;
|
"${name}-profiles-overwrite" = ./profiles/overwrite;
|
||||||
"${name}-profiles-search" = ./profiles/search;
|
"${name}-profiles-search" = ./profiles/search;
|
||||||
"${name}-profiles-settings" = ./profiles/settings;
|
"${name}-profiles-settings" = ./profiles/settings;
|
||||||
"${name}-state-version-19_09" = ./state-version-19_09.nix;
|
|
||||||
"${name}-profiles-shared-path" = ./profiles/shared-path.nix;
|
"${name}-profiles-shared-path" = ./profiles/shared-path.nix;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,9 +66,15 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} // {
|
} // {
|
||||||
nmt.script = ''
|
nmt.script = let
|
||||||
|
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
|
||||||
|
profilePath = if isDarwin then
|
||||||
|
"Library/Application Support/Firefox/Profiles"
|
||||||
|
else
|
||||||
|
".mozilla/firefox";
|
||||||
|
in ''
|
||||||
bookmarksUserJs=$(normalizeStorePaths \
|
bookmarksUserJs=$(normalizeStorePaths \
|
||||||
home-files/${cfg.configPath}/bookmarks/user.js)
|
"home-files/${profilePath}/bookmarks/user.js")
|
||||||
|
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
$bookmarksUserJs \
|
$bookmarksUserJs \
|
||||||
|
@ -76,7 +82,9 @@ in {
|
||||||
|
|
||||||
bookmarksFile="$(sed -n \
|
bookmarksFile="$(sed -n \
|
||||||
'/browser.bookmarks.file/ {s|^.*\(/nix/store[^"]*\).*|\1|;p}' \
|
'/browser.bookmarks.file/ {s|^.*\(/nix/store[^"]*\).*|\1|;p}' \
|
||||||
$TESTED/home-files/${cfg.configPath}/bookmarks/user.js)"
|
$TESTED/home-files/'${profilePath}'/bookmarks/user.js)"""
|
||||||
|
|
||||||
|
echo "bookmarksFile: $bookmarksFile"
|
||||||
|
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
$bookmarksFile \
|
$bookmarksFile \
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
modulePath:
|
modulePath:
|
||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath;
|
||||||
|
|
||||||
cfg = lib.getAttrFromPath modulePath config;
|
|
||||||
|
|
||||||
firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath;
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
imports = [ firefoxMockOverlay ];
|
imports = [ firefoxMockOverlay ];
|
||||||
|
|
||||||
|
@ -20,9 +15,15 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} // {
|
} // {
|
||||||
nmt.script = ''
|
nmt.script = let
|
||||||
|
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
|
||||||
|
profilePath = if isDarwin then
|
||||||
|
"Library/Application Support/Firefox/Profiles"
|
||||||
|
else
|
||||||
|
".mozilla/firefox";
|
||||||
|
in ''
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
home-files/${cfg.configPath}/containers/containers.json \
|
"home-files/${profilePath}/containers/containers.json" \
|
||||||
${./expected-containers.json}
|
${./expected-containers.json}
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
modulePath:
|
modulePath:
|
||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath;
|
||||||
cfg = lib.getAttrFromPath modulePath config;
|
|
||||||
|
|
||||||
firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath;
|
|
||||||
in {
|
in {
|
||||||
imports = [ firefoxMockOverlay ];
|
imports = [ firefoxMockOverlay ];
|
||||||
|
|
||||||
|
@ -27,9 +24,15 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} // {
|
} // {
|
||||||
nmt.script = ''
|
nmt.script = let
|
||||||
|
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
|
||||||
|
profilePath = if isDarwin then
|
||||||
|
"Library/Application Support/Firefox/Profiles"
|
||||||
|
else
|
||||||
|
".mozilla/firefox";
|
||||||
|
in ''
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
home-files/${cfg.configPath}/extensions/browser-extension-data/uBlock0@raymondhill.net/storage.js \
|
"home-files/${profilePath}/extensions/browser-extension-data/uBlock0@raymondhill.net/storage.js" \
|
||||||
${./expected-storage.js}
|
${./expected-storage.js}
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
modulePath:
|
modulePath:
|
||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
@ -26,15 +26,17 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} // {
|
} // {
|
||||||
nmt.script = ''
|
nmt.script = let
|
||||||
assertFileRegex \
|
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
|
||||||
home-path/bin/${cfg.wrappedPackageName} \
|
profilePath = if isDarwin then
|
||||||
MOZ_APP_LAUNCHER
|
"Library/Application Support/Firefox/Profiles"
|
||||||
|
else
|
||||||
assertDirectoryExists home-files/${cfg.configPath}/basic
|
".mozilla/firefox";
|
||||||
|
in ''
|
||||||
|
assertDirectoryExists "home-files/${profilePath}/basic"
|
||||||
|
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
home-files/${cfg.configPath}/test/user.js \
|
"home-files/${profilePath}/test/user.js" \
|
||||||
${./expected-user.js}
|
${./expected-user.js}
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
|
@ -196,6 +196,11 @@ in {
|
||||||
};
|
};
|
||||||
} // {
|
} // {
|
||||||
nmt.script = let
|
nmt.script = let
|
||||||
|
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
|
||||||
|
profilePath = if isDarwin then
|
||||||
|
"Library/Application Support/Firefox/Profiles"
|
||||||
|
else
|
||||||
|
".mozilla/firefox";
|
||||||
|
|
||||||
noHashQuery = ''
|
noHashQuery = ''
|
||||||
'def walk(f):
|
'def walk(f):
|
||||||
|
@ -228,11 +233,11 @@ in {
|
||||||
}
|
}
|
||||||
|
|
||||||
assertFirefoxSearchContent \
|
assertFirefoxSearchContent \
|
||||||
home-files/${cfg.configPath}/search/search.json.mozlz4 \
|
"home-files/${profilePath}/search/search.json.mozlz4" \
|
||||||
${withName ./expected-search.json}
|
${withName ./expected-search.json}
|
||||||
|
|
||||||
assertFirefoxSearchContent \
|
assertFirefoxSearchContent \
|
||||||
home-files/${cfg.configPath}/searchWithoutDefault/search.json.mozlz4 \
|
"home-files/${profilePath}/searchWithoutDefault/search.json.mozlz4" \
|
||||||
${withName ./expected-search-without-default.json}
|
${withName ./expected-search-without-default.json}
|
||||||
|
|
||||||
assertFirefoxSearchContent \
|
assertFirefoxSearchContent \
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
modulePath:
|
modulePath:
|
||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
@ -26,15 +26,17 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
} // {
|
} // {
|
||||||
nmt.script = ''
|
nmt.script = let
|
||||||
assertFileRegex \
|
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
|
||||||
home-path/bin/${cfg.wrappedPackageName} \
|
profilePath = if isDarwin then
|
||||||
MOZ_APP_LAUNCHER
|
"Library/Application Support/Firefox/Profiles"
|
||||||
|
else
|
||||||
assertDirectoryExists home-files/${cfg.configPath}/basic
|
".mozilla/firefox";
|
||||||
|
in ''
|
||||||
|
assertDirectoryExists "home-files/${profilePath}/basic"
|
||||||
|
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
home-files/${cfg.configPath}/test/user.js \
|
"home-files/${profilePath}/test/user.js" \
|
||||||
${./expected-user.js}
|
${./expected-user.js}
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
modulePath:
|
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
|
||||||
cfg = lib.getAttrFromPath modulePath config;
|
|
||||||
|
|
||||||
firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath;
|
|
||||||
in {
|
|
||||||
imports = [ firefoxMockOverlay ];
|
|
||||||
|
|
||||||
config = lib.mkIf config.test.enableBig ({
|
|
||||||
home.stateVersion = "19.09";
|
|
||||||
} // lib.setAttrByPath modulePath { enable = true; } // {
|
|
||||||
nmt.script = ''
|
|
||||||
assertFileRegex \
|
|
||||||
home-path/bin/${cfg.wrappedPackageName} \
|
|
||||||
MOZ_APP_LAUNCHER
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue