me like nix
1{ pkgs, ... }:
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
33 # Fix USB disconnection issues with Dell U4025QW Thunderbolt dock
34 # Disables autosuspend and LPM for Dell hub (vendor ID: 1d5c, product ID: 5801)
35 # boot.kernelParams = [ "usbcore.quirks=1d5c:5801:gk" ];
36 # If USB disconnects persist, try disabling UCSI ACPI instead:
37 # boot.kernelParams = [ "module_blacklist=ucsi_acpi" ];
38
39 # Enable networking
40 networking.networkmanager.enable = true;
41
42 # Set your time zone.
43 # time.timeZone = "America/New_York";
44 time.timeZone = "America/Toronto";
45
46 # Select internationalisation properties.
47 i18n.defaultLocale = "en_US.UTF-8";
48
49 i18n.extraLocaleSettings = {
50 LC_ADDRESS = "en_US.UTF-8";
51 LC_IDENTIFICATION = "en_US.UTF-8";
52 LC_MEASUREMENT = "en_US.UTF-8";
53 LC_MONETARY = "en_US.UTF-8";
54 LC_NAME = "en_US.UTF-8";
55 LC_NUMERIC = "en_US.UTF-8";
56 LC_PAPER = "en_US.UTF-8";
57 LC_TELEPHONE = "en_US.UTF-8";
58 LC_TIME = "en_US.UTF-8";
59 };
60
61 # Font configuration
62 fonts = {
63 fontDir.enable = true;
64 fontconfig = {
65 enable = true;
66 defaultFonts = {
67 monospace = [
68 "BerkeleyMono Nerd Font"
69 "BerkeleyMono"
70 ];
71 };
72 };
73 packages = with pkgs; [
74 berkeley-mono-typeface
75 ];
76 };
77
78 programs.niri = {
79 enable = true;
80 };
81
82 catppuccin = {
83 enable = true;
84 flavor = "frappe";
85 };
86
87 programs.regreet.enable = true;
88
89 # Enable CUPS to print documents.
90 services.printing.enable = true;
91
92 security.polkit.enable = true;
93 security.rtkit.enable = true;
94 services.pipewire = {
95 enable = true;
96 alsa.enable = true;
97 alsa.support32Bit = true;
98 pulse.enable = true;
99 # If you want to use JACK applications, uncomment this
100 #jack.enable = true;
101
102 # use the example session manager (no others are packaged yet so this is enabled by default,
103 # no need to redefine it in your config for now)
104 #media-session.enable = true;
105 };
106
107 services.gnome.gnome-keyring.enable = true;
108 security.pam.services.greetd.enableGnomeKeyring = true;
109
110 services.udisks2.enable = true;
111 services.tailscale.enable = true;
112 services.pcscd.enable = true; # Smart card daemon for Yubikey
113
114 security.pam.u2f = {
115 enable = true;
116 control = "sufficient";
117 cue = true;
118 settings = {
119 origin = "pam://nixos";
120 appid = "pam://nixos";
121 };
122 };
123 security.pam.services.sudo.u2fAuth = true;
124
125 programs.yubikey-touch-detector.enable = true;
126
127 # ZSA Keyboard udev rules for Oryx web flashing and live training
128 services.udev.extraRules = ''
129 # Rules for Oryx web flashing and live training
130 KERNEL=="hidraw*", ATTRS{idVendor}=="16c0", MODE="0664", GROUP="plugdev"
131 KERNEL=="hidraw*", ATTRS{idVendor}=="3297", MODE="0664", GROUP="plugdev"
132
133 # Legacy rules for live training over webusb (Not needed for firmware v21+)
134 # Rule for all ZSA keyboards
135 SUBSYSTEM=="usb", ATTR{idVendor}=="3297", GROUP="plugdev"
136 # Rule for the Moonlander
137 SUBSYSTEM=="usb", ATTR{idVendor}=="3297", ATTR{idProduct}=="1969", GROUP="plugdev"
138 # Rule for the Ergodox EZ
139 SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="1307", GROUP="plugdev"
140 # Rule for the Planck EZ
141 SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="6060", GROUP="plugdev"
142
143 # Wally Flashing rules for the Ergodox EZ
144 ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1"
145 ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
146 SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
147 KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
148
149 # Keymapp / Wally Flashing rules for the Moonlander and Planck EZ
150 SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666", SYMLINK+="stm32_dfu"
151 # Keymapp Flashing rules for the Voyager
152 SUBSYSTEMS=="usb", ATTRS{idVendor}=="3297", MODE:="0666", SYMLINK+="ignition_dfu"
153 # USB serial device access via Chrome/Chromium
154 KERNEL=="ttyUSB[0-9]*", MODE:="0666", GROUP="dialout"
155 KERNEL=="ttyACM[0-9]*", MODE:="0666", GROUP="dialout"
156 '';
157
158 # Define a user account. Don't forget to set a password with ‘passwd’.
159 users.groups.storage = { };
160 users.groups.plugdev = { };
161 users.users.sean = {
162 isNormalUser = true;
163 description = "Sean Aye";
164 extraGroups = [
165 "docker"
166 "networkmanager"
167 "wheel"
168 "video"
169 "disk"
170 "storage"
171 "input"
172 "plugdev"
173 "dialout"
174 ];
175 shell = pkgs.fish;
176 };
177
178 programs.steam = {
179 enable = true;
180 remotePlay.openFirewall = true;
181 gamescopeSession = {
182 enable = true;
183 args = [
184 "-r 120"
185 "-R 120"
186 ];
187 env = {
188 STEAM_DESKTOP_SESSION = "niri";
189 };
190 };
191 extraCompatPackages = with pkgs; [
192 proton-ge-bin
193 ];
194 };
195
196 programs.gamemode.enable = true;
197
198 programs.gamescope = {
199 enable = true;
200 capSysNice = true;
201 };
202
203 programs.fish.enable = true;
204 programs._1password.enable = true;
205 programs._1password-gui = {
206 enable = true;
207 polkitPolicyOwners = [ "sean" ];
208 };
209
210 virtualisation.docker.enable = true;
211
212 # Allow unfree packages
213 nixpkgs.config.allowUnfree = true;
214
215 # List packages installed in system profile. To search, run:
216 # $ nix search wget
217 environment.systemPackages = with pkgs; [
218 wl-clipboard
219 steamos-session-select
220 ];
221 environment.variables = {
222 EDITOR = "hx";
223 VISUAL = "hx";
224 SUDO_EDITOR = "hx";
225 };
226}