wip: modularizing?
This commit is contained in:
		@@ -1,19 +1,20 @@
 | 
			
		||||
{
 | 
			
		||||
  lib,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  userName,
 | 
			
		||||
  userEmail,
 | 
			
		||||
  ghostty,
 | 
			
		||||
  ...
 | 
			
		||||
}: let
 | 
			
		||||
  # Have a file sturcture that holds all the configuration files that can't be configured by Nix
 | 
			
		||||
  # or maybe I'm too lazy to do anything about it? I dunno
 | 
			
		||||
{ lib
 | 
			
		||||
, pkgs
 | 
			
		||||
, userName
 | 
			
		||||
, userEmail
 | 
			
		||||
, ghostty
 | 
			
		||||
, isNixOS ? true
 | 
			
		||||
, ...
 | 
			
		||||
}:
 | 
			
		||||
let
 | 
			
		||||
  # Have a file structure that holds all the configuration files that can't be configured by Nix
 | 
			
		||||
  dirs = {
 | 
			
		||||
    defaults = ../defaults;
 | 
			
		||||
  };
 | 
			
		||||
in {
 | 
			
		||||
in
 | 
			
		||||
{
 | 
			
		||||
  # Import sub modules
 | 
			
		||||
  imports = map (module: import module {inherit lib pkgs dirs userName userEmail ghostty;}) [
 | 
			
		||||
  imports = map (module: import module { inherit lib pkgs dirs userName userEmail ghostty isNixOS; }) [
 | 
			
		||||
    ./atuin.nix
 | 
			
		||||
    ./shell.nix
 | 
			
		||||
    ./packages
 | 
			
		||||
@@ -22,43 +23,49 @@ in {
 | 
			
		||||
    ./eza.nix
 | 
			
		||||
    ./neovim.nix
 | 
			
		||||
    ./direnv.nix
 | 
			
		||||
    ./sway.nix
 | 
			
		||||
    # ./sway.nix
 | 
			
		||||
    ./terminal.nix
 | 
			
		||||
    ./browser.nix
 | 
			
		||||
    ./zellij.nix
 | 
			
		||||
    ./bat.nix
 | 
			
		||||
    ./lazygit.nix
 | 
			
		||||
  ] ++ lib.optionalattrs isNixOS [
 | 
			
		||||
    ./sway.nix
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  # Home Manager needs a bit of information about you and the
 | 
			
		||||
  # paths it should manage.
 | 
			
		||||
  home = {
 | 
			
		||||
    username = userName;
 | 
			
		||||
    homeDirectory =
 | 
			
		||||
      if pkgs.stdenv.isDarwin
 | 
			
		||||
      then "/Users/${userName}"
 | 
			
		||||
      else "/home/${userName}";
 | 
			
		||||
  home = lib.mkMerge [
 | 
			
		||||
    {
 | 
			
		||||
      username = userName;
 | 
			
		||||
      homeDirectory =
 | 
			
		||||
        if pkgs.stdenv.isDarwin
 | 
			
		||||
        then "/Users/${userName}"
 | 
			
		||||
        else "/home/${userName}";
 | 
			
		||||
 | 
			
		||||
    sessionVariables = {
 | 
			
		||||
      XDG_CURRENT_DESKTOP = "sway";
 | 
			
		||||
      XDG_SESSION_TYPE = "wayland";
 | 
			
		||||
      XDG_SESSION_DESKTOP="sway";
 | 
			
		||||
      XDG_CONFIG_HOME = "$HOME/.config";
 | 
			
		||||
      XDG_CACHE_HOME = "$HOME/.cache";
 | 
			
		||||
      XDG_DATA_HOME = "$HOME/.local/share";
 | 
			
		||||
      XDG_STATE_HOME = "$HOME/.local/state";
 | 
			
		||||
      NIXOS_OZONE_WL = "1";
 | 
			
		||||
    };
 | 
			
		||||
      stateVersion = "24.11";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pointerCursor = lib.mkIf pkgs.stdenv.isLinux {
 | 
			
		||||
      gtk.enable = true;
 | 
			
		||||
      package = pkgs.catppuccin-cursors.mochaDark;
 | 
			
		||||
      name = "catppuccin-mocha-dark-cursors";
 | 
			
		||||
      size = 22;
 | 
			
		||||
    };
 | 
			
		||||
    (lib.mkIf isNixOS {
 | 
			
		||||
      sessionVariables = {
 | 
			
		||||
        XDG_CURRENT_DESKTOP = "sway";
 | 
			
		||||
        XDG_SESSION_TYPE = "wayland";
 | 
			
		||||
        XDG_SESSION_DESKTOP = "sway";
 | 
			
		||||
        XDG_CONFIG_HOME = "$HOME/.config";
 | 
			
		||||
        XDG_CACHE_HOME = "$HOME/.cache";
 | 
			
		||||
        XDG_DATA_HOME = "$HOME/.local/share";
 | 
			
		||||
        XDG_STATE_HOME = "$HOME/.local/state";
 | 
			
		||||
        NIXOS_OZONE_WL = "1";
 | 
			
		||||
      };
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    stateVersion = "24.11";
 | 
			
		||||
  };
 | 
			
		||||
    (lib.mkIf pkgs.stdenv.isLinux {
 | 
			
		||||
      pointerCursor = {
 | 
			
		||||
        gtk.enable = true;
 | 
			
		||||
        package = pkgs.catppuccin-cursors.mochaDark;
 | 
			
		||||
        name = "catppuccin-mocha-dark-cursors";
 | 
			
		||||
        size = 22;
 | 
			
		||||
      };
 | 
			
		||||
    })
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  # Let Home Manager install and manage itself.
 | 
			
		||||
  programs.home-manager.enable = true;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user