From 01ce9ad9ca326a05790dac75b264b46d2e7ce853 Mon Sep 17 00:00:00 2001 From: Grey Jones Date: Sun, 5 Jul 2026 14:19:03 +0100 Subject: [PATCH] make everything more modular + basic kitagawa config using gnome --- global-configs/fastfetch.nix | 2 + global-configs/kitty.nix | 14 +++ global-configs/zsh.nix | 27 ++++++ global-default.nix | 11 ++- hosts/kitagawa/default.nix | 45 +++++++++ hosts/kitagawa/home.nix | 29 ++++++ hosts/nixos-vm/configs/zen-browser.nix | 91 ------------------- hosts/nixos-vm/default.nix | 8 +- hosts/nixos-vm/home.nix | 78 +++++----------- modules/desktop-environments/gnome.nix | 20 ++++ modules/desktop-environments/plasma6.nix | 17 ++++ modules/display-managers/gdm.nix | 7 ++ .../sddm.nix} | 14 +-- modules/zsh.nix | 9 ++ 14 files changed, 203 insertions(+), 169 deletions(-) create mode 100644 global-configs/kitty.nix create mode 100644 global-configs/zsh.nix create mode 100644 hosts/kitagawa/default.nix create mode 100644 hosts/kitagawa/home.nix delete mode 100644 hosts/nixos-vm/configs/zen-browser.nix create mode 100644 modules/desktop-environments/gnome.nix create mode 100644 modules/desktop-environments/plasma6.nix create mode 100644 modules/display-managers/gdm.nix rename modules/{plasma-desktop.nix => display-managers/sddm.nix} (52%) create mode 100644 modules/zsh.nix diff --git a/global-configs/fastfetch.nix b/global-configs/fastfetch.nix index b32f0c8..d734694 100644 --- a/global-configs/fastfetch.nix +++ b/global-configs/fastfetch.nix @@ -2,6 +2,8 @@ pkgs, ... }: { + programs.zsh.initContent = lib.mkOrder 1500 "fastfetch"; + programs.fastfetch = { enable = true; settings = { diff --git a/global-configs/kitty.nix b/global-configs/kitty.nix new file mode 100644 index 0000000..4d7a35d --- /dev/null +++ b/global-configs/kitty.nix @@ -0,0 +1,14 @@ +{ + pkgs, + ... +}: { + programs.kitty = { + enable = true; + settings = { + confirm_os_window_close = -1; + }; + + shellIntegration.enableBashIntegration = true; + themeFile = "Arthur"; + }; +} \ No newline at end of file diff --git a/global-configs/zsh.nix b/global-configs/zsh.nix new file mode 100644 index 0000000..7a3ccbf --- /dev/null +++ b/global-configs/zsh.nix @@ -0,0 +1,27 @@ +{ + pkgs, + ... +}: { + home.shell.enableZshIntegration = true; + + programs.kitty.shellIntegration.enableZshIntegration = true; + + programs.zsh = { + antidote = { + enable = true; + plugins = [ + "getantidote/use-omz" + "ohmyzsh/ohmyzsh path:lib" + "ohmyzsh/ohmyzsh path:plugins/pip" + "ohmyzsh/ohmyzsh path:plugins/command-not-found" + "ohmyzsh/ohmyzsh path:themes/nanotech.zsh-theme" + "zsh-users/zsh-autosuggestions" + "zsh-users/zsh-syntax-highlighting" + ]; + }; + + localVariables = { + PATH = "/home/grey/.local/bin:$PATH"; + }; + } +} \ No newline at end of file diff --git a/global-default.nix b/global-default.nix index 542165a..26f47d6 100644 --- a/global-default.nix +++ b/global-default.nix @@ -4,6 +4,10 @@ specialArgs, ... }: { + includes = [ + /hosts/${specialArgs.hostname}/hardware-configuration.nix + ]; + networking.hostName = specialArgs.hostname; # Define your hostname. nix.settings.experimental-features = [ @@ -59,10 +63,9 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - pkgs.pipewire - pkgs.git - pkgs.fzf - pkgs.jq + git + fzf + jq ]; # This value determines the NixOS release from which the default diff --git a/hosts/kitagawa/default.nix b/hosts/kitagawa/default.nix new file mode 100644 index 0000000..db15032 --- /dev/null +++ b/hosts/kitagawa/default.nix @@ -0,0 +1,45 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ + config, + pkgs, + ... +}: let +modules-dir = ../../modules; +in { + imports = [ + ../../global-default.nix + ./hardware-configuration.nix + "${modules-dir}/nh.nix" + "${modules-dir}/home-manager.nix" + "${modules-dir}/zsh.nix" + "${modules-dir}/display-managers/gdm.nix" + "${modules-dir}/desktop-environments/gnome.nix" + ]; + + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; +} diff --git a/hosts/kitagawa/home.nix b/hosts/kitagawa/home.nix new file mode 100644 index 0000000..878f32e --- /dev/null +++ b/hosts/kitagawa/home.nix @@ -0,0 +1,29 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: let +global-configs = ../../global-configs; +in { + imports = [ + ../../global-home.nix + "${global-configs}/fastfetch.nix" + "${global-configs}/zsh.nix" + "${global-configs}/kitty.nix" + ]; + + home.packages = with pkgs; [ + equibop + obsidian + github-desktop + vscode + thunderbird + spotify + jetbrains.clion + jetbrains.idea + proton-vpn + ente-auth + ]; +} diff --git a/hosts/nixos-vm/configs/zen-browser.nix b/hosts/nixos-vm/configs/zen-browser.nix deleted file mode 100644 index 019af12..0000000 --- a/hosts/nixos-vm/configs/zen-browser.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ - pkgs, - inputs, - ... -}: let - firefox-addons = with pkgs; inputs.firefox-addons.packages.${system}; -in { - programs.zen-browser = { - enable = true; - setAsDefaultBrowser = true; - nativeMessagingHosts = [ - pkgs.firefoxpwa - ]; - policies = { - AutofillAddressEnabled = false; - AutofillCreditCardEnabled = false; - DisableAppUpdate = true; - DisableFeedbackCommands = true; - DisableFirefoxStudies = true; - DisablePocket = true; - DisableTelemetry = true; - NoDefaultBookmarks = true; - OfferToSaveLogins = false; - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; - Preferences = { - "browser.startup.homepage" = { - Value = "about:blank"; - Status = "locked"; - }; - }; - }; - profiles.default = { - settings = { - "zen.urlbar.behavior" = "float"; - "zen.welcome-screen.seen" = true; - }; - extensions.packages = with firefox-addons; [ - adnauseam - bitwarden - indie-wiki-buddy - pwas-for-firefox - ]; - search = { - force = true; - default = "ddg"; - engines = { - nixpkgs = { - name = "nixpkgs packages"; - urls = [ - { - template = "https://search.nixos.org/packages?query={searchTerms}"; - } - ]; - icon = "https://wiki.nixos.org/favicon.ico"; - definedAliases = ["@np"]; - }; - nixos-options = { - name = "NixOS options"; - urls = [ - { - template = "https://search.nixos.org/options?query={searchTerms}"; - } - ]; - icon = "https://wiki.nixos.org/favicon.ico"; - definedAliases = ["@no"]; - }; - nixos-wiki = { - name = "NixOS Wiki"; - urls = [ - { - template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; - } - ]; - icon = "https://wiki.nixos.org/favicon.ico"; - definedAliases = ["@nw"]; - }; - }; - }; - #keyboardShortcuts = [ - # { - # id = "zen" - # } - #]; - }; - }; -} diff --git a/hosts/nixos-vm/default.nix b/hosts/nixos-vm/default.nix index 8e592b7..f4afdf5 100644 --- a/hosts/nixos-vm/default.nix +++ b/hosts/nixos-vm/default.nix @@ -13,8 +13,10 @@ in { ../../global-default.nix ./hardware-configuration.nix "${modules-dir}/nh.nix" - "${modules-dir}/plasma-desktop.nix" + "${modules-dir}/display-managers/sddm.nix" + "${modules-dir}/desktop-environments/plasma6.nix" "${modules-dir}/home-manager.nix" + "${modules-dir}/zsh.nix" ]; # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. @@ -26,10 +28,6 @@ in { virtualisation.virtualbox.guest.enable = true; virtualisation.virtualbox.guest.dragAndDrop = true; - programs.zsh.enable = true; - users.defaultUserShell = pkgs.zsh; - users.users."grey".shell = pkgs.zsh; - # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; diff --git a/hosts/nixos-vm/home.nix b/hosts/nixos-vm/home.nix index fa63961..c61cdb1 100644 --- a/hosts/nixos-vm/home.nix +++ b/hosts/nixos-vm/home.nix @@ -5,67 +5,33 @@ lib, ... }: let -global-configs-dir = ../../global-configs; +global-configs = ../../global-configs; in { imports = [ ../../global-home.nix - "${global-configs-dir}/plasma.nix" - "${global-configs-dir}/fastfetch.nix" - "${global-configs-dir}/zen-browser.nix" + "${global-configs}/plasma.nix" + "${global-configs}/fastfetch.nix" + "${global-configs}/zen-browser.nix" + "${global-configs}/zsh.nix" + "${global-configs}/kitty.nix" ]; home.packages = with pkgs; [ - pkgs.steam - pkgs.equibop - pkgs.prismlauncher - pkgs.obsidian - pkgs.github-desktop - pkgs.vscode - pkgs.thunderbird - pkgs.spotify - pkgs.unityhub - pkgs.godot - pkgs.jetbrains.clion - pkgs.jetbrains.idea - pkgs.obs-studio - pkgs.proton-vpn - pkgs.ente-auth - pkgs.lact + steam + equibop + prismlauncher + obsidian + github-desktop + vscode + thunderbird + spotify + unityhub + godot + jetbrains.clion + jetbrains.idea + obs-studio + proton-vpn + ente-auth + lact ]; - - home.shell.enableZshIntegration = true; - - programs.zsh = { - enable = true; - - antidote = { - enable = true; - plugins = [ - "getantidote/use-omz" - "ohmyzsh/ohmyzsh path:lib" - "ohmyzsh/ohmyzsh path:plugins/pip" - "ohmyzsh/ohmyzsh path:plugins/command-not-found" - "ohmyzsh/ohmyzsh path:themes/nanotech.zsh-theme" - "zsh-users/zsh-autosuggestions" - "zsh-users/zsh-syntax-highlighting" - ]; - }; - - localVariables = { - PATH = "/home/grey/.local/bin:$PATH"; - }; - - initContent = lib.mkOrder 1500 "fastfetch"; - }; - - programs.kitty = { - enable = true; - settings = { - confirm_os_window_close = -1; - }; - - shellIntegration.enableBashIntegration = true; - shellIntegration.enableZshIntegration = true; - themeFile = "Arthur"; - }; } diff --git a/modules/desktop-environments/gnome.nix b/modules/desktop-environments/gnome.nix new file mode 100644 index 0000000..3d10c8d --- /dev/null +++ b/modules/desktop-environments/gnome.nix @@ -0,0 +1,20 @@ +{ + config, + pkgs, + ... +}: { + services.desktopManager.gnome.enable = true; + + # To disable installing GNOME's suite of applications + # and only be left with GNOME shell. + services.gnome = { + core-apps.enable = false; + core-developer-tools.enable = false; + games.enable = false; + }; + + environment.gnome.excludePackages = with pkgs; [ + gnome-tour + gnome-user-docs + ]; +} \ No newline at end of file diff --git a/modules/desktop-environments/plasma6.nix b/modules/desktop-environments/plasma6.nix new file mode 100644 index 0000000..96674ea --- /dev/null +++ b/modules/desktop-environments/plasma6.nix @@ -0,0 +1,17 @@ +{ + config, + pkgs, + ... +}: { + services.desktopManager.plasma6 = { + enable = true; + enableQt5Integration = true; + }; + + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + konsole + qrca + ]; + + services.displayManager.defaultSession = "plasma"; +} diff --git a/modules/display-managers/gdm.nix b/modules/display-managers/gdm.nix new file mode 100644 index 0000000..eff72a4 --- /dev/null +++ b/modules/display-managers/gdm.nix @@ -0,0 +1,7 @@ +{ + config, + pkgs, + ... +}: { + services.displayManager.gdm.enable = true; +} \ No newline at end of file diff --git a/modules/plasma-desktop.nix b/modules/display-managers/sddm.nix similarity index 52% rename from modules/plasma-desktop.nix rename to modules/display-managers/sddm.nix index e24f98a..3dfd107 100644 --- a/modules/plasma-desktop.nix +++ b/modules/display-managers/sddm.nix @@ -3,18 +3,6 @@ pkgs, ... }: { - services.desktopManager.plasma6 = { - enable = true; - enableQt5Integration = true; - }; - - environment.plasma6.excludePackages = with pkgs.kdePackages; [ - konsole - qrca - ]; - - services.displayManager.defaultSession = "plasma"; - services.displayManager.sddm = { enable = true; theme = "breeze"; @@ -27,4 +15,4 @@ }; }; }; -} +} \ No newline at end of file diff --git a/modules/zsh.nix b/modules/zsh.nix new file mode 100644 index 0000000..5d454e0 --- /dev/null +++ b/modules/zsh.nix @@ -0,0 +1,9 @@ +{ + config, + pkgs, + ... +}: { + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; + users.users."grey".shell = pkgs.zsh; +} \ No newline at end of file