From 46fb7622e917551c2e6a712d02f30c96c9cce702 Mon Sep 17 00:00:00 2001 From: DerGrumpf Date: Fri, 10 Apr 2026 21:32:38 +0200 Subject: [PATCH] Added Guard for Server Configuration; Builds are all successfull --- home/catppuccin.nix | 53 +++++++++++++++++++++++++ home/default.nix | 86 +++++++--------------------------------- home/desktop/default.nix | 3 +- home/neovim/lsp.nix | 9 ++++- nixos/catppuccin.nix | 19 +++++++++ nixos/default.nix | 56 ++++++++++---------------- 6 files changed, 115 insertions(+), 111 deletions(-) create mode 100644 home/catppuccin.nix create mode 100644 nixos/catppuccin.nix diff --git a/home/catppuccin.nix b/home/catppuccin.nix new file mode 100644 index 0000000..6040348 --- /dev/null +++ b/home/catppuccin.nix @@ -0,0 +1,53 @@ +{ + lib, + isDarwin, + inputs, + ... +}: +{ + imports = [ inputs.catppuccin.homeModules.catppuccin ]; + + catppuccin = { + enable = false; + accent = "sky"; + flavor = "mocha"; + eza.enable = true; + fzf.enable = true; + bat.enable = true; + element-desktop = lib.mkIf (!isDarwin) { + enable = true; + accent = "green"; + }; + btop.enable = true; + cava = { + enable = true; + transparent = true; + }; + kitty.enable = true; + lazygit.enable = true; + yazi.enable = true; + fish.enable = true; + cursors = lib.mkIf (!isDarwin) { + enable = true; + accent = "sapphire"; + }; + hyprland = lib.mkIf (!isDarwin) { enable = true; }; + hyprlock = lib.mkIf (!isDarwin) { + enable = true; + useDefaultConfig = false; + }; + waybar = lib.mkIf (!isDarwin) { + enable = true; + mode = "createLink"; + }; + mako.enable = lib.mkIf (!isDarwin) true; + mpv.enable = lib.mkIf (!isDarwin) true; + newsboat.enable = true; + mangohud.enable = lib.mkIf (!isDarwin) true; + gtk.icon.enable = lib.mkIf (!isDarwin) true; + kvantum = lib.mkIf (!isDarwin) { + enable = true; + apply = true; + }; + }; +} diff --git a/home/default.nix b/home/default.nix index c32fb75..5bb48f9 100644 --- a/home/default.nix +++ b/home/default.nix @@ -5,6 +5,7 @@ self, lib, isDarwin, + isServer, ... }: { @@ -16,93 +17,37 @@ ./xdg.nix ./neovim ./python.nix + inputs.sops-nix.homeManagerModules.sops + ] + ++ lib.optionals (!isDarwin && !isServer) [ + ./desktop + ./catppuccin.nix + ] + ++ lib.optionals isDarwin [ + ./desktop/sketchybar + ./catppuccin.nix + ] + ++ lib.optionals (!isServer) [ ./nixcord.nix ./spicetify.nix ./floorp.nix ./obsidian.nix - inputs.sops-nix.homeManagerModules.sops - ] - ++ lib.optionals (!isDarwin) [ ./desktop ] - ++ lib.optionals isDarwin [ - ./desktop/sketchybar - inputs.catppuccin.homeModules.catppuccin ]; + nixpkgs.config.allowUnfree = true; - #targets.darwin.copyApps.enableChecks = isDarwin; - - catppuccin = { - enable = false; - accent = "sky"; - flavor = "mocha"; - - eza.enable = true; - fzf.enable = true; - bat.enable = true; - - element-desktop = lib.mkIf (!isDarwin) { - enable = true; - accent = "green"; - }; - - btop.enable = true; - - cava = lib.mkIf (!isDarwin) { - enable = true; - transparent = true; - }; - - kitty.enable = true; - lazygit.enable = true; - yazi.enable = true; - fish.enable = true; - - cursors = lib.mkIf (!isDarwin) { - enable = true; - accent = "sapphire"; - }; - - hyprland = lib.mkIf (!isDarwin) { enable = true; }; - - hyprlock = lib.mkIf (!isDarwin) { - enable = true; - useDefaultConfig = false; - }; - - waybar = lib.mkIf (!isDarwin) { - enable = true; - mode = "createLink"; - }; - - mako.enable = lib.mkIf (!isDarwin) true; - mpv.enable = lib.mkIf (!isDarwin) true; - newsboat.enable = lib.mkIf (!isDarwin) true; - mangohud.enable = lib.mkIf (!isDarwin) true; - - gtk.icon.enable = lib.mkIf (!isDarwin) true; - - kvantum = lib.mkIf (!isDarwin) { - enable = true; - apply = true; - }; - }; - home = { - - # activation.checkAppManagementPermission = lib.mkForce ""; username = primaryUser; stateVersion = "26.05"; - sessionVariables = lib.mkIf (!isDarwin) { + sessionVariables = lib.mkIf (!isDarwin && !isServer) { GROQ_API_KEY = config.sops.secrets.GROQ_API_KEY.path; OPENWEATHER_API_KEY = config.sops.secrets.OPENWEATHER_API_KEY.path; }; - - file = { + file = lib.mkIf (!isServer) { "Pictures/Avatar" = { source = "${self}/assets/avatar"; recursive = true; }; - "Pictures/Wallpapers" = { source = "${self}/assets/wallpapers"; recursive = true; @@ -118,7 +63,6 @@ "/Users/${primaryUser}/.config/nix/secrets/keys.txt" else "/home/${primaryUser}/.config/nix/secrets/keys.txt"; - secrets = { GROQ_API_KEY = { }; OPENWEATHER_API_KEY = { }; diff --git a/home/desktop/default.nix b/home/desktop/default.nix index 043e39e..05341c5 100644 --- a/home/desktop/default.nix +++ b/home/desktop/default.nix @@ -1,7 +1,6 @@ -{ pkgs, inputs, ... }: +{ pkgs, ... }: { imports = [ - inputs.catppuccin.homeModules.catppuccin ./hyprland ./rofi ./waybar diff --git a/home/neovim/lsp.nix b/home/neovim/lsp.nix index c995e49..678dc15 100644 --- a/home/neovim/lsp.nix +++ b/home/neovim/lsp.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ # LSP configuration: Language Server Protocol provides IDE features # like autocomplete, go-to-definition, diagnostics, and more. programs.nixvim = { @@ -80,6 +81,10 @@ }; # Install LSP servers - extraPackages = with pkgs; [ lua-language-server nil rust-analyzer ]; + extraPackages = with pkgs; [ + lua-language-server + nil + rust-analyzer + ]; }; } diff --git a/nixos/catppuccin.nix b/nixos/catppuccin.nix new file mode 100644 index 0000000..205a962 --- /dev/null +++ b/nixos/catppuccin.nix @@ -0,0 +1,19 @@ +{ inputs, ... }: +{ + imports = [ inputs.catppuccin.nixosModules.catppuccin ]; + + catppuccin = { + enable = true; + accent = "sky"; + flavor = "mocha"; + cache.enable = true; + cursors = { + enable = true; + accent = "sapphire"; + }; + fcitx5.enable = false; + forgejo.enable = false; + gitea.enable = false; + sddm.enable = false; + }; +} diff --git a/nixos/default.nix b/nixos/default.nix index f7b52f4..656487c 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -1,43 +1,28 @@ { pkgs, inputs, + lib, primaryUser, + isServer, ... }: { imports = [ ./fonts.nix ./sops.nix + ./locale.nix + ./tailscale.nix + ./ssh.nix + ] + ++ lib.optionals (!isServer) [ ./regreet.nix ./plymouth.nix ./audio.nix - ./ssh.nix - ./locale.nix - ./tailscale.nix - ./virt.nix ./webcam.nix - - inputs.catppuccin.nixosModules.catppuccin + ./virt.nix + ./catppuccin.nix ]; - catppuccin = { - enable = true; - accent = "sky"; - flavor = "mocha"; - cache.enable = true; - - cursors = { - enable = true; - accent = "sapphire"; - }; - - fcitx5.enable = false; - forgejo.enable = false; - gitea.enable = false; - sddm.enable = false; - }; - - # nix config nix = { settings = { experimental-features = [ @@ -59,8 +44,6 @@ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; }; - - # Garbage collection gc = { automatic = true; dates = "weekly"; @@ -68,39 +51,38 @@ }; }; - # Disable Docs documentation = { enable = true; - doc.enable = false; # Skip large documentation - man.enable = false; # Keep man pages - info.enable = false; # Skip info pages + doc.enable = false; + man.enable = false; + info.enable = false; }; - nixpkgs.config = { - allowUnfree = true; - }; + nixpkgs.config.allowUnfree = true; programs = { fish.enable = true; + } + // lib.optionalAttrs (!isServer) { + dconf.enable = true; hyprland = { enable = true; package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; }; steam.enable = true; - dconf.enable = true; appimage = { enable = true; binfmt = true; }; }; - security = { + security = lib.mkIf (!isServer) { pam.services.swaylock = { }; polkit.enable = true; apparmor.enable = false; }; - services.gnome = { + services.gnome = lib.mkIf (!isServer) { tinysparql.enable = true; localsearch.enable = true; }; @@ -111,6 +93,8 @@ isNormalUser = true; extraGroups = [ "wheel" + ] + ++ lib.optionals (!isServer) [ "video" "audio" "libvirtd"