aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/develop.nix
blob: 8b413a925b1177bcb06dccabef7fab1db03bfb7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
{
  config,
  lib,
  pkgs,
  ...
}: let
  inherit (lib) mkOption mkIf types;
in {
  options = {
    cynerd.develop = mkOption {
      type = types.bool;
      default = false;
      description = "If machine is about to be used for development.";
    };
  };

  config = mkIf config.cynerd.develop {
    cynerd = {
      devmin = true;
      compile = true;
    };
    environment.systemPackages = with pkgs; [
      # Tools
      git-lfs
      gitlint
      tig
      gitg
      gource
      glab
      github-cli
      wlc # Weblate
      cloc
      openssl
      tio
      vim-vint
      vim-language-server
      vale
      can-utils
      unixtools.xxd

      # Required for neovim plugins
      editorconfig-checker
      go
      gcc

      # Nix
      dev
      cachix
      nurl
      nil
      nixfmt
      alejandra
      statix
      deadnix
      agenix
      nix-tree
      nix-output-monitor

      # Shell
      dash # Posix shell
      bats
      shellcheck
      shfmt
      bash-language-server
      jq
      yq
      fq

      # C
      clang-tools
      bear
      #massif-visualizer
      elf-size-analyze

      # Python
      (python3.withPackages (pypkgs:
        with pypkgs; [
          pip
          ipython
          python-lsp-server

          pytest
          pytest-html
          pytest-tap
          coverage
          mypy

          scipy
          statsmodels
          sympy

          pygraphviz
          matplotlib
          seaborn
          plotly
          pygal

          python-gitlab
          pygithub

          schema
          jinja2
          ruamel-yaml
          msgpack
          urllib3

          influxdb-client
          psycopg
          paho-mqtt

          humanize
          rich

          pygobject3

          pyserial
          pylibftdi
          pyusb
          usbtmc

          pylxd
          selenium

          pyvisa
          pyvisa-py
        ]))
      ruff
      geckodriver
      chromedriver
      # Libraries to be used by python packages
      gobject-introspection
      gtk3
      gtk4

      # Lua
      selene
      stylua

      # Julia
      julia

      # XML
      libxml2

      # Qemmu
      qemu
      virt-manager
      cdrtools

      # Docker
      docker-credential-helpers

      # U-Boot
      ubootTools
      tftp-hpa

      # Network
      iperf3
      inetutils

      # Gtk
      cambalache

      # Barcode generation
      barcode

      # D-Bus
      d-spy

      # Documentation
      man-pages
      man-pages-posix
      linux-manual
      stdmanpages

      # Writing documentation
      docstrfmt

      # SHV
      (shvcli.withPlugins [python3Packages.shvcli-ell])

      # Images
      imagemagick

      # S3
      rclone
    ];
    #programs.wireshark = {
    #  enable = true;
    #  package = pkgs.wireshark;
    #};

    programs.nix-ld = {
      enable = true;
      libraries = with pkgs; [
        alsa-lib
        at-spi2-atk
        cairo
        cups
        dbus
        expat
        gdk-pixbuf
        glib
        gtk3
        libGL
        libXpm
        libdrm
        libgbm
        libgcrypt
        libsoup_3
        libudev0-shim
        libusb1
        libx11
        libxcb
        libxcomposite
        libxdamage
        libxext
        libxfixes
        libxkbcommon
        libxrandr
        nspr
        nss
        openssl
        pango
        udev
        webkitgtk_4_1
      ];
    };

    documentation = {
      nixos = {
        enable = true;
        includeAllModules = true;
      };
      dev.enable = true;
      doc.enable = true;
    };

    services.guix.enable = true;
    #environment.etc."guix/machines.scm".text = ''
    #  (list (build-machine
    #    (name "czellembsrv.elektroline.cz")
    #    (systems (list "x86_64-linux" "i686-linux"))
    #    (host-key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICQZIwdzBo5CvMjS0M9tKYG2ikqPmSgSKRa/UPAoyhBC root@embsrv")
    #    (user "kkoci")
    #    (private-key "/home/cynerd/.ssh/elektroline-emb")
    #    (parallel-builds 16)
    #    (speed 2.0)
    #  ))
    #'';

    virtualisation = {
      containers.enable = true;
      docker = {
        enable = true;
        autoPrune.enable = true;
        storageDriver = "btrfs";
      };
      lxc.enable = true;
      libvirtd = {
        enable = true;
        qemu = {
          swtpm.enable = true;
          vhostUserPackages = with pkgs; [virtiofsd];
        };
      };
      spiceUSBRedirection.enable = true;
    };
    networking.firewall.trustedInterfaces = ["virbr0"];

    users.users.cynerd.extraGroups = [
      "docker"
      "lxd"
      "libvirtd"
    ];
  };
}