btw i use nix
1{
2 pkgs,
3 config,
4 lib,
5 i3-workspace-history,
6 ...
7}:
8
9let
10 cfg = config.custom.gui;
11in
12{
13 options.custom.gui.enable = lib.mkOption {
14 type = lib.types.bool;
15 default = cfg.i3 || cfg.sway || cfg.kde;
16 };
17
18 config = lib.mkIf cfg.enable {
19 home-manager.users.${config.custom.username} =
20 { config, ... }:
21 {
22 config.custom.gui.enable = true;
23 };
24
25 networking.networkmanager.enable = true;
26
27 i18n = {
28 defaultLocale = "en_GB.UTF-8";
29 inputMethod = {
30 enable = true;
31 type = "fcitx5";
32 fcitx5.addons = with pkgs; [
33 fcitx5-rime
34 fcitx5-chinese-addons
35 fcitx5-m17n
36 ];
37 };
38 };
39 console = {
40 font = "Lat2-Terminus16";
41 keyMap = "uk";
42 };
43
44 # Needed for Keychron K2
45 boot.extraModprobeConfig = ''
46 options hid_apple fnmode=2
47 options i915 enable_psr=0
48 '';
49 boot.kernelModules = [ "hid-apple" ];
50
51 services.xserver = {
52 excludePackages = with pkgs; [ xterm ];
53 displayManager.startx.enable = true;
54 xkb.layout = "gb";
55 };
56
57 security.rtkit.enable = true;
58 services.pipewire = {
59 enable = true;
60 alsa.enable = true;
61 alsa.support32Bit = true;
62 pulse.enable = true;
63 };
64
65 hardware.bluetooth.enable = true;
66 services.blueman.enable = true;
67
68 environment.systemPackages =
69 with pkgs;
70 let
71 desktopEntries = [
72 (pkgs.makeDesktopItem {
73 name = "feh.desktop";
74 desktopName = "feh";
75 exec = "feh --scale-down --auto-zoom";
76 icon = "feh";
77 })
78 ];
79 in
80 [
81 jq
82 playerctl
83 brightnessctl
84 xdg-utils
85 yad
86 networkmanagerapplet
87 pavucontrol
88 (xfce.thunar.override {
89 thunarPlugins = with xfce; [
90 thunar-archive-plugin
91 xfconf
92 ];
93 })
94 # https://discourse.nixos.org/t/sway-wm-configuration-polkit-login-manager/3857/6
95 polkit_gnome
96 glib
97 feh
98 libnotify
99 # https://nixos.wiki/wiki/PipeWire#pactl_not_found
100 pulseaudio
101 tridactyl-native
102 vlc
103 ]
104 ++ desktopEntries;
105
106 fonts.packages = with pkgs; [
107 noto-fonts
108 noto-fonts-emoji
109 (nerdfonts.override { fonts = [ "DroidSansMono" "NerdFontsSymbolsOnly" ]; })
110 wqy_zenhei
111 libertine
112 ];
113
114 # thunar
115 services.gvfs.enable = true;
116 services.udisks2.enable = true;
117 # thunar thumbnail support for images
118 services.tumbler.enable = true;
119
120 # sets $WORLDLIST for `dict`
121 environment.wordlist.enable = true;
122 };
123}