summaryrefslogtreecommitdiff
path: root/home/environ.nix
blob: 60d618a62beee45f07284fb7f73770a44979f1f5 (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
{ config, lib, pkgs, ... }:
with lib; let
  symlink = config.lib.file.mkOutOfStoreSymlink;

  #TODO: No sirve, creo que por readline
  devNull = symlink "/dev/null";
in
{
  config = {
    xdg.enable = true;

    systemd.user = {
      tmpfiles.rules = [
        "d %t/vtmp 0700"
      ];

      timers = {
        units-cur = {
          Install.WantedBy = [ "timers.target" ];
          Timer.OnCalendar = "daily";
          Unit.Description = "Update currency information for 'units'";
        };
      };

      services = {
        units-cur = {
          Unit.Description = "Update currency information for 'units'";

          Service = {
            Type = "exec";
            ExecStart = "${pkgs.units}/bin/units_cur .units";
          };
        };
      };
    };

    home.file = {
      #TODO: .calc_history
      "vtmp".source = symlink "/run/user/${toString config.local.uid}/vtmp";
      ".units_history".source = devNull;
    };

    programs = {
      zsh = {
        enable = true;
        autosuggestion.enable = true;
        syntaxHighlighting.enable = true;
        initExtra = import ./zshrc.nix pkgs;
      };

      neovim = {
        enable = true;

        viAlias = true;
        vimAlias = true;
        withRuby = false;
        withPython3 = false;

        extraConfig = ''
          set number         " Enable line numbering
          set relativenumber " Enable relative line numbering
          set tabstop=4      " Set tap stop to 4
          set shiftwidth=4   " Set shift width to 4 (same as tabstop)
          set viminfo=       " No tracking
        '';
      };
    };

    xdg.configFile."home-manager" = mkIf (!config.home.isolation.active) {
      source = symlink "${config.home.homeDirectory}/nix";
    };
  };
}