Working on modularizing nix configs
This commit is contained in:
parent
77deb9e0d7
commit
5d531dc695
4 changed files with 66 additions and 81 deletions
|
|
@ -23,4 +23,36 @@
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
# Enable nix-command and flakes
|
# Enable nix-command and flakes
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes"];
|
nix.settings.experimental-features = [ "nix-command" "flakes"];
|
||||||
|
# using piprewire cuz embrace muh modernity
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
# Basic configuration stuff - WiFi, Xserver keyboard layout, Stylix
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
time.timeZone = "America/St_Thomas";
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
services.xserver.xkb = {
|
||||||
|
layout = "us";
|
||||||
|
variant = "";
|
||||||
|
};
|
||||||
|
stylix = {
|
||||||
|
enable = true;
|
||||||
|
image = ./bg.jpg;
|
||||||
|
};
|
||||||
|
# Zsh
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
# Browser
|
||||||
|
programs.firefox.enable = true;
|
||||||
|
# Tailscale
|
||||||
|
services.tailscale.enable = true;
|
||||||
|
# Syncthing
|
||||||
|
services.syncthing.enable = true;
|
||||||
|
# GPG
|
||||||
|
programs.gnupg.agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSSHSupport = true;
|
||||||
|
};
|
||||||
|
# OpenSSH
|
||||||
|
services.openssh.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,23 +6,6 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enable automatic system updates
|
|
||||||
system.autoUpgrade = {
|
|
||||||
enable = true;
|
|
||||||
flake = inputs.self.outPath;
|
|
||||||
flags = [
|
|
||||||
"--update-input"
|
|
||||||
"nixpkgs"
|
|
||||||
"-L" # print build logs
|
|
||||||
];
|
|
||||||
dates = "weekly";
|
|
||||||
randomizedDelaySec = "45min";
|
|
||||||
};
|
|
||||||
# Allow non-free software (RMS will be mad at me :<)
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
# Enable nix-command and flakes
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes"];
|
|
||||||
|
|
||||||
# SystemD-boot is good enough
|
# SystemD-boot is good enough
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
|
||||||
|
|
@ -4,66 +4,22 @@
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
../../modules/kanata.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
systemd.tpm2.enable = false;
|
systemd.tpm2.enable = false;
|
||||||
networking.hostName = "syntheticnexus";
|
networking.hostName = "syntheticnexus";
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
time.timeZone = "America/St_Thomas";
|
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
|
||||||
services.xserver.xkb = {
|
|
||||||
layout = "us";
|
|
||||||
variant = "";
|
|
||||||
};
|
|
||||||
stylix = {
|
|
||||||
enable = true;
|
|
||||||
image = ./bg.jpg;
|
|
||||||
};
|
|
||||||
services.displayManager.gdm.enable = true;
|
services.displayManager.gdm.enable = true;
|
||||||
services.desktopManager.gnome.enable = true;
|
services.desktopManager.gnome.enable = true;
|
||||||
services.gnome.core-apps.enable = false;
|
services.gnome.core-apps.enable = false;
|
||||||
services.gnome.core-developer-tools.enable = false;
|
services.gnome.core-developer-tools.enable = false;
|
||||||
services.gnome.games.enable = false;
|
services.gnome.games.enable = false;
|
||||||
environment.gnome.excludePackages = with pkgs; [ gnome-tour gnome-user-docs ];
|
environment.gnome.excludePackages = with pkgs; [ gnome-tour gnome-user-docs ];
|
||||||
# using piprewire cuz embrace muh modernity
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
services.libinput.enable = true; # for laptop touchpad
|
services.libinput.enable = true; # for laptop touchpad
|
||||||
# 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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.lunita = {
|
users.users.lunita = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
|
|
@ -86,21 +42,5 @@
|
||||||
nyxt
|
nyxt
|
||||||
];
|
];
|
||||||
|
|
||||||
# Zsh
|
|
||||||
programs.zsh.enable = true;
|
|
||||||
# Browser
|
|
||||||
programs.firefox.enable = true;
|
|
||||||
# Tailscale
|
|
||||||
services.tailscale.enable = true;
|
|
||||||
# Syncthing
|
|
||||||
services.syncthing.enable = true;
|
|
||||||
|
|
||||||
programs.gnupg.agent = {
|
|
||||||
enable = true;
|
|
||||||
enableSSHSupport = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.openssh.enable = true;
|
|
||||||
|
|
||||||
system.stateVersion = "25.05";
|
system.stateVersion = "25.05";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
30
.config/nix/modules/kanata.nix
Normal file
30
.config/nix/modules/kanata.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
{ config, libs, pkgs. inputs, ... }
|
||||||
|
{
|
||||||
|
# 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.readFile ../../kanata/conf.kbd;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue