firefoxpwa: add module (#7408)

Adds the `firefoxpwa` module for the native Progressive Web Apps for
Firefox application.
This commit is contained in:
bricked 2025-07-08 15:56:50 +00:00 committed by GitHub
parent 5751fa774f
commit 218da00bfa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 309 additions and 0 deletions

View file

@ -0,0 +1,33 @@
{
programs.firefoxpwa = {
enable = true;
package = null;
profiles = {
"INVALID" = { };
"0123456789ABCDEFGHJKMNPQRS".sites."00000000000000000000000000" = {
name = "MDN Web Docs";
url = "https://developer.mozilla.org/";
manifestUrl = "https://developer.mozilla.org/manifest.f42880861b394dd4dc9b.json";
};
"ZYXWVTSRQPNMKJHGFEDCBA9876".sites."00000000000000000000000000" = {
name = "MDN Web Docs";
url = "https://developer.mozilla.org/";
manifestUrl = "https://developer.mozilla.org/manifest.f42880861b394dd4dc9b.json";
};
};
};
test.asserts.assertions.expected = [
''
ULID 'INVALID' at 'programs.firefoxpwa.profiles' must be 26 characters, but is
7 characters long.
''
''
ULID 'INVALID' at 'programs.firefoxpwa.profiles' must only contain characters
'0123456789ABCDEFGHJKMNPQRSTVWXYZ', but contains 'ILI'.
''
''
Site with ULID '00000000000000000000000000' must be present in exactly one profile, but is present
in 2 profiles, namely '0123456789ABCDEFGHJKMNPQRS', 'ZYXWVTSRQPNMKJHGFEDCBA9876'.
''
];
}

View file

@ -0,0 +1 @@
{"profiles":{"0123456789ABCDEFGHJKMNPQRS":{"name":"0123456789ABCDEFGHJKMNPQRS","sites":["ZYXWVTSRQPNMKJHGFEDCBA9876"],"ulid":"0123456789ABCDEFGHJKMNPQRS"}},"sites":{"ZYXWVTSRQPNMKJHGFEDCBA9876":{"config":{"document_url":"https://developer.mozilla.org/","manifest_url":"https://developer.mozilla.org/manifest.f42880861b394dd4dc9b.json","name":"MDN Web Docs"},"manifest":{"name":"MDN Web Docs","start_url":"https://developer.mozilla.org/"},"profile":"0123456789ABCDEFGHJKMNPQRS","ulid":"ZYXWVTSRQPNMKJHGFEDCBA9876"}}}

View file

@ -0,0 +1,17 @@
{
programs.firefoxpwa = {
enable = true;
package = null;
profiles."0123456789ABCDEFGHJKMNPQRS".sites."ZYXWVTSRQPNMKJHGFEDCBA9876" = {
name = "MDN Web Docs";
url = "https://developer.mozilla.org/";
manifestUrl = "https://developer.mozilla.org/manifest.f42880861b394dd4dc9b.json";
};
};
nmt.script = ''
configFile=home-files/.local/share/firefoxpwa/config.json
assertFileExists $configFile
assertFileContent $configFile ${./config-expected.json}
'';
}

View file

@ -0,0 +1,4 @@
{
firefoxpwa-config = ./config.nix;
firefoxpwa-assertions = ./assertions.nix;
}