about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2018-12-18 00:27:23 +0100
committerGitHub <noreply@github.com>2018-12-18 00:27:23 +0100
commitaacb2448896e6f22aff226833d719216acae1481 (patch)
tree58bc8e0b8ef4e4bf25695543fb898ba266ccdf49 /nixos
parent0ceb8236bca7531128c42563981bd0b81f9fd9cd (diff)
parent656b74f021c204b4ef1ecdfedd180e3336f8cdc5 (diff)
downloadnixlib-aacb2448896e6f22aff226833d719216acae1481.tar
nixlib-aacb2448896e6f22aff226833d719216acae1481.tar.gz
nixlib-aacb2448896e6f22aff226833d719216acae1481.tar.bz2
nixlib-aacb2448896e6f22aff226833d719216acae1481.tar.lz
nixlib-aacb2448896e6f22aff226833d719216acae1481.tar.xz
nixlib-aacb2448896e6f22aff226833d719216acae1481.tar.zst
nixlib-aacb2448896e6f22aff226833d719216acae1481.zip
Merge pull request #51520 from michaelpj/imp/appstream
nixos: add AppStream module
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/config/appstream.nix25
-rw-r--r--nixos/modules/module-list.nix1
2 files changed, 26 insertions, 0 deletions
diff --git a/nixos/modules/config/appstream.nix b/nixos/modules/config/appstream.nix
new file mode 100644
index 000000000000..483ac9c3cd76
--- /dev/null
+++ b/nixos/modules/config/appstream.nix
@@ -0,0 +1,25 @@
+{ config, lib, ... }:
+
+with lib;
+{
+  options = {
+    appstream.enable = mkOption {
+      type = types.bool;
+      default = true;
+      description = ''
+        Whether to install files to support the 
+        <link xlink:href="https://www.freedesktop.org/software/appstream/docs/index.html">AppStream metadata specification</link>.
+      '';
+    };
+  };
+
+  config = mkIf config.appstream.enable {
+    environment.pathsToLink = [ 
+      # per component metadata
+      "/share/metainfo" 
+      # legacy path for above
+      "/share/appdata" 
+    ];
+  };
+
+}
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 5ffb0c5ab223..09ed55c0699a 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -11,6 +11,7 @@
   ./config/xdg/icons.nix
   ./config/xdg/menus.nix
   ./config/xdg/mime.nix
+  ./config/appstream.nix
   ./config/gtk/gtk-icon-cache.nix
   ./config/gnu.nix
   ./config/i18n.nix