summaryrefslogtreecommitdiff
path: root/configuration.nix
blob: 691a31183be22cf991815ac9c86e180dada1f95b (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
{ config, pkgs, ... }:

{
  imports = [
    ./hardware-configuration.nix
    <home-manager/nixos>
  ];

  nix.settings.experimental-features = [ "nix-command" "flakes" ];

  # Use the systemd-boot EFI boot loader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  networking.hostName = "OwO";
  networking.networkmanager.enable = true;

  fileSystems."/data" = {
    device = "/dev/sda";
    fsType = "ext4";
  };

  time.timeZone = "Asia/Kolkata";

  nixpkgs.config.allowUnfree = true;

  programs.hyprland = {
    enable = true;
    xwayland.enable = true;
  };
  xdg.portal.enable = true;
  xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ];

  environment.sessionVariables = {
    NIXOS_OZONE_WL = "1";
  };

  services.printing.enable = true;
  sound.enable = true;
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    jack.enable = true;
  };

  hardware.bluetooth.enable = true;
  hardware.bluetooth.powerOnBoot = true;
  services.blueman.enable = true;

  services.xserver.libinput.enable = true;
  services.greetd = {
    enable = true;
    settings = {
      default_session = {
        command = "tuigreet --time --remember --cmd Hyprland";
        user = "greeter";
      };
    };
  };

  services.logind.extraConfig = ''
    HandlePowerKey=ignore
  '';

  systemd.services.greetd.serviceConfig = {
    Type = "idle";
    StandardInput = "tty";
    StandardOutput = "tty";
    StandardError = "journal";
    TTYReset = true;
    TTYVHangup = true;
    TTYVTDisallocate = true;
  };

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

  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

      pavucontrol
      blueman
      brillo
    ];

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

        sessionizer() {
          DIR=$(fd . $HOME --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-F": "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-Light"; package = pkgs.papirus-icon-theme; };

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

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

    home.stateVersion = "23.11";
    programs.home-manager.enable = true;
  };

  environment.systemPackages = with pkgs; [
    waybar
    tofi
    fuzzel
    dunst
    hyprpaper

    networkmanagerapplet

    greetd.tuigreet
    greetd.greetd
    polkit_gnome
    waylock

    libnotify
    libappindicator
  ];

  fonts.packages = with pkgs; [
    (nerdfonts.override { fonts = [ "UbuntuMono" ]; })
  ];

  virtualisation.libvirtd.enable = true;
  programs.dconf.enable = true;

  programs.gnupg.agent = {
    enable = true;
  };

  security.polkit.enable = true;
  security.pam.services.waylock.text = ''
    auth include login
  '';

  system.stateVersion = "23.11";
}