Enable openrazer

This commit is contained in:
Natsu Kagami 2021-11-27 21:02:00 -05:00
parent 5487a65026
commit 54449a4506
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51

View file

@ -6,7 +6,8 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
# secret management # secret management
./secrets ./secrets
@ -16,24 +17,24 @@
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot = { boot = {
plymouth.enable = true; plymouth.enable = true;
loader.timeout = 60; loader.timeout = 60;
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true; loader.efi.canTouchEfiVariables = true;
supportedFilesystems = [ "ntfs" ]; supportedFilesystems = [ "ntfs" ];
}; };
## Encryption ## Encryption
# Kernel modules needed for mounting USB VFAT devices in initrd stage # Kernel modules needed for mounting USB VFAT devices in initrd stage
boot.initrd.kernelModules = [ "usb_storage" ]; boot.initrd.kernelModules = [ "usb_storage" ];
boot.initrd.luks.devices = { boot.initrd.luks.devices = {
root = { root = {
keyFile = "/dev/disk/by-id/usb-090c___B1608112001295-0:0"; keyFile = "/dev/disk/by-id/usb-090c___B1608112001295-0:0";
keyFileSize = 4096; keyFileSize = 4096;
fallbackToPassword = true; fallbackToPassword = true;
device = "/dev/disk/by-uuid/7c6e40a8-900b-4f85-9712-2b872caf1892"; device = "/dev/disk/by-uuid/7c6e40a8-900b-4f85-9712-2b872caf1892";
preLVM = true; preLVM = true;
allowDiscards = true; allowDiscards = true;
}; };
}; };
networking.hostName = "kagamiPC"; # Define your hostname. networking.hostName = "kagamiPC"; # Define your hostname.
@ -62,7 +63,7 @@
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "ja_JP.UTF-8"; i18n.defaultLocale = "ja_JP.UTF-8";
i18n.inputMethod.enabled = "ibus"; i18n.inputMethod.enabled = "ibus";
i18n.inputMethod.ibus.engines = (with pkgs.ibus-engines; [bamboo mozc libpinyin]); i18n.inputMethod.ibus.engines = (with pkgs.ibus-engines; [ bamboo mozc libpinyin ]);
# console = { # console = {
# font = "Lat2-Terminus16"; # font = "Lat2-Terminus16";
# keyMap = "us"; # keyMap = "us";
@ -70,7 +71,7 @@
# Enable the X11 windowing system. # Enable the X11 windowing system.
services.xserver.enable = true; services.xserver.enable = true;
# Configure keymap in X11 # Configure keymap in X11
services.xserver.layout = "jp"; services.xserver.layout = "jp";
# services.xserver.xkbOptions = ""; # services.xserver.xkbOptions = "";
@ -88,11 +89,18 @@
# Enable touchpad support (enabled default in most desktopManager). # Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true; # services.xserver.libinput.enable = true;
# Enable razer daemon
hardware.openrazer.enable = true;
hardware.openrazer.keyStatistics = true;
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.nki = { users.users.nki = {
isNormalUser = true; isNormalUser = true;
uid = 1000; uid = 1000;
extraGroups = [ "wheel" ]; # Enable sudo for the user. extraGroups = [
"wheel" # Enable sudo for the user.
"plugdev" # Enable openrazer-daemon privileges
];
}; };
# Allow all packages # Allow all packages
@ -122,25 +130,25 @@
nix.binaryCachePublicKeys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ]; nix.binaryCachePublicKeys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
nix.binaryCaches = [ "https://hydra.iohk.io" ]; nix.binaryCaches = [ "https://hydra.iohk.io" ];
# Terminal # Terminal
programs.gnome-terminal.enable = true; programs.gnome-terminal.enable = true;
# Environment variables # Environment variables
environment.variables = { environment.variables = {
# Input method overrides # Input method overrides
GTK_IM_MODULE = "ibus"; GTK_IM_MODULE = "ibus";
QT_IM_MODULE = "ibus"; QT_IM_MODULE = "ibus";
"XMODIFIERS=@im" = "ibus"; "XMODIFIERS=@im" = "ibus";
# Basic editor setup # Basic editor setup
EDITOR = "kak"; EDITOR = "kak";
VISUAL = "kak"; VISUAL = "kak";
}; };
# Enable Desktop Environment. # Enable Desktop Environment.
services.xserver.displayManager = { services.xserver.displayManager = {
lightdm.enable = true; lightdm.enable = true;
}; };
services.xserver.desktopManager.cinnamon.enable = true; services.xserver.desktopManager.cinnamon.enable = true;
@ -176,41 +184,41 @@
sops.secrets."windscribe/privateKey" = { mode = "0755"; }; sops.secrets."windscribe/privateKey" = { mode = "0755"; };
sops.secrets."windscribe/presharedKey" = { mode = "0755"; }; sops.secrets."windscribe/presharedKey" = { mode = "0755"; };
networking.wg-quick.interfaces = { networking.wg-quick.interfaces = {
windscribe = { windscribe = {
privateKeyFile = config.sops.secrets."windscribe/privateKey".path; privateKeyFile = config.sops.secrets."windscribe/privateKey".path;
address = [ "100.70.42.56/32" ]; address = [ "100.70.42.56/32" ];
dns = [ "10.255.255.2" ]; dns = [ "10.255.255.2" ];
peers = [ peers = [
{ {
allowedIPs = [ "0.0.0.0/0" ]; allowedIPs = [ "0.0.0.0/0" ];
endpoint = "yyz-197-wg.whiskergalaxy.com:443"; endpoint = "yyz-197-wg.whiskergalaxy.com:443";
presharedKeyFile = config.sops.secrets."windscribe/presharedKey".path; presharedKeyFile = config.sops.secrets."windscribe/presharedKey".path;
publicKey = "U5s7Yy/2fCqlaFcI96dFKupqEVCn+BYF04LRLD1zOhg="; publicKey = "U5s7Yy/2fCqlaFcI96dFKupqEVCn+BYF04LRLD1zOhg=";
} }
]; ];
}; };
}; };
# Mounting disks! # Mounting disks!
fileSystems = fileSystems =
let let
ntfsMount = path: { ntfsMount = path: {
device = path; device = path;
fsType = "ntfs"; fsType = "ntfs";
options = [ "rw" "uid=${toString config.users.users.nki.uid}" ]; options = [ "rw" "uid=${toString config.users.users.nki.uid}" ];
};
in
{
"/mnt/Data" = ntfsMount "/dev/disk/by-uuid/A90680F8BBE62FE3";
"/mnt/Windows" = ntfsMount "/dev/disk/by-uuid/C2F6FBACF6FB9F3B";
"/mnt/Stuff" = ntfsMount "/dev/disk/by-uuid/717BF2EE20BB8A62";
"/mnt/Shared" = ntfsMount "/dev/disk/by-uuid/76AC086BAC0827E7";
}; };
in
{
"/mnt/Data" = ntfsMount "/dev/disk/by-uuid/A90680F8BBE62FE3";
"/mnt/Windows" = ntfsMount "/dev/disk/by-uuid/C2F6FBACF6FB9F3B";
"/mnt/Stuff" = ntfsMount "/dev/disk/by-uuid/717BF2EE20BB8A62";
"/mnt/Shared" = ntfsMount "/dev/disk/by-uuid/76AC086BAC0827E7";
};
# PAM # PAM
security.pam.services.lightdm.enableKwallet = true; security.pam.services.lightdm.enableKwallet = true;
security.pam.services.lightdm.enableGnomeKeyring = true; security.pam.services.lightdm.enableGnomeKeyring = true;
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions
@ -222,8 +230,8 @@
system.autoUpgrade.channel = "https://nixos.org/channels/nixos-21.05/"; system.autoUpgrade.channel = "https://nixos.org/channels/nixos-21.05/";
# tinc network # tinc network
sops.secrets."tinc/ed25519-private-key" = {}; sops.secrets."tinc/ed25519-private-key" = { };
sops.secrets."tinc/rsa-private-key" = {}; sops.secrets."tinc/rsa-private-key" = { };
services.my-tinc = { services.my-tinc = {
enable = true; enable = true;
hostName = "home"; hostName = "home";
@ -234,7 +242,7 @@
# extra host for my personal server # extra host for my personal server
sops.secrets.hosts = { sops.secrets.hosts = {
mode = "0755"; mode = "0755";
}; };
services.dnsmasq.enable = true; services.dnsmasq.enable = true;
services.dnsmasq.extraConfig = '' services.dnsmasq.extraConfig = ''