This commit is contained in:
2025-09-13 23:16:22 +02:00
commit 5057e1effa
179 changed files with 20524 additions and 0 deletions

22
modules/core/boot.nix Normal file
View File

@@ -0,0 +1,22 @@
{ pkgs, config, ... }:
{
boot = {
kernelPackages = pkgs.linuxPackages_zen;
kernelModules = [ "v4l2loopback" ];
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
kernel.sysctl = { "vm.max_map_count" = 2147483642; };
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
# Appimage Support
binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
magicOrExtension = ''\x7fELF....AI\x02'';
};
plymouth.enable = true;
};
}

36
modules/core/default.nix Normal file
View File

@@ -0,0 +1,36 @@
{
inputs,
host,
...
}:
let
# Import the host-specific variables.nix
vars = import ../../hosts/${host}/variables.nix;
in
{
imports = [
./boot.nix
./flatpak.nix
./fonts.nix
./hardware.nix
./network.nix
./nfs.nix
./nh.nix
#./quickshell.nix #Disabled for now not using it yet
./packages.nix
./printing.nix
# Conditionally import the display manager module
(if vars.displayManager == "tui" then ./greetd.nix else ./sddm.nix)
./security.nix
./services.nix
./steam.nix
./stylix.nix
./syncthing.nix
./system.nix
./thunar.nix
./user.nix
./virtualisation.nix
./xserver.nix
inputs.stylix.nixosModules.stylix
];
}

31
modules/core/flatpak.nix Normal file
View File

@@ -0,0 +1,31 @@
{ pkgs, ... }: {
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
configPackages = [ pkgs.hyprland ];
};
services = {
flatpak = {
enable = true;
# List the Flatpak applications you want to install
# Use the official Flatpak application ID (e.g., from flathub.org)
# Examples:
packages = [
#"com.github.tchx84.Flatseal" #Manage flatpak permissions - should always have this
#"com.rtosta.zapzap" # WhatsApp client
#"io.github.flattool.Warehouse" # Manage flatpaks, clean data, remove flatpaks and deps
#"it.mijorus.gearlever" # Manage and support AppImages
#"io.github.freedoom.Phase1" # Classic Doom FPS 1
#"io.github.freedoom.Phase2" # Classic Doom FPS 2
#"io.github.dvlv.boxbuddyrs" # Manage distroboxes
#"de.schmidhuberj.tubefeeder" #watch YT videos
# Add other Flatpak IDs here, e.g., "org.mozilla.firefox"
];
# Optional: Automatically update Flatpaks when you run nixos-rebuild swit ch
update.onActivation = true;
};
};
}

29
modules/core/fonts.nix Normal file
View File

@@ -0,0 +1,29 @@
{pkgs, ...}: {
fonts = {
packages = with pkgs; [
dejavu_fonts
fira-code
fira-code-symbols
font-awesome
hackgen-nf-font
ibm-plex
inter
jetbrains-mono
material-icons
maple-mono.NF
minecraftia
nerd-fonts.im-writing
nerd-fonts.blex-mono
noto-fonts
noto-fonts-emoji
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-monochrome-emoji
powerline-fonts
roboto
roboto-mono
#symbola
terminus_font
];
};
}

15
modules/core/greetd.nix Normal file
View File

@@ -0,0 +1,15 @@
{ pkgs
, username
, ...
}: {
services.greetd = {
enable = true;
#vt = 3;
settings = {
default_session = {
user = username;
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland"; # start Hyprland with a TUI login manager
};
};
};
}

18
modules/core/hardware.nix Normal file
View File

@@ -0,0 +1,18 @@
{ pkgs, ... }:
{
hardware = {
sane = {
enable = true;
extraBackends = [ pkgs.sane-airscan ];
disabledDefaultBackends = [ "escl" ];
};
logitech.wireless.enable = false;
logitech.wireless.enableGraphical = false;
graphics.enable = true;
enableRedistributableFirmware = true;
keyboard.qmk.enable = true;
bluetooth.enable = true;
bluetooth.powerOnBoot = true;
};
local.hardware-clock.enable = false;
}

41
modules/core/network.nix Normal file
View File

@@ -0,0 +1,41 @@
{ pkgs
, host
, options
, ...
}:
let
inherit (import ../../hosts/${host}/variables.nix) hostId;
in
{
# Defensive assertion for hostname validity (clearer message at eval time)
assertions = [
{
assertion = builtins.match "^[[:alnum:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$" host != null;
message = "Invalid hostname '${host}'. Must be 1-63 chars, start/end alphanumeric; allowed middle chars: letters, digits, '-' or '_'.";
}
];
networking = {
hostName = "${host}";
hostId = hostId;
networkmanager.enable = true;
timeServers = options.networking.timeServers.default ++ [ "pool.ntp.org" ];
firewall = {
enable = true;
allowedTCPPorts = [
22
80
443
59010
59011
8080
];
allowedUDPPorts = [
59010
59011
];
};
};
environment.systemPackages = with pkgs; [ networkmanagerapplet ];
}

10
modules/core/nfs.nix Normal file
View File

@@ -0,0 +1,10 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) enableNFS;
in
{
services = {
rpcbind.enable = enableNFS;
nfs.server.enable = enableNFS;
};
}

18
modules/core/nh.nix Normal file
View File

@@ -0,0 +1,18 @@
{ pkgs
, username
, ...
}: {
programs.nh = {
enable = true;
clean = {
enable = true;
extraArgs = "--keep-since 7d --keep 5";
};
flake = "/home/${username}/garandos";
};
environment.systemPackages = with pkgs; [
nix-output-monitor
nvd
];
}

85
modules/core/packages.nix Normal file
View File

@@ -0,0 +1,85 @@
{
pkgs,
inputs,
...
}:
{
programs = {
neovim = {
enable = true;
defaultEditor = true;
};
firefox.enable = false; # Firefox is not installed by default
hyprland = {
enable = true; # set this so desktop file is created
withUWSM = false;
};
dconf.enable = true;
seahorse.enable = true;
fuse.userAllowOther = true;
mtr.enable = true;
adb.enable = true;
hyprlock.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
};
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
# Hyprland systeminfo QT (Optional)
#inputs.hyprsysteminfo.packages.${pkgs.system}.default
amfora # Fancy Terminal Browser For Gemini Protocol
appimage-run # Needed For AppImage Support
brave # Brave Browser
brightnessctl # For Screen Brightness Control
cliphist # Clipboard manager using rofi menu
cmatrix # Matrix Movie Effect In Terminal
cowsay # Great Fun Terminal Program
docker-compose # Allows Controlling Docker From A Single File
duf # Utility For Viewing Disk Usage In Terminal
dysk # Disk space util nice formattting
eza # Beautiful ls Replacement
ffmpeg # Terminal Video / Audio Editing
file-roller # Archive Manager
gedit # Simple Graphical Text Editor
#gemini-cli # CLI AI client ONLY (optional)
gimp # Great Photo Editor
glxinfo # needed for inxi diag util
greetd.tuigreet # The Login Manager (Sometimes Referred To As Display Manager)
htop # Simple Terminal Based System Monitor
hyprpicker # Color Picker
eog # For Image Viewing
inxi # CLI System Information Tool
killall # For Killing All Instances Of Programs
libnotify # For Notifications
lm_sensors # Used For Getting Hardware Temps
lolcat # Add Colors To Your Terminal Command Output
lshw # Detailed Hardware Information
mpv # Incredible Video Player
ncdu # Disk Usage Analyzer With Ncurses Interface
nixfmt-rfc-style # Nix Formatter
nwg-displays # configure monitor configs via GUI
onefetch # provides zsaneyos build info on current system
pavucontrol # For Editing Audio Levels & Devices
pciutils # Collection Of Tools For Inspecting PCI Devices
picard # For Changing Music Metadata & Getting Cover Art
pkg-config # Wrapper Script For Allowing Packages To Get Info On Others
playerctl # Allows Changing Media Volume Through Scripts
rhythmbox # audio player
ripgrep # Improved Grep
socat # Needed For Screenshots
unrar # Tool For Handling .rar Files
unzip # Tool For Handling .zip Files
usbutils # Good Tools For USB Devices
uwsm # Universal Wayland Session Manager (optional must be enabled)
v4l-utils # Used For Things Like OBS Virtual Camera
waypaper # wallpaper changer
warp-terminal # Terminal with AI support build in
wget # Tool For Fetching Files With Links
ytmdl # Tool For Downloading Audio From YouTube
];
}

20
modules/core/printing.nix Normal file
View File

@@ -0,0 +1,20 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) printEnable;
in
{
services = {
printing = {
enable = printEnable;
drivers = [
# pkgs.hplipWithPlugin
];
};
avahi = {
enable = printEnable;
nssmdns4 = true;
openFirewall = true;
};
ipp-usb.enable = printEnable;
};
}

View File

@@ -0,0 +1,31 @@
{ pkgs, inputs, ... }:
{
environment.systemPackages = with pkgs; [
inputs.quickshell.packages.${pkgs.system}.default
# Qt6 related kitsfor slove Qt5Compat problem
qt6.qt5compat
qt6.qtbase
qt6.qtquick3d
qt6.qtwayland
qt6.qtdeclarative
qt6.qtsvg
# alternate options
# libsForQt5.qt5compat
kdePackages.qt5compat
libsForQt5.qt5.qtgraphicaleffects
];
# necessary environment variables
environment.variables = {
QML_IMPORT_PATH = "${pkgs.qt6.qt5compat}/lib/qt-6/qml:${pkgs.qt6.qtbase}/lib/qt-6/qml";
QML2_IMPORT_PATH = "${pkgs.qt6.qt5compat}/lib/qt-6/qml:${pkgs.qt6.qtbase}/lib/qt-6/qml";
};
# make sure the Qt application is working properly
environment.sessionVariables = {
QT_QPA_PLATFORM = "wayland;xcb";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
};
}

72
modules/core/sddm.nix Normal file
View File

@@ -0,0 +1,72 @@
# SDDM is a display manager for X11 and Wayland
{
pkgs,
config,
lib,
...
}: let
foreground = config.stylix.base16Scheme.base00;
textColor = config.stylix.base16Scheme.base05;
sddm-astronaut = pkgs.sddm-astronaut.override {
embeddedTheme = "pixel_sakura";
themeConfig =
if lib.hasSuffix "sakura_static.png" config.stylix.image
then {
FormPosition = "left";
Blur = "2.0";
}
else if lib.hasSuffix "studio.png" config.stylix.image
then {
Background = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/anotherhadi/nixy-wallpapers/refs/heads/main/wallpapers/studio.gif";
sha256 = "sha256-qySDskjmFYt+ncslpbz0BfXiWm4hmFf5GPWF2NlTVB8=";
};
HeaderTextColor = "#${textColor}";
DateTextColor = "#${textColor}";
TimeTextColor = "#${textColor}";
LoginFieldTextColor = "#${textColor}";
PasswordFieldTextColor = "#${textColor}";
UserIconColor = "#${textColor}";
PasswordIconColor = "#${textColor}";
WarningColor = "#${textColor}";
LoginButtonBackgroundColor = "#${foreground}";
SystemButtonsIconsColor = "#${foreground}";
SessionButtonTextColor = "#${textColor}";
VirtualKeyboardButtonTextColor = "#${textColor}";
DropdownBackgroundColor = "#${foreground}";
HighlightBackgroundColor = "#${textColor}";
}
else {
FormPosition = "left";
Blur = "4.0";
Background = "${toString config.stylix.image}";
HeaderTextColor = "#${textColor}";
DateTextColor = "#${textColor}";
TimeTextColor = "#${textColor}";
LoginFieldTextColor = "#${textColor}";
PasswordFieldTextColor = "#${textColor}";
UserIconColor = "#${textColor}";
PasswordIconColor = "#${textColor}";
WarningColor = "#${textColor}";
LoginButtonBackgroundColor = "#${config.stylix.base16Scheme.base01}";
SystemButtonsIconsColor = "#${textColor}";
SessionButtonTextColor = "#${textColor}";
VirtualKeyboardButtonTextColor = "#${textColor}";
DropdownBackgroundColor = "#${config.stylix.base16Scheme.base01}";
HighlightBackgroundColor = "#${textColor}";
FormBackgroundColor = "#${config.stylix.base16Scheme.base01}";
};
};
in {
services.displayManager = {
sddm = {
package = pkgs.kdePackages.sddm;
extraPackages = [sddm-astronaut];
enable = true;
wayland.enable = true;
theme = "sddm-astronaut-theme";
};
};
environment.systemPackages = [sddm-astronaut];
}

22
modules/core/security.nix Normal file
View File

@@ -0,0 +1,22 @@
_: {
security = {
rtkit.enable = true;
polkit = {
enable = true;
extraConfig = ''
polkit.addRule(function(action, subject) {
if ( subject.isInGroup("users") && (
action.id == "org.freedesktop.login1.reboot" ||
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.power-off-multiple-sessions"
))
{ return polkit.Result.YES; }
})
'';
};
pam.services.swaylock = {
text = ''auth include login '';
};
};
}

57
modules/core/services.nix Normal file
View File

@@ -0,0 +1,57 @@
{ profile, ... }: {
# Services to start
services = {
libinput.enable = true; # Input Handling
fstrim.enable = true; # SSD Optimizer
gvfs.enable = true; # For Mounting USB & More
openssh = {
enable = true; # Enable SSH
settings = {
PermitRootLogin = "no"; # Prevent root from SSH login
PasswordAuthentication = true; #Users can SSH using kb and password
KbdInteractiveAuthentication = true;
};
ports = [ 22 ];
};
blueman.enable = true; # Bluetooth Support
tumbler.enable = true; # Image/video preview
gnome.gnome-keyring.enable = true;
smartd = {
enable =
if profile == "vm"
then false
else true;
autodetect = true;
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
extraConfig.pipewire."92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.quantum" = 256;
"default.clock.min-quantum" = 256;
"default.clock.max-quantum" = 256;
};
};
extraConfig.pipewire-pulse."92-low-latency" = {
context.modules = [
{
name = "libpipewire-module-protocol-pulse";
args = {
pulse.min.req = "256/48000";
pulse.default.req = "256/48000";
pulse.max.req = "256/48000";
pulse.min.quantum = "256/48000";
pulse.max.quantum = "256/48000";
};
}
];
};
};
};
}

73
modules/core/starfish.nix Normal file
View File

@@ -0,0 +1,73 @@
{ ... }: {
programs = {
starship = {
enable = false;
settings = {
add_newline = false;
buf = {
symbol = " ";
};
c = {
symbol = " ";
};
directory = {
read_only = " 󰌾";
};
docker_context = {
symbol = " ";
};
fossil_branch = {
symbol = " ";
};
git_branch = {
symbol = " ";
};
golang = {
symbol = " ";
};
hg_branch = {
symbol = " ";
};
hostname = {
ssh_symbol = " ";
};
lua = {
symbol = " ";
};
memory_usage = {
symbol = "󰍛 ";
};
meson = {
symbol = "󰔷 ";
};
nim = {
symbol = "󰆥 ";
};
nix_shell = {
symbol = " ";
};
nodejs = {
symbol = " ";
};
ocaml = {
symbol = " ";
};
package = {
symbol = "󰏗 ";
};
python = {
symbol = " ";
};
rust = {
symbol = " ";
};
swift = {
symbol = " ";
};
zig = {
symbol = " ";
};
};
};
};
}

20
modules/core/steam.nix Normal file
View File

@@ -0,0 +1,20 @@
{ pkgs, ... }: {
programs = {
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
gamescopeSession.enable = true;
extraCompatPackages = [ pkgs.proton-ge-bin ];
};
gamescope = {
enable = true;
capSysNice = true;
args = [
"--rt"
"--expose-wayland"
];
};
};
}

59
modules/core/stylix.nix Normal file
View File

@@ -0,0 +1,59 @@
{ pkgs
, host
, ...
}:
let
inherit (import ../../hosts/${host}/variables.nix) stylixImage;
in
{
# Styling Options
stylix = {
enable = true;
image = stylixImage;
# base16Scheme = {
# base00 = "282936";
# base01 = "3a3c4e";
# base02 = "4d4f68";
# base03 = "626483";
# base04 = "62d6e8";
# base05 = "e9e9f4";
# base06 = "f1f2f8";
# base07 = "f7f7fb";
# base08 = "ea51b2";
# base09 = "b45bcf";
# base0A = "00f769";
# base0B = "ebff87";
# base0C = "a1efe4";
# base0D = "62d6e8";
# base0E = "b45bcf";
# base0F = "00f769";
# };
polarity = "dark";
opacity.terminal = 1.0;
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 24;
};
fonts = {
monospace = {
package = pkgs.nerd-fonts.jetbrains-mono;
name = "JetBrains Mono";
};
sansSerif = {
package = pkgs.montserrat;
name = "Montserrat";
};
serif = {
package = pkgs.montserrat;
name = "Montserrat";
};
sizes = {
applications = 12;
terminal = 15;
desktop = 11;
popups = 12;
};
};
};
}

View File

@@ -0,0 +1,8 @@
{ username, ... }: {
services.syncthing = {
enable = false;
user = "${username}";
dataDir = "/home/${username}";
configDir = "/home/${username}/.config/syncthing";
};
}

38
modules/core/system.nix Normal file
View File

@@ -0,0 +1,38 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) consoleKeyMap;
in
{
nix = {
settings = {
download-buffer-size = 200000000;
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
};
};
time.timeZone = "Europe/Warsaw";
i18n.defaultLocale = "pl_PL.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "pl_PL.UTF-8";
LC_IDENTIFICATION = "pl_PL.UTF-8";
LC_MEASUREMENT = "pl_PL.UTF-8";
LC_MONETARY = "pl_PL.UTF-8";
LC_NAME = "pl_PL.UTF-8";
LC_NUMERIC = "pl_PL.UTF-8";
LC_PAPER = "pl_PL.UTF-8";
LC_TELEPHONE = "pl_PL.UTF-8";
LC_TIME = "pl_PL.UTF-8";
};
environment.variables = {
NIXOS_OZONE_WL = "1";
ZANEYOS_VERSION = "2.4";
ZANEYOS = "true";
};
console.keyMap = "${consoleKeyMap}";
system.stateVersion = "23.11"; # Do not change!
}

21
modules/core/thunar.nix Normal file
View File

@@ -0,0 +1,21 @@
{ host
, pkgs
, ...
}:
let
inherit (import ../../hosts/${host}/variables.nix) thunarEnable;
in
{
programs = {
thunar = {
enable = thunarEnable;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
};
environment.systemPackages = with pkgs; [
ffmpegthumbnailer # Need For Video / Image Preview
];
}

45
modules/core/user.nix Normal file
View File

@@ -0,0 +1,45 @@
{ pkgs
, inputs
, username
, host
, profile
, ...
}:
let
inherit (import ../../hosts/${host}/variables.nix) gitUsername;
in
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = false;
backupFileExtension = "backup";
extraSpecialArgs = { inherit inputs username host profile; };
users.${username} = {
imports = [ ./../home ];
home = {
username = "${username}";
homeDirectory = "/home/${username}";
stateVersion = "23.11";
};
};
};
users.mutableUsers = true;
users.users.${username} = {
isNormalUser = true;
description = "${gitUsername}";
extraGroups = [
"adbusers"
"docker" #access to docker as non-root
"libvirtd" #Virt manager/QEMU access
"lp"
"networkmanager"
"scanner"
"wheel" #subdo access
"vboxusers" #Virtual Box
];
shell = pkgs.zsh;
ignoreShellProgramCheck = true;
};
nix.settings.allowed-users = [ "${username}" ];
}

