fork/home-manager
git clone https://git.julia.blue/fork/home-manager
24c1a633
master
1{ pkgs , ...} : 2 3let 4 5snippetsDir = if pkgs . stdenv . hostPlatform . isDarwin then 6"Library/Application Support/Code/User/snippets" 7else 8".config/Code/User/snippets" ; 9 10globalSnippetsPath = " ${ snippetsDir } /global.code-snippets" ; 11 12globalSnippetsExpectedContent = pkgs . writeText "global.code-snippet" '' 13{ 14"fixme": { 15"body": [ 16"fixme body in global user snippet" 17], 18"description": "Insert a FIXME remark", 19"prefix": [ 20"fixme" 21] 22} 23} 24'' ; 25 26haskellSnippetsPath = " ${ snippetsDir } /haskell.json" ; 27 28haskellSnippetsExpectedContent = pkgs . writeText "haskell.json" '' 29{ 30"impl": { 31"body": [ 32"impl body in user haskell snippet" 33], 34"description": "Insert an implementation stub", 35"prefix": [ 36"impl" 37] 38} 39} 40'' ; 41 42in { 43programs . vscode = { 44enable = true ; 45package = pkgs . writeScriptBin "vscode" "" // { pname = "vscode" ; }; 46globalSnippets = { 47fixme = { 48prefix = [ "fixme" ]; 49body = [ "fixme body in global user snippet" ]; 50description = "Insert a FIXME remark" ; 51}; 52}; 53languageSnippets = { 54haskell = { 55impl = { 56prefix = [ "impl" ]; 57body = [ "impl body in user haskell snippet" ]; 58description = "Insert an implementation stub" ; 59}; 60}; 61}; 62}; 63 64nmt . script = '' 65assertFileExists "home-files/ ${ globalSnippetsPath } " 66assertFileContent " home-files/ ${ globalSnippetsPath } " " ${ globalSnippetsExpectedContent } " 67 68assertFileExists " home-files/ ${ haskellSnippetsPath } " 69assertFileContent " home-files/ ${ haskellSnippetsPath } " " ${ haskellSnippetsExpectedContent } " 70'' ; 71}