From 432d5df1956d3b59c7e6fd0ed224b412a3e96f98 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Tue, 17 Feb 2026 15:21:54 -0700 Subject: [PATCH] Cleanup with LSP guidance --- configuration.nix | 7 +++++-- modules/audio.nix | 2 +- modules/boot.nix | 8 ++++++-- modules/desktop.nix | 2 +- modules/hardware.nix | 2 +- modules/home.nix | 16 +++++++++------- modules/home/cli.nix | 8 +++++--- modules/home/cosmic.nix | 2 +- modules/home/session.nix | 2 +- modules/home/ssh.nix | 2 +- modules/home/syncthing.nix | 2 +- modules/home/zed.nix | 7 +++++-- modules/locale.nix | 4 ++-- modules/networking.nix | 18 +++++++++++++----- modules/programs.nix | 2 +- modules/services.nix | 38 +++++++++++++++++--------------------- modules/users.nix | 2 +- 17 files changed, 71 insertions(+), 53 deletions(-) diff --git a/configuration.nix b/configuration.nix index 3698ae8..87bf5d5 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { imports = [ @@ -17,7 +17,10 @@ ./modules/home.nix ]; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; system.stateVersion = "25.11"; } diff --git a/modules/audio.nix b/modules/audio.nix index 6dd7184..4470e85 100644 --- a/modules/audio.nix +++ b/modules/audio.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { security.rtkit.enable = true; diff --git a/modules/boot.nix b/modules/boot.nix index 2afa00e..f0712c2 100644 --- a/modules/boot.nix +++ b/modules/boot.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { boot.loader.systemd-boot = { @@ -12,7 +12,11 @@ boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelModules = [ "tcp_bbr" ]; boot.initrd.kernelModules = [ "amdgpu" ]; - boot.kernelParams = [ "preempt=full" "quiet" "udev.log_priority=3" ]; + boot.kernelParams = [ + "preempt=full" + "quiet" + "udev.log_priority=3" + ]; boot.tmp.useTmpfs = true; boot.tmp.tmpfsSize = "4G"; diff --git a/modules/desktop.nix b/modules/desktop.nix index bf10852..b004687 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { services.desktopManager.cosmic.enable = true; diff --git a/modules/hardware.nix b/modules/hardware.nix index c1bc6a5..28060d2 100644 --- a/modules/hardware.nix +++ b/modules/hardware.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { hardware.graphics = { diff --git a/modules/home.nix b/modules/home.nix index b45c13d..c8a738a 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, inputs, ... }: +{ inputs, ... }: let settings = import ../settings.nix; @@ -26,11 +26,13 @@ in inherit settings; }; - home-manager.users.${settings.username} = { config, ... }: { - imports = homeModules; - home.stateVersion = "25.11"; - home.sessionVariables = { - SSH_AUTH_SOCK = "${config.home.homeDirectory}/.bitwarden-ssh-agent.sock"; + home-manager.users.${settings.username} = + { config, ... }: + { + imports = homeModules; + home.stateVersion = "25.11"; + home.sessionVariables = { + SSH_AUTH_SOCK = "${config.home.homeDirectory}/.bitwarden-ssh-agent.sock"; + }; }; - }; } diff --git a/modules/home/cli.nix b/modules/home/cli.nix index e93e919..0f609fc 100644 --- a/modules/home/cli.nix +++ b/modules/home/cli.nix @@ -1,15 +1,17 @@ -{ pkgs, ... }: +{ ... }: { home.shellAliases = { # Nix Commands "nix:rebuild" = "sudo nixos-rebuild switch --flake /etc/nixos"; "nix:update" = "cd /etc/nixos && nix flake update && sudo nixos-rebuild switch --flake ."; - "nix:purge" = "sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot"; + "nix:purge" = + "sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot"; "nix:edit" = "$EDITOR /etc/nixos"; "nix:push" = "cd /etc/nixos && git add -A && git commit -m \"$(date -u +%s)\" && git push"; "nix:pull" = "cd /etc/nixos && git pull"; - "nix:hw" = "sudo nixos-generate-config --show-hardware-config > /etc/nixos/hardware-configuration.nix"; + "nix:hw" = + "sudo nixos-generate-config --show-hardware-config > /etc/nixos/hardware-configuration.nix"; # Utilities "fixaudio" = "systemctl --user restart pipewire pipewire-pulse wireplumber"; diff --git a/modules/home/cosmic.nix b/modules/home/cosmic.nix index 121ea43..1d57e20 100644 --- a/modules/home/cosmic.nix +++ b/modules/home/cosmic.nix @@ -1,4 +1,4 @@ -{ config, lib, cosmicLib, ... }: +{ config, cosmicLib, ... }: { wayland.desktopManager.cosmic = { diff --git a/modules/home/session.nix b/modules/home/session.nix index 31b246f..1c0ea28 100644 --- a/modules/home/session.nix +++ b/modules/home/session.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ ... }: { home.file."Assets" = { diff --git a/modules/home/ssh.nix b/modules/home/ssh.nix index e45ce74..dad0382 100644 --- a/modules/home/ssh.nix +++ b/modules/home/ssh.nix @@ -1,4 +1,4 @@ -{ settings, ... }: +{ ... }: { programs.ssh = { diff --git a/modules/home/syncthing.nix b/modules/home/syncthing.nix index 1eccd8d..02123a9 100644 --- a/modules/home/syncthing.nix +++ b/modules/home/syncthing.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { services.syncthing = { diff --git a/modules/home/zed.nix b/modules/home/zed.nix index 2473a06..621e746 100644 --- a/modules/home/zed.nix +++ b/modules/home/zed.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ ... }: { programs.zed-editor = { @@ -44,7 +44,10 @@ languages = { "Nix" = { - language_servers = [ "nil" "nixd" ]; + language_servers = [ + "nil" + "nixd" + ]; format_on_save = "on"; }; }; diff --git a/modules/locale.nix b/modules/locale.nix index fdd4f48..c8a51d2 100644 --- a/modules/locale.nix +++ b/modules/locale.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: let settings = import ../settings.nix; @@ -9,4 +9,4 @@ in # Internationalization properties i18n.defaultLocale = settings.locale; -} \ No newline at end of file +} diff --git a/modules/networking.nix b/modules/networking.nix index 9e3f07e..15d9fdb 100644 --- a/modules/networking.nix +++ b/modules/networking.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: let settings = import ../settings.nix; @@ -17,19 +17,27 @@ in # Allowed ports allowedTCPPorts = [ # SyncThing - 8384 22000 + 8384 + 22000 ]; allowedUDPPorts = [ # SyncThing - 22000 21027 + 22000 + 21027 ]; }; - networking.nameservers = [ "1.1.1.1" "9.9.9.9" ]; + networking.nameservers = [ + "1.1.1.1" + "9.9.9.9" + ]; services.resolved = { enable = true; dnsovertls = "opportunistic"; - fallbackDns = [ "1.0.0.1" "149.112.112.112" ]; + fallbackDns = [ + "1.0.0.1" + "149.112.112.112" + ]; }; } diff --git a/modules/programs.nix b/modules/programs.nix index e9a9edb..973c8b8 100644 --- a/modules/programs.nix +++ b/modules/programs.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { # Enable unfree globally diff --git a/modules/services.nix b/modules/services.nix index f799c43..18fa7d8 100644 --- a/modules/services.nix +++ b/modules/services.nix @@ -1,10 +1,6 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: -let - settings = import ../settings.nix; -in { - # Hardened OpenSSH services.openssh = { enable = true; ports = [ 22 ]; @@ -38,22 +34,22 @@ in # Sunshine services.sunshine = { - enable = true; - autoStart = true; - capSysAdmin = true; - openFirewall = true; - applications = { - apps = [ - { - name = "Steam Big Picture"; - cmd = "${pkgs.steam}/bin/steam -gamepadui"; - } - { - name = "Desktop"; - cmd = "${pkgs.coreutils}/bin/true"; - } - ]; - }; + enable = true; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + applications = { + apps = [ + { + name = "Steam Big Picture"; + cmd = "${pkgs.steam}/bin/steam -gamepadui"; + } + { + name = "Desktop"; + cmd = "${pkgs.coreutils}/bin/true"; + } + ]; + }; }; services.avahi.publish.enable = true; diff --git a/modules/users.nix b/modules/users.nix index a9ed61c..50ad777 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: let settings = import ../settings.nix;