fork/home-manager
git clone https://git.julia.blue/fork/home-manager
ec06f419
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5{ 6config = { 7xdg . desktopEntries = { 8full = { # full definition 9type = "Application" ; 10exec = "test --option" ; 11icon = "test" ; 12comment = "My Application" ; 13terminal = true ; 14name = "Test" ; 15genericName = "Web Browser" ; 16mimeType = [ "text/html" "text/xml" ]; 17categories = [ "Network" "WebBrowser" ]; 18startupNotify = false ; 19noDisplay = false ; 20prefersNonDefaultGPU = false ; 21settings = { 22Keywords = "calc;math" ; 23DBusActivatable = "false" ; 24}; 25actions = { 26"New-Window" = { 27name = "New Window" ; 28exec = "test --new-window" ; 29icon = "test" ; 30}; 31"Default" = { exec = "test --default" ; }; 32}; 33}; 34min = { # minimal definition 35name = "Test" ; 36}; 37deprecated = { 38exec = "test --option" ; 39name = "Test" ; 40# Deprecated options 41fileValidation = true ; 42extraConfig = '' 43[X-ExtraSection] 44Exec=foo -o 45'' ; 46}; 47}; 48 49#testing that preexisting entries in the store are overridden 50home . packages = [ 51( pkgs . makeDesktopItem { 52name = "full" ; 53desktopName = "We don't want this" ; 54exec = "no" ; 55}) 56( pkgs . makeDesktopItem { 57name = "min" ; 58desktopName = "We don't want this" ; 59exec = "no" ; 60}) 61]; 62 63test . asserts . assertions . expected = 64let currentFile = toString ./desktop-entries.nix ; 65in [ 66'' 67The option definition `fileValidation' in ` ${ currentFile } ' no longer has any effect; please remove it. 68Validation of the desktop file is always enabled. 69'' 70'' 71The option definition `extraConfig' in ` ${ currentFile } ' no longer has any effect; please remove it. 72The `extraConfig` option of `xdg.desktopEntries` has been removed following a change in Nixpkgs. 73'' 74]; 75 76nmt . script = '' 77assertFileExists home-path/share/applications/full.desktop 78assertFileExists home-path/share/applications/min.desktop 79assertFileContent home-path/share/applications/full.desktop \ 80${ ./desktop-full-expected.desktop } 81assertFileContent home-path/share/applications/min.desktop \ 82${ ./desktop-min-expected.desktop } 83'' ; 84}; 85}