diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index e2e9935c7..74639dc76 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -874,7 +874,11 @@ in "chrome" else "chrome/userChrome.css"; - sourcePath = if lib.types.path.check profile.userChrome then profile.userChrome else null; + sourcePath = + if ((i: lib.isPath i && lib.types.path.check i) profile.userChrome) then + profile.userChrome + else + null; in # Merge the regular profile settings with extension settings mkMerge ( diff --git a/tests/modules/programs/firefox/profiles/userchrome/chrome/userChrome.css b/tests/modules/programs/firefox/profiles/userchrome/chrome/userChrome.css index 120791fd7..bc84d62bd 100644 --- a/tests/modules/programs/firefox/profiles/userchrome/chrome/userChrome.css +++ b/tests/modules/programs/firefox/profiles/userchrome/chrome/userChrome.css @@ -1,3 +1,7 @@ +/* + This is a simple comment that should be written inside the `chrome/userChrome.css` +*/ + #urlbar { min-width: none !important; border: none !important; diff --git a/tests/modules/programs/firefox/profiles/userchrome/default.nix b/tests/modules/programs/firefox/profiles/userchrome/default.nix index a0640afd8..a174f3ce4 100644 --- a/tests/modules/programs/firefox/profiles/userchrome/default.nix +++ b/tests/modules/programs/firefox/profiles/userchrome/default.nix @@ -18,14 +18,17 @@ in basic.isDefault = true; lines = { id = 1; - userChrome = # CSS - '' - #urlbar { - min-width: none !important; - border: none !important; - outline: none !important; - } - ''; + userChrome = '' + /* + This is a simple comment that should be written inside the `chrome/userChrome.css` + */ + + #urlbar { + min-width: none !important; + border: none !important; + outline: none !important; + } + ''; }; path = { id = 2; diff --git a/tests/modules/programs/firefox/profiles/userchrome/expected-userchrome.css b/tests/modules/programs/firefox/profiles/userchrome/expected-userchrome.css index 120791fd7..bc84d62bd 100644 --- a/tests/modules/programs/firefox/profiles/userchrome/expected-userchrome.css +++ b/tests/modules/programs/firefox/profiles/userchrome/expected-userchrome.css @@ -1,3 +1,7 @@ +/* + This is a simple comment that should be written inside the `chrome/userChrome.css` +*/ + #urlbar { min-width: none !important; border: none !important;