View File

@@ -0,0 +1,29 @@
{ pkgs, ... }: {
# Only enable either docker or podman -- Not both
virtualisation = {
docker = {
enable = true;
};
podman.enable = false;
libvirtd = {
enable = true;
};
virtualbox.host = {
enable = false;
enableExtensionPack = true;
};
};
programs = {
virt-manager.enable = false;
};
environment.systemPackages = with pkgs; [
virt-viewer # View Virtual Machines
lazydocker
docker-client
];
}

13
modules/core/xserver.nix Normal file
View File

@@ -0,0 +1,13 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) keyboardLayout;
in
{
services.xserver = {
enable = false;
xkb = {
layout = "${keyboardLayout}";
variant = "";
};
};
}

View File

@@ -0,0 +1,19 @@
{ lib
, pkgs
, config
, ...
}:
with lib;
let
cfg = config.drivers.amdgpu;
in
{
options.drivers.amdgpu = {
enable = mkEnableOption "Enable AMD Drivers";
};
config = mkIf cfg.enable {
systemd.tmpfiles.rules = [ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ];
services.xserver.videoDrivers = [ "amdgpu" ];
};
}

View File

@@ -0,0 +1,12 @@
{ ...
}:
{
imports = [
./amd-drivers.nix
./intel-drivers.nix
./local-hardware-clock.nix
./nvidia-drivers.nix
./nvidia-prime-drivers.nix
./vm-guest-services.nix
];
}

View File

@@ -0,0 +1,25 @@
{ lib
, pkgs
, config
, ...
}:
with lib; let
cfg = config.drivers.intel;
in
{
options.drivers.intel = {
enable = mkEnableOption "Enable Intel Graphics Drivers";
};
config = mkIf cfg.enable {
# OpenGL
hardware.graphics = {
extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
};
};
}

View File

@@ -0,0 +1,16 @@
{ lib
, pkgs
, config
, ...
}:
with lib;
let
cfg = config.local.hardware-clock;
in
{
options.local.hardware-clock = {
enable = mkEnableOption "Change Hardware Clock To Local Time";
};
config = mkIf cfg.enable { time.hardwareClockInLocalTime = true; };
}

View File

@@ -0,0 +1,40 @@
{ lib
, pkgs
, config
, ...
}:
with lib;
let
cfg = config.drivers.nvidia;
in
{
options.drivers.nvidia = {
enable = mkEnableOption "Enable Nvidia Drivers";
};
config = mkIf cfg.enable {
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
};
}

View File

@@ -0,0 +1,36 @@
{ lib
, pkgs
, config
, ...
}:
with lib;
let
cfg = config.drivers.nvidia-prime;
in
{
options.drivers.nvidia-prime = {
enable = mkEnableOption "Enable Nvidia Prime Hybrid GPU Offload";
intelBusID = mkOption {
type = types.str;
default = "PCI:1:0:0";
};
nvidiaBusID = mkOption {
type = types.str;
default = "PCI:0:2:0";
};
};
config = mkIf cfg.enable {
hardware.nvidia = {
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
# Make sure to use the correct Bus ID values for your system!
intelBusId = "${cfg.intelBusID}";
nvidiaBusId = "${cfg.nvidiaBusID}";
};
};
};
}

View File

@@ -0,0 +1,20 @@
{ lib
, pkgs
, config
, ...
}:
with lib;
let
cfg = config.vm.guest-services;
in
{
options.vm.guest-services = {
enable = mkEnableOption "Enable Virtual Machine Guest Services";
};
config = mkIf cfg.enable {
services.qemuGuest.enable = true;
services.spice-vdagentd.enable = true;
services.spice-webdavd.enable = false; #Causes navfs2 build failure invalid neon version 9-12-25
};
}

View File

@@ -0,0 +1,30 @@
{ lib, ... }: {
programs.alacritty =
let
font_family = lib.mkForce "Maple Mono NF";
in
{
enable = true;
settings = {
font = {
normal = {
family = font_family;
style = "Regular";
};
bold = {
family = font_family;
style = "Bold";
};
italic = {
family = font_family;
style = "Italic";
};
bold_italic = {
family = font_family;
style = "Bold Italic";
};
size = 15;
};
};
};
}

107
modules/home/amfora.nix Normal file
View File

@@ -0,0 +1,107 @@
_: {
home.file = {
".config/amfora/config.toml".text = ''
[a-general]
home = "gemini://gem.zaney.org"
color = true
ansi = true
bullets = true
show_link = false
scrollbar = "never"
auto_redirect = false
http = 'brave'
search = "gemini://gus.guru/search"
max_width = 140
page_max_size = 2097152 # 2 MiB
page_max_time = 10
highlight_code = true
highlight_style = "dracula"
downloads = '~/Downloads/'
underline = true
[auth]
[auth.certs]
[auth.keys]
[commands]
[keybindings]
bind_bottom = ":"
bind_quit = "Q"
bind_reload = "R"
bind_back = "h"
bind_forward = "l"
bind_moveup = "k"
bind_movedown = "j"
bind_moveleft = "H"
bind_moveright = "L"
bind_next_tab = "J"
bind_prev_tab = "K"
bind_edit = "o"
bind_new_tab = "O"
bind_close_tab = "q"
bind_save = "S"
bind_home = "Ctrl-h"
bind_bookmarks = "b"
bind_add_bookmark = "B"
bind_copy_page_url = "c"
bind_copy_target_url = "C"
bind_search = "/"
bind_next_match = "n"
bind_prev_match = "N"
[url-handlers]
[url-prompts]
[cache]
max_size = 0 # Size in bytes
max_pages = 30 # The maximum number of pages the cache will store
timeout = 1800 # 30 mins
[proxies]
[subscriptions]
popup = true
update_interval = 1800 # 30 mins
workers = 3
entries_per_page = 20
header = true
[theme]
bg = "#282a36"
tab_num = "#bd93f9"
tab_divider = "#f8f8f2"
bottombar_label = "#bd93f9"
bottombar_text = "#8be9fd"
bottombar_bg = "#44475a"
scrollbar = "#44475a"
hdg_1 = "#bd93f9"
hdg_2 = "#7cafc2"
hdg_3 = "#a16946"
amfora_link = "#ff79c6"
foreign_link = "#ffb86c"
link_number = "#8be9fd"
regular_text = "#f8f8f2"
quote_text = "#f1fa8c"
preformatted_text = "#ffb86c"
list_text = "#f8f8f2"
btn_bg = "#44475a"
btn_text = "#f8f8f2"
dl_choice_modal_bg = "#6272a4"
dl_choice_modal_text = "#f8f8f2"
dl_modal_bg = "#6272a4"
dl_modal_text = "#f8f8f2"
info_modal_bg = "#6272a4"
info_modal_text = "#f8f8f2"
error_modal_bg = "#ff5555"
error_modal_text = "#f8f8f2"
yesno_modal_bg = "#6272a4"
yesno_modal_text = "#f8f8f2"
tofu_modal_bg = "#6272a4"
tofu_modal_text = "#f8f8f2"
subscription_modal_bg = "#6272a4"
subscription_modal_text = "#f8f8f2"
input_modal_bg = "#6272a4"
input_modal_text = "#f8f8f2"
input_modal_field_bg = "#44475a"
input_modal_field_text = "#f8f8f2"
bkmk_modal_bg = "#6272a4"
bkmk_modal_text = "#f8f8f2"
bkmk_modal_label = "#f8f8f2"
bkmk_modal_field_bg = "#44475a"
bkmk_modal_field_text = "#f8f8f2"
'';
};
}

22
modules/home/bash.nix Normal file
View File

@@ -0,0 +1,22 @@
{ profile, ... }: {
programs.bash = {
enable = false;
enableCompletion = true;
initExtra = ''
fastfetch
if [ -f $HOME/.bashrc-personal ]; then
source $HOME/.bashrc-personal
fi
'';
shellAliases = {
sv = "sudo nvim";
fr = "nh os switch --hostname ${profile}";
fu = "nh os switch --hostname ${profile} --update";
zu = "sh <(curl -L https://gitlab.com/Zaney/zaneyos/-/releases/latest/download/install-zaneyos.sh)";
ncg = "nix-collect-garbage --delete-old && sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot";
v = "nvim";
cat = "bat";
".." = "cd ..";
};
};
}

View File

@@ -0,0 +1,20 @@
{ pkgs, ... }: {
home.packages = with pkgs; [ bash ];
home.file."./.bashrc-personal".text = ''
# This file allows you to define your own aliases, functions, etc
# below are just some examples of what you can use this file for
#!/usr/bin/env bash
# Set defaults
#
#export EDITOR="nvim"
#export VISUAL="nvim"
#alias c="clear"
#eval "$(zoxide init bash)"
#eval "$(oh-my-posh init bash --config $HOME/.config/powerlevel10k_rainbow.omp.json)"
'';
}

26
modules/home/bat.nix Normal file
View File

@@ -0,0 +1,26 @@
{ pkgs
, lib
, ...
}: {
programs.bat = {
enable = true;
config = {
pager = "less -FR";
# other styles available and cane be combined
# style = "numbers,changes,headers,rule,grid";
style = "full";
# Bat has other thems as well
# ansi,Catppuccin,base16,base16-256,GitHub,Nord,etc
theme = lib.mkForce "Dracula";
};
extraPackages = with pkgs.bat-extras; [
batman
batpipe
batgrep
];
};
home.sessionVariables = {
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
MANROFFOPT = "-c";
};
}

35
modules/home/bottom.nix Normal file
View File

@@ -0,0 +1,35 @@
{ ... }: {
programs.bottom = {
enable = true;
settings = {
enable_gpu = true;
theme = "nord";
flags.group_processes = true;
row = [
{
ratio = 2;
child = [
{ type = "cpu"; }
{ type = "temp"; }
];
}
{
ratio = 2;
child = [
{ type = "network"; }
];
}
{
ratio = 3;
child = [
{
type = "proc";
ratio = 1;
default = true;
}
];
}
];
};
};
}

22
modules/home/btop.nix Normal file
View File

@@ -0,0 +1,22 @@
{ pkgs, ... }: {
programs.btop = {
enable = true;
package = pkgs.btop.override {
rocmSupport = true;
cudaSupport = true;
};
settings = {
vim_keys = true;
rounded_corners = true;
proc_tree = true;
show_gpu_info = "on";
show_uptime = true;
show_coretemp = true;
cpu_sensor = "auto";
show_disks = true;
only_physical = true;
io_mode = true;
io_graph_combined = false;
};
};
}

43
modules/home/cava.nix Normal file
View File

@@ -0,0 +1,43 @@
{ config, ... }: {
programs.cava = {
enable = true;
settings = {
general = {
bar_spacing = 1;
bar_width = 2;
frame_rate = 60;
};
color = {
#gradient = 1;
#gradient_color_1 = "'#011f30'";
#gradient_color_2 = "'#09465b'";
#gradient_color_3 = "'#045a93'";
#gradient_color_4 = "'#00aa00'";
#gradient_color_5 = "'#ffff00'";
#gradient_color_6 = "'#cc8033'";
#gradient_color_7 = "'#aa0000'";
#gradient_color_8 = "'#ff00ff'";
# Old config
#gradient = 1;
#gradient_color_1 = "'#8bd5ca'";
#gradient_color_2 = "'#91d7e3'";
#gradient_color_3 = "'#7dc4e4'";
#gradient_color_4 = "'#8aadf4'";
#gradient_color_5 = "'#c6a0f6'";
#gradient_color_6 = "'#f5bde6'";
#gradient_color_7 = "'#ee99a0'";
#gradient_color_8 = "'#ed8796'";
# Dracula
gradient = 1;
gradient_color_1 = "'#8BE9FD'";
gradient_color_2 = "'#9AEDFE'";
gradient_color_3 = "'#CAA9FA'";
gradient_color_4 = "'#BD93F9'";
gradient_color_5 = "'#FF92D0'";
gradient_color_6 = "'#FF79C6'";
gradient_color_7 = "'#FF6E67'";
gradient_color_8 = "'#FF5555'";
};
};
};
}

70
modules/home/default.nix Normal file
View File

@@ -0,0 +1,70 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix)
alacrittyEnable
ghosttyEnable
tmuxEnable
waybarChoice
weztermEnable
vscodeEnable
helixEnable
doomEmacsEnable
;
in
{
imports = [
./amfora.nix
./bash.nix
./bashrc-personal.nix
./bat.nix
./btop.nix
./bottom.nix
./cava.nix
./emoji.nix
./eza.nix
./fastfetch
./fzf.nix
./gh.nix
./git.nix
./gtk.nix
./htop.nix
./hyprland
./kitty.nix
./lazygit.nix
./obs-studio.nix
./nvf.nix
./obs-studio.nix
./rofi
./qt.nix
./scripts
./scripts/gemini-cli.nix
#./starship.nix
#./starship-ddubs-1.nix
./stylix.nix
./swappy.nix
./swaync.nix
./tealdeer.nix
./virtmanager.nix
waybarChoice
./wlogout
./xdg.nix
./yazi
./zoxide.nix
./zsh
]
++ (if helixEnable then [ ./evil-helix.nix ] else [ ])
++ (if vscodeEnable then [ ./vscode.nix ] else [ ])
++ (
if doomEmacsEnable then
[
./editors/doom-emacs-install.nix
./editors/doom-emacs.nix
]
else
[ ]
)
++ (if weztermEnable then [ ./wezterm.nix ] else [ ])
++ (if ghosttyEnable then [ ./ghostty.nix ] else [ ])
++ (if tmuxEnable then [ ./tmux.nix ] else [ ])
++ (if alacrittyEnable then [ ./alacritty.nix ] else [ ]);
}

View File

@@ -0,0 +1,78 @@
{ pkgs, ... }:
let
doom-icon = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/jeetelongname/doom-banners/master/splashes/doom/doom-emacs-color2.svg";
sha256 = "1xxi5ra1z8njsqaqiaq96wyn1sc967l42kvjzbji1zrjj8za6bgq";
};
in
{
# 1. Create a script to install Doom Emacs
home.packages = [
(pkgs.writeShellScriptBin "get-doom" ''
#!/usr/bin/env bash
set -e
# --- Icons ---
ICON_CHECK=""
ICON_INFO=""
ICON_ROCKET="🚀"
# --- Helper Functions ---
print_status() {
echo
echo "--- $ICON_INFO $1 ---"
}
print_success() {
echo "--- $ICON_CHECK $1 ---"
}
print_banner() {
echo "==============================="
echo " Doom Emacs Installer $ICON_ROCKET"
echo "==============================="
}
# --- Main Script ---
print_banner
EMACSDIR="$HOME/.emacs.d"
if [ -d "$EMACSDIR" ]; then
print_success "Doom Emacs is already installed."
exit 0
fi
print_status "Cloning Doom Emacs..."
git clone --depth 1 https://github.com/doomemacs/doomemacs "$EMACSDIR"
print_success "Doom Emacs cloned."
print_status "Running Doom install..."
"$EMACSDIR/bin/doom" install
print_success "Doom install complete."
print_status "Running doom sync..."
"$EMACSDIR/bin/doom" sync
print_success "Doom sync complete."
echo
print_success "All done! Doom Emacs is ready to use."
'')
];
# 2. Add the bin directory to the PATH
home.sessionPath = [
"$HOME/.emacs.d/bin"
];
# 3. Create a desktop file
xdg.desktopEntries.doom-emacs = {
name = "Doom Emacs";
comment = "A configuration framework for GNU Emacs";
exec = "emacs";
icon = doom-icon;
terminal = false;
type = "Application";
categories = [ "Development" "TextEditor" ];
};
}

View File

@@ -0,0 +1,162 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
emacs-gtk
git
lazygit
ripgrep
libtool
cmake
pkg-config
# Spell checking
hunspell
hunspellDicts.en_US
hunspellDicts.en_AU
hunspellDicts.es_ES
# LSP servers
clang-tools # C/C++ LSP
nil # Nix LSP
];
home.file.".doom.d/init.el".text = ''
;;; init.el -*- lexical-binding: t; -*-
(doom!
:completion
(company +auto)
(vertico +icons)
:ui
doom
doom-dashboard
doom-quit
hl-todo
modeline
nav-flash
ophints
(popup +defaults)
(ligatures +extra)
tabs
treemacs
vi-tilde-fringe
window-select
:editor
(evil +everywhere)
file-templates
fold
multiple-cursors
snippets
word-wrap
:emacs
(dired +icons)
electric
(ibuffer +icons)
(undo +tree)
vc
:term
vterm
:checkers
(syntax +flymake)
(spell +flyspell)
grammar
:tools
(eval +overlay)
(lookup +docsets)
lsp
(magit +forge)
pdf
tree-sitter
:lang
bash
(c +lsp)
css
docker
html
(json +lsp)
markdown
(nix +tree-sitter +lsp)
toml
yaml
:config
(default +bindings +smartparens))
'';
home.file.".doom.d/config.el".text = ''
;;; config.el -*- lexical-binding: t; -*-
(setq doom-theme 'doom-one)
(setq display-line-numbers-type 'relative)
(setq nerd-icons-font-family "JetBrainsMono Nerd Font")
;; Git configuration
(after! magit
;; Set default git editor to emacsclient
(setq with-editor-emacsclient-executable "emacsclient")
;; Show word-granularity differences within diff hunks
(setq magit-diff-refine-hunk t)
;; Auto-refresh magit buffers
(setq magit-refresh-status-buffer t))
;; Lazygit integration
(defun my/lazygit ()
"Open lazygit in a terminal."
(interactive)
(if (fboundp 'vterm)
(let ((default-directory (magit-toplevel)))
(vterm "*lazygit*")
(vterm-send-string "lazygit")
(vterm-send-return))
(async-shell-command "lazygit" "*lazygit*")))
;; LSP configuration
(after! lsp-mode
(setq lsp-signature-auto-activate t
lsp-signature-render-documentation t
lsp-completion-provider :company-capf
lsp-idle-delay 0.1))
;; Nix LSP (nil) configuration
(with-eval-after-load 'lsp-nix-nil
(setq lsp-nix-nil-auto-eval-inputs t))
;; Company completion settings
(after! company
(setq company-idle-delay 0.2
company-minimum-prefix-length 1
company-tooltip-align-annotations t
company-require-match 'never))
;; Spell checking configuration
(after! ispell
(setq ispell-program-name "hunspell")
(setq ispell-local-dictionary "en_US")
(setq ispell-local-dictionary-alist
'(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US") nil utf-8))))
;; Git keybindings
(map! :leader
(:prefix-map ("g" . "git")
:desc "Magit status" "g" #'magit-status
:desc "Magit dispatch" "d" #'magit-dispatch
:desc "Magit file dispatch" "f" #'magit-file-dispatch
:desc "Magit blame" "b" #'magit-blame-addition
:desc "Git time machine" "t" #'git-timemachine-toggle
:desc "Lazygit" "l" #'my/lazygit
:desc "Git stage file" "s" #'magit-stage-file
:desc "Git unstage file" "u" #'magit-unstage-file))
'';
home.file.".doom.d/packages.el".text = ''
;;; packages.el -*- lexical-binding: t; -*-
;; Git-related packages
(package! git-timemachine)
'';
}

1853
modules/home/emoji.nix Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,89 @@
{ pkgs, ... }:
let
enableEvilHelix = true; # Set to true to enable the configuration
in
{
home.packages = with pkgs; (
if enableEvilHelix
then [
evil-helix
cmake-language-server
jsonnet-language-server
luaformatter
lua-language-server
marksman
taplo
nil
jq-lsp
vscode-langservers-extracted
bash-language-server
awk-language-server
vscode-extensions.llvm-vs-code-extensions.vscode-clangd
clang-tools
docker-compose-language-service
docker-compose
docker-language-server
typescript-language-server
]
else [ ]
);
home.file.".config/helix/languages.toml".text =
if enableEvilHelix
then ''
[language-server.nil]
command = "nil"
[language-server.lua]
command = "lua-language-server"
[language-server.json]
command = "vscode-json-languageserver"
[language-server.markdown]
command = "marksman"
''
else "";
home.file.".config/helix/config.toml".text =
if enableEvilHelix
then ''
theme = "catppuccin_mocha"
#theme = "ao"
[editor]
evil = true
end-of-line-diagnostics = "hint"
auto-pairs = true
mouse = true
middle-click-paste = true
shell = ["zsh", "-c"]
line-number = "absolute"
auto-completion = true
path-completion = true
auto-info = true
color-modes = true
popup-border = "all"
clipboard-provider = "wayland"
indent-heuristic = "hybrid"
[editor.statusline]
left = ["mode", "spinner"]
center = ["file-absolute-path", "total-line-numbers", "read-only-indicator", "file-modification-indicator"]
right = ["diagnostics", "selections", "position", "file-encoding", "file-line-ending", "file-type"]
separator = ""
mode.normal = "NORMAL"
mode.insert = "INSERT"
mode.select = "SELECT"
[editor.lsp]
enable = true
display-messages = true
display-progress-messages = true
[editor.inline-diagnostics]
cursor-line = "hint"
other-lines = "hint"
''
else "";
}

30
modules/home/eza.nix Normal file
View File

@@ -0,0 +1,30 @@
# Eza is a ls replacement
{
programs.eza = {
enable = true;
icons = "auto";
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
git = true;
extraOptions = [
"--group-directories-first"
"--no-quotes"
"--header" # Show header row
"--git-ignore"
"--icons=always"
# "--time-style=long-iso" # ISO 8601 extended format for time
"--classify" # append indicator (/, *, =, @, |)
"--hyperlink" # make paths clickable in some terminals
];
};
# Aliases to make `ls`, `ll`, `la` use eza
home.shellAliases = {
ls = "eza";
lt = "eza --tree --level=2";
ll = "eza -lh --no-user --long";
la = "eza -lah ";
tree = "eza --tree ";
};
}

View File

@@ -0,0 +1,136 @@
{
programs.fastfetch = {
enable = true;
settings = {
display = {
color = {
keys = "35";
output = "95";
};
separator = " ";
};
logo = {
source = ./nixos.png;
type = "kitty-direct";
height = 10;
width = 20;
padding = {
top = 2;
left = 2;
};
};
modules = [
"break"
{
type = "os";
key = "OS";
keyColor = "31";
}
{
type = "command";
key = " ZaneyOS ";
keyColor = "31";
text = "echo v$" + "{ZANEYOS_VERSION}";
}
{
type = "kernel";
key = " ";
keyColor = "31";
}
{
type = "packages";
key = " 󰏖 ";
keyColor = "31";
}
{
type = "shell";
key = " ";
keyColor = "31";
}
"break"
{
type = "wm";
key = "WM ";
keyColor = "32";
}
{
type = "wmtheme";
key = " 󰉼 ";
keyColor = "32";
}
{
type = "icons";
key = " 󰀻 ";
keyColor = "32";
}
{
type = "cursor";
key = " ";
keyColor = "32";
}
{
type = "terminal";
key = " ";
keyColor = "32";
}
{
type = "terminalfont";
key = " ";
keyColor = "32";
}
"break"
{
type = "host";
format = "{5} {1} Type {2}";
key = "PC ";
keyColor = "33";
}
{
type = "cpu";
format = "{1} ({3}) @ {7} GHz";
key = " ";
keyColor = "33";
}
{
type = "gpu";
format = "{1} {2} @ {12} GHz";
key = " 󰢮 ";
keyColor = "33";
}
{
type = "memory";
key = " ";
keyColor = "33";
}
{
type = "disk";
key = " 󰋊 ";
keyColor = "33";
}
{
type = "monitor";
key = " ";
keyColor = "33";
}
{
type = "player";
key = " 󰥠 ";
keyColor = "33";
}
{
type = "media";
key = " 󰝚 ";
keyColor = "33";
}
"break"
{
type = "uptime";
key = " Uptime ";
}
];
};
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

37
modules/home/fzf.nix Normal file
View File

@@ -0,0 +1,37 @@
# Fzf is a general-purpose command-line fuzzy finder.
{ config
, lib
, ...
}:
let
accent = "#" + config.lib.stylix.colors.base0D;
foreground = "#" + config.lib.stylix.colors.base05;
muted = "#" + config.lib.stylix.colors.base03;
in
{
programs.fzf = {
enable = true;
enableZshIntegration = true;
colors = lib.mkForce {
"fg+" = accent;
"bg+" = "-1";
"fg" = foreground;
"bg" = "-1";
"prompt" = muted;
"pointer" = accent;
};
defaultOptions = [
"--margin=1"
"--layout=reverse"
"--border=none"
"--info='hidden'"
"--header=''"
"--prompt='/ '"
"-i"
"--no-bold"
"--bind='enter:execute(nvim {})'"
"--preview='bat --style=numbers --color=always --line-range :500 {}'"
"--preview-window=right:60%:wrap"
];
};
}

6
modules/home/gh.nix Normal file
View File

@@ -0,0 +1,6 @@
{ ... }:
{
programs = {
gh.enable = true;
};
}

100
modules/home/ghostty.nix Normal file
View File

@@ -0,0 +1,100 @@
{ pkgs, ... }:
let
# A recent issue 7/7/2025 w/ghostty causes it to hang or respond slowly
# This is a workaround until a fix is released
myGhostty = pkgs.ghostty.overrideAttrs (_: {
preBuild = ''
shopt -s globstar
sed -i 's/^const xev = @import("xev");$/const xev = @import("xev").Epoll;/' **/*.zig
shopt -u globstar
'';
});
in
{
programs.ghostty = {
enable = true;
package = myGhostty; # to fix a but in current builds of ghostty
#package = pkgs.ghostty;
};
home.file."./.config/ghostty/config".text = ''
#theme = Aura
theme = Dracula
#theme = Aardvark Blue
#theme = GruvboxDarkHard
adjust-cell-height = 10%
window-theme = dark
window-height = 32
window-width = 110
background-opacity = 0.95
background-blur-radius = 60
selection-background = #2d3f76
selection-foreground = #c8d3f5
cursor-style = bar
mouse-hide-while-typing = true
# keybindings
# Copy/Paste
keybind = ctrl+shift+c=copy_to_clipboard
keybind = ctrl+shift+v=paste_from_clipboard
keybind = alt+s>r=reload_config
keybind = alt+s>x=close_surface
keybind = alt+s>n=new_window
# tabs
keybind = alt+s>c=new_tab
keybind = alt+s>shift+l=next_tab
keybind = alt+s>shift+h=previous_tab
keybind = alt+s>comma=move_tab:-1
keybind = alt+s>period=move_tab:1
# quick tab switch
keybind = alt+s>1=goto_tab:1
keybind = alt+s>2=goto_tab:2
keybind = alt+s>3=goto_tab:3
keybind = alt+s>4=goto_tab:4
keybind = alt+s>5=goto_tab:5
keybind = alt+s>6=goto_tab:6
keybind = alt+s>7=goto_tab:7
keybind = alt+s>8=goto_tab:8
keybind = alt+s>9=goto_tab:9
# split
keybind = alt+s>\=new_split:right
keybind = alt+s>-=new_split:down
keybind = alt+s>j=goto_split:bottom
keybind = alt+s>k=goto_split:top
keybind = alt+s>h=goto_split:left
keybind = alt+s>l=goto_split:right
keybind = alt+s>z=toggle_split_zoom
keybind = alt+s>e=equalize_splits
# other
#copy-on-select = clipboard
font-size = 12
#font-family = JetBrainsMono Nerd Font Mono
#font-family-bold = JetBrainsMono NFM Bold
#font-family-bold-italic = JetBrainsMono NFM Bold Italic
#font-family-italic = JetBrainsMono NFM Italic
font-family = BerkeleyMono Nerd Font
#font-family = Iosevka Nerd Font
# font-family = SFMono Nerd Font
title = "GhosTTY"
wait-after-command = false
shell-integration = detect
window-save-state = always
gtk-single-instance = true
unfocused-split-opacity = 0.5
quick-terminal-position = center
shell-integration-features = cursor,sudo
'';
}

33
modules/home/git.nix Normal file
View File

@@ -0,0 +1,33 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) gitUsername gitEmail;
in
{
programs.git = {
enable = true;
userName = "${gitUsername}";
userEmail = "${gitEmail}";
extraConfig = {
# FOSS-friendly settings
push.default = "simple"; # Match modern push behavior
credential.helper = "cache --timeout=7200";
init.defaultBranch = "main"; # Set default new branches to 'main'
log.decorate = "full"; # Show branch/tag info in git log
log.date = "iso"; # ISO 8601 date format
# Conflict resolution style for readable diffs
merge.conflictStyle = "diff3";
};
# Optional: FOSS-friendly Git aliases
aliases = {
br = "branch --sort=-committerdate";
co = "checkout";
df = "diff";
com = "commit -a";
gs = "stash";
gp = "pull";
lg = "log --graph --pretty=format:'%Cred%h%Creset - %C(yellow)%d%Creset %s %C(green)(%cr)%C(bold blue) <%an>%Creset' --abbrev-commit";
st = "status";
};
};
}

16
modules/home/gtk.nix Normal file
View File

@@ -0,0 +1,16 @@
{ pkgs, ... }:
{
gtk = {
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
};
}

42
modules/home/htop.nix Normal file
View File

@@ -0,0 +1,42 @@
{ config, ... }: {
programs.htop = {
enable = true;
settings =
{
color_scheme = 6;
cpu_count_from_one = 0;
delay = 15;
fields = with config.lib.htop.fields; [
PID
USER
PRIORITY
NICE
M_SIZE
M_RESIDENT
M_SHARE
STATE
PERCENT_CPU
PERCENT_MEM
TIME
COMM
];
highlight_base_name = 1;
highlight_megabytes = 1;
highlight_threads = 1;
}
// (with config.lib.htop;
leftMeters [
(bar "AllCPUs2")
(bar "Memory")
(bar "Swap")
(text "Zram")
])
// (with config.lib.htop;
rightMeters [
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
(text "Systemd")
]);
};
}

View File

@@ -0,0 +1,22 @@
{ ... }: {
wayland.windowManager.hyprland.settings = {
animations = {
enabled = true;
bezier = [
"wind, -1.05, 0.9, 0.1, 1.05"
"winIn, -1.1, 1.1, 0.1, 1.1"
"winOut, -1.3, -0.3, 0, 1"
"liner, 0, 1, 1, 1"
];
animation = [
"windows, 0, 6, wind, slide"
"windowsIn, 0, 6, winIn, slide"
"windowsOut, 0, 5, winOut, slide"
"windowsMove, 0, 5, wind, slide"
"border, 0, 1, liner"
"fade, 0, 10, default"
"workspaces, 0, 5, wind"
];
};
};
}

View File

@@ -0,0 +1,25 @@
{ ... }: {
wayland.windowManager.hyprland.settings = {
# name "Dynamic"
# credit https://github.com/mylinuxforwork/dotfiles
animations = {
enabled = true;
bezier = [
"wind, 0.05, 0.9, 0.1, 1.05"
"winIn, 0.1, 1.1, 0.1, 1.1"
"winOut, 0.3, -0.3, 0, 1"
"liner, 1, 1, 1, 1"
];
animation = [
"windows, 1, 6, wind, slide"
"windowsIn, 1, 6, winIn, slide"
"windowsOut, 1, 5, winOut, slide"
"windowsMove, 1, 5, wind, slide"
"border, 1, 1, liner"
"borderangle, 1, 30, liner, loop"
"fade, 1, 10, default"
"workspaces, 1, 5, wind"
];
};
};
}

View File

@@ -0,0 +1,37 @@
{ ... }: {
wayland.windowManager.hyprland.settings = {
# Name: END-4
# Credit: END-4 project https://github.com/end-4/dots-hyprland
animations = {
enabled = true;
bezier = [
"linear, 0, 0, 1, 1"
"md3_standard, 0.2, 0, 0, 1"
"md3_decel, 0.05, 0.7, 0.1, 1"
"md3_accel, 0.3, 0, 0.8, 0.15"
"overshot, 0.05, 0.9, 0.1, 1.1"
"crazyshot, 0.1, 1.5, 0.76, 0.92 "
"hyprnostretch, 0.05, 0.9, 0.1, 1.0"
"menu_decel, 0.1, 1, 0, 1"
"menu_accel, 0.38, 0.04, 1, 0.07"
"easeInOutCirc, 0.85, 0, 0.15, 1"
"easeOutCirc, 0, 0.55, 0.45, 1"
"easeOutExpo, 0.16, 1, 0.3, 1"
"softAcDecel, 0.26, 0.26, 0.15, 1"
"md2, 0.4, 0, 0.2, 1 # use with .2s duration"
];
animation = [
"windows, 1, 3, md3_decel, popin 60%"
"windowsIn, 1, 3, md3_decel, popin 60%"
"windowsOut, 1, 3, md3_accel, popin 60%"
"border, 1, 10, default"
"fade, 1, 3, md3_decel"
"layersIn, 1, 3, menu_decel, slide"
"layersOut, 1, 1.6, menu_accel"
"fadeLayersIn, 1, 2, menu_decel"
"fadeLayersOut, 1, 4.5, menu_accel"
"workspaces, 1, 7, menu_decel, slide"
];
};
};
}

View File

@@ -0,0 +1,24 @@
{ ... }: {
wayland.windowManager.hyprland.settings = {
# name "moving"
# credit https://github.com/mylinuxforwork/dotfiles
animations = {
enabled = true;
bezier = [
"overshot, 0.05, 0.9, 0.1, 1.05"
"smoothOut, 0.5, 0, 0.99, 0.99"
"smoothIn, 0.5, -0.5, 0.68, 1.5"
];
animation = [
"windows, 1, 5, overshot, slide"
"windowsOut, 1, 3, smoothOut"
"windowsIn, 1, 3, smoothOut"
"windowsMove, 1, 4, smoothIn, slide"
"border, 1, 5, default"
"fade, 1, 5, smoothIn"
"fadeDim, 1, 5, smoothIn"
"workspaces, 1, 6, default"
];
};
};
}

View File

@@ -0,0 +1,106 @@
{ host, ... }:
let
inherit
(import ../../../hosts/${host}/variables.nix)
browser
terminal
;
in
{
wayland.windowManager.hyprland.settings = {
bind = [
"$modifier,Return,exec,${terminal}"
"$modifier,K,exec,list-keybinds"
"$modifier SHIFT,Return,exec,rofi-launcher"
"$modifier ,R,exec,rofi-launcher"
"$modifier SHIFT,W,exec,web-search"
"$modifier ALT,W,exec,wallsetter"
"$modifier SHIFT,N,exec,swaync-client -rs"
"$modifier,W,exec,${browser}"
"$modifier,Y,exec,kitty -e yazi"
"$modifier,E,exec,emopicker9000"
"$modifier,S,exec,screenshootin"
"$modifier,D,exec,discord"
"$modifier,O,exec,obs"
"$modifier,C,exec,hyprpicker -a"
"$modifier,G,exec,gimp"
"$modifier shift,T,exec,pypr toggle term"
"$modifier,T,exec, thunar"
"$modifier,M,exec,pavucontrol"
"$modifier,Q,killactive,"
"$modifier,P,pseudo,"
"$modifier,V,exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy"
"$modifier SHIFT,I,togglesplit,"
"$modifier,F,fullscreen,"
"$modifier SHIFT,F,togglefloating,"
"$modifier ALT,F,workspaceopt, allfloat"
"$modifier SHIFT,C,exit,"
"$modifier SHIFT,left,movewindow,l"
"$modifier SHIFT,right,movewindow,r"
"$modifier SHIFT,up,movewindow,u"
"$modifier SHIFT,down,movewindow,d"
"$modifier SHIFT,h,movewindow,l"
"$modifier SHIFT,l,movewindow,r"
"$modifier SHIFT,k,movewindow,u"
"$modifier SHIFT,j,movewindow,d"
"$modifier ALT, left, swapwindow,l"
"$modifier ALT, right, swapwindow,r"
"$modifier ALT, up, swapwindow,u"
"$modifier ALT, down, swapwindow,d"
"$modifier ALT, 43, swapwindow,l"
"$modifier ALT, 46, swapwindow,r"
"$modifier ALT, 45, swapwindow,u"
"$modifier ALT, 44, swapwindow,d"
"$modifier,left,movefocus,l"
"$modifier,right,movefocus,r"
"$modifier,up,movefocus,u"
"$modifier,down,movefocus,d"
"$modifier,h,movefocus,l"
"$modifier,l,movefocus,r"
"$modifier,k,movefocus,u"
"$modifier,j,movefocus,d"
"$modifier,1,workspace,1"
"$modifier,2,workspace,2"
"$modifier,3,workspace,3"
"$modifier,4,workspace,4"
"$modifier,5,workspace,5"
"$modifier,6,workspace,6"
"$modifier,7,workspace,7"
"$modifier,8,workspace,8"
"$modifier,9,workspace,9"
"$modifier,0,workspace,10"
"$modifier SHIFT,SPACE,movetoworkspace,special"
"$modifier,SPACE,togglespecialworkspace"
"$modifier SHIFT,1,movetoworkspace,1"
"$modifier SHIFT,2,movetoworkspace,2"
"$modifier SHIFT,3,movetoworkspace,3"
"$modifier SHIFT,4,movetoworkspace,4"
"$modifier SHIFT,5,movetoworkspace,5"
"$modifier SHIFT,6,movetoworkspace,6"
"$modifier SHIFT,7,movetoworkspace,7"
"$modifier SHIFT,8,movetoworkspace,8"
"$modifier SHIFT,9,movetoworkspace,9"
"$modifier SHIFT,0,movetoworkspace,10"
"$modifier CONTROL,right,workspace,e+1"
"$modifier CONTROL,left,workspace,e-1"
"$modifier,mouse_down,workspace, e+1"
"$modifier,mouse_up,workspace, e-1"
"ALT,Tab,cyclenext"
"ALT,Tab,bringactivetotop"
",XF86AudioRaiseVolume,exec,wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume,exec,wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
" ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86AudioPlay, exec, playerctl play-pause"
",XF86AudioPause, exec, playerctl play-pause"
",XF86AudioNext, exec, playerctl next"
",XF86AudioPrev, exec, playerctl previous"
",XF86MonBrightnessDown,exec,brightnessctl set 5%-"
",XF86MonBrightnessUp,exec,brightnessctl set +5%"
];
bindm = [
"$modifier, mouse:272, movewindow"
"$modifier, mouse:273, resizewindow"
];
};
}

View File

@@ -0,0 +1,17 @@
{ host, ... }:
let
inherit (import ../../../hosts/${host}/variables.nix) animChoice;
in
{
imports = [
animChoice
./binds.nix
./env.nix
./exec-once.nix
./hypridle.nix
./hyprland.nix
./hyprlock.nix
./pyprland.nix
./windowrules.nix
];
}

View File

@@ -0,0 +1,36 @@
{ ... }: {
wayland.windowManager.hyprland = {
settings = {
env = [
"NIXOS_OZONE_WL, 1"
"NIXPKGS_ALLOW_UNFREE, 1"
"XDG_CURRENT_DESKTOP, Hyprland"
"XDG_SESSION_TYPE, wayland"
"XDG_SESSION_DESKTOP, Hyprland"
"GDK_BACKEND, wayland, x11"
"CLUTTER_BACKEND, wayland"
"QT_QPA_PLATFORM=wayland;xcb"
"QT_WAYLAND_DISABLE_WINDOWDECORATION, 1"
"QT_AUTO_SCREEN_SCALE_FACTOR, 1"
"SDL_VIDEODRIVER, x11"
"MOZ_ENABLE_WAYLAND, 1"
# This is to make electron apps start in wayland
"ELECTRON_OZONE_PLATFORM_HINT,wayland"
# Disabling this by default as it can result in inop cfg
# Added card2 in case this gets enabled. For better coverage
# This is mostly needed by Hybrid laptops.
# but if you have multiple discrete GPUs this will set order
#"AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1:/dev/card2"
"GDK_SCALE,1"
"QT_SCALE_FACTOR,1"
"EDITOR,nvim"
# Set terminal and xdg_terminal_emulator to kitty
# To provent yazi from starting xterm when run from rofi menu
# You can set to your preferred terminal if you you like
# ToDo: Pull default terminal from config
"TERMINAL,kitty"
"XDG_TERMINAL_EMULATOR,kitty"
];
};
};
}

View File

@@ -0,0 +1,27 @@
{ host, ... }:
let
inherit
(import ../../../hosts/${host}/variables.nix)
stylixImage
;
in
{
wayland.windowManager.hyprland.settings = {
exec-once = [
"wl-paste --type text --watch cliphist store" # Saves text
"wl-paste --type image --watch cliphist store" # Saves images
"dbus-update-activation-environment --all --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
"
"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"systemctl --user start hyprpolkitagent"
"killall -q swww;sleep .5 && swww-daemon"
"killall -q waybar;sleep .5 && waybar"
"killall -q swaync;sleep .5 && swaync"
"#wallsetter &"
"pypr &"
"nm-applet --indicator"
"sleep 1.0 && swww img ${stylixImage}"
];
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -0,0 +1,27 @@
{ ... }:
{
services = {
hypridle = {
enable = true;
settings = {
general = {
after_sleep_cmd = "hyprctl dispatch dpms on";
ignore_dbus_inhibit = false;
lock_cmd = "hyprlock";
};
listener = [
{
timeout = 900;
on-timeout = "hyprlock";
}
{
timeout = 1200;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
];
};
};
};
}

View File

@@ -0,0 +1,171 @@
{ host
, config
, pkgs
, ...
}:
let
inherit
(import ../../../hosts/${host}/variables.nix)
extraMonitorSettings
keyboardLayout
stylixImage
;
in
{
home.packages = with pkgs; [
swww
grim
slurp
wl-clipboard
swappy
ydotool
hyprpolkitagent
hyprland-qtutils # needed for banners and ANR messages
];
systemd.user.targets.hyprland-session.Unit.Wants = [
"xdg-desktop-autostart.target"
];
# Place Files Inside Home Directory
home.file = {
"Pictures/Wallpapers" = {
source = ../../../wallpapers;
recursive = true;
};
".face.icon".source = ./face.jpg;
".config/face.jpg".source = ./face.jpg;
};
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.hyprland;
systemd = {
enable = true;
enableXdgAutostart = true;
variables = [ "--all" ];
};
xwayland = {
enable = true;
};
settings = {
input = {
kb_layout = "${keyboardLayout}";
kb_options = [
"grp:alt_caps_toggle"
"caps:super"
];
numlock_by_default = true;
repeat_delay = 300;
follow_mouse = 1;
float_switch_override_focus = 0;
sensitivity = 0;
touchpad = {
natural_scroll = true;
disable_while_typing = true;
scroll_factor = 0.8;
};
};
gestures = {
workspace_swipe = 1;
workspace_swipe_fingers = 3;
workspace_swipe_distance = 500;
workspace_swipe_invert = 1;
workspace_swipe_min_speed_to_force = 30;
workspace_swipe_cancel_ratio = 0.5;
workspace_swipe_create_new = 1;
workspace_swipe_forever = 1;
};
general = {
"$modifier" = "SUPER";
layout = "dwindle";
gaps_in = 6;
gaps_out = 8;
border_size = 2;
resize_on_border = true;
"col.active_border" = "rgb(${config.lib.stylix.colors.base08}) rgb(${config.lib.stylix.colors.base0C}) 45deg";
"col.inactive_border" = "rgb(${config.lib.stylix.colors.base01})";
};
misc = {
layers_hog_keyboard_focus = true;
initial_workspace_tracking = 0;
mouse_move_enables_dpms = true;
key_press_enables_dpms = false;
disable_hyprland_logo = true;
disable_splash_rendering = true;
enable_swallow = false;
vfr = true; # Variable Frame Rate
vrr = 2; #Variable Refresh Rate Might need to set to 0 for NVIDIA/AQ_DRM_DEVICES
# Screen flashing to black momentarily or going black when app is fullscreen
# Try setting vrr to 0
# Application not responding (ANR) settings
enable_anr_dialog = true;
anr_missed_pings = 15;
};
dwindle = {
pseudotile = true;
preserve_split = true;
force_split = 2;
};
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 5;
passes = 3;
ignore_opacity = false;
new_optimizations = true;
};
shadow = {
enabled = true;
range = 4;
render_power = 3;
color = "rgba(1a1a1aee)";
};
};
ecosystem = {
no_donation_nag = true;
no_update_news = false;
};
cursor = {
sync_gsettings_theme = true;
no_hardware_cursors = 2; # change to 1 if want to disable
enable_hyprcursor = false;
warp_on_change_workspace = 2;
no_warps = true;
};
render = {
# Disabling as no longer supported
#explicit_sync = 1; # Change to 1 to disable
#explicit_sync_kms = 1;
direct_scanout = 0;
};
master = {
new_status = "master";
new_on_top = 1;
mfact = 0.5;
};
# Ensure Xwayland windows render at integer scale; compositor scales them
xwayland = {
force_zero_scaling = true;
};
};
extraConfig = "
monitor=,preferred,auto,auto
monitor=Virtual-1,1920x1080@60,auto,1
${extraMonitorSettings}
# To enable blur on waybar uncomment the line below
# Thanks to SchotjeChrisman
#layerrule = blur,waybar
";
};
}

View File

@@ -0,0 +1,47 @@
{ username, ... }: {
programs.hyprlock = {
enable = true;
settings = {
general = {
disable_loading_bar = true;
grace = 10;
hide_cursor = true;
no_fade_in = false;
};
background = [
{
path = "/home/${username}/Pictures/Wallpapers/beautifulmountainscape.jpg";
blur_passes = 3;
blur_size = 8;
}
];
image = [
{
path = "/home/${username}/.config/face.jpg";
size = 150;
border_size = 4;
border_color = "rgb(0C96F9)";
rounding = -1; # Negative means circle
position = "0, 200";
halign = "center";
valign = "center";
}
];
input-field = [
{
size = "200, 50";
position = "0, -80";
monitor = "";
dots_center = true;
fade_on_empty = false;
font_color = "rgb(CFE6F4)";
inner_color = "rgb(657DC2)";
outer_color = "rgb(0D0E15)";
outline_thickness = 5;
placeholder_text = "Password...";
shadow_passes = 2;
}
];
};
};
}

View File

@@ -0,0 +1,18 @@
{ pkgs, ... }: {
home.packages = with pkgs; [ pyprland ];
home.file.".config/hypr/pyprland.toml".text = ''
[pyprland]
plugins = [
"scratchpads",
]
[scratchpads.term]
animation = "fromTop"
command = "kitty --class kitty-dropterm"
class = "kitty-dropterm"
size = "70% 70%"
max_size = "1920px 100%"
position = "150px 150px"
'';
}

View File

@@ -0,0 +1,82 @@
{host, ...}: let
inherit
(import ../../../hosts/${host}/variables.nix)
extraMonitorSettings
;
in {
wayland.windowManager.hyprland = {
settings = {
windowrule = [
#"noblur, xwayland:1" # Helps prevent odd borders/shadows for xwayland apps
# downside it can impact other xwayland apps
# This rule is a template for a more targeted approach
"noblur, class:^(\bresolve\b)$, xwayland:1" # Window rule for just resolve
"tag +file-manager, class:^([Tt]hunar|org.gnome.Nautilus|[Pp]cmanfm-qt)$"
"tag +terminal, class:^(com.mitchellh.ghostty|org.wezfurlong.wezterm|Alacritty|kitty|kitty-dropterm)$"
"tag +browser, class:^(Brave-browser(-beta|-dev|-unstable)?)$"
"tag +browser, class:^([Ff]irefox|org.mozilla.firefox|[Ff]irefox-esr)$"
"tag +browser, class:^([Gg]oogle-chrome(-beta|-dev|-unstable)?)$"
"tag +browser, class:^([Tt]horium-browser|[Cc]achy-browser)$"
"tag +projects, class:^(codium|codium-url-handler|VSCodium)$"
"tag +projects, class:^(VSCode|code-url-handler)$"
"tag +im, class:^([Dd]iscord|[Ww]ebCord|[Vv]esktop)$"
"tag +im, class:^([Ff]erdium)$"
"tag +im, class:^([Ww]hatsapp-for-linux)$"
"tag +im, class:^(org.telegram.desktop|io.github.tdesktop_x64.TDesktop)$"
"tag +im, class:^(teams-for-linux)$"
"tag +games, class:^(gamescope)$"
"tag +games, class:^(steam_app_\d+)$"
"tag +gamestore, class:^([Ss]team)$"
"tag +gamestore, title:^([Ll]utris)$"
"tag +gamestore, class:^(com.heroicgameslauncher.hgl)$"
"tag +settings, class:^(gnome-disks|wihotspot(-gui)?)$"
"tag +settings, class:^([Rr]ofi)$"
"tag +settings, class:^(file-roller|org.gnome.FileRoller)$"
"tag +settings, class:^(nm-applet|nm-connection-editor|blueman-manager)$"
"tag +settings, class:^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$"
"tag +settings, class:^(nwg-look|qt5ct|qt6ct|[Yy]ad)$"
"tag +settings, class:(xdg-desktop-portal-gtk)"
"tag +settings, class:(.blueman-manager-wrapped)"
"tag +settings, class:(nwg-displays)"
"move 72% 7%,title:^(Picture-in-Picture)$"
"center, class:^([Ff]erdium)$"
"float, class:^([Ww]aypaper)$"
"center, class:^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$"
"center, class:([Tt]hunar), title:negative:(.*[Tt]hunar.*)"
"center, title:^(Authentication Required)$"
"idleinhibit fullscreen, class:^(*)$"
"idleinhibit fullscreen, title:^(*)$"
"idleinhibit fullscreen, fullscreen:1"
"float, tag:settings*"
"float, class:^([Ff]erdium)$"
"float, title:^(Picture-in-Picture)$"
"float, class:^(mpv|com.github.rafostar.Clapper)$"
"float, title:^(Authentication Required)$"
"float, class:(codium|codium-url-handler|VSCodium), title:negative:(.*codium.*|.*VSCodium.*)"
"float, class:^(com.heroicgameslauncher.hgl)$, title:negative:(Heroic Games Launcher)"
"float, class:^([Ss]team)$, title:negative:^([Ss]team)$"
"float, class:([Tt]hunar), title:negative:(.*[Tt]hunar.*)"
"float, initialTitle:(Add Folder to Workspace)"
"float, initialTitle:(Open Files)"
"float, initialTitle:(wants to save)"
"size 70% 60%, initialTitle:(Open Files)"
"size 70% 60%, initialTitle:(Add Folder to Workspace)"
"size 70% 70%, tag:settings*"
"size 60% 70%, class:^([Ff]erdium)$"
"opacity 1.0 1.0, tag:browser*"
"opacity 0.9 0.8, tag:projects*"
"opacity 0.94 0.86, tag:im*"
"opacity 0.9 0.8, tag:file-manager*"
"opacity 0.8 0.7, tag:terminal*"
"opacity 0.8 0.7, tag:settings*"
"opacity 0.8 0.7, class:^(gedit|org.gnome.TextEditor|mousepad)$"
"opacity 0.9 0.8, class:^(seahorse)$ # gnome-keyring gui"
"opacity 0.95 0.75, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
"keepaspectratio, title:^(Picture-in-Picture)$"
"noblur, tag:games*"
"fullscreen, tag:games*"
];
};
};
}

229
modules/home/install-zaneyos.sh Executable file
View File

@@ -0,0 +1,229 @@
#!/usr/bin/env bash
######################################
# Install script for zaneyos
# Author: Don Williams
# Date: June 27, 2005
#######################################
# Define colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
# Define log file
LOG_DIR="$(dirname "$0")"
LOG_FILE="${LOG_DIR}/install_$(date +"%Y-%m-%d_%H-%M-%S").log"
mkdir -p "$LOG_DIR"
exec > >(tee -a "$LOG_FILE") 2>&1
# Function to print a section header
print_header() {
echo -e "${GREEN}╔═══════════════════════════════════════════════════════════════════════╗${NC}"
echo -e "${GREEN}${1} ${NC}"
echo -e "${GREEN}╚═══════════════════════════════════════════════════════════════════════╝${NC}"
}
# Function to print an error message
print_error() {
echo -e "${RED}Error: ${1}${NC}"
}
# Function to print a success banner
print_success_banner() {
echo -e "${GREEN}╔═══════════════════════════════════════════════════════════════════════╗${NC}"
echo -e "${GREEN}║ zaneyos Installation Successful! ║${NC}"
echo -e "${GREEN}║ ║${NC}"
echo -e "${GREEN}║ Please reboot your system for changes to take full effect. ║${NC}"
echo -e "${GREEN}║ ║${NC}"
echo -e "${GREEN}╚═══════════════════════════════════════════════════════════════════════╝${NC}"
}
# Function to print a failure banner
print_failure_banner() {
echo -e "${RED}╔═══════════════════════════════════════════════════════════════════════╗${NC}"
echo -e "${RED}║ zaneyos Installation Failed! ║${NC}"
echo -e "${RED}║ ║${NC}"
echo -e "${RED}║ Please review the log file for details: ║${NC}"
echo -e "${RED}${LOG_FILE}${NC}"
echo -e "${RED}║ ║${NC}"
echo -e "${RED}╚═══════════════════════════════════════════════════════════════════════╝${NC}"
}
print_header "Verifying System Requirements"
# Check for git
if ! command -v git &> /dev/null; then
print_error "Git is not installed."
echo -e "Please install git and pciutils are installed, then re-run the install script."
echo -e "Example: nix-shell -p git pciutils"
exit 1
fi
# Check for lspci (pciutils)
if ! command -v lspci &> /dev/null; then
print_error "pciutils is not installed."
echo -e "Please install git and pciutils, then re-run the install script."
echo -e "Example: nix-shell -p git pciutils"
exit 1
fi
if [ -n "$(grep -i nixos < /etc/os-release)" ]; then
echo -e "${GREEN}Verified this is NixOS.${NC}"
else
print_error "This is not NixOS or the distribution information is not available."
exit 1
fi
print_header "Initial Setup"
echo -e "Default options are in brackets []"
echo -e "Just press enter to select the default"
sleep 2
print_header "Ensure In Home Directory"
cd "$HOME" || exit 1
echo -e "${GREEN}Current directory: $(pwd)${NC}"
print_header "Hostname Configuration"
read -rp "Enter Your New Hostname: [ default ] " hostName
if [ -z "$hostName" ]; then
hostName="default"
fi
print_header "GPU Profile Detection"
# Attempt automatic detection
DETECTED_PROFILE=""
has_nvidia=false
has_intel=false
has_amd=false
has_vm=false
if lspci | grep -qi 'vga\|3d'; then
while read -r line; do
if echo "$line" | grep -qi 'nvidia'; then
has_nvidia=true
elif echo "$line" | grep -qi 'amd'; then
has_amd=true
elif echo "$line" | grep -qi 'intel'; then
has_intel=true
elif echo "$line" | grep -qi 'virtio\|vmware'; then
has_vm=true
fi
done < <(lspci | grep -i 'vga\|3d')
if $has_vm; then
DETECTED_PROFILE="vm"
elif $has_nvidia && $has_intel; then
DETECTED_PROFILE="hybrid"
elif $has_nvidia; then
DETECTED_PROFILE="nvidia"
elif $has_amd; then
DETECTED_PROFILE="amd"
elif $has_intel; then
DETECTED_PROFILE="intel"
fi
fi
# Handle detected profile or fall back to manual input
if [ -n "$DETECTED_PROFILE" ]; then
profile="$DETECTED_PROFILE"
echo -e "${GREEN}Detected GPU profile: $profile${NC}"
read -p "Correct? (Y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo -e "${RED}GPU profile not confirmed. Falling back to manual selection.${NC}"
profile="" # Clear profile to force manual input
fi
fi
# If profile is still empty (either not detected or not confirmed), prompt manually
if [ -z "$profile" ]; then
echo -e "${RED}Automatic GPU detection failed or no specific profile found.${NC}"
read -rp "Enter Your Hardware Profile (GPU)\nOptions:\n[ amd ]\nnvidia\nnvidia-laptop\nintel\nvm\nPlease type out your choice: " profile
if [ -z "$profile" ]; then
profile="amd"
fi
echo -e "${GREEN}Selected GPU profile: $profile${NC}"
fi
print_header "Backup Existing zaneyos (if any)"
backupname=$(date +"%Y-%m-%d-%H-%M-%S")
if [ -d "zaneyos" ]; then
echo -e "${GREEN}zaneyos exists, backing up to .config/zaneyos-backups folder.${NC}"
if [ -d ".config/zaneyos-backups" ]; then
echo -e "${GREEN}Moving current version of zaneyos to backups folder.${NC}"
mv "$HOME"/zaneyos .config/zaneyos-backups/"$backupname"
sleep 1
else
echo -e "${GREEN}Creating the backups folder & moving zaneyos to it.${NC}"
mkdir -p .config/zaneyos-backups
mv "$HOME"/zaneyos .config/zaneyos-backups/"$backupname"
sleep 1
fi
else
echo -e "${GREEN}Thank you for choosing zaneyos.${NC}"
echo -e "${GREEN}I hope you find your time here enjoyable!${NC}"
fi
print_header "Cloning zaneyos Repository"
git clone https://gitlab.com/dwilliam62/zaneyos.git --depth=1 ~/zaneyos
cd ~/zaneyos || exit 1
print_header "Configuring Host and Profile"
mkdir -p hosts/"$hostName"
cp hosts/default/*.nix hosts/"$hostName"
installusername=$(echo $USER)
git config --global user.name "$installusername"
git config --global user.email "$installusername@gmail.com"
git add .
git config --global --unset-all user.name
git config --global --unset-all user.email
sed -i "/^[[:space:]]*host[[:space:]]*=[[:space:]]*\"/ s/\"[^\"]*\"/\"$hostName\"/" ./flake.nix
sed -i "/^[[:space:]]*profile[[:space:]]*=[[:space:]]*\"/ s/\"[^\"]*\"/\"$profile\"/" ./flake.nix
print_header "Keyboard Layout Configuration"
read -rp "Enter your keyboard layout: [ us ] " keyboardLayout
if [ -z "$keyboardLayout" ]; then
keyboardLayout="us"
fi
sed -i "/^[[:space:]]*keyboardLayout[[:space:]]*=[[:space:]]*\"/ s/\"[^\"]*\"/\"$keyboardLayout\"/" ./hosts/$hostName/variables.nix
print_header "Console Keymap Configuration"
read -rp "Enter your console keymap: [ us ] " consoleKeyMap
if [ -z "$consoleKeyMap" ]; then
consoleKeyMap="us"
fi
sed -i "/^[[:space:]]*consoleKeyMap[[:space:]]*=[[:space:]]*\"/ s/\"[^\"]*\"/\"$consoleKeyMap\"/" ./hosts/$hostName/variables.nix
print_header "Username Configuration"
sed -i "/^[[:space:]]*username[[:space:]]*=[[:space:]]*\"/ s/\"[^\"]*\"/\"$installusername\"/" ./flake.nix
print_header "Generating Hardware Configuration -- Ignore ERROR: cannot access /bin"
sudo nixos-generate-config --show-hardware-config > ./hosts/$hostName/hardware.nix
print_header "Setting Nix Configuration"
NIX_CONFIG="experimental-features = nix-command flakes"
print_header "Initiating NixOS Build"
read -p "Ready to run initial build? (Y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo -e "${RED}Build cancelled.${NC}"
exit 1
fi
sudo nixos-rebuild boot --flake ~/zaneyos/#${profile}
# Check the exit status of the last command (nixos-rebuild)
if [ $? -eq 0 ]; then
print_success_banner
else
print_failure_banner
fi

75
modules/home/kitty.nix Normal file
View File

@@ -0,0 +1,75 @@
{ pkgs, ... }: {
programs.kitty = {
enable = true;
package = pkgs.kitty;
settings = {
font_size = 12;
wheel_scroll_min_lines = 1;
window_padding_width = 4;
confirm_os_window_close = 0;
scrollback_lines = 10000;
enable_audio_bell = false;
mouse_hide_wait = 60;
cursor_trail = 1;
tab_fade = 1;
active_tab_font_style = "bold";
inactive_tab_font_style = "bold";
tab_bar_edge = "top";
tab_bar_margin_width = 0;
tab_bar_style = "powerline";
#tab_bar_style = "fade";
enabled_layouts = "splits";
};
extraConfig = ''
# Clipboard
map ctrl+shift+v paste_from_selection
map shift+insert paste_from_selection
# Scrolling
map ctrl+shift+up scroll_line_up
map ctrl+shift+down scroll_line_down
map ctrl+shift+k scroll_line_up
map ctrl+shift+j scroll_line_down
map ctrl+shift+page_up scroll_page_up
map ctrl+shift+page_down scroll_page_down
map ctrl+shift+home scroll_home
map ctrl+shift+end scroll_end
map ctrl+shift+h show_scrollback
# Window management
map alt+n new_window_with_cwd #open in current dir
#map alt+n new_os_window #opens term in $HOME
map alt+w close_window
map ctrl+shift+enter launch --location=hsplit
map ctrl+shift+s launch --location=vsplit
map ctrl+shift+] next_window
map ctrl+shift+[ previous_window
map ctrl+shift+f move_window_forward
map ctrl+shift+b move_window_backward
map ctrl+shift+` move_window_to_top
map ctrl+shift+1 first_window
map ctrl+shift+2 second_window
map ctrl+shift+3 third_window
map ctrl+shift+4 fourth_window
map ctrl+shift+5 fifth_window
map ctrl+shift+6 sixth_window
map ctrl+shift+7 seventh_window
map ctrl+shift+8 eighth_window
map ctrl+shift+9 ninth_window # Tab management
map ctrl+shift+0 tenth_window
map ctrl+shift+right next_tab
map ctrl+shift+left previous_tab
map ctrl+shift+t new_tab
map ctrl+shift+q close_tab
map ctrl+shift+l next_layout
map ctrl+shift+. move_tab_forward
map ctrl+shift+, move_tab_backward
# Miscellaneous
map ctrl+shift+up increase_font_size
map ctrl+shift+down decrease_font_size
map ctrl+shift+backspace restore_font_size
'';
};
}

32
modules/home/lazygit.nix Normal file
View File

@@ -0,0 +1,32 @@
# Lazygit is a simple terminal UI for git commands.
{ config, lib, ... }:
let
accent = "#${config.lib.stylix.colors.base0D}";
muted = "#${config.lib.stylix.colors.base03}";
in
{
programs.lazygit = {
enable = true;
settings = lib.mkForce {
disableStartupPopups = true;
notARepository = "skip";
promptToReturnFromSubprocess = false;
update.method = "never";
git = {
commit.signOff = true;
parseEmoji = true;
};
gui = {
theme = {
activeBorderColor = [ accent "bold" ];
inactiveBorderColor = [ muted ];
};
showListFooter = false;
showRandomTip = false;
showCommandLog = false;
showBottomLine = false;
nerdFontsVersion = "3";
};
};
};
}

268
modules/home/nvf.nix Normal file
View File

@@ -0,0 +1,268 @@
{ inputs
, config
, ...
}: {
imports = [ inputs.nvf.homeManagerModules.default ];
programs.nvf = {
enable = true;
settings.vim = {
lsp.enable = true;
vimAlias = true;
viAlias = true;
withNodeJs = true;
lineNumberMode = "relNumber";
enableLuaLoader = true;
preventJunkFiles = true;
options = {
tabstop = 4;
shiftwidth = 2;
wrap = false;
};
clipboard = {
enable = true;
registers = "unnamedplus";
providers = {
wl-copy.enable = true;
xsel.enable = true;
};
};
maps = {
normal = {
"<leader>e" = {
action = "<CMD>Neotree toggle<CR>";
silent = false;
};
};
};
diagnostics = {
enable = true;
config = {
virtual_lines.enable = true;
underline = true;
};
};
keymaps = [
{
key = "jk";
mode = [ "i" ];
action = "<ESC>";
desc = "Exit insert mode";
}
{
key = "<leader>nh";
mode = [ "n" ];
action = ":nohl<CR>";
desc = "Clear search highlights";
}
{
key = "<leader>ff";
mode = [ "n" ];
action = "<cmd>Telescope find_files<cr>";
desc = "Search files by name";
}
{
key = "<leader>lg";
mode = [ "n" ];
action = "<cmd>Telescope live_grep<cr>";
desc = "Search files by contents";
}
{
key = "<leader>fe";
mode = [ "n" ];
action = "<cmd>Neotree toggle<cr>";
desc = "File browser toggle";
}
{
key = "<C-h>";
mode = [ "i" ];
action = "<Left>";
desc = "Move left in insert mode";
}
{
key = "<C-j>";
mode = [ "i" ];
action = "<Down>";
desc = "Move down in insert mode";
}
{
key = "<C-k>";
mode = [ "i" ];
action = "<Up>";
desc = "Move up in insert mode";
}
{
key = "<C-l>";
mode = [ "i" ];
action = "<Right>";
desc = "Move right in insert mode";
}
];
telescope.enable = true;
spellcheck = {
enable = true;
languages = [ "en" ];
programmingWordlist.enable = true;
};
lsp = {
formatOnSave = true;
lspkind.enable = false;
lightbulb.enable = false;
lspsaga.enable = false;
trouble.enable = true;
lspSignature.enable = true;
otter-nvim.enable = false;
nvim-docs-view.enable = false;
};
languages = {
enableFormat = true;
enableTreesitter = true;
enableExtraDiagnostics = true;
nix.enable = true;
clang.enable = true;
zig.enable = true;
python.enable = true;
markdown.enable = true;
ts = {
enable = true;
lsp.enable = true;
format.type = "prettierd";
extensions.ts-error-translator.enable = true;
};
html.enable = true;
lua.enable = true;
css = {
enable = true;
format.type = "prettierd";
};
typst.enable = true;
rust = {
enable = true;
crates.enable = true;
};
};
visuals = {
nvim-web-devicons.enable = true;
nvim-cursorline.enable = true;
cinnamon-nvim.enable = true;
fidget-nvim.enable = true;
highlight-undo.enable = true;
indent-blankline.enable = true;
rainbow-delimiters.enable = true;
};
statusline.lualine = {
enable = true;
theme = "base16";
};
autopairs.nvim-autopairs.enable = true;
autocomplete.nvim-cmp.enable = true;
snippets.luasnip.enable = true;
tabline.nvimBufferline.enable = true;
treesitter.context.enable = false;
binds = {
whichKey.enable = true;
cheatsheet.enable = true;
};
git = {
enable = true;
gitsigns.enable = true;
gitsigns.codeActions.enable = false;
};
projects.project-nvim.enable = true;
dashboard.dashboard-nvim.enable = true;
filetree.neo-tree.enable = true;
notify = {
nvim-notify.enable = true;
nvim-notify.setupOpts.background_colour = "#${config.lib.stylix.colors.base01}";
};
utility = {
preview.markdownPreview.enable = true;
ccc.enable = false;
vim-wakatime.enable = false;
icon-picker.enable = true;
surround.enable = true;
diffview-nvim.enable = true;
motion = {
hop.enable = true;
leap.enable = true;
precognition.enable = false;
};
images = {
image-nvim.enable = false;
};
};
ui = {
borders.enable = true;
noice.enable = true;
colorizer.enable = true;
illuminate.enable = true;
breadcrumbs = {
enable = false;
navbuddy.enable = false;
};
smartcolumn = {
enable = true;
};
fastaction.enable = true;
};
session = {
nvim-session-manager.enable = false;
};
comments = {
comment-nvim.enable = true;
};
luaConfigPost = ''
-- Nix LSP (nil) configuration for auto-eval-inputs
local lspconfig = require('lspconfig')
lspconfig.nil_ls.setup({
settings = {
['nil'] = {
nix = {
auto_eval_inputs = true,
},
},
},
})
-- Auto-update programming wordlist on first startup
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
-- Check if dirtytalk dict file exists
local dict_path = vim.fn.stdpath('data') .. '/site/spell/programming.utf-8.add'
if vim.fn.filereadable(dict_path) == 0 then
-- Only run if file doesn't exist to avoid repeated downloads
vim.schedule(function()
vim.cmd('DirtytalkUpdate')
end)
end
end,
})
'';
};
};
home.activation = {
dirtytalkUpdate = ''
# Create the spell directory if it doesn't exist
mkdir -p "$HOME/.local/share/nvim/site/spell"
# Try to run DirtytalkUpdate in headless mode with better error handling
if ! ${config.programs.nvf.finalPackage}/bin/nvim --headless -c "DirtytalkUpdate" -c "qa!" 2>/dev/null; then
echo "Note: DirtytalkUpdate will run automatically on first Neovim startup"
fi
'';
};
}

View File

@@ -0,0 +1,15 @@
{ pkgs, ... }: {
programs.obs-studio = {
enable = true;
#enableVirtualCamera = true;
plugins = with pkgs.obs-studio-plugins; [
wlrobs
obs-pipewire-audio-capture
obs-vkcapture
obs-source-clone
obs-move-transition
obs-composite-blur
obs-backgroundremoval
];
};
}

6
modules/home/qt.nix Normal file
View File

@@ -0,0 +1,6 @@
{ lib, ... }: {
qt = {
enable = true;
platformTheme.name = lib.mkForce "qtct";
};
}

View File

@@ -0,0 +1,49 @@
{ ... }: {
home.file.".config/rofi/config-long.rasi".text = ''
@import "~/.config/rofi/config.rasi"
window {
width: 750px;
border-radius: 20px;
}
mainbox {
orientation: vertical;
children: [ "inputbar", "listbox" ];
}
inputbar {
padding: 75px 40px;
background-color: transparent;
background-image: url("~/Pictures/Wallpapers/Rainnight.jpg", width);
text-color: @foreground;
children: [ "textbox-prompt-colon", "entry" ];
}
textbox-prompt-colon {
padding: 12px 20px;
border-radius: 100%;
background-color: @bg-alt;
text-color: @foreground;
}
entry {
expand: true;
padding: 12px 16px;
border-radius: 100%;
background-color: @bg-alt;
text-color: @foreground;
}
button {
padding: 12px;
border-radius: 100%;
}
element {
spacing: 10px;
padding: 12px;
border-radius: 100%;
}
textbox {
padding: 12px;
border-radius: 100%;
}
error-message {
border-radius: 0px;
}
'';
}

View File

@@ -0,0 +1,6 @@
{ ... }: {
imports = [
./config-long.nix
./rofi.nix
];
}

208
modules/home/rofi/rofi.nix Normal file
View File

@@ -0,0 +1,208 @@
{ pkgs
, config
, ...
}: {
programs = {
rofi = {
enable = true;
package = pkgs.rofi-wayland;
extraConfig = {
modi = "drun,filebrowser,run";
show-icons = true;
icon-theme = "Papirus";
font = "JetBrainsMono Nerd Font Mono 12";
drun-display-format = "{icon} {name}";
display-drun = " Apps";
display-run = " Run";
display-filebrowser = " File";
};
theme =
let
inherit (config.lib.formats.rasi) mkLiteral;
in
{
"*" = {
bg = mkLiteral "#${config.stylix.base16Scheme.base00}";
bg-alt = mkLiteral "#${config.stylix.base16Scheme.base09}";
foreground = mkLiteral "#${config.stylix.base16Scheme.base01}";
selected = mkLiteral "#${config.stylix.base16Scheme.base08}";
active = mkLiteral "#${config.stylix.base16Scheme.base0B}";
text-selected = mkLiteral "#${config.stylix.base16Scheme.base00}";
text-color = mkLiteral "#${config.stylix.base16Scheme.base05}";
border-color = mkLiteral "#${config.stylix.base16Scheme.base0F}";
urgent = mkLiteral "#${config.stylix.base16Scheme.base0E}";
};
"window" = {
transparency = "real";
width = mkLiteral "1000px";
location = mkLiteral "center";
anchor = mkLiteral "center";
fullscreen = false;
x-offset = mkLiteral "0px";
y-offset = mkLiteral "0px";
cursor = "default";
enabled = true;
border-radius = mkLiteral "15px";
background-color = mkLiteral "@bg";
};
"mainbox" = {
enabled = true;
spacing = mkLiteral "0px";
orientation = mkLiteral "horizontal";
children = map mkLiteral [
"imagebox"
"listbox"
];
background-color = mkLiteral "transparent";
};
"imagebox" = {
padding = mkLiteral "20px";
background-color = mkLiteral "transparent";
background-image = mkLiteral ''url("~/Pictures/Wallpapers/Rainnight.jpg", height)'';
orientation = mkLiteral "vertical";
children = map mkLiteral [
"inputbar"
"dummy"
"mode-switcher"
];
};
"listbox" = {
spacing = mkLiteral "20px";
padding = mkLiteral "20px";
background-color = mkLiteral "transparent";
orientation = mkLiteral "vertical";
children = map mkLiteral [
"message"
"listview"
];
};
"dummy" = {
background-color = mkLiteral "transparent";
};
"inputbar" = {
enabled = true;
spacing = mkLiteral "10px";
padding = mkLiteral "10px";
border-radius = mkLiteral "10px";
background-color = mkLiteral "@bg-alt";
text-color = mkLiteral "@foreground";
children = map mkLiteral [
"textbox-prompt-colon"
"entry"
];
};
"textbox-prompt-colon" = {
enabled = true;
expand = false;
str = "";
background-color = mkLiteral "inherit";
text-color = mkLiteral "inherit";
};
"entry" = {
enabled = true;
background-color = mkLiteral "inherit";
text-color = mkLiteral "inherit";
cursor = mkLiteral "text";
placeholder = "Search";
placeholder-color = mkLiteral "inherit";
};
"mode-switcher" = {
enabled = true;
spacing = mkLiteral "20px";
background-color = mkLiteral "transparent";
text-color = mkLiteral "@foreground";
};
"button" = {
padding = mkLiteral "15px";
border-radius = mkLiteral "10px";
background-color = mkLiteral "@bg-alt";
text-color = mkLiteral "inherit";
cursor = mkLiteral "pointer";
};
"button selected" = {
background-color = mkLiteral "@selected";
text-color = mkLiteral "@foreground";
};
"listview" = {
enabled = true;
columns = 1;
lines = 8;
cycle = true;
dynamic = true;
scrollbar = false;
layout = mkLiteral "vertical";
reverse = false;
fixed-height = true;
fixed-columns = true;
spacing = mkLiteral "10px";
background-color = mkLiteral "transparent";
text-color = mkLiteral "@foreground";
cursor = "default";
};
"element" = {
enabled = true;
spacing = mkLiteral "15px";
padding = mkLiteral "8px";
border-radius = mkLiteral "10px";
background-color = mkLiteral "transparent";
text-color = mkLiteral "@text-color";
cursor = mkLiteral "pointer";
};
"element normal.normal" = {
background-color = mkLiteral "inherit";
text-color = mkLiteral "@text-color";
};
"element normal.urgent" = {
background-color = mkLiteral "@urgent";
text-color = mkLiteral "@text-color";
};
"element normal.active" = {
background-color = mkLiteral "inherit";
text-color = mkLiteral "@text-color";
};
"element selected.normal" = {
background-color = mkLiteral "@selected";
text-color = mkLiteral "@foreground";
};
"element selected.urgent" = {
background-color = mkLiteral "@urgent";
text-color = mkLiteral "@text-selected";
};
"element selected.active" = {
background-color = mkLiteral "@urgent";
text-color = mkLiteral "@text-selected";
};
"element-icon" = {
background-color = mkLiteral "transparent";
text-color = mkLiteral "inherit";
size = mkLiteral "36px";
cursor = mkLiteral "inherit";
};
"element-text" = {
background-color = mkLiteral "transparent";
text-color = mkLiteral "inherit";
cursor = mkLiteral "inherit";
vertical-align = mkLiteral "0.5";
horizontal-align = mkLiteral "0.0";
};
"message" = {
background-color = mkLiteral "transparent";
};
"textbox" = {
padding = mkLiteral "15px";
border-radius = mkLiteral "10px";
background-color = mkLiteral "@bg-alt";
text-color = mkLiteral "@foreground";
vertical-align = mkLiteral "0.5";
horizontal-align = mkLiteral "0.0";
};
"error-message" = {
padding = mkLiteral "15px";
border-radius = mkLiteral "20px";
background-color = mkLiteral "@bg";
text-color = mkLiteral "@foreground";
};
};
};
};
}

View File

@@ -0,0 +1,29 @@
{ pkgs
, username
, profile
, ...
}: {
home.packages = [
(import ./emopicker9000.nix { inherit pkgs; })
(import ./hm-find.nix { inherit pkgs; })
(import ./keybinds.nix { inherit pkgs; })
(import ./note.nix { inherit pkgs; })
(import ./note-from-clipboard.nix { inherit pkgs; })
(import ./nvidia-offload.nix { inherit pkgs; })
(import ./rofi-launcher.nix { inherit pkgs; })
(import ./screenshootin.nix { inherit pkgs; })
(import ./squirtle.nix { inherit pkgs; })
(import ./task-waybar.nix { inherit pkgs; })
(import ./wallsetter.nix {
inherit pkgs;
inherit username;
})
(import ./web-search.nix { inherit pkgs; })
(import ./zcli.nix {
inherit pkgs profile;
backupFiles = [
".config/mimeapps.list.backup"
];
})
];
}

View File

@@ -0,0 +1,22 @@
{ pkgs }:
pkgs.writeShellScriptBin "emopicker9000" ''
# check if rofi is already running
if pidof rofi > /dev/null; then
pkill rofi
fi
# Get user selection via wofi from emoji file.
chosen=$(cat $HOME/.config/.emoji | ${pkgs.rofi-wayland}/bin/rofi -i -dmenu -config ~/.config/rofi/config-long.rasi | awk '{print $1}')
# Exit if none chosen.
[ -z "$chosen" ] && exit
# If you run this command with an argument, it will automatically insert the
# character. Otherwise, show a message that the emoji has been copied.
if [ -n "$1" ]; then
${pkgs.ydotool}/bin/ydotool type "$chosen"
else
printf "$chosen" | ${pkgs.wl-clipboard}/bin/wl-copy
${pkgs.libnotify}/bin/notify-send "'$chosen' copied to clipboard." &
fi
''

View File

@@ -0,0 +1,37 @@
{ config, pkgs, ... }:
let
gemini-launcher = pkgs.writeShellScriptBin "gemini-launcher" ''
#!${pkgs.bash}/bin/bash
# Define the path to your API key file
KEY_FILE="${config.home.homeDirectory}/gem.key"
# Check if the key file exists and is readable
if [ -f "$KEY_FILE" ]; then
# Source the API key from the file.
source "$KEY_FILE"
# Launch Gemini directly; it will pick up the exported key.
exec ${pkgs.kitty}/bin/kitty -e ${pkgs.gemini-cli}/bin/gemini
else
# If the key file doesn't exist, launch kitty with an informational message, then start gemini.
exec ${pkgs.kitty}/bin/kitty -e bash -c "echo 'NOTE: Gemini API key file not found at ~/.gem.key.'; echo 'To use a key, create this file with content: export GEMINI_API_KEY=\"YOUR_KEY\"'; echo; echo 'Starting Gemini CLI, which will fall back to web-based login...'; echo; exec ${pkgs.gemini-cli}/bin/gemini"
fi
'';
in
{
home.packages = [
gemini-launcher
];
xdg.desktopEntries.gemini-cli = {
name = "Gemini CLI";
comment = "Launch the Gemini CLI in Kitty terminal";
icon = "utilities-terminal";
exec = "gemini-launcher";
terminal = false;
type = "Application";
categories = [ "Development" "Utility" ];
};
}

View File

@@ -0,0 +1,60 @@
{ pkgs }:
pkgs.writeShellScriptBin "hm-find" ''
#!/usr/bin/env bash
# Script Metadata
#===============================================
# This script searches recent journalctl entries for Home Manager errors
# It identifies backup files that prevent rebuilds and allows removal.
# Author: Don Williams
# Creation Date: May 6th, 2025
# Revision History:
#-----------------------------------------------
# 0.1 - 5/6/25 - Initial version
# 0.2 - 5/7/25 - Improved messaging, added log directory check
# Display WARNING message
echo "==============================================="
echo " WARNING "
echo "==============================================="
echo "*** This script is experimental! ***"
echo "It will attempt to find old backup files that are preventing Home Manager from rebuilding."
echo "If conflicting files are found, you will be prompted to remove them."
echo "A log of any deletions will be stored in \$HOME/hm-logs."
echo "==============================================="
# Define the time range (default: last 30 minutes)
TIME_RANGE="30m"
LOG_DIR="$HOME/hm-logs"
LOG_FILE="$LOG_DIR/hm-cleanup-$(date +'%Y-%m-%d_%H-%M-%S').log"
# Ensure the log directory exists
if [ ! -d "$LOG_DIR" ]; then
echo "Creating log directory: $LOG_DIR"
mkdir -p "$LOG_DIR"
fi
# Search journal logs for backup conflicts and extract file paths
FILES=$(journalctl --since "-$TIME_RANGE" -xe | grep hm-activate | awk -F "'|'" '/would be clobbered by backing up/ {print $2}')
# Check if any files were found
if [ -z "$FILES" ]; then
echo "No conflicting backup files found in the last $TIME_RANGE."
exit 0
fi
# Display found backup files
echo "🚨 The following backup files are preventing Home Manager from rebuilding:"
echo "$FILES" | tr ' ' '\n'
# Ask for user confirmation before deletion
read -p " Do you want to remove these files? (y/N): " confirm
if [[ "$confirm" == "y" || "$confirm" == "Y" ]]; then
echo "🗑 Deleting files..." | tee -a "$LOG_FILE"
echo "$FILES" | xargs rm -v | tee -a "$LOG_FILE"
echo " Cleanup completed at $(date)" | tee -a "$LOG_FILE"
else
echo " No files were removed." | tee -a "$LOG_FILE"
fi
''

View File

@@ -0,0 +1,17 @@
{ pkgs }:
pkgs.writeShellScriptBin "list-keybinds" ''
# check if rofi is already running
if pidof rofi > /dev/null; then
pkill rofi
fi
msg=' NOTE : Clicking with Mouse or Pressing ENTER will have NO function'
keybinds=$(cat ~/.config/hypr/hyprland.conf | grep -E '^bind')
# replace #modifier with SUPER in the displayed keybinds for rofi
display_keybinds=$(echo "$keybinds" | sed 's/\$modifier/SUPER/g')
# use rofi to display the keybinds with the modified content
echo "$display_keybinds" | rofi -dmenu -i -config ~/.config/rofi/config-long.rasi -mesg "$msg"
''

View File

@@ -0,0 +1,20 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "note-from-clipboard" ''
#!/usr/bin/env bash
# Check clipboard content type
clipboard_type=$(${pkgs.wl-clipboard}/bin/wl-paste --list-types | head -n 1)
if [[ "$clipboard_type" == "text/plain"* ]]; then
# It's text, let's create a note
${pkgs.wl-clipboard}/bin/wl-paste | note
if [ $? -eq 0 ]; then
${pkgs.libnotify}/bin/notify-send -t 3000 "📝 Note Created" "Clipboard content added as a new note."
else
${pkgs.libnotify}/bin/notify-send -t 5000 -u critical " Note Creation Failed" "There was an error creating the note."
fi
else
# It's not text, so we do nothing and notify the user
${pkgs.libnotify}/bin/notify-send -t 4000 -u low "📋 Note Skipped" "Clipboard does not contain text."
fi
''

View File

@@ -0,0 +1,244 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "note" ''
# Colors for nice output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
MAGENTA='\033[0;35m'
CYAN='\033[0;36m'
WHITE='\033[1;37m'
GRAY='\033[0;37m'
BOLD='\033[1m'
NC='\033[0m' # No Color
# XDG-compliant notes directory and file
NOTES_DIR="$HOME/.local/share/notes"
NOTES_FILE="$NOTES_DIR/notes.txt"
# Create notes directory if it doesn't exist
mkdir -p "$NOTES_DIR"
# Function to display usage
show_usage() {
echo -e "''${BOLD}''${BLUE}📝 Note Manager''${NC}"
echo -e "''${GRAY}Usage:''${NC}"
echo -e " ''${CYAN}note''${NC} ''${YELLOW}<text>''${NC} - Add a new note"
echo -e " ''${CYAN}note''${NC} - Display all notes"
echo -e " ''${CYAN}note del''${NC} ''${YELLOW}<number>''${NC} - Delete note by number"
echo -e " ''${CYAN}note clear''${NC} - Clear all notes"
echo -e " ''${CYAN}echo 'text' | note''${NC} - Add note from stdin"
echo -e " ''${CYAN}cat file | note''${NC} - Add file contents as note"
echo ""
echo -e "''${GRAY}Examples:''${NC}"
echo -e " ''${GREEN}note call plumber tomorrow''${NC}"
echo -e " ''${GREEN}cat todo.txt | note''${NC}"
echo -e " ''${GREEN}note del 3''${NC}"
}
# Function to add a note
add_note() {
local note_text="$1"
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
local date_only=$(date '+%Y-%m-%d')
# Create notes file if it doesn't exist
touch "$NOTES_FILE"
# Get next note number
local note_num=1
if [ -f "$NOTES_FILE" ] && [ -s "$NOTES_FILE" ]; then
note_num=$(grep -E "^#[0-9]+" "$NOTES_FILE" | sed 's/^#\([0-9]*\).*/\1/' | sort -n | tail -1)
note_num=$((note_num + 1))
fi
# Add the note with proper formatting
{
echo "#$note_num [$timestamp]"
echo "$note_text"
echo ""
} >> "$NOTES_FILE"
echo -e "''${GREEN}''${NC} Note #$note_num added ''${GRAY}($date_only)''${NC}"
}
# Function to display all notes
display_notes() {
if [ ! -f "$NOTES_FILE" ] || [ ! -s "$NOTES_FILE" ]; then
echo -e "''${YELLOW}📝 No notes found''${NC}"
echo -e "''${GRAY}Use ''${CYAN}note <text>''${GRAY} to add your first note''${NC}"
return
fi
echo -e "''${BOLD}''${BLUE}📝 Your Notes''${NC}"
echo -e "''${GRAY}📁 $NOTES_FILE''${NC}"
echo -e "''${GRAY}$(printf '%.0s' {1..50})''${NC}"
local in_note=false
local note_content=""
while IFS= read -r line; do
# Check if line starts with # followed by numbers and space and [
if echo "$line" | grep -q "^#[0-9][0-9]* \["; then
# Print previous note content if exists
if [ "$in_note" = true ] && [ -n "$note_content" ]; then
echo -e "$note_content"
echo ""
fi
# Extract note number and timestamp
local num=$(echo "$line" | sed 's/^#\([0-9]*\) \[.*/\1/')
local timestamp=$(echo "$line" | sed 's/^#[0-9]* \[\(.*\)\]/\1/')
local date_part=$(echo "$timestamp" | cut -d' ' -f1)
local time_part=$(echo "$timestamp" | cut -d' ' -f2)
echo -e "''${BOLD}''${CYAN}#$num''${NC} ''${GRAY}[$date_part ''${YELLOW}$time_part''${GRAY}]''${NC}"
in_note=true
note_content=""
elif [ -n "$line" ] && [ "$in_note" = true ]; then
# Accumulate note content
if [ -z "$note_content" ]; then
note_content="''${WHITE}$line''${NC}"
else
note_content="$note_content\n''${WHITE}$line''${NC}"
fi
elif [ -z "$line" ] && [ "$in_note" = true ]; then
# End of current note
if [ -n "$note_content" ]; then
echo -e "$note_content"
echo ""
fi
in_note=false
note_content=""
fi
done < "$NOTES_FILE"
# Print last note if file doesn't end with empty line
if [ "$in_note" = true ] && [ -n "$note_content" ]; then
echo -e "$note_content"
echo ""
fi
local total_notes=$(grep -c "^#[0-9]" "$NOTES_FILE")
echo -e "''${GRAY}$(printf '%.0s' {1..50})''${NC}"
echo -e "''${GRAY}Total: ''${BOLD}$total_notes''${NC} ''${GRAY}notes''${NC}"
}
# Function to delete a note
delete_note() {
local note_num="$1"
if [ ! -f "$NOTES_FILE" ] || [ ! -s "$NOTES_FILE" ]; then
echo -e "''${RED}''${NC} No notes found"
return 1
fi
if ! echo "$note_num" | grep -q "^[0-9][0-9]*$"; then
echo -e "''${RED}''${NC} Invalid note number: $note_num"
return 1
fi
# Check if note exists
if ! grep -q "^#$note_num " "$NOTES_FILE"; then
echo -e "''${RED}''${NC} Note #$note_num not found"
return 1
fi
# Create temporary file without the specified note
local temp_file=$(mktemp)
local skip_lines=false
while IFS= read -r line; do
if echo "$line" | grep -q "^#[0-9][0-9]* "; then
local current_num=$(echo "$line" | sed 's/^#\([0-9]*\) .*/\1/')
if [ "$current_num" = "$note_num" ]; then
skip_lines=true
continue
else
skip_lines=false
fi
fi
if [ "$skip_lines" = false ]; then
echo "$line" >> "$temp_file"
elif [ -z "$line" ]; then
# Stop skipping when we hit an empty line (end of note)
skip_lines=false
fi
done < "$NOTES_FILE"
mv "$temp_file" "$NOTES_FILE"
echo -e "''${GREEN}''${NC} Note #$note_num deleted"
}
# Function to clear all notes
clear_notes() {
if [ ! -f "$NOTES_FILE" ] || [ ! -s "$NOTES_FILE" ]; then
echo -e "''${YELLOW}📝 No notes to clear''${NC}"
return
fi
local total_notes=$(grep -c "^#[0-9]" "$NOTES_FILE")
echo -e "''${YELLOW}''${NC} This will delete all $total_notes notes. Are you sure? ''${GRAY}[y/N]''${NC}"
read -r confirmation
if echo "$confirmation" | grep -qi "^y"; then
> "$NOTES_FILE"
echo -e "''${GREEN}''${NC} All notes cleared"
else
echo -e "''${BLUE}''${NC} Operation cancelled"
fi
}
# Main script logic
main() {
# Check if input is being piped
if [ ! -t 0 ]; then
# Read from stdin (pipe)
local piped_content=""
while IFS= read -r line; do
if [ -z "$piped_content" ]; then
piped_content="$line"
else
piped_content="$piped_content"$'\n'"$line"
fi
done
if [ -n "$piped_content" ]; then
add_note "$piped_content"
else
echo -e "''${RED}''${NC} No input received from pipe"
exit 1
fi
return
fi
# Handle command line arguments
case "$1" in
"")
display_notes
;;
"del")
if [ -z "$2" ]; then
echo -e "''${RED}''${NC} Please specify note number to delete"
echo -e "''${GRAY}Usage: ''${CYAN}note del <number>''${NC}"
exit 1
fi
delete_note "$2"
;;
"clear")
clear_notes
;;
"help"|"--help"|"-h")
show_usage
;;
*)
# Everything else is treated as note content
add_note "$*"
;;
esac
}
main "$@"
''

View File

@@ -0,0 +1,9 @@
{ pkgs }:
pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
''

View File

@@ -0,0 +1,8 @@
{ pkgs }:
pkgs.writeShellScriptBin "rofi-launcher" ''
# check if rofi is already running
if pidof rofi > /dev/null; then
pkill rofi
fi
rofi -show drun
''

View File

@@ -0,0 +1,5 @@
{ pkgs }:
pkgs.writeShellScriptBin "screenshootin" ''
grim -g "$(slurp)" - | swappy -f -
''

View File

@@ -0,0 +1,23 @@
{ pkgs }:
pkgs.writeShellScriptBin "squirtle" ''
echo "

  
  
  



 
 
 
 
 
 
 
 
 
 
"
''

View File

@@ -0,0 +1,6 @@
{ pkgs }:
pkgs.writeShellScriptBin "task-waybar" ''
sleep 0.1
${pkgs.swaynotificationcenter}/bin/swaync-client -t &
''

View File

@@ -0,0 +1,24 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "wallsetter" ''
TIMEOUT=720
for pid in $(pidof -o %PPID -x wallsetter); do
kill $pid
done
if ! [ -d ~/Pictures/Wallpapers ]; then notify-send -t 5000 "~/Pictures/Wallpapers does not exist" && exit 1; fi
if [ $(ls -1 ~/Pictures/Wallpapers | wc -l) -lt 1 ]; then notify-send -t 9000 "The wallpaper folder is expected to have more than 1 image. Exiting Wallsetter." && exit 1; fi
while true; do
while [ "$WALLPAPER" == "$PREVIOUS" ]; do
WALLPAPER=$(find ~/Pictures/Wallpapers -name '*' | awk '!/.git/' | tail -n +2 | shuf -n 1)
done
PREVIOUS=$WALLPAPER
${pkgs.swww}/bin/swww img "$WALLPAPER" --transition-type random --transition-step 1 --transition-fps 60
sleep $TIMEOUT
done
''

View File

@@ -0,0 +1,47 @@
{ pkgs }:
pkgs.writeShellScriptBin "web-search" ''
# check if rofi is already running
if pidof rofi > /dev/null; then
pkill rofi
fi
declare -A URLS
URLS=(
["🌎 Search"]="https://search.brave.com/search?q="
[" Unstable Packages"]="https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query="
["🎞 YouTube"]="https://www.youtube.com/results?search_query="
["🦥 Arch Wiki"]="https://wiki.archlinux.org/title/"
["🐃 Gentoo Wiki"]="https://wiki.gentoo.org/index.php?title="
)
# List for rofi
gen_list() {
for i in "''${!URLS[@]}"
do
echo "$i"
done
}
main() {
# Pass the list to rofi
platform=$( (gen_list) | ${pkgs.rofi-wayland}/bin/rofi -dmenu -config ~/.config/rofi/config-long.rasi )
if [[ -n "$platform" ]]; then
query=$( (echo ) | ${pkgs.rofi-wayland}/bin/rofi -dmenu -config ~/.config/rofi/config-long.rasi )
if [[ -n "$query" ]]; then
url=''${URLS[$platform]}$query
xdg-open "$url"
else
exit
fi
else
exit
fi
}
main
exit 0
''

View File

@@ -0,0 +1,700 @@
{ pkgs
, profile
, backupFiles ? [ ".config/mimeapps.list.backup" ]
, ...
}:
let
backupFilesString = pkgs.lib.strings.concatStringsSep " " backupFiles;
# Create the get-doom script as a dependency
get-doom-script = pkgs.writeShellScriptBin "get-doom" ''
#!/usr/bin/env bash
set -euo pipefail
# --- Icons ---
ICON_CHECK=""
ICON_INFO=""
ICON_ROCKET="🚀"
# --- Helper Functions ---
print_status() {
echo
echo "--- $ICON_INFO $1 ---"
}
print_success() {
echo "--- $ICON_CHECK $1 ---"
}
print_banner() {
echo "==============================="
echo " Doom Emacs Installer $ICON_ROCKET"
echo "==============================="
}
is_doom_installed() {
local dir="$1"
[[ -x "$dir/bin/doom" ]] && [[ -f "$dir/core/doom.el" ]]
}
emacsdir_is_empty() {
local dir="$1"
[[ -d "$dir" ]] && [[ -z "$(ls -A "$dir" 2>/dev/null)" ]]
}
# --- Main Script ---
print_banner
EMACSDIR="$HOME/.emacs.d"
if is_doom_installed "$EMACSDIR"; then
print_success "Doom Emacs is already installed."
exit 0
fi
if [[ -d "$EMACSDIR" ]]; then
if emacsdir_is_empty "$EMACSDIR"; then
print_status "Found empty $EMACSDIR; proceeding to install Doom Emacs into it..."
else
echo "Error: Found $EMACSDIR but it does not look like a Doom Emacs installation." >&2
echo "Refusing to overwrite a non-empty directory. Move it away and re-run, e.g.:" >&2
echo " mv \"$EMACSDIR\" \"$EMACSDIR.bak\"" >&2
exit 1
fi
fi
print_status "Cloning Doom Emacs..."
${pkgs.git}/bin/git clone --depth 1 https://github.com/doomemacs/doomemacs "$EMACSDIR"
print_success "Doom Emacs cloned."
print_status "Running Doom install..."
"$EMACSDIR/bin/doom" install
print_success "Doom install complete."
print_status "Running doom sync..."
"$EMACSDIR/bin/doom" sync
print_success "Doom sync complete."
echo
print_success "All done! Doom Emacs is ready to use."
'';
in
pkgs.writeShellScriptBin "zcli" ''
#!${pkgs.bash}/bin/bash
set -euo pipefail
# --- Program info ---
#
# zcli - NixOS System Management CLI
# ==================================
#
# Purpose: NixOS system management utility for ZaneyOS distribution
# Author: Don Williams (ddubs) & Zaney
# Start Date: June 7th, 2025
# Version: 1.0.2
#
# Architecture:
# - Nix-generated shell script using writeShellScriptBin
# - Configuration via Nix parameters (profile, backupFiles)
# - Uses 'nh' tool for NixOS operations, 'inxi' for diagnostics
# - Git integration for host configuration versioning
#
# Helper Functions:
# verify_hostname() - Validates current hostname against flake.nix host variable
# Exits with error if mismatch or missing host directory
# detect_gpu_profile() - Parses lspci output to identify GPU hardware
# Returns: nvidia/nvidia-laptop/amd/intel/vm/empty
# handle_backups() - Removes files listed in BACKUP_FILES array from $HOME
# parse_nh_args() - Parses command-line arguments for nh operations
# print_help() - Outputs command usage and available operations
#
# Command Functions:
# cleanup - Interactive cleanup of old generations via 'nh clean'
# diag - Generate system report using 'inxi --full'
# list-gens - Display user/system generations via nix-env and nix profile
# rebuild - NixOS rebuild using 'nh os switch'
# rebuild-boot - NixOS rebuild for next boot using 'nh os boot'
# trim - SSD optimization via 'sudo fstrim -v /'
# update - Flake update + rebuild using 'nh os switch --update'
# update-host - Modify flake.nix host/profile variables via sed
# add-host - Add new host configuration
# del-host - Delete host configuration
# doom [sub] - Doom Emacs management (install/status/remove/update)
#
# Variables:
# PROJECT - Base directory name (ddubsos/zaneyos)
# PROFILE - Hardware profile from Nix parameter
# BACKUP_FILES - Array of backup file paths to clean
# FLAKE_NIX_PATH - Path to flake.nix for host/profile updates
#
# --- Configuration ---
PROJECT="zaneyos" #ddubos or zaneyos
PROFILE="${profile}"
BACKUP_FILES_STR="${backupFilesString}"
VERSION="1.0.2"
FLAKE_NIX_PATH="$HOME/$PROJECT/flake.nix"
read -r -a BACKUP_FILES <<< "$BACKUP_FILES_STR"
# --- Helper Functions ---
verify_hostname() {
local current_hostname
local flake_hostname
current_hostname="$(hostname)"
# Extract the host value from flake.nix
if [ -f "$FLAKE_NIX_PATH" ]; then
flake_hostname=$(${pkgs.gnugrep}/bin/grep -E '^[[:space:]]*host[[:space:]]*=' "$FLAKE_NIX_PATH" | ${pkgs.gnused}/bin/sed 's/.*=[[:space:]]*"\([^"]*\)".*/\1/')
if [ -z "$flake_hostname" ]; then
echo "Error: Could not find 'host' variable in $FLAKE_NIX_PATH" >&2
exit 1
fi
if [ "$current_hostname" != "$flake_hostname" ]; then
echo "Error: Hostname mismatch!" >&2
echo " Current hostname: '$current_hostname'" >&2
echo " Flake.nix host: '$flake_hostname'" >&2
echo "" >&2
echo "Hint: Run 'zcli update-host' to automatically update flake.nix" >&2
echo " or manually edit $FLAKE_NIX_PATH" >&2
exit 1
fi
else
echo "Error: Flake.nix not found at $FLAKE_NIX_PATH" >&2
exit 1
fi
# Also check if host folder exists
local folder="$HOME/$PROJECT/hosts/$current_hostname"
if [ ! -d "$folder" ]; then
echo "Error: Matching host not found in $PROJECT, Missing folder: $folder" >&2
exit 1
fi
}
print_help() {
echo "ZaneyOS CLI Utility -- version $VERSION"
echo ""
echo "Usage: zcli [command] [options]"
echo ""
echo "Commands:"
echo " cleanup - Clean up old system generations. Can specify a number to keep."
echo " diag - Create a system diagnostic report."
echo " (Filename: homedir/diag.txt)"
echo " list-gens - List user and system generations."
echo " rebuild - Rebuild the NixOS system configuration."
echo " rebuild-boot - Rebuild and set as boot default (activates on next restart)."
echo " trim - Trim filesystems to improve SSD performance."
echo " update - Update the flake and rebuild the system."
echo " update-host - Auto set host and profile in flake.nix."
echo " (Opt: zcli update-host [hostname] [profile])"
echo ""
echo "Options for rebuild, rebuild-boot, and update commands:"
echo " --dry, -n - Show what would be done without doing it"
echo " --ask, -a - Ask for confirmation before proceeding"
echo " --cores N - Limit build to N cores (useful for VMs)"
echo " --verbose, -v - Show verbose output"
echo " --no-nom - Don't use nix-output-monitor"
echo ""
echo "Doom Emacs:"
echo " doom install - Install Doom Emacs using get-doom script."
echo " doom status - Check if Doom Emacs is installed."
echo " doom remove - Remove Doom Emacs installation."
echo " doom update - Update Doom Emacs (runs doom sync)."
echo ""
echo " help - Show this help message."
}
handle_backups() {
if [ ''${#BACKUP_FILES[@]} -eq 0 ]; then
echo "No backup files configured to check."
return
fi
echo "Checking for backup files to remove..."
for file_path in "''${BACKUP_FILES[@]}"; do
full_path="$HOME/$file_path"
if [ -f "$full_path" ]; then
echo "Removing stale backup file: $full_path"
rm "$full_path"
fi
done
}
detect_gpu_profile() {
local detected_profile=""
local has_nvidia=false
local has_intel=false
local has_amd=false
local has_vm=false
if ${pkgs.pciutils}/bin/lspci &> /dev/null; then # Check if lspci is available
if ${pkgs.pciutils}/bin/lspci | ${pkgs.gnugrep}/bin/grep -qi 'vga\|3d'; then
while read -r line; do
if echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'nvidia'; then
has_nvidia=true
elif echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'amd'; then
has_amd=true
elif echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'intel'; then
has_intel=true
elif echo "$line" | ${pkgs.gnugrep}/bin/grep -qi 'virtio\|vmware'; then
has_vm=true
fi
done < <(${pkgs.pciutils}/bin/lspci | ${pkgs.gnugrep}/bin/grep -i 'vga\|3d')
if "$has_vm"; then
detected_profile="vm"
elif "$has_nvidia" && "$has_intel"; then
detected_profile="nvidia-laptop"
elif "$has_nvidia"; then
detected_profile="nvidia"
elif "$has_amd"; then
detected_profile="amd"
elif "$has_intel"; then
detected_profile="intel"
fi
fi
else
echo "Warning: lspci command not found. Cannot auto-detect GPU profile." >&2
fi
echo "$detected_profile" # Return the detected profile
}
# --- Helper function to parse additional arguments ---
parse_nh_args() {
local args_string=""
local options_selected=()
shift # Remove the main command (rebuild, rebuild-boot, update)
while [[ $# -gt 0 ]]; do
case $1 in
--dry|-n)
args_string="$args_string --dry"
options_selected+=("dry run mode (showing what would be done)")
shift
;;
--ask|-a)
args_string="$args_string --ask"
options_selected+=("confirmation prompts enabled")
shift
;;
--cores)
if [[ -n $2 && $2 =~ ^[0-9]+$ ]]; then
args_string="$args_string -- --cores $2"
options_selected+=("limited to $2 CPU cores")
shift 2
else
echo "Error: --cores requires a numeric argument" >&2
exit 1
fi
;;
--verbose|-v)
args_string="$args_string --verbose"
options_selected+=("verbose output enabled")
shift
;;
--no-nom)
args_string="$args_string --no-nom"
options_selected+=("nix-output-monitor disabled")
shift
;;
--)
shift
args_string="$args_string -- $*"
options_selected+=("additional arguments: $*")
break
;;
-*)
echo "Warning: Unknown flag '$1' - passing through to nh" >&2
args_string="$args_string $1"
options_selected+=("unknown flag '$1' passed through")
shift
;;
*)
echo "Error: Unexpected argument '$1'" >&2
exit 1
;;
esac
done
# Print friendly confirmation of selected options to stderr so it doesn't interfere with return value
if [[ ''${#options_selected[@]} -gt 0 ]]; then
echo "Options selected:" >&2
for option in "''${options_selected[@]}"; do
echo " $option" >&2
done
echo >&2
fi
# Return only the args string
echo "$args_string"
}
# --- Main Logic ---
if [ "$#" -eq 0 ]; then
echo "Error: No command provided." >&2
print_help
exit 1
fi
case "$1" in
cleanup)
echo "Warning! This will remove old generations of your system."
read -p "How many generations to keep (default: all)? " keep_count
if [ -z "$keep_count" ]; then
read -p "This will remove all but the current generation. Continue (y/N)? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
${pkgs.nh}/bin/nh clean all -v
else
echo "Cleanup cancelled."
fi
else
read -p "This will keep the last $keep_count generations. Continue (y/N)? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
${pkgs.nh}/bin/nh clean all -k "$keep_count" -v
else
echo "Cleanup cancelled."
fi
fi
LOG_DIR="$HOME/zcli-cleanup-logs"
mkdir -p "$LOG_DIR"
LOG_FILE="$LOG_DIR/zcli-cleanup-$(${pkgs.coreutils}/bin/date +%Y-%m-%d_%H-%M-%S).log"
echo "Cleaning up old log files..." >> "$LOG_FILE"
${pkgs.findutils}/bin/find "$LOG_DIR" -type f -mtime +3 -name "*.log" -delete >> "$LOG_FILE" 2>&1
echo "Cleanup process logged to $LOG_FILE"
;;
diag)
echo "Generating system diagnostic report..."
${pkgs.inxi}/bin/inxi --full > "$HOME/diag.txt"
echo "Diagnostic report saved to $HOME/diag.txt"
;;
help)
print_help
;;
list-gens)
echo "--- User Generations ---"
${pkgs.nix}/bin/nix-env --list-generations | ${pkgs.coreutils}/bin/cat || echo "Could not list user generations."
echo ""
echo "--- System Generations ---"
${pkgs.nix}/bin/nix profile history --profile /nix/var/nix/profiles/system | ${pkgs.coreutils}/bin/cat || echo "Could not list system generations."
;;
rebuild)
verify_hostname
handle_backups
# Parse additional arguments
extra_args=$(parse_nh_args "$@")
echo "Starting NixOS rebuild for host: $(${pkgs.nettools}/bin/hostname)"
if eval "${pkgs.nh}/bin/nh os switch --hostname '$PROFILE' $extra_args"; then
echo "Rebuild finished successfully"
else
echo "Rebuild Failed" >&2
exit 1
fi
;;
rebuild-boot)
verify_hostname
handle_backups
# Parse additional arguments
extra_args=$(parse_nh_args "$@")
echo "Starting NixOS rebuild (boot) for host: $(${pkgs.nettools}/bin/hostname)"
echo "Note: Configuration will be activated on next reboot"
if eval "${pkgs.nh}/bin/nh os boot --hostname '$PROFILE' $extra_args"; then
echo "Rebuild-boot finished successfully"
echo "New configuration set as boot default - restart to activate"
else
echo "Rebuild-boot Failed" >&2
exit 1
fi
;;
trim)
echo "Running 'sudo fstrim -v /' may take a few minutes and impact system performance."
read -p "Enter (y/Y) to run now or enter to exit (y/N): " -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Running fstrim..."
sudo ${pkgs.util-linux}/bin/fstrim -v /
echo "fstrim complete."
else
echo "Trim operation cancelled."
fi
;;
update)
verify_hostname
handle_backups
# Parse additional arguments
extra_args=$(parse_nh_args "$@")
echo "Updating flake and rebuilding system for host: $(${pkgs.nettools}/bin/hostname)"
if eval "${pkgs.nh}/bin/nh os switch --hostname '$PROFILE' --update $extra_args"; then
echo "Update and rebuild finished successfully"
else
echo "Update and rebuild Failed" >&2
exit 1
fi
;;
update-host)
target_hostname=""
target_profile=""
if [ "$#" -eq 3 ]; then # zcli update-host <hostname> <profile>
target_hostname="$2"
target_profile="$3"
elif [ "$#" -eq 1 ]; then # zcli update-host (auto-detect)
echo "Attempting to auto-detect hostname and GPU profile..."
target_hostname=$(${pkgs.nettools}/bin/hostname)
target_profile=$(detect_gpu_profile)
if [ -z "$target_profile" ]; then
echo "Error: Could not auto-detect a specific GPU profile. Please provide it manually." >&2
echo "Usage: zcli update-host [hostname] [profile]" >&2
exit 1
fi
echo "Auto-detected Hostname: $target_hostname"
echo "Auto-detected Profile: $target_profile"
else
echo "Error: Invalid number of arguments for 'update-host'." >&2
echo "Usage: zcli update-host [hostname] [profile]" >&2
exit 1
fi
echo "Updating $FLAKE_NIX_PATH..."
# Update host
if ${pkgs.gnused}/bin/sed -i "s/^[[:space:]]*host[[:space:]]*=[[:space:]]*\".*\"/ host = \"$target_hostname\"/" "$FLAKE_NIX_PATH"; then
echo "Successfully updated host to: $target_hostname"
else
echo "Error: Failed to update host in $FLAKE_NIX_PATH" >&2
exit 1
fi
# Update profile
if ${pkgs.gnused}/bin/sed -i "s/^[[:space:]]*profile[[:space:]]*=[[:space:]]*\".*\"/ profile = \"$target_profile\"/" "$FLAKE_NIX_PATH"; then
echo "Successfully updated profile to: $target_profile"
else
echo "Error: Failed to update profile in $FLAKE_NIX_PATH" >&2
exit 1
fi
echo "Flake.nix updated successfully!"
;;
add-host)
hostname=""
profile_arg=""
if [ "$#" -ge 2 ]; then
hostname="$2"
fi
if [ "$#" -eq 3 ]; then
profile_arg="$3"
fi
if [ -z "$hostname" ]; then
read -p "Enter the new hostname: " hostname
fi
if [ -d "$HOME/$PROJECT/hosts/$hostname" ]; then
echo "Error: Host '$hostname' already exists." >&2
exit 1
fi
echo "Copying default host configuration..."
${pkgs.coreutils}/bin/cp -r "$HOME/$PROJECT/hosts/default" "$HOME/$PROJECT/hosts/$hostname"
detected_profile=""
if [[ -n "$profile_arg" && "$profile_arg" =~ ^(intel|amd|nvidia|nvidia-hybrid|vm)$ ]]; then
detected_profile="$profile_arg"
else
echo "Detecting GPU profile..."
detected_profile=$(detect_gpu_profile)
echo "Detected GPU profile: $detected_profile"
read -p "Is this correct? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Nn]$ ]]; then
read -p "Enter the correct profile (intel, amd, nvidia, nvidia-hybrid, vm): " new_profile
while [[ ! "$new_profile" =~ ^(intel|amd|nvidia|nvidia-hybrid|vm)$ ]]; do
echo "Invalid profile. Please enter one of the following: intel, amd, nvidia, nvidia-hybrid, vm"
read -p "Enter the correct profile: " new_profile
done
detected_profile=$new_profile
fi
fi
echo "Setting profile to '$detected_profile'..."
${pkgs.gnused}/bin/sed -i "s/profile = .*/profile = \"$detected_profile\";/" "$HOME/$PROJECT/hosts/$hostname/default.nix"
read -p "Generate new hardware.nix? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Generating hardware.nix..."
sudo nixos-generate-config --show-hardware-config > "$HOME/$PROJECT/hosts/$hostname/hardware.nix"
echo "hardware.nix generated."
fi
echo "Adding new host to git..."
${pkgs.git}/bin/git -C "$HOME/$PROJECT" add .
echo "hostname: $hostname added"
;;
del-host)
hostname=""
if [ "$#" -eq 2 ]; then
hostname="$2"
else
read -p "Enter the hostname to delete: " hostname
fi
if [ ! -d "$HOME/$PROJECT/hosts/$hostname" ]; then
echo "Error: Host '$hostname' does not exist." >&2
exit 1
fi
read -p "Are you sure you want to delete the host '$hostname'? (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Deleting host '$hostname'..."
${pkgs.coreutils}/bin/rm -rf "$HOME/$PROJECT/hosts/$hostname"
${pkgs.git}/bin/git -C "$HOME/$PROJECT" add .
echo "hostname: $hostname removed"
else
echo "Deletion cancelled."
fi
;;
doom)
if [ "$#" -lt 2 ]; then
echo "Error: doom command requires a subcommand." >&2
echo "Usage: zcli doom [install|status|remove|update]" >&2
exit 1
fi
# Ensure we're acting on a valid host and we can locate variables.nix
verify_hostname
current_hostname="$(hostname)"
host_vars_file="$HOME/$PROJECT/hosts/$current_hostname/variables.nix"
if [ ! -f "$host_vars_file" ]; then
echo "Error: Host variables file not found: $host_vars_file" >&2
echo "Please ensure your host folder exists and contains variables.nix." >&2
exit 1
fi
is_doom_enabled() {
# Return 0 if doomEmacsEnable = true; appears (ignoring leading spaces)
${pkgs.gnugrep}/bin/grep -Eq '^[[:space:]]*doomEmacsEnable[[:space:]]*=[[:space:]]*true[[:space:]]*;' "$host_vars_file"
}
ensure_doom_enabled() {
# If the variable is present but false, flip it; if missing, append it
if ${pkgs.gnugrep}/bin/grep -Eq '^[[:space:]]*doomEmacsEnable[[:space:]]*=' "$host_vars_file"; then
${pkgs.gnused}/bin/sed -i 's/^[[:space:]]*doomEmacsEnable[[:space:]]*=.*/ doomEmacsEnable = true;/' "$host_vars_file"
else
echo "" >> "$host_vars_file"
echo " # Enabled by zcli doom on $(date)" >> "$host_vars_file"
echo " doomEmacsEnable = true;" >> "$host_vars_file"
fi
}
doom_subcommand="$2"
case "$doom_subcommand" in
install)
if ! is_doom_enabled; then
echo " Doom Emacs is disabled for host '$current_hostname' (doomEmacsEnable = false)." >&2
echo "To enable, set doomEmacsEnable = true; in:" >&2
echo " $host_vars_file" >&2
echo "and rebuild your system before installing Doom." >&2
echo
read -p "Enable Doom for this host now and rebuild? (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Enabling Doom Emacs in $host_vars_file..."
ensure_doom_enabled
echo "Rebuilding system so user modules are applied..."
if ${pkgs.nh}/bin/nh os switch --hostname "$PROFILE"; then
echo "Rebuild complete. Proceeding with Doom installation."
else
echo "Error: Rebuild failed. Please fix the build and re-run 'zcli doom install'." >&2
exit 1
fi
else
echo "Aborting. Please enable doomEmacsEnable and rebuild before installing." >&2
exit 1
fi
fi
echo "Installing Doom Emacs..."
${get-doom-script}/bin/get-doom
;;
status)
if [ -x "$HOME/.emacs.d/bin/doom" ] && [ -f "$HOME/.emacs.d/core/doom.el" ]; then
echo " Doom Emacs appears installed at $HOME/.emacs.d"
if [ -f "$HOME/.doom.d/init.el" ]; then
echo " User config found: $HOME/.doom.d/init.el"
else
echo " Warning: User config (~/.doom.d) not found"
fi
echo "Version information:"
"$HOME/.emacs.d/bin/doom" version 2>/dev/null || echo "Could not get version information"
else
if [ -d "$HOME/.emacs.d" ]; then
if [ -z "$(ls -A "$HOME/.emacs.d" 2>/dev/null)" ]; then
echo " Found empty ~/.emacs.d (not a valid Doom installation)"
else
echo " ~/.emacs.d exists but Doom was not detected"
fi
else
echo " Doom Emacs is not installed"
fi
echo "Run 'zcli doom install' to install it"
fi
;;
remove)
if [ ! -d "$HOME/.emacs.d" ]; then
echo "Doom Emacs is not installed"
exit 0
fi
echo "Warning: This will completely remove Doom Emacs and all your configuration!"
read -p "Are you sure you want to continue? (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Removing Doom Emacs..."
${pkgs.coreutils}/bin/rm -rf "$HOME/.emacs.d"
echo " Doom Emacs has been removed"
else
echo "Removal cancelled"
fi
;;
update)
if [ ! -x "$HOME/.emacs.d/bin/doom" ] || [ ! -f "$HOME/.emacs.d/core/doom.el" ]; then
echo "Error: Doom Emacs is not installed correctly. Run 'zcli doom install' first." >&2
exit 1
fi
echo "Updating Doom Emacs..."
"$HOME/.emacs.d/bin/doom" sync
echo " Doom Emacs update complete"
;;
*)
echo "Error: Invalid doom subcommand '$doom_subcommand'" >&2
echo "Usage: zcli doom [install|status|remove|update]" >&2
exit 1
;;
esac
;;
*)
echo "Error: Invalid command '$1'" >&2
print_help
exit 1
;;
esac
''

