about summary refs log tree commit diff stats
path: root/flake/nixosConfigurations/common.nix
blob: 232c329d3815bc390fb80f960ce5e3327c2daaa5 (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
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
# This file contains common configuration applied to every host.
# It should only `enable` options defined in the `modules/by-name` directory.
{
  config,
  pkgs,
  lib,
  ...
}: {
  soispha = {
    boot.enable = true;
    cleanup.enable = true;
    documentation.enable = true;

    fonts = {
      enable = true;
      enableEmoji = true;
    };

    home-manager.enable = true;
    impermanence = {
      enable = true;

      directories = [
        "/etc/nixos"
        "/var/log"
        "/var/lib/systemd"
        "/var/lib/nixos"
      ];
    };
    polkit.enable = true;
    power.enable = true;

    services = {
      adb = {
        enable = true;
        user = "soispha";
      };
      fwupd.enable = true;
      mpd = {
        enable = true;
        directories = let
          data = "${config.home-manager.users.soispha.xdg.dataHome}/mpd";
        in {
          inherit data;
          playlists = "${data}/playlists";
          runtime = "/run/user/${builtins.toString config.users.users.soispha.uid}/mpd";
          music = config.home-manager.users.soispha.programs.beets.settings.directory;
        };
        mpc = {
          enable = true;
          beetsPkg = config.home-manager.users.soispha.programs.beets.package;
        };
      };
      ollama.enable = false;
      postgresql.enable = false;
      printing.enable = true;
      scanning.enable = true;
      snapper.enable = true;
      steam.enable = false;
      systemDiff.enable = true;
      unison = {
        enable = true;

        foreign.userName = "soispha";
        dataDir = "${config.home-manager.users.soispha.xdg.dataHome}/unison";
        userSourceDir = "/srv/home/soispha";
        pathsToIgnore = let
          extractTarget = attr: "~/${attr.target}";
          homeManagerSymlinks =
            builtins.map extractTarget
            (builtins.attrValues
              config.home-manager.users.soispha.home.file);
        in
          [
            # already synchronized by the taskserver
            "~/.local/share/task"

            # Should not be synchronized
            "~/.local/share/unison"

            # Is just to big to be synchronized (# TODO: Work around that <2024-08-31> )
            "~/media/music"
          ]
          ++ homeManagerSymlinks;

        pathsToSync = [
          "~/.local/state/mpv"
          "~/.local/state/nvim"
          "~/.local/share"
          "~/.local/.Trash-1000"

          "~/.mozilla/firefox"

          "~/media"
          "~/school"
          "~/repos"
        ];
      };
    };

    programs = {
      nvim = {
        enable = true;
        shell = pkgs.zsh;
      };
      atuin.enable = true;
      direnv.enable = true;
      git.enable = true;
      imv.enable = true;
      less.enable = true;
      lf.enable = true;
      river = {
        enable = true;
        init = {
          rules = [
            {
              app-id = "float";
              title = "*";
              action = "float";
            }
            {
              app-id = "mpv";
              title = "*";
              action = "float";
            }
            {
              app-id = "ModernGL";
              title = "*";
              action = "float";
            }
            {
              app-id = "*";
              title = "Manim Slides";
              action = "float";
            }
            {
              app-id = "*";
              title = "floating please";
              action = "float";
            }

            {
              app-id = "*";
              title = "*";
              action = "ssd";
            }
            # This remove the focus border around Firefox (which is useful because the Firefox is nearly always in its own tag.)
            {
              app-id = "firefox";
              title = "*";
              action = "csd";
            }
          ];
          generalSettings = {
            # background
            background-color = "0x002b36";
            border-color-focused = "0x93a1a1";
            border-color-unfocused = "0x586e75";

            # keyboard repeat rate
            set-repeat = ["50" "300"];

            # Cursor
            focus-follows-cursor = "normal";
            # hide-cursor = ["timeout" "2000"];
            hide-cursor = ["when-typing" "enabled"];
            set-cursor-warp = "on-output-change";
            xcursor-theme = ["Nordzy-cursors" "24"];
          };
          inputs = {
            pointer-1133-49970-Logitech_Gaming_Mouse_G502 = [["pointer-accel" "0"] ["accel-profile" "none"]];
            pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I = [["pointer-accel" "0"] ["accel-profile" "none"]];
          };
          backgroundStart = [
            pkgs.gammastep
            pkgs.yambar

            pkgs.mako
            ["${lib.getExe pkgs.swaybg}" "--image" "${./abstract-nord.png}"]
            pkgs.swayidle
            pkgs.alacritty
          ];
        };
      };
      mpv.enable = true;
      swaylock.enable = true;
      taskwarrior.enable = true;
      yambar.enable = true;
      yt.enable = true;
      zathura.enable = true;
      zsh.enable = true;
    };

    sound.enable = true;
    version.enable = true;
  };
}