fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert Helgessontests: some minor cleanupsaf715ed8

master
851 B43 linesraw
1{ pkgs, ... }:
2
3let
4
5  tasksFilePath = if pkgs.stdenv.hostPlatform.isDarwin then
6    "Library/Application Support/Code/User/tasks.json"
7  else
8    ".config/Code/User/tasks.json";
9
10  tasks = {
11    version = "2.0.0";
12    tasks = [{
13      type = "shell";
14      label = "Hello task";
15      command = "hello";
16    }];
17  };
18
19  expectedTasks = pkgs.writeText "tasks-expected.json" ''
20    {
21      "tasks": [
22        {
23          "command": "hello",
24          "label": "Hello task",
25          "type": "shell"
26        }
27      ],
28      "version": "2.0.0"
29    }
30  '';
31
32in {
33  programs.vscode = {
34    enable = true;
35    package = pkgs.writeScriptBin "vscode" "" // { pname = "vscode"; };
36    userTasks = tasks;
37  };
38
39  nmt.script = ''
40    assertFileExists "home-files/${tasksFilePath}"
41    assertFileContent "home-files/${tasksFilePath}" "${expectedTasks}"
42  '';
43}