View File

@@ -0,0 +1,60 @@
# starship is a minimal, fast, and extremely customizable prompt for any shell!
{ config
, lib
, ...
}:
let
accent = "#${config.lib.stylix.colors.base0D}";
background-alt = "#${config.lib.stylix.colors.base01}";
in
{
programs.starship = {
enable = false;
settings = {
add_newline = false;
format = lib.concatStrings [
"$nix_shell"
"$hostname"
"$directory"
"$git_branch"
"$git_state"
"$git_status"
"\n"
"$character"
];
directory = { style = accent; };
character = {
success_symbol = "[](${accent})";
error_symbol = "[](red)";
vimcmd_symbol = "[](cyan)";
};
nix_shell = {
format = "[$symbol]($style) ";
symbol = "🐚";
style = "";
};
git_branch = {
symbol = "[](${background-alt}) ";
style = "fg:${accent} bg:${background-alt}";
format = "on [$symbol$branch]($style)[](${background-alt}) ";
};
git_status = {
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218)($ahead_behind$stashed)]($style)";
style = "cyan";
conflicted = "";
renamed = "";
deleted = "";
stashed = "";
};
git_state = {
format = "([$state( $progress_current/$progress_total)]($style)) ";
style = "bright-black";
};
};
};
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }: {
programs.starship = {
enable = false;
package = pkgs.starship;
};
}

