summaryrefslogtreecommitdiff
path: root/common/desktop.nix
blob: 89bd86d055391175aa5e54cf024429308ff4e9dd (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
{ config, lib, pkgs, ... }:

{
  imports = [
    ./common.nix
  ];

  # nix.extraOptions = ''
  #   plugin-files = ${pkgs.nix-doc}/lib/libnix_doc_plugin.so
  # '';

  # Enable CUPS to print documents.
  services.printing = {
    enable = true;
    drivers = [ pkgs.epson-escpr2 pkgs.epson-escpr ];
  };

  programs.fish.enable = true;
  programs.ssh.startAgent = true;
  programs.ssh.enableAskPassword = true;
  systemd.user.services.ssh-agent.environment.DISPLAY = lib.mkForce ":0";
  systemd.user.services.ssh-agent.environment.SSH_ASKPASS = lib.mkForce "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass";

  users.mutableUsers = false;
  users.defaultUserShell = pkgs.fish;
  users.users.stuebinm = {
    isNormalUser = true;
    extraGroups = [ "docker" "wheel" "networking" "video" "wireshark" ];
    home = "/home/stuebinm";
    hashedPassword = "$6$IULsCnY7HjDHAJWs$05DYuwXsfWWKj6m3KTWCPp5k9HuQikIamNBzn2GihMG8oeEf5c8YkXlwuO6uTnX8ZFmyAQdhXfO5yYNEM/YTm0";
    useDefaultShell = true;
  };

  nix.settings.trusted-users = [ "root" "@wheel" ];

  services.syncthing = {
    enable = true;
    user = "stuebinm";
    guiAddress = "syncthing.localhost:3000";
    dataDir = "/home/stuebinm/syncthing";
    configDir = "/home/stuebinm/syncthing/.config/syncthing";
  };

  networking.hosts = {
    "127.0.0.1" = [ "syncthing.localhost" ];
  };

  # graphics and stuff
  programs.light.enable = true;
  programs.slock.enable = true;

  environment.systemPackages = with pkgs; [
    hikari fuzzel
  ];

  security.pam.services.hikari-unlocker.text = ''
    auth include login
  '';

  services.davfs2.enable = true;

  services.greetd = {
    enable = true;
    settings = {
      default_session = {
        command = "${pkgs.greetd.tuigreet}/bin/tuigreet -tr --asterisks --cmd 'hikari -c ~/hikari.conf'";
        user = "stuebinm";
      };
      terminal.vt = 2;
    };
  };

  systemd.services.greetd.unitConfig.Conflicts = lib.mkForce ["getty@tty2.service"];
  systemd.services.greetd.serviceConfig.Type = lib.mkForce "idle";
  systemd.services.greetd.unitConfig.after = lib.mkForce [ "multi-user.target" ];

  #boot.kernelParams = [ "console=tty1" ];

  hardware.opengl.enable = true;
  programs.xwayland.enable = false;
  programs.wireshark.enable = true;
  xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-wlr ];
  xdg.portal.enable = true;
  xdg.portal.config.common.default = "*";
  services.flatpak.enable = true;

  fonts.enableDefaultPackages = true;
  fonts.packages = with pkgs; [
    noto-fonts
    noto-fonts-cjk
    noto-fonts-cjk-serif
    noto-fonts-emoji
  ];

  # Enable sound.
  sound.enable = true;
  hardware.pulseaudio.enable = true;
}