Restructured NixOS system configurations to be more modularized
This commit is contained in:
parent
4326a51ef7
commit
4cf7c21ed8
6 changed files with 94 additions and 176 deletions
|
|
@ -1,6 +1,14 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
# Set default user lunita
|
||||
users.users.lunita = {
|
||||
isNormalUser = true;
|
||||
description = "Lunita";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
packages = with pkgs; [];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
# Enable automatic system updates
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
|
|
@ -30,16 +38,12 @@
|
|||
};
|
||||
# Basic configuration stuff - WiFi, Xserver keyboard layout, Stylix
|
||||
networking.networkmanager.enable = true;
|
||||
time.timeZone = "America/St_Thomas";
|
||||
time.timeZone = "America/St_Thomas"; # Timezone => AST
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
services.xserver.xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
};
|
||||
stylix = {
|
||||
enable = true;
|
||||
image = ./bg.jpg;
|
||||
};
|
||||
# Zsh
|
||||
programs.zsh.enable = true;
|
||||
# Browser
|
||||
|
|
|
|||
|
|
@ -1,155 +1,21 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
{ config, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./hardware-configuration.nix
|
||||
../../modules/kanata.nix
|
||||
../../modules/efi.nix
|
||||
../../modules/laptop.nix
|
||||
../../modules/hypr.nix
|
||||
];
|
||||
|
||||
# SystemD-boot is good enough
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
systemd.tpm2.enable = false;
|
||||
networking.hostName = "mecca";
|
||||
|
||||
networking.hostName = "mecca"; # Change for given system
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Timezone => AST
|
||||
time.timeZone = "America/St_Thomas";
|
||||
|
||||
stylix = {
|
||||
enable = true;
|
||||
image = ./bg.jpg;
|
||||
};
|
||||
|
||||
# Hyprland looks nice so I'm using it
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
xdg.portal.enable = true;
|
||||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
|
||||
# using piprewire cuz embrace muh modernity
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
services.libinput.enable = true; # for laptop touchpad
|
||||
|
||||
# Laptop battery optimizations
|
||||
# NOTE: Comment out if on PC/Not required for your rig
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
|
||||
CPU_MIN_PERF_ON_AC = 0;
|
||||
CPU_MAX_PERF_ON_AC = 100;
|
||||
CPU_MIN_PERF_ON_BAT = 0;
|
||||
CPU_MAX_PERF_ON_BAT = 20;
|
||||
|
||||
START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
|
||||
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
|
||||
};
|
||||
};
|
||||
services.auto-cpufreq.enable = true;
|
||||
services.auto-cpufreq.settings = {
|
||||
battery = {
|
||||
governor = "powersave";
|
||||
turbo = "never";
|
||||
};
|
||||
charger = {
|
||||
governor = "performance";
|
||||
turbo = "auto";
|
||||
};
|
||||
};
|
||||
powerManagement.powertop.enable = true;
|
||||
|
||||
# Kanata setup
|
||||
# Mostly copied from https://dev.to/shanu-kumawat/how-to-set-up-kanata-on-nixos-a-step-by-step-guide-1jkc
|
||||
boot.kernelModules = [ "uinput" ]; # Enable uinput kernel module
|
||||
hardware.uinput.enable = true; # Enable uinput
|
||||
# Set up udev rules for uinput
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
|
||||
'';
|
||||
users.groups.uinput = { }; # ensure uinput group exists
|
||||
# Add Kanata service user to necessary groups
|
||||
systemd.services.kanata-internalKeyboard.serviceConfig = {
|
||||
SupplementaryGroups = [
|
||||
"input"
|
||||
"uinput"
|
||||
];
|
||||
};
|
||||
# Kanata configuration
|
||||
services.kanata = {
|
||||
enable = true;
|
||||
keyboards = {
|
||||
internalKeyboard = {
|
||||
devices = [
|
||||
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
|
||||
];
|
||||
configFile = builtins.fetchurl {
|
||||
url = https://git.luluslly.xyz/lulusilly/dotfiles/raw/branch/master/.config/kanata/conf.kbd;
|
||||
sha256 = "1jv6051igv4yxwr9bxzil6qrynvg3imlnh65lxhjdfcvpnmlcy6p";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Default user account
|
||||
users.users.lunita = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
# Enabling Emacs server
|
||||
services.emacs = {
|
||||
enable = true;
|
||||
package = pkgs.emacs-gtk;
|
||||
};
|
||||
# Enable zsh
|
||||
programs.zsh.enable = true;
|
||||
# Going with FF for now. Might switch over to Zen eventually
|
||||
programs.firefox.enable = true;
|
||||
# Enable Tailscale for homeserver stuff
|
||||
services.tailscale.enable = true;
|
||||
# Enable syncthing for Obsidian & KeePass DB sync across devices
|
||||
services.syncthing.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# home-manager # For using Nix Home Manager
|
||||
zsh # Default user shell
|
||||
minecraftia # font
|
||||
jetbrains-mono # font
|
||||
terminus_font # font
|
||||
neovim # Terminal text editor
|
||||
wget # coreutil for some script compatibility
|
||||
waybar # Status bar
|
||||
libnotify # Desktop notifications
|
||||
swww # Wallpaper manager
|
||||
brightnessctl # For laptop backlight brightness control
|
||||
grim # screenshot utility
|
||||
slurp # select utility
|
||||
wl-clipboard # xclip alternative
|
||||
rofi-wayland # Dmenu replacement for Wayland
|
||||
ghostty # Terminal emulator
|
||||
];
|
||||
|
||||
# Enable OpenSSH SSH Daemon
|
||||
services.openssh.enable = true;
|
||||
|
||||
# Copy sysconf in case this file is deleted or corrupted
|
||||
# NOTE: Doesn't work with flakes enabled.
|
||||
# system.copySystemConfiguration = true;
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,42 +5,17 @@
|
|||
[
|
||||
./hardware-configuration.nix
|
||||
../../modules/kanata.nix
|
||||
../../modules/laptop.nix
|
||||
../../modules/efi.nix
|
||||
../../modules/hypr.nix
|
||||
];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
systemd.tpm2.enable = false;
|
||||
networking.hostName = "syntheticnexus";
|
||||
|
||||
services.displayManager.gdm.enable = true;
|
||||
services.desktopManager.gnome.enable = true;
|
||||
services.gnome.core-apps.enable = false;
|
||||
services.gnome.core-developer-tools.enable = false;
|
||||
services.gnome.games.enable = false;
|
||||
environment.gnome.excludePackages = with pkgs; [ gnome-tour gnome-user-docs ];
|
||||
|
||||
services.libinput.enable = true; # for laptop touchpad
|
||||
|
||||
users.users.lunita = {
|
||||
isNormalUser = true;
|
||||
description = "Lunita";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
packages = with pkgs; [];
|
||||
shell = pkgs.zsh;
|
||||
stylix = {
|
||||
enable = true;
|
||||
image = ./bg.jpg;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
wget
|
||||
neovim
|
||||
git
|
||||
home-manager
|
||||
gnome-console
|
||||
gnomeExtensions.blur-my-shell
|
||||
gnomeExtensions.just-perfection
|
||||
gnomeExtensions.paperwm
|
||||
nyxt
|
||||
];
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue