ctucx.git: nixfiles

ctucx' nixfiles

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 
{ config, pkgs, lib, ... }:

let
  cfg = config.ctucxConfig.programs.networkUtilities;

in {

  options = {
    ctucxConfig.programs.networkUtilities = {
      enable = lib.mkEnableOption "some networking related utilities";
    };
  };

  config = lib.mkIf cfg.enable {
    programs.mtr.enable        = (if pkgs.stdenv.isLinux then true else false);
    programs.traceroute.enable = (if pkgs.stdenv.isLinux then true else false);

    home-manager.users.katja.home = {
      packages = with pkgs; [
        dnsutils
        nmap
        tcpdump
        iperf3
      ] ++ (if pkgs.stdenv.isDarwin then [
        mtr
        spoof-mac
      ] else [
        whois
        macchanger
      ]);

      shellAliases = lib.mkIf pkgs.stdenv.isDarwin {
        mtr = "sudo mtr";
      };
    };
  };

}