-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
freedesktop modules: init #45058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
freedesktop modules: init #45058
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { config, lib, ... }: | ||
|
|
||
| with lib; | ||
| { | ||
| options = { | ||
| xdg.autostart.enable = mkOption { | ||
| type = types.bool; | ||
| default = true; | ||
| description = '' | ||
| Whether to install files to support the | ||
| <link xlink:href="https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html">XDG Autostart specification</link>. | ||
| ''; | ||
| }; | ||
| }; | ||
|
|
||
| config = mkIf config.xdg.autostart.enable { | ||
| environment.pathsToLink = [ | ||
| "/etc/xdg/autostart" | ||
| ]; | ||
| }; | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { config, lib, ... }: | ||
|
|
||
| with lib; | ||
| { | ||
| options = { | ||
| xdg.icons.enable = mkOption { | ||
| type = types.bool; | ||
| default = true; | ||
| description = '' | ||
| Whether to install files to support the | ||
| <link xlink:href="https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html">XDG Icon Theme specification</link>. | ||
| ''; | ||
| }; | ||
| }; | ||
|
|
||
| config = mkIf config.xdg.icons.enable { | ||
| environment.pathsToLink = [ | ||
| "/share/icons" | ||
| "/share/pixmaps" | ||
| ]; | ||
|
|
||
| environment.profileRelativeEnvVars = { | ||
| XCURSOR_PATH = [ "/share/icons" ]; | ||
| }; | ||
| }; | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { config, lib, ... }: | ||
|
|
||
| with lib; | ||
| { | ||
| options = { | ||
| xdg.menus.enable = mkOption { | ||
| type = types.bool; | ||
| default = true; | ||
| description = '' | ||
| Whether to install files to support the | ||
| <link xlink:href="https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html">XDG Desktop Menu specification</link>. | ||
| ''; | ||
| }; | ||
| }; | ||
|
|
||
| config = mkIf config.xdg.menus.enable { | ||
| environment.pathsToLink = [ | ||
| "/share/applications" | ||
| "/share/desktop-directories" | ||
| "/etc/xdg/menus" | ||
| "/etc/xdg/menus/applications-merged" | ||
| ]; | ||
| }; | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { config, lib, pkgs, ... }: | ||
|
||
|
|
||
| with lib; | ||
| { | ||
| options = { | ||
| xdg.mime.enable = mkOption { | ||
| type = types.bool; | ||
| default = true; | ||
| description = '' | ||
| Whether to install files to support the | ||
| <link xlink:href="https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html">XDG Shared MIME-info specification</link> and the | ||
| <link xlink:href="https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html">XDG MIME Applications specification</link>. | ||
| ''; | ||
| }; | ||
| }; | ||
|
|
||
| config = mkIf config.xdg.mime.enable { | ||
| environment.pathsToLink = [ "/share/mime" ]; | ||
|
|
||
| environment.systemPackages = [ | ||
| # this package also installs some useful data, as well as its utilities | ||
| pkgs.shared-mime-info | ||
| ]; | ||
|
|
||
| environment.extraSetup = '' | ||
| if [ -w $out/share/mime ]; then | ||
| XDG_DATA_DIRS=$out/share ${pkgs.shared-mime-info}/bin/update-mime-database -V $out/share/mime > /dev/null | ||
| fi | ||
|
|
||
| if [ -w $out/share/applications ]; then | ||
| ${pkgs.desktop-file-utils}/bin/update-desktop-database $out/share/applications | ||
| fi | ||
| ''; | ||
| }; | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be moved to
xdg.iconsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I wasn't sure about that - I thought maybe there should be a GTK module that does this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that looks like GTK thing: https://developer.gnome.org/gtk3/stable/gtk-update-icon-cache.html
We should probably get a module later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly for the glib schemas.