13
modules/home/stylix.nix Normal file
View File

@@ -0,0 +1,13 @@
_: {
stylix.targets = {
waybar.enable = false;
rofi.enable = false;
hyprland.enable = false;
hyprlock.enable = false;
ghostty.enable = false;
qt = {
enable = true;
platform = "qtct";
};
};
}

16
modules/home/swappy.nix Normal file
View File

@@ -0,0 +1,16 @@
{ username, ... }: {
home.file = {
".config/swappy/config".text = ''
[Default]
save_dir=/home/${username}/Pictures/Screenshots
save_filename_format=swappy-%Y%m%d-%H%M%S.png
show_panel=false
line_size=5
text_size=20
text_font=Ubuntu
paint_mode=brush
early_exit=true
fill_shape=false
'';
};
}

311
modules/home/swaync.nix Normal file
View File

@@ -0,0 +1,311 @@
{ config, ... }: {
services.swaync = {
enable = true;
settings = {
positionX = "right";
positionY = "top";
layer = "overlay";
control-center-margin-top = 10;
control-center-margin-bottom = 10;
control-center-margin-right = 10;
control-center-margin-left = 10;
notification-icon-size = 64;
notification-body-image-height = 100;
notification-body-image-width = 200;
timeout = 10;
timeout-low = 5;
timeout-critical = 0;
fit-to-screen = false;
control-center-width = 500;
control-center-height = 1025;
notification-window-width = 500;
keyboard-shortcuts = true;
image-visibility = "when-available";
transition-time = 200;
hide-on-clear = false;
hide-on-action = true;
script-fail-notify = true;
widget-config = {
title = {
text = "Notification Center";
clear-all-button = true;
button-text = "󰆴 Clear All";
};
dnd = {
text = "Do Not Disturb";
};
label = {
max-lines = 1;
text = "Notification Center";
};
mpris = {
image-size = 96;
image-radius = 7;
};
volume = {
label = "󰕾";
};
backlight = {
label = "󰃟";
};
};
widgets = [
"title"
"mpris"
"volume"
"backlight"
"dnd"
"notifications"
];
};
style = ''
* {
font-family: JetBrainsMono Nerd Font Mono;
font-weight: bold;
}
.control-center .notification-row:focus,
.control-center .notification-row:hover {
opacity: 0.9;
background: #${config.lib.stylix.colors.base00}
}
.notification-row {
outline: none;
margin: 10px;
padding: 0;
}
.notification {
background: transparent;
padding: 0;
margin: 0px;
}
.notification-content {
background: #${config.lib.stylix.colors.base00};
padding: 10px;
border-radius: 5px;
border: 2px solid #${config.lib.stylix.colors.base0D};
margin: 0;
}
.notification-default-action {
margin: 0;
padding: 0;
border-radius: 5px;
}
.close-button {
background: #${config.lib.stylix.colors.base08};
color: #${config.lib.stylix.colors.base00};
text-shadow: none;
padding: 0;
border-radius: 5px;
margin-top: 5px;
margin-right: 5px;
}
.close-button:hover {
box-shadow: none;
background: #${config.lib.stylix.colors.base0D};
transition: all .15s ease-in-out;
border: none
}
.notification-action {
border: 2px solid #${config.lib.stylix.colors.base0D};
border-top: none;
border-radius: 5px;
}
.notification-default-action:hover,
.notification-action:hover {
color: #${config.lib.stylix.colors.base0B};
background: #${config.lib.stylix.colors.base0B}
}
.notification-default-action {
border-radius: 5px;
margin: 0px;
}
.notification-default-action:not(:only-child) {
border-bottom-left-radius: 7px;
border-bottom-right-radius: 7px
}
.notification-action:first-child {
border-bottom-left-radius: 10px;
background: #${config.lib.stylix.colors.base00}
}
.notification-action:last-child {
border-bottom-right-radius: 10px;
background: #${config.lib.stylix.colors.base00}
}
.inline-reply {
margin-top: 8px
}
.inline-reply-entry {
background: #${config.lib.stylix.colors.base00};
color: #${config.lib.stylix.colors.base05};
caret-color: #${config.lib.stylix.colors.base05};
border: 1px solid #${config.lib.stylix.colors.base09};
border-radius: 5px
}
.inline-reply-button {
margin-left: 4px;
background: #${config.lib.stylix.colors.base00};
border: 1px solid #${config.lib.stylix.colors.base09};
border-radius: 5px;
color: #${config.lib.stylix.colors.base05}
}
.inline-reply-button:disabled {
background: initial;
color: #${config.lib.stylix.colors.base03};
border: 1px solid transparent
}
.inline-reply-button:hover {
background: #${config.lib.stylix.colors.base00}
}
.body-image {
margin-top: 6px;
background-color: #${config.lib.stylix.colors.base05};
border-radius: 5px
}
.summary {
font-size: 16px;
font-weight: 700;
background: transparent;
color: rgba(158, 206, 106, 1);
text-shadow: none
}
.time {
font-size: 16px;
font-weight: 700;
background: transparent;
color: #${config.lib.stylix.colors.base05};
text-shadow: none;
margin-right: 18px
}
.body {
font-size: 15px;
font-weight: 400;
background: transparent;
color: #${config.lib.stylix.colors.base05};
text-shadow: none
}
.control-center {
background: #${config.lib.stylix.colors.base00};
border: 2px solid #${config.lib.stylix.colors.base0C};
border-radius: 5px;
}
.control-center-list {
background: transparent
}
.control-center-list-placeholder {
opacity: .5
}
.floating-notifications {
background: transparent
}
.blank-window {
background: alpha(black, 0)
}
.widget-title {
color: #${config.lib.stylix.colors.base0B};
background: #${config.lib.stylix.colors.base00};
padding: 5px 10px;
margin: 10px 10px 5px 10px;
font-size: 1.5rem;
border-radius: 5px;
}
.widget-title>button {
font-size: 1rem;
color: #${config.lib.stylix.colors.base05};
text-shadow: none;
background: #${config.lib.stylix.colors.base00};
box-shadow: none;
border-radius: 5px;
}
.widget-title>button:hover {
background: #${config.lib.stylix.colors.base08};
color: #${config.lib.stylix.colors.base00};
}
.widget-dnd {
background: #${config.lib.stylix.colors.base00};
padding: 5px 10px;
margin: 10px 10px 5px 10px;
border-radius: 5px;
font-size: large;
color: #${config.lib.stylix.colors.base0B};
}
.widget-dnd>switch {
border-radius: 5px;
/* border: 1px solid #${config.lib.stylix.colors.base0B}; */
background: #${config.lib.stylix.colors.base0B};
}
.widget-dnd>switch:checked {
background: #${config.lib.stylix.colors.base08};
border: 1px solid #${config.lib.stylix.colors.base08};
}
.widget-dnd>switch slider {
background: #${config.lib.stylix.colors.base00};
border-radius: 5px
}
.widget-dnd>switch:checked slider {
background: #${config.lib.stylix.colors.base00};
border-radius: 5px
}
.widget-label {
margin: 10px 10px 5px 10px;
}
.widget-label>label {
font-size: 1rem;
color: #${config.lib.stylix.colors.base05};
}
.widget-mpris {
color: #${config.lib.stylix.colors.base05};
padding: 5px 10px;
margin: 10px 10px 5px 10px;
border-radius: 5px;
}
.widget-mpris > box > button {
border-radius: 5px;
}
.widget-mpris-player {
padding: 5px 10px;
margin: 10px
}
.widget-mpris-title {
font-weight: 700;
font-size: 1.25rem
}
.widget-mpris-subtitle {
font-size: 1.1rem
}
.widget-menubar>box>.menu-button-bar>button {
border: none;
background: transparent
}
.topbar-buttons>button {
border: none;
background: transparent
}
.widget-volume {
background: #${config.lib.stylix.colors.base01};
padding: 5px;
margin: 10px 10px 5px 10px;
border-radius: 5px;
font-size: x-large;
color: #${config.lib.stylix.colors.base05};
}
.widget-volume>box>button {
background: #${config.lib.stylix.colors.base0B};
border: none
}
.per-app-volume {
background-color: #${config.lib.stylix.colors.base00};
padding: 4px 8px 8px;
margin: 0 8px 8px;
border-radius: 5px;
}
.widget-backlight {
background: #${config.lib.stylix.colors.base01};
padding: 5px;
margin: 10px 10px 5px 10px;
border-radius: 5px;
font-size: x-large;
color: #${config.lib.stylix.colors.base05}
}
'';
};
}

