about summary refs log tree commit diff
path: root/modules/profiles/dev/default.nix
blob: 3ee2ff5e6788abbfc7e5171e3f63f8afebff2965 (plain) (blame)
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
{
  config,
  lib,
  pkgs,
  ...
}:
with lib;
let
  cfg = config.nixfiles.modules.profiles.dev;
in
{
  imports = attrValues (modulesIn ./.);

  options.nixfiles.modules.profiles.dev.enable = mkEnableOption "Catch-all profile for stuff related to software development and etc.";

  config = mkIf cfg.enable {
    nixfiles.modules = {
      bat.enable = true;
      curl.enable = true;
      direnv.enable = true;
      editorconfig.enable = true;
      git.client.enable = true;
      nmap.enable = true;
      wget.enable = true;
    };

    hm = {
      home = {
        sessionVariables = rec {
          CABAL_DIR = "${config.dirs.data}/cabal";
          CABAL_CONFIG = pkgs.writeText "cabal-config" ''
            repository hackage.haskell.org
              url: https://hackage.haskell.org/
              secure: True

            jobs: $ncpus

            remote-repo-cache: ${CABAL_DIR}/packages

            world-file: ${CABAL_DIR}/world

            logs-dir: ${CABAL_DIR}/logs
            build-summary: ${CABAL_DIR}/logs/build.log

            installdir: ${CABAL_DIR}/bin
            extra-prog-path: ${CABAL_DIR}/bin
          '';
          STACK_ROOT = "${config.dirs.data}/stack";

          RUSTUP_HOME = "${config.dirs.data}/rustup";
          CARGO_HOME = "${config.dirs.data}/cargo";

          GOPATH = "${config.dirs.data}/go";
          GORE_HOME = "${config.dirs.data}/gore";

          PYTHONSTARTUP = ./pystartup.py;
        };

        packages = with pkgs; [
          age
          google-cloud-sdk
          htmlq
          httpie
          hydra-check
          jq
          logcli
          nix-update
          nixpkgs-review
          scaleway-cli
          sops
          vultr-cli
          yq
        ];

        language = {
          collate = "C";
          messages = "C";
        };
      };

      xdg.configFile = {
        "gdb/gdbinit".source = ./gdbinit;
        "ghc/ghci.conf".source = ./ghci.conf;
      };
    };

    programs.wireshark = {
      enable = true;
      package = pkgs.wireshark;
    };

    my.extraGroups = [
      "kvm"
      "wireshark"
    ];
  };
}

Consider giving Nix/NixOS a try! <3