summaryrefslogtreecommitdiff
path: root/machines/enzo/desktop.nix
blob: 294fe414596d1a650f224da27eb603e2eaf5f813 (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
# enzo-only desktop extras. The shared niri/dark/audio/firefox base comes from
# ../../profiles/desktop.nix (imported in ./default.nix); this file holds just
# what's specific to the laptop.
{ pkgs, ... }:

{
  # --- Fonts: enzo's monospace (base font packages come from the shared profile) ---
  fonts.fontconfig.defaultFonts.monospace = [ "Adwaita Mono" ];

  # --- Cursor ---
  environment.sessionVariables = {
    XCURSOR_THEME = "Adwaita";
    XCURSOR_SIZE = "24";

    # TODO: move to dotfiles
    LESSHISTFILE = "$HOME/.local/state/lesshst";
    HISTFILE = "$HOME/.local/state/bash_history";
  };

  nix.settings.use-xdg-base-directories = true;

  environment.systemPackages = with pkgs; [
    adwaita-icon-theme
    yambar # text status bar
    xdg-user-dirs
  ];

  # --- XDG user directories (~/Downloads, ~/Pictures, …) ---
  # Bare niri runs no desktop environment, so nothing generates
  # ~/.config/user-dirs.dirs on its own — Firefox downloads land in $HOME, the
  # GTK file chooser and Nautilus have a bare sidebar, and screenshot tools have
  # no Pictures default. This trims the default set (Templates/Publicshare
  # dropped — unused under niri) and runs the generator at login.
  environment.etc."xdg/user-dirs.defaults".text = ''
    DESKTOP=Desktop
    DOWNLOAD=Downloads
    DOCUMENTS=Documents
    MUSIC=Music
    PICTURES=Pictures
    VIDEOS=Videos
  '';
  # A oneshot bound to graphical-session.target (the target niri-session brings
  # up — same hook swayidle uses). Before= makes the session wait for the dirs to
  # exist before apps start. GTK/GLib reads user-dirs.dirs directly, so no env
  # export is needed for the file to take effect.
  systemd.user.services.xdg-user-dirs-update = {
    description = "Create/update XDG user directories (~/Downloads, ~/Pictures, …)";
    wantedBy = [ "graphical-session.target" ];
    partOf = [ "graphical-session.target" ];
    before = [ "graphical-session.target" ];
    serviceConfig = {
      Type = "oneshot";
      ExecStart = "${pkgs.xdg-user-dirs}/bin/xdg-user-dirs-update";
    };
  };

  # --- Bar + wallpaper (was spawn-at-startup in the shared niri config.kdl) ---
  # The bar and wallpaper differ per host, so they live in nixos-config rather
  # than the stowed niri config. Long-running user services bound to
  # graphical-session.target (the target niri-session activates), same hook as
  # xdg-user-dirs-update above.
  systemd.user.services.yambar = {
    description = "yambar status bar";
    wantedBy = [ "graphical-session.target" ];
    partOf = [ "graphical-session.target" ];
    after = [ "graphical-session.target" ];
    serviceConfig = {
      ExecStart = "${pkgs.yambar}/bin/yambar";
      Restart = "on-failure";
    };
  };

  systemd.user.services.swaybg = {
    description = "swaybg wallpaper";
    wantedBy = [ "graphical-session.target" ];
    partOf = [ "graphical-session.target" ];
    after = [ "graphical-session.target" ];
    serviceConfig = {
      # Solid color (the old shared config's --image path pointed at
      # /home/henz, kusanagi's user, so enzo never had a valid image). Swap in
      # an enzo-local image path here if desired.
      ExecStart = "${pkgs.swaybg}/bin/swaybg --color '#24273a'";
      Restart = "on-failure";
    };
  };

  # --- User: desktop groups (niri essentials) ---
  users.users.hwebs.extraGroups = [
    "audio"
    "input"
  ];

  # --- Console / greeter font (HiDPI panel) ---
  # The eDP panel is high-density, so the kernel VT and tuigreet render with a
  # tiny 8x16 font. A large Terminus bitmap font makes the TTY and the greeter
  # legible; earlySetup applies it from initrd so it's big from the first frame.
  # Sizes: ter-v{16,18,20,22,24,28,32}n — bump/drop to taste.
  console = {
    earlySetup = true;
    packages = [ pkgs.terminus_font ];
    font = "ter-v32n";
  };
}