10
modules/home/tealdeer.nix Normal file
View File

@@ -0,0 +1,10 @@
{ ... }: {
programs.tealdeer = {
enable = true;
settings = {
display.compact = false;
display.use_pager = true;
updates.auto_update = true;
};
};
}

118
modules/home/tmux.nix Normal file
View File

@@ -0,0 +1,118 @@
# Tmux is a terminal multiplexer that allows you to run multiple terminal sessions in a single window.
{ pkgs, ... }: {
programs.tmux = {
enable = true;
mouse = true;
shell = "${pkgs.zsh}/bin/zsh";
prefix = "C-a";
terminal = "kitty";
keyMode = "vi";
extraConfig = ''
set-option -g status-position top
#set -g default-terminal "screen-256color"
set-option -g history-limit 5000
unbind %
unbind '"'
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
set -gq allow-passthrough on
bind-key x kill-pane # skip "kill-pane 1? (y/n)" prompt
bind-key -n C-Tab next-window
bind-key -n C-S-Tab previous-window
bind-key -n M-Tab new-window
# Start windows and panes index at 1, not 0.
set -g base-index 1
setw -g pane-base-index 1
bind-key "|" split-window -h -c "#{pane_current_path}"
bind-key "\\" split-window -fh -c "#{pane_current_path}"
bind-key "-" split-window -v -c "#{pane_current_path}"
bind-key "_" split-window -fv -c "#{pane_current_path}"
bind -r C-j resize-pane -D 15
bind -r C-k resize-pane -U 15
bind -r C-h resize-pane -L 15
bind -r C-l resize-pane -R 15
# 'c' to new window
bind-key c new-window
# 'n' next window
bind-key n next-window
# 'p' next previous
bind-key n previous-window
unbind r
bind r source-file ~/.config/tmux/tmux.conf
bind -r m resize-pane -Z
bind-key t clock-mode
bind-key q display-panes
bind-key u refresh-client
bind-key o select-pane -t :.+
##### Display Popups #####
bind C-y display-popup \
-d "#{pane_current_path}" \
-w 80% \
-h 80% \
-E "lazygit"
bind C-n display-popup -E 'bash -i -c "read -p \"Session name: \" name; tmux new-session -d -s \$name && tmux switch-client -t \$name"'
bind C-j display-popup -E "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
#bind C-p display-popup -E "ipython"
#bind C-f display-popup \
# -w 80% \
# -h 80% \
# -E 'rmpc'
bind C-r display-popup \
-d "#{pane_current_path}" \
-w 90% \
-h 90% \
-E "yazi"
bind C-z display-popup \
-w 90% \
-h 90% \
-E 'nvim ~/ddubsos/flake.nix'
#bind C-g display-popup -E "bash -i ~/.tmux/scripts/chat-popup.sh"
bind C-t display-popup \
-d "#{pane_current_path}" \
-w 75% \
-h 75% \
-E "zsh"
##### Display Menu #####
bind d display-menu -T "#[align=centre]Dotfiles" -x C -y C \
"ZaneyOS flake.nix" f "display-popup -E 'nvim ~/garandos/flake.nix'" \
"ZaneyOS packages" p "display-popup -E 'nvim ~/garandos/modules/core/packages.nix'" \
"ZaneyOS keybinds" k "display-popup -E 'nvim ~/garandos/modules/home/hyprland/binds.nix'" \
"ZaneyOS env variables" e "display-popup -E 'nvim ~/garandos/modules/home/hyprland/env.nix'" \
"ZaneyOS windowrules" w "display-popup -E 'nvim ~/garandos/modules/home/hyprland/windowrules.nix'" \
"Exit" q ""
'';
plugins = with pkgs; [
tmuxPlugins.vim-tmux-navigator
tmuxPlugins.sensible
tmuxPlugins.tokyo-night-tmux
];
};
}

View File

@@ -0,0 +1,10 @@
{ ... }:
{
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu:///system" ];
uris = [ "qemu:///system" ];
};
};
}

39
modules/home/vscode.nix Normal file
View File

@@ -0,0 +1,39 @@
{ pkgs, lib, ... }: {
nixpkgs.config.allowUnfree = true;
programs.vscode = {
enable = true;
package = pkgs.vscodium;
profiles = {
default = {
extensions = with pkgs.vscode-extensions; [
bbenoist.nix
jeff-hykin.better-nix-syntax
ms-vscode.cpptools-extension-pack
mads-hartmann.bash-ide-vscode
tamasfe.even-better-toml
zainchen.json
shd101wyy.markdown-preview-enhanced
];
# userSettings = {
# "chat.editor.fontFamily" = "JetBrains Mono";
# "chat.editor.fontSize" = 20.0;
# "debug.console.fontFamily" = "JetBrains Mono";
# "debug.console.fontSize" = 20.0;
# "editor.fontFamily" = "JetBrains Mono";
# "editor.fontSize" = 20.0;
# "editor.inlayHints.fontFamily" = "JetBrains Mono";
# "editor.inlineSuggest.fontFamily" = "JetBrains Mono";
# "editor.minimap.sectionHeaderFontSize" = 12.857142857142858;
# "markdown.preview.fontFamily" = "Montserrat";
# "markdown.preview.fontSize" = 20.0;
# "scm.inputFontFamily" = "JetBrains Mono";
# "scm.inputFontSize" = 18.571428571428573;
# "screencastMode.fontSize" = 80.0;
# "terminal.integrated.fontSize" = 20.0;
# "workbench.colorTheme" = "One Dark Pro Monokai Darker";
# };
};
};
};
}

Some files were not shown because too many files have changed in this diff Show More