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 
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 
240 
241 
242 
243 
244 
245 
246 
247 
248 
249 
250 
251 
252 
253 
254 
255 
256 
257 
258 
259 
260 
261 
262 
263 
264 
{ inputs, config, lib, pkgs, home-manager, ... }:

{

  nixpkgs.overlays = [(final: prev: {
    # patch gdm to automaticly select the first user
    gnome-shell    = prev.gnome-shell.overrideAttrs (prevAttrs: {
      patches = prevAttrs.patches ++ [ ../../pkgs/gdm-autoselect-user.patch ];
    });

    # use more generic name and icon
    ptyxis    = prev.ptyxis.overrideAttrs (prevAttrs: {
      mesonFlags = [ "-Dgeneric=terminal" ];
    });

    # deactivate some backends
    gnome-online-accounts = prev.gnome-online-accounts.overrideAttrs( prevAttrs: {
      mesonFlags = prevAttrs.mesonFlags ++ [ "-Dexchange=false" "-Dgoogle=false" "-Dkerberos=false" "-Downcloud=false" "-Dwindows_live=false" "-Dms_graph=false" ];
    });
  })];

  boot.plymouth.enable = true;

  hardware.bluetooth.settings = {
    General.Experimental = true;
  };

  users.users.katja.extraGroups = [ "dialout" "networkmanager"];

  # networking.networkmanager.wifi.backend = "iwd";

  services = {
    nscd.enable  = true;
    gvfs.package = (pkgs.gvfs.overrideAttrs (old: {
      mesonFlags = (old.mesonFlags or []) ++ [
        "-Dafp=false"
        "-Dafc=false"
        "-Dmtp=false"
        "-Dgphoto2=false"
      ];
    })).override {
      samba        = null;
      gnomeSupport = false;
    };

    #required for gnome-calendar
    gnome.evolution-data-server.enable  = true;
    gnome.gnome-online-accounts.enable  = true;
  };

  programs.evince.enable = true;

  home-manager.users.katja = {
    manual.html.enable = true;

    home.packages = with pkgs; [
      wl-clipboard-x11
      gnome-calendar
      gnome-text-editor
      gnome-podcasts
      gnome-obfuscate
      loupe
      errands
      diebahn
      xdg-utils
      # look and feel from libadwaita ported to GTK-3
      adw-gtk3
    ] ++ (with pkgs.gnomeExtensions; [
      just-perfection
      airpod-battery-monitor
      battery-time-percentage-compact
      space-bar
      dash-to-dock
      search-light
      pip-on-top
    ]);

    gtk = {
      enable = true;

      iconTheme.package = pkgs.adwaita-colors-icon-theme;
      iconTheme.name    = "Adwaita-green";

      gtk3.extraConfig = {
        gtk-application-prefer-dark-theme = 1;
        gtk-theme-name                    = "adw-gtk3-dark";
      };

      gtk4.extraCss = ''
        /* remove 'starred' in nautilus side-panel */
        .nautilus-window .navigation-sidebar > .sidebar-row:nth-child(2) {
          min-height:0;
          font-size: 0;
          -gtk-icon-size: 0;
          margin-top: -2px;
        }
      '';
    };

    # Use `dconf watch /` to track stateful changes you are doing and store them here.
    dconf.settings = with inputs.home-manager.lib.hm.gvariant; let
      numWorkspaces = 7;
      workspaces = lib.lists.reverseList( pkgs.std.list.unfold( n: if n == 0 then pkgs.std.optional.nothing else pkgs.std.optional.just( pkgs.std.tuple.tuple2 n (n - 1))) numWorkspaces);
    in {
      "org/gnome/mutter" = {
        edge-tiling        = true;
        dynamic-workspaces = false;
      };

      "org/gnome/desktop/wm/preferences" = {
        button-layout   = "close:appmenu";
        auto-raise      = false;
        focus-mode      = "sloppy";
        num-workspaces  = lib.lists.last workspaces;
        workspace-names = [ "Main" "Mail" "Term" ];
      };
      "org/gnome/desktop/wm/keybindings" = builtins.listToAttrs( builtins.concatMap( v: [
        { name = "switch-to-workspace-${toString v}"; value = [ "<Super>${toString v}" ]; }
        { name = "move-to-workspace-${toString v}";   value = [ "<Super><Shift>${toString v}" ]; }
      ]) workspaces) // {
        switch-input-source          = [ "<Control><Super>space" ];
        switch-input-source-backward = [ "<Shift><Control><Super>space" ];
      };

      "org/gnome/shell" = {
        disable-extension-version-validation = true;
        disable-user-extensions              = false;
        enabled-extensions = with pkgs.gnomeExtensions; [
          just-perfection.extensionUuid
          airpod-battery-monitor.extensionUuid
          battery-time-percentage-compact.extensionUuid
          space-bar.extensionUuid
          dash-to-dock.extensionUuid
          search-light.extensionUuid
          pip-on-top.extensionUuid
        ];
        favorite-apps = [
          "org.gnome.Nautilus.desktop"
          "firefox.desktop"
          "thunderbird.desktop"
          "org.gnome.Fractal.desktop"
          "app.drey.PaperPlane.desktop"
          "dev.geopjr.Tuba.desktop"
          "de.schmidhuberj.DieBahn.desktop"
          "org.gnome.Calendar.desktop"
          "io.github.mrvladus.List.desktop"
          "org.gnome.Podcasts.desktop"
          "org.gnome.Ptyxis.desktop"
          "org.gnome.Settings.desktop"
        ];
      };
      "org/gnome/shell/keybindings" = builtins.listToAttrs( map( v: { name = "switch-to-application-${toString v}"; value = []; }) workspaces);
      "org/gnome/settings-daemon/plugins/color" = {
        night-light-enabled = true;
      };

      "org/gnome/settings-daemon/plugins/media-keys" = {
        custom-keybindings = [ "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" ];
      };
      "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
        name    = "Start Terminal";
        command = "ptyxis --new-window";
        binding = "<Super>Return";
      };

      "org/gnome/desktop/a11y".always-show-universal-access-status = false;
      "org/gnome/desktop/privacy".remember-recent-files            = false;
      "org/gnome/desktop/interface" = {
        color-scheme = "prefer-dark";
        accent-color = "green";
        enable-hot-corners      = false;
        show-battery-percentage = true;
      };
      "org/gnome/desktop/input-sources" = {
        sources = [
          (mkTuple ["xkb" "us+mac"])
          (mkTuple ["xkb" "de"])
          (mkTuple ["xkb" "ru+mac"])
        ];
      };
      "org/gnome/desktop/background" = {
        picture-uri      = "file://${pkgs.nixos-artwork.wallpapers.simple-blue.gnomeFilePath}";
        picture-uri-dark = "file://${pkgs.nixos-artwork.wallpapers.simple-dark-gray.gnomeFilePath}";
      };
      "org/gnome/desktop/screensaver" = {
        picture-uri     = "file://${pkgs.nixos-artwork.wallpapers.simple-dark-gray.gnomeFilePath}";
        primary-color   = "#3465a4";
        secondary-color = "#000000";
      };

      "org/gnome/nautilus/list-view" = {
        use-tree-view      = true;
        default-zoom-level = "small";
      };
      "org/gnome/nautilus/preferences" = {
        date-time-format      = "detailed";
        default-folder-viewer = "list-view";
      };

      "org/gnome/shell/extensions/pip-on-top".stick = true;
      "org/gnome/shell/extensions/just-perfection" = {
        clock-menu-position        = 1;
        clock-menu-position-offset = 6;
        quick-settings-dark-mode   = false;
      };
      "org/gnome/shell/extensions/space-bar/behavior" = {
        show-empty-workspaces = false;
        always-show-numbers   = true;
      };
      "org/gnome/shell/extensions/dash-to-dock" = {
        multi-monitor         = true;
        apply-custom-theme    = true;
        custom-theme-shrink   = true;
        show-show-apps-button = false;
        show-mounts           = false;
        hot-keys              = false;
      };
      "org/gnome/shell/extensions/search-light".shortcut-search = [ "<Super>space" ];
    };
  };

  ctucxConfig = {
    configure = {
      mobileDevice = false;
      fonts        = true;
    };

    wm.gnome.enable      = true;
    wm.gnome.gdm.dconfSettings = {
      "org/gnome/desktop/a11y" = {
        always-show-universal-access-status = false;
      };
      "org/gnome/login-screen" = {
        banner-message-enable = true;
        banner-message-text   = "katja (fedi/mail: katja@ctu.cx)";
      };
    };

    services = {
      pipewire.enable    = true;
#      easyeffects.enable = true;

      syncthing.enable   = true;
    };

    programs = {
      ddcutil.enable       = true;

      firefox.enable       = true;
      thunderbird.enable   = true;
      fractal.enable       = true;
      tuba.enable          = true;
      paper-plane.enable   = true;

      libreoffice.enable   = true;
      ausweisapp.enable    = true;

      mpv.enable           = true;

      bitwarden-cli.enable = true;
    };
  };

}