me like nix
1{ pkgs, lib, ... }:
2
3let
4 berkeley-mono-typeface = pkgs.callPackage ../../berkely-mono/berkeley.nix { };
5
6 # Steam/gamescope calls steamos-session-select when the user presses
7 # "Switch to Desktop". Without this script, the button does nothing.
8 # Returning 0 lets gamescope proceed to exit, returning to greetd/regreet.
9 steamos-session-select = pkgs.writeShellScriptBin "steamos-session-select" ''
10 echo "Switching session to: $1"
11 '';
12in
13{
14
15 nix.settings.experimental-features = [
16 "nix-command"
17 "flakes"
18 ];
19 nix.settings.download-buffer-size = 268435456;
20
21 hardware.bluetooth.enable = true;
22 hardware.bluetooth.powerOnBoot = true;
23 services.blueman.enable = true;
24
25 # Bootloader.
26 boot.loader.systemd-boot.enable = true;
27 boot.loader.efi.canTouchEfiVariables = true;
28
29 services.fwupd.enable = true;
30 # Use latest kernel.
31 boot.kernelPackages = pkgs.linuxPackages_latest;
32 boot.kernel.sysctl."kernel.task_delayacct" = 1;
33
34 # Fix USB disconnection issues with Dell U4025QW Thunderbolt dock
35 # Disables autosuspend and LPM for Dell hub (vendor ID: 1d5c, product ID: 5801)
36 # boot.kernelParams = [ "usbcore.quirks=1d5c:5801:gk" ];
37 # If USB disconnects persist, try disabling UCSI ACPI instead:
38 # boot.kernelParams = [ "module_blacklist=ucsi_acpi" ];
39
40 # Enable networking
41 networking.networkmanager.enable = true;
42 systemd.services.NetworkManager-wait-online.enable = false;
43
44 # Set your time zone.
45 # time.timeZone = "America/New_York";
46 time.timeZone = "America/Toronto";
47
48 # Select internationalisation properties.
49 i18n.defaultLocale = "en_US.UTF-8";
50
51 i18n.extraLocaleSettings = {
52 LC_ADDRESS = "en_US.UTF-8";
53 LC_IDENTIFICATION = "en_US.UTF-8";
54 LC_MEASUREMENT = "en_US.UTF-8";
55 LC_MONETARY = "en_US.UTF-8";
56 LC_NAME = "en_US.UTF-8";
57 LC_NUMERIC = "en_US.UTF-8";
58 LC_PAPER = "en_US.UTF-8";
59 LC_TELEPHONE = "en_US.UTF-8";
60 LC_TIME = "en_US.UTF-8";
61 };
62
63 # Font configuration
64 fonts = {
65 fontDir.enable = true;
66 fontconfig = {
67 enable = true;
68 defaultFonts = {
69 monospace = [
70 "BerkeleyMono Nerd Font"
71 "BerkeleyMono"
72 ];
73 };
74 };
75 packages = with pkgs; [
76 berkeley-mono-typeface
77 ];
78 };
79
80 programs.niri = {
81 enable = true;
82 };
83
84 catppuccin = {
85 enable = true;
86 flavor = "frappe";
87 };
88
89 programs.regreet = {
90 enable = true;
91 cageArgs = [ "-s" "-d" ];
92 settings.GTK.application_prefer_dark_theme = true;
93 theme = {
94 package = pkgs.catppuccin-gtk.override {
95 variant = "frappe";
96 accents = [ "lavender" ];
97 size = "standard";
98 };
99 name = "catppuccin-frappe-lavender-standard";
100 };
101 iconTheme = {
102 package = pkgs.catppuccin-papirus-folders.override {
103 flavor = "frappe";
104 accent = "lavender";
105 };
106 name = "Papirus-Dark";
107 };
108 cursorTheme = {
109 package = pkgs.catppuccin-cursors.frappeDark;
110 name = "catppuccin-frappe-dark-cursors";
111 };
112 };
113
114 # Scale regreet's greeter for HiDPI displays
115 services.greetd.settings.default_session.command = lib.mkForce
116 "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.cage} -s -d -- env GDK_SCALE=2 ${lib.getExe pkgs.greetd.regreet}";
117
118 # Enable CUPS to print documents.
119 services.printing.enable = true;
120
121 security.polkit.enable = true;
122 security.rtkit.enable = true;
123 services.pipewire = {
124 enable = true;
125 alsa.enable = true;
126 alsa.support32Bit = true;
127 pulse.enable = true;
128 # If you want to use JACK applications, uncomment this
129 #jack.enable = true;
130
131 # use the example session manager (no others are packaged yet so this is enabled by default,
132 # no need to redefine it in your config for now)
133 #media-session.enable = true;
134 };
135
136 services.gnome.gnome-keyring.enable = true;
137 security.pam.services.greetd.enableGnomeKeyring = true;
138
139 services.udisks2.enable = true;
140 services.tailscale.enable = true;
141 services.pcscd.enable = true; # Smart card daemon for Yubikey
142
143 security.pam.u2f = {
144 enable = true;
145 control = "sufficient";
146 cue = true;
147 settings = {
148 origin = "pam://nixos";
149 appid = "pam://nixos";
150 };
151 };
152 security.pam.services.sudo.u2fAuth = true;
153
154 programs.yubikey-touch-detector.enable = true;
155
156 # ZSA Keyboard udev rules for Oryx web flashing and live training
157 services.udev.extraRules = ''
158 # Rules for Oryx web flashing and live training
159 KERNEL=="hidraw*", ATTRS{idVendor}=="16c0", MODE="0664", GROUP="plugdev"
160 KERNEL=="hidraw*", ATTRS{idVendor}=="3297", MODE="0664", GROUP="plugdev"
161
162 # Legacy rules for live training over webusb (Not needed for firmware v21+)
163 # Rule for all ZSA keyboards
164 SUBSYSTEM=="usb", ATTR{idVendor}=="3297", GROUP="plugdev"
165 # Rule for the Moonlander
166 SUBSYSTEM=="usb", ATTR{idVendor}=="3297", ATTR{idProduct}=="1969", GROUP="plugdev"
167 # Rule for the Ergodox EZ
168 SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="1307", GROUP="plugdev"
169 # Rule for the Planck EZ
170 SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="6060", GROUP="plugdev"
171
172 # Wally Flashing rules for the Ergodox EZ
173 ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1"
174 ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
175 SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
176 KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
177
178 # Keymapp / Wally Flashing rules for the Moonlander and Planck EZ
179 SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666", SYMLINK+="stm32_dfu"
180 # Keymapp Flashing rules for the Voyager
181 SUBSYSTEMS=="usb", ATTRS{idVendor}=="3297", MODE:="0666", SYMLINK+="ignition_dfu"
182 # USB serial device access via Chrome/Chromium
183 KERNEL=="ttyUSB[0-9]*", MODE:="0666", GROUP="dialout"
184 KERNEL=="ttyACM[0-9]*", MODE:="0666", GROUP="dialout"
185 '';
186
187 # Define a user account. Don't forget to set a password with ‘passwd’.
188 users.groups.storage = { };
189 users.groups.plugdev = { };
190 users.users.sean = {
191 isNormalUser = true;
192 description = "Sean Aye";
193 extraGroups = [
194 "docker"
195 "networkmanager"
196 "wheel"
197 "video"
198 "disk"
199 "storage"
200 "input"
201 "plugdev"
202 "dialout"
203 ];
204 shell = pkgs.fish;
205 };
206
207 programs.steam = {
208 enable = true;
209 remotePlay.openFirewall = true;
210 gamescopeSession = {
211 enable = true;
212 args = [
213 "-r" "120"
214 "-R" "120"
215 ];
216 env = {
217 STEAM_DESKTOP_SESSION = "niri";
218 };
219 };
220 extraCompatPackages = with pkgs; [
221 proton-ge-bin
222 ];
223 };
224
225 programs.gamemode.enable = true;
226
227 programs.gamescope = {
228 enable = true;
229 capSysNice = false;
230 };
231
232 # Manually add the gamescope capability wrapper without triggering
233 # the steam module's setuid bwrap override (which zeros CapBnd
234 # inside the FHS sandbox, preventing games from launching)
235 security.wrappers.gamescope = {
236 owner = "root";
237 group = "root";
238 source = "${pkgs.gamescope}/bin/gamescope";
239 capabilities = "cap_sys_nice+pie";
240 };
241
242 programs.fish.enable = true;
243 programs._1password.enable = true;
244 programs._1password-gui = {
245 enable = true;
246 polkitPolicyOwners = [ "sean" ];
247 };
248
249 virtualisation.docker.enable = true;
250
251 # Allow unfree packages
252 nixpkgs.config.allowUnfree = true;
253
254 # List packages installed in system profile. To search, run:
255 # $ nix search wget
256 environment.systemPackages = with pkgs; [
257 wl-clipboard
258 steamos-session-select
259 ];
260 environment.variables = {
261 EDITOR = "hx";
262 VISUAL = "hx";
263 SUDO_EDITOR = "hx";
264 };
265}