From 95e94196b2f520ecb5217532579b6d4ae80a22c0 Mon Sep 17 00:00:00 2001
From: Thiago Sposito
Date: Mon, 25 Aug 2025 20:36:59 -0300
Subject: [PATCH] refactor: cleanup configs, unify session handling
- flake.nix:
- Close braces formatting for `allowUnfree`
- Remove per-user `custom.sessionType` modules
- home-manager:
- home.nix: remove unused apps (bambu-studio, hydralauncher, keymapp, etc.)
- drop librespot service
- add waydroid
- fix kitty font_family spacing
- gnome: add gnome-tweaks and appindicator extension
- vim: update nixvim module import path
- zsh: drop sessionType option and conditional aliases
- hardcode wl-copy/wl-paste as pbcopy/pbpaste
- hyprland: style fixes in braces, spacing, keybind comments
- hosts/Nixstation:
- remove gnome-session and redundant tweaks
- remove env vars NIXOS_HOST / NIXOS_DE
- enable virtualization (libvirtd, spiceUSBRedirection, vmware.host=false)
- hardware-configuration: reformat fileSystems definitions
- common/nvidia:
- remove explicit kernelPackages override
- ensure xserver.enable=true and GNOME/GDM config intact
- users/thiago: reorder and regroup extraGroups list
---
flake.nix | 5 +--
home-manager/gnome/default.nix | 5 ++-
home-manager/home.nix | 42 +--------------------
home-manager/hyprland/default.nix | 10 ++---
home-manager/vim.nix | 3 +-
home-manager/zsh.nix | 39 +++++--------------
hosts/Nixstation/default.nix | 29 ++++++--------
hosts/Nixstation/hardware-configuration.nix | 17 +++++----
hosts/common/default.nix | 2 +-
hosts/common/nvidia/default.nix | 14 +++----
hosts/common/users/thiago/default.nix | 37 +++++++++---------
11 files changed, 70 insertions(+), 133 deletions(-)
diff --git a/flake.nix b/flake.nix
index 5308962..88e508e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -37,7 +37,8 @@
Nixstation = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
- allowUnfree = true;};
+ allowUnfree = true;
+ };
modules = [
./hosts/Nixstation
];
@@ -52,7 +53,6 @@
};
modules = [
./home-manager/home.nix
- { custom.sessionType = "wayland"; }
];
};
"thiago@Nixstation" = home-manager.lib.homeManagerConfiguration {
@@ -63,7 +63,6 @@
modules = [
./home-manager/home.nix
- { custom.sessionType = "wayland"; }
];
};
};
diff --git a/home-manager/gnome/default.nix b/home-manager/gnome/default.nix
index 08f4582..e728184 100644
--- a/home-manager/gnome/default.nix
+++ b/home-manager/gnome/default.nix
@@ -27,6 +27,8 @@
};
home.packages = with pkgs; [
+ gnome-tweaks
+ gnomeExtensions.appindicator
gnomeExtensions.pop-shell
gnomeExtensions.forge
gnomeExtensions.tray-icons-reloaded
@@ -34,6 +36,5 @@
gnomeExtensions.sound-output-device-chooser
gnomeExtensions.space-bar
nordzy-icon-theme
-
];
-}
\ No newline at end of file
+}
diff --git a/home-manager/home.nix b/home-manager/home.nix
index b6d26f7..212d407 100644
--- a/home-manager/home.nix
+++ b/home-manager/home.nix
@@ -26,40 +26,26 @@
home = {
homeDirectory = "/home/thiago";
packages = with pkgs; [
- bambu-studio
direnv
fira-code
firefox
heroic
hwinfo
- hydralauncher
inkscape
- wl-clipboard
- kanshi
- keymapp
lazygit
libinput
- librespot
- luarocks
- nerd-fonts.gohufont
nerd-fonts.fira-code
nil
nixpkgs-fmt
nordic
obsidian
python3
- python3Packages.pip
ripgrep
- shfmt
statix
- stylua
- sysbench
- swaybg
- transmission_4
uget
unzip
+ waydroid
wl-clipboard
- zed-editor
];
username = "thiago";
};
@@ -113,12 +99,11 @@
settings = {
hide_window_decorations = "titlebar-only";
font_size = 18;
- font_family="GohuFont 14 Nerd Font Mono";
+ font_family = "GohuFont 14 Nerd Font Mono";
inactive_text_alpha = "0.6";
# background_blur = 32;
background_opacity = 1.0;
};
- themeFile = "Nord";
};
vscode = {
@@ -126,29 +111,6 @@
};
};
- systemd.user.services.librespot-connect = {
- Unit = {
- Description = "Librespot (Spotify Connect) bound to LAN interface";
- After = [ "network.target" ];
- };
- Service = {
- ExecStart = "${pkgs.librespot}/bin/librespot \
- --name LS-TEST \
- --backend pulseaudio \
- --device default \
- --bitrate 320 \
- --disable-audio-cache \
- --enable-volume-normalisation \
- --initial-volume 75 \
- --zeroconf-port 17005";
- Restart = "on-failure";
- BindToDevice = "wlp7s0"; # Force binding to LAN interface
- };
- Install = {
- WantedBy = [ "default.target" ];
- };
- };
-
systemd.user.startServices = "sd-switch";
home.stateVersion = "25.11";
}
diff --git a/home-manager/hyprland/default.nix b/home-manager/hyprland/default.nix
index 419e25c..87d28cc 100644
--- a/home-manager/hyprland/default.nix
+++ b/home-manager/hyprland/default.nix
@@ -1,4 +1,5 @@
-{lib, ...}: {
+{ lib, ... }:
+{
home.sessionVariables = {
fileManager = "thunar";
menu = "fuzzel --show drun";
@@ -22,7 +23,7 @@
sha256 = "0gxa45qigjcjb12v243jv37nji5dax6rn5y6l823f0a2s2hfkqm5";
};
force = true;
- };
+ };
};
services.hyprpaper.enable = true;
services.hyprpaper.settings = {
@@ -34,7 +35,7 @@
enable = true;
settings = {
"$mod" = "SUPER";
- layerrule =[
+ layerrule = [
"ignorezero, waybar"
"blur, waybar"
];
@@ -80,9 +81,8 @@
"$mod, mouse_up, workspace, e-1"
];
-
bindm = [
- "$mod, mouse:272, movewindow" # Hold $mod and left mouse button to move window
+ "$mod, mouse:272, movewindow" # Hold $mod and left mouse button to move window
"$mod, mouse:273, resizewindow" # Hold $mod and right mouse button to resize window
];
diff --git a/home-manager/vim.nix b/home-manager/vim.nix
index 66d647e..a4cc953 100644
--- a/home-manager/vim.nix
+++ b/home-manager/vim.nix
@@ -2,7 +2,7 @@
{
imports = [
- inputs.nixvim.homeManagerModules.nixvim
+ inputs.nixvim.homeModules.nixvim
];
home.packages = with pkgs; [
ripgrep
@@ -96,4 +96,3 @@
'';
};
}
-
diff --git a/home-manager/zsh.nix b/home-manager/zsh.nix
index 5289149..ac8d7c9 100644
--- a/home-manager/zsh.nix
+++ b/home-manager/zsh.nix
@@ -3,16 +3,7 @@
, pkgs
, ...
}:
-let
- isWayland = config.custom.sessionType == "wayland";
-in
{
- options.custom.sessionType = lib.mkOption {
- type = lib.types.str;
- default = "x11";
- description = "The X session type: 'wayland' or 'x11'";
- };
-
config = {
home.file."scripts/lsgpu.sh" = {
source = ./scripts/lsgpu.sh;
@@ -28,25 +19,15 @@ in
export GPG_TTY=$(tty)
'';
- shellAliases = lib.mkMerge [
- {
- "vi" = "nvim";
- "vim" = "nvim";
- "ll" = "ls -l";
- "lsgpu" = "$HOME/scripts/lsgpu.sh";
- "gedit" = "gnome-text-editor";
- }
-
- (lib.mkIf isWayland {
- "pbcopy" = "wl-copy";
- "pbpaste" = "wl-paste";
- })
-
- (lib.mkIf (!isWayland) {
- "pbcopy" = "xclip -selection clipboard -i";
- "pbpaste" = "xclip -selection clipboard -o";
- })
- ];
+ shellAliases = {
+ "vi" = "nvim";
+ "vim" = "nvim";
+ "ll" = "ls -l";
+ "lsgpu" = "$HOME/scripts/lsgpu.sh";
+ "gedit" = "gnome-text-editor";
+ "pbcopy" = "wl-copy";
+ "pbpaste" = "wl-paste";
+ };
oh-my-zsh = {
enable = true;
@@ -57,7 +38,5 @@ in
];
};
};
-
- home.packages = with pkgs; [ xclip ];
};
}
diff --git a/hosts/Nixstation/default.nix b/hosts/Nixstation/default.nix
index 169431e..5f42285 100644
--- a/hosts/Nixstation/default.nix
+++ b/hosts/Nixstation/default.nix
@@ -12,7 +12,9 @@
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
+ # kernelPackages = pkgs.linuxPackages_6_16;
};
+
environment = {
systemPackages = with pkgs; [
act
@@ -21,16 +23,9 @@
networkmanagerapplet
libwacom
wacomtablet
- gnome-tweaks
- gnome-session
];
-
- variables = {
- NIXOS_HOST = "nixstation";
- NIXOS_DE = "wayland";
- };
};
-
+
hardware = {
sane.enable = true;
graphics.enable = true;
@@ -144,15 +139,15 @@
};
system.stateVersion = "25.11"; # keep it!
time.timeZone = "America/Sao_Paulo";
- # virtualisation = {
- # vmware.host.enable = false;
- # spiceUSBRedirection.enable = true;
- # libvirtd = {
- # enable = true;
- # qemu.ovmf.enable = true;
- # # qemu.package = pkgs.qemu_full;
- # };
- # };
+ virtualisation = {
+ vmware.host.enable = false;
+ spiceUSBRedirection.enable = true;
+ libvirtd = {
+ enable = true;
+ qemu.ovmf.enable = true;
+ # qemu.package = pkgs.qemu_full;
+ };
+ };
zramSwap = {
enable = true;
diff --git a/hosts/Nixstation/hardware-configuration.nix b/hosts/Nixstation/hardware-configuration.nix
index 7c73688..eb809da 100644
--- a/hosts/Nixstation/hardware-configuration.nix
+++ b/hosts/Nixstation/hardware-configuration.nix
@@ -26,22 +26,25 @@
extraModulePackages = [ ];
};
-fileSystems."/" =
- { device = "/dev/disk/by-uuid/07c4d31f-e1cd-4a02-8b3f-8c2bd2e0ce8d";
+ fileSystems."/" = {
+ device = "/dev/disk/by-uuid/07c4d31f-e1cd-4a02-8b3f-8c2bd2e0ce8d";
fsType = "btrfs";
options = [ "subvol=@" ];
};
-fileSystems."/home" =
- { device = "/dev/disk/by-uuid/07c4d31f-e1cd-4a02-8b3f-8c2bd2e0ce8d";
+ fileSystems."/home" = {
+ device = "/dev/disk/by-uuid/07c4d31f-e1cd-4a02-8b3f-8c2bd2e0ce8d";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
-fileSystems."/boot" =
- { device = "/dev/disk/by-uuid/D2EA-469F";
+ fileSystems."/boot" = {
+ device = "/dev/disk/by-uuid/D2EA-469F";
fsType = "vfat";
- options = [ "fmask=0077" "dmask=0077" ];
+ options = [
+ "fmask=0077"
+ "dmask=0077"
+ ];
};
swapDevices = [ ];
diff --git a/hosts/common/default.nix b/hosts/common/default.nix
index a7b44c1..d07253d 100644
--- a/hosts/common/default.nix
+++ b/hosts/common/default.nix
@@ -55,7 +55,7 @@
programs.zsh.enable = true;
services = {
pcscd.enable = true;
- # xserver.displayManager.sessionCommands =
+ # xserver.displayManager.sessionCommands =
# "${pkgs.xorg.xmodmap}/bin/xmodmap -e 'keycode 64 = Alt_L'";
};
diff --git a/hosts/common/nvidia/default.nix b/hosts/common/nvidia/default.nix
index a426ae5..b44ff63 100644
--- a/hosts/common/nvidia/default.nix
+++ b/hosts/common/nvidia/default.nix
@@ -6,9 +6,8 @@
# ./passthrough.nix
];
boot.kernelModules = [ "nvidia" ];
- boot.kernelParams = ["nvidia-drm.modset=1"];
- boot.blacklistedKernelModules = ["nouveau"];
- boot.kernelPackages = pkgs.linuxPackages_6_12;
+ boot.kernelParams = [ "nvidia-drm.modset=1" ];
+ boot.blacklistedKernelModules = [ "nouveau" ];
hardware = {
graphics = {
enable = true;
@@ -29,13 +28,14 @@
};
services = {
- desktopManager.gnome.enable = true;
- displayManager = {
+ services.xserver.enable = true;
+ desktopManager.gnome.enable = true;
+ displayManager = {
gdm.enable = true;
gdm.wayland = true;
defaultSession = "gnome";
- };
- xserver.videoDrivers = [ "nvidia" ];
+ };
+ xserver.videoDrivers = [ "nvidia" ];
};
nixpkgs.config.cudaSupport = true;
diff --git a/hosts/common/users/thiago/default.nix b/hosts/common/users/thiago/default.nix
index 8016d79..dd5dd93 100644
--- a/hosts/common/users/thiago/default.nix
+++ b/hosts/common/users/thiago/default.nix
@@ -7,25 +7,24 @@ in
isNormalUser = true;
initialPassword = "changeme";
- extraGroups =
- [
- "fuse"
- "networkmanager"
- "wheel"
- "scard"
- ]
- ++ ifTheyExist [
- "wireshark"
- "i2c"
- "docker"
- "git"
- "libvirtd"
- "libvirt"
- "video"
- "kvm"
- "scanner"
- "photos"
- ];
+ extraGroups = [
+ "fuse"
+ "networkmanager"
+ "scard"
+ "wheel"
+ ]
+ ++ ifTheyExist [
+ "docker"
+ "git"
+ "i2c"
+ "kvm"
+ "libvirt"
+ "libvirtd"
+ "photos"
+ "scanner"
+ "video"
+ "wireshark"
+ ];
openssh.authorizedKeys.keyFiles = [
(builtins.fetchurl {
url = "https://github.com/sposito.keys";