mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-03-15 12:19:00 +00:00
lib/builders: add settings attribute for XDG MIME list builder
This commit is contained in:
parent
72b6d22f71
commit
494cfe614f
@ -10,6 +10,11 @@
|
|||||||
# with.
|
# with.
|
||||||
desktopName ? "",
|
desktopName ? "",
|
||||||
|
|
||||||
|
# Optional Nix-representable settings in INI format. Mutually exclusive with
|
||||||
|
# `addedAssociations`, `removedAssociations`, and `defaultApplications` and
|
||||||
|
# basically ignores proper checking if set.
|
||||||
|
settings ? { },
|
||||||
|
|
||||||
# Applications to be put in `Added Associations`. This is not set when the
|
# Applications to be put in `Added Associations`. This is not set when the
|
||||||
# database is desktop-specific (when the `desktopName` is non-empty.)
|
# database is desktop-specific (when the `desktopName` is non-empty.)
|
||||||
addedAssociations ? { },
|
addedAssociations ? { },
|
||||||
@ -28,12 +33,14 @@ writeTextFile {
|
|||||||
text =
|
text =
|
||||||
# Non-desktop-specific mimeapps.list are only allowed to specify
|
# Non-desktop-specific mimeapps.list are only allowed to specify
|
||||||
# default applications.
|
# default applications.
|
||||||
lib.generators.toINI { } ({
|
lib.generators.toINI { } (
|
||||||
"Default Applications" = defaultApplications;
|
if (settings != { }) then settings
|
||||||
} // (lib.optionalAttrs (desktopName == "") {
|
else {
|
||||||
"Added Associations" = addedAssociations;
|
"Default Applications" = defaultApplications;
|
||||||
"Removed Associations" = removedAssociations;
|
} // (lib.optionalAttrs (desktopName == "") {
|
||||||
}));
|
"Added Associations" = addedAssociations;
|
||||||
|
"Removed Associations" = removedAssociations;
|
||||||
|
}));
|
||||||
destination = "/share/applications/${
|
destination = "/share/applications/${
|
||||||
lib.optionalString (desktopName != "") "${desktopName}-"
|
lib.optionalString (desktopName != "") "${desktopName}-"
|
||||||
}mimeapps.list";
|
}mimeapps.list";
|
||||||
|
Loading…
Reference in New Issue
Block a user