summaryrefslogtreecommitdiff
path: root/home.nix
blob: cda4cd3e466683d35830c6775999ab0c41902f35 (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
{ config, pkgs, ... }:
let
  home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
in
{
  imports = [
    (import "${home-manager}/nixos")
  ];

  users.users.compromyse = {
    isNormalUser = true;
    extraGroups = [ "wheel" "storage" "libvirtd" ];
  };

  home-manager.useUserPackages = true;
  home-manager.useGlobalPkgs = true;

  home-manager.users.compromyse = { pkgs, ... }: {
    home.packages = with pkgs; [
      wget

      tmux
      fzf
      fd
      ripgrep

      cinnamon.nemo
      mate.eom

      spotify
      firefox

      obs-studio

      pavucontrol
      blueman
      brillo
    ];

    programs.bash = {
      enable = true;
      initExtra= ''
        export PS1="\[\e[38;5;243m\]\h \[\e[38;5;254m\]\w \[\033[0m\]> "
        set -o vi

        if [[ -n "$IN_NIX_SHELL" ]]; then
          export PS1="\[\e[38;5;242m\](dev) $PS1"
        fi

        sessionizer() {
          DIR=$(fd . /data --type d -L -H | fzf)
          SESSION_NAME="$DIR_$(date +%M%S)"

          if [ -n "$DIR" ]
          then
            if [ "$1" == "-cd" ]
            then
              cd $DIR
              return
            fi
            tmux new-session -d -c "$DIR" -s "$SESSION_NAME"
            if [ -n "$TMUX" ]
            then
              tmux switch -t "$SESSION_NAME"
            else
              tmux attach -t "$SESSION_NAME"
            fi
          fi
        }

        if [[ $- != *i* ]]
        then
          sessionizer
        fi

        bind '"\C-f": "sessionizer\n"'
        bind '"\C-a": "sessionizer -cd\n"'
      '';
    };

    programs.git = {
      enable = true;
      userName = "Raghuram Subramani";
      userEmail = "raghus2247@gmail.com";
    };

    programs.neovim = {
      enable = true;
      defaultEditor = true;
      viAlias = true;
      vimAlias = true;
      vimdiffAlias = true;
    };


    programs.alacritty = {
      enable = true;
    };

    home.file = {
      ".tmux.conf".source = ./.tmux.conf;
      ".fdignore".source = ./.fdignore;
      ".config" = {
        source = ./config;
        recursive = true;
      };
    };

    home.pointerCursor = {
      gtk.enable = true;
      package = pkgs.bibata-cursors;
      name = "Bibata-Modern-Classic";
      size = 16;
    };

    gtk = {
      enable = true;

      theme = { name = "adw-gtk3-dark"; package = pkgs.adw-gtk3; };
      iconTheme = { name = "Papirus-Dark"; package = pkgs.papirus-icon-theme; };

      font = { name = "UbuntuMono Nerd Font"; };
    };

    qt = {
      enable = true;
      platformTheme = "gtk";
      style.name = "adwaita-dark";
    };

    home.stateVersion = "23.11";
  };

  environment.etc."inputrc".text = pkgs.lib.mkForce (
    builtins.readFile <nixpkgs/nixos/modules/programs/bash/inputrc> + ''
      set completion-ignore-case on
    ''
  );

  virtualisation.libvirtd.enable = true;
  programs.virt-manager.enable = true;
}