More nonsense not worth describing
This commit is contained in:
parent
6e81c396c4
commit
68d7df796e
12 changed files with 4 additions and 29 deletions
BIN
.config/nix/hosts/mecca/bg.jpg
Normal file
BIN
.config/nix/hosts/mecca/bg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
173
.config/nix/hosts/mecca/configuration.nix
Normal file
173
.config/nix/hosts/mecca/configuration.nix
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./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
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
systemd.tpm2.enable = false;
|
||||
|
||||
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
|
||||
htop # Resource manager
|
||||
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";
|
||||
}
|
||||
41
.config/nix/hosts/mecca/hardware-configuration.nix
Normal file
41
.config/nix/hosts/mecca/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/9c7f9128-0371-4b7b-b0fb-86aeabe0491a";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/BE22-C08F";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/8380ab37-d79c-4b25-888b-d457596dcfae"; }
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
128
.config/nix/hosts/mecca/home.nix
Normal file
128
.config/nix/hosts/mecca/home.nix
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.username = "lunita";
|
||||
home.homeDirectory = "/home/lunita";
|
||||
|
||||
home.stateVersion = "25.05";
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
shellAliases = {
|
||||
c = "clear";
|
||||
nf = "neofetch";
|
||||
hmc = "nvim ~/.config/home-manager/home.nix";
|
||||
hmb = "home-manager build switch";
|
||||
fkc = "sudo nvim ~/.config/nixos/flake.nix";
|
||||
nxr = "sudo nixos-rebuild switch --flake ~/.config/nixos#${config.home.sessionVariables.HOSTNAME}";
|
||||
v = "nvim";
|
||||
d = "cd ~/Documents";
|
||||
D = "cd ~/Downloads";
|
||||
};
|
||||
|
||||
initContent = ''
|
||||
# '~' => goto base of user home directory
|
||||
alias ~='cd ~'
|
||||
# Vim keybinds
|
||||
bindkey -v
|
||||
# Preferred editor for local and remote sessions
|
||||
if [[ -n $SSH_CONNECTION ]]; then
|
||||
export EDITOR='vim'
|
||||
else
|
||||
export EDITOR='nvim'
|
||||
fi
|
||||
# Set TERM for Ghostty ssh workaround
|
||||
if [[ "$TERM_PROGRAM" == "ghostty" ]]; then
|
||||
export TERM=xterm-256color
|
||||
fi
|
||||
'';
|
||||
|
||||
history.size = 10000;
|
||||
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [ "git" ];
|
||||
theme = "lambda";
|
||||
};
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "lulusilly";
|
||||
userEmail = "lunita@puppygirl.onl";
|
||||
aliases = {
|
||||
ci = "commit";
|
||||
co = "checkout";
|
||||
s = "status";
|
||||
};
|
||||
};
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
package = pkgs.waybar;
|
||||
|
||||
# Define the Waybar style.css content here
|
||||
style = ''
|
||||
* {
|
||||
font-family: "JetBrainsMono Nerd Font", monospace;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#window {
|
||||
/* Example: style the window module */
|
||||
background-color: #333333;
|
||||
color: #ffffff;
|
||||
border-radius: 8px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
'';
|
||||
|
||||
# Define the Waybar config content here (JSON format)
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
modules-left = [ "hyprland/workspaces" "hyprland/window" ];
|
||||
modules-center = [ "clock" ];
|
||||
modules-right = [ "network" "pulseaudio" "battery" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
home.packages = with pkgs; [
|
||||
tree # Nice file tree views w/permissions
|
||||
neofetch # Muh epic r1ce!!!
|
||||
btop # Resource manager
|
||||
stow # For dotfiles deployment. May use home.file in future
|
||||
imagemagick # For converting images into other fmts
|
||||
sxiv # Minimal image viewer
|
||||
mpv # Video player
|
||||
zathura # PDF/CBZ/EPUB/DJVU reader
|
||||
tmux # Tride and true terminal multiplexer
|
||||
obsidian # For epic note taking (really just mediocre journaling)
|
||||
keepassxc # Secure password manager
|
||||
syncthing # Self explanatory
|
||||
];
|
||||
|
||||
home.file = {
|
||||
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
||||
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
||||
# # symlink to the Nix store copy.
|
||||
# ".screenrc".source = dotfiles/screenrc;
|
||||
|
||||
# # You can also set the file content immediately.
|
||||
# ".gradle/gradle.properties".text = ''
|
||||
# org.gradle.console=verbose
|
||||
# org.gradle.daemon.idletimeout=3600000
|
||||
# '';
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
HOSTNAME = builtins.getEnv "HOSTNAME";
|
||||
};
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue