made git profile options.
This commit is contained in:
		
							parent
							
								
									a26d6a1e02
								
							
						
					
					
						commit
						90409b441f
					
				
					 8 changed files with 187 additions and 129 deletions
				
			
		| 
						 | 
				
			
			@ -5,12 +5,21 @@
 | 
			
		|||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  # Home Manager needs a bit of information about you and the paths it should
 | 
			
		||||
  # manage.
 | 
			
		||||
  # machine specific options
 | 
			
		||||
  host.enable-speech = true;
 | 
			
		||||
  host.nvim.enable-lsp = true;
 | 
			
		||||
  host.nvim.enable-treesitter = true;
 | 
			
		||||
  host = {
 | 
			
		||||
    enable-speech = true;
 | 
			
		||||
    nvim = {
 | 
			
		||||
      enable-lsp = true;
 | 
			
		||||
      enable-treesitter = true;
 | 
			
		||||
    };
 | 
			
		||||
    git = {
 | 
			
		||||
      profile = {
 | 
			
		||||
        name = "Gabe Venberg";
 | 
			
		||||
        email = "gabevenberg@gmail.com";
 | 
			
		||||
      };
 | 
			
		||||
      workProfile.enable = false;
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  home.username = "gabe";
 | 
			
		||||
  home.homeDirectory = "/home/gabe";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,18 +4,27 @@
 | 
			
		|||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  # Home Manager needs a bit of information about you and the paths it should
 | 
			
		||||
  # manage.
 | 
			
		||||
  # machine specific options
 | 
			
		||||
  host.enable-speech = true;
 | 
			
		||||
  host.nvim.enable-lsp = true;
 | 
			
		||||
  host.nvim.enable-treesitter = true;
 | 
			
		||||
  host = {
 | 
			
		||||
    enable-speech = true;
 | 
			
		||||
    nvim = {
 | 
			
		||||
      enable-lsp = true;
 | 
			
		||||
      enable-treesitter = true;
 | 
			
		||||
    };
 | 
			
		||||
    git = {
 | 
			
		||||
      profile = {
 | 
			
		||||
        name = "Gabe Venberg";
 | 
			
		||||
        email = "gabevenberg@gmail.com";
 | 
			
		||||
      };
 | 
			
		||||
      workProfile.enable = false;
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  targets.genericLinux.enable = true;
 | 
			
		||||
  home.username = "gabe";
 | 
			
		||||
  home.homeDirectory = "/home/gabe";
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../terminal/terminal.nix
 | 
			
		||||
    ../../modules/home-manager/home-manager.nix
 | 
			
		||||
    ../modules/home-manager/terminal/terminal.nix
 | 
			
		||||
    ../modules/home-manager/home-manager.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										33
									
								
								hosts/gabe-workstation.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								hosts/gabe-workstation.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,33 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  host = {
 | 
			
		||||
    # machine specific options
 | 
			
		||||
    enable-speech = true;
 | 
			
		||||
    nvim = {
 | 
			
		||||
      enable-lsp = true;
 | 
			
		||||
      enable-treesitter = true;
 | 
			
		||||
    };
 | 
			
		||||
    git = {
 | 
			
		||||
      profile = {
 | 
			
		||||
        name = "Gabe Venberg";
 | 
			
		||||
        email = "gabevenberg@gmail.com";
 | 
			
		||||
      };
 | 
			
		||||
      workProfile = {
 | 
			
		||||
        enable = true;
 | 
			
		||||
        email = "venberggabe@johndeere.com";
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  targets.genericLinux.enable = true;
 | 
			
		||||
  home.username = "gabe";
 | 
			
		||||
  home.homeDirectory = "/home/gabe";
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../modules/home-manager/terminal/terminal.nix
 | 
			
		||||
    ../modules/home-manager/home-manager.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,21 +0,0 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  # Home Manager needs a bit of information about you and the paths it should
 | 
			
		||||
  # manage.
 | 
			
		||||
  # machine specific options
 | 
			
		||||
  host.enable-speech = false;
 | 
			
		||||
  host.nvim.enable-lsp = false;
 | 
			
		||||
  host.nvim.enable-treesitter = true;
 | 
			
		||||
 | 
			
		||||
  targets.genericLinux.enable = true;
 | 
			
		||||
  home.username = "gabe";
 | 
			
		||||
  home.homeDirectory = "/home/gabe";
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../terminal/terminal.nix
 | 
			
		||||
    ../../modules/home-manager/home-manager.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,57 +1,79 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  pgks,
 | 
			
		||||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  programs.git = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    aliases = {
 | 
			
		||||
      hist = "log --graph --date-order --date=short --pretty=format:'%C(auto)%h%d %C(reset)%s %C(bold blue)%ce %C(reset)%C(green)%cr (%cd)'";
 | 
			
		||||
      graph = "log --graph --topo-order --all --pretty=format:'%C(auto)%h %C(cyan)%an %C(blue)%ar %C(auto)%d %s'";
 | 
			
		||||
      recent = "branch --sort=-committerdate --format='%(committerdate:relative)%09%(refname:short)'";
 | 
			
		||||
    };
 | 
			
		||||
    delta.enable = true;
 | 
			
		||||
    # difftastic.enable=true;
 | 
			
		||||
    # difftastic.background="dark";
 | 
			
		||||
    userEmail = "gabevenberg@gmail.com";
 | 
			
		||||
    userName = "Gabe Venberg";
 | 
			
		||||
    extraConfig = {
 | 
			
		||||
      init = {
 | 
			
		||||
        defaultBranch = "main";
 | 
			
		||||
      };
 | 
			
		||||
      push = {
 | 
			
		||||
        autoSetupRemote = true;
 | 
			
		||||
        default = "current";
 | 
			
		||||
      };
 | 
			
		||||
      pull = {
 | 
			
		||||
        ff = true;
 | 
			
		||||
      };
 | 
			
		||||
      merge = {
 | 
			
		||||
        conflictstyle = "zdiff3";
 | 
			
		||||
      };
 | 
			
		||||
      rebase = {
 | 
			
		||||
        autosquash = true;
 | 
			
		||||
      };
 | 
			
		||||
      help = {
 | 
			
		||||
        autocorrect = "prompt";
 | 
			
		||||
      };
 | 
			
		||||
      branch = {
 | 
			
		||||
        sort = "-committerdate";
 | 
			
		||||
      };
 | 
			
		||||
      status = {
 | 
			
		||||
        submodulesummary = true;
 | 
			
		||||
  options = {
 | 
			
		||||
    host.git.workProfile = {
 | 
			
		||||
      enable = lib.mkEnableOption "git work profile";
 | 
			
		||||
      email = lib.mkOption {
 | 
			
		||||
        type = lib.types.str;
 | 
			
		||||
        description = "email for work profile.";
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
    host.git.profile = {
 | 
			
		||||
      email = lib.mkOption {
 | 
			
		||||
        type = lib.types.str;
 | 
			
		||||
        description = "email for main profile";
 | 
			
		||||
      };
 | 
			
		||||
      name = lib.mkOption {
 | 
			
		||||
        type = lib.types.str;
 | 
			
		||||
        description = "name for main profile";
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
    includes = [
 | 
			
		||||
      {
 | 
			
		||||
        condition = "gitdir:~/work/";
 | 
			
		||||
        contents = {
 | 
			
		||||
          user = {
 | 
			
		||||
            email = "venberggabe@johndeere.com";
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
  programs.lazygit.enable = true;
 | 
			
		||||
 | 
			
		||||
  config = {
 | 
			
		||||
    programs.git = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      aliases = {
 | 
			
		||||
        hist = "log --graph --date-order --date=short --pretty=format:'%C(auto)%h%d %C(reset)%s %C(bold blue)%ce %C(reset)%C(green)%cr (%cd)'";
 | 
			
		||||
        graph = "log --graph --topo-order --all --pretty=format:'%C(auto)%h %C(cyan)%an %C(blue)%ar %C(auto)%d %s'";
 | 
			
		||||
        recent = "branch --sort=-committerdate --format='%(committerdate:relative)%09%(refname:short)'";
 | 
			
		||||
      };
 | 
			
		||||
      delta.enable = true;
 | 
			
		||||
      # difftastic.enable=true;
 | 
			
		||||
      # difftastic.background="dark";
 | 
			
		||||
      userEmail = config.host.git.profile.email;
 | 
			
		||||
      userName = config.host.git.profile.name;
 | 
			
		||||
      extraConfig = {
 | 
			
		||||
        init = {
 | 
			
		||||
          defaultBranch = "main";
 | 
			
		||||
        };
 | 
			
		||||
        push = {
 | 
			
		||||
          autoSetupRemote = true;
 | 
			
		||||
          default = "current";
 | 
			
		||||
        };
 | 
			
		||||
        pull = {
 | 
			
		||||
          ff = true;
 | 
			
		||||
        };
 | 
			
		||||
        merge = {
 | 
			
		||||
          conflictstyle = "zdiff3";
 | 
			
		||||
        };
 | 
			
		||||
        rebase = {
 | 
			
		||||
          autosquash = true;
 | 
			
		||||
        };
 | 
			
		||||
        help = {
 | 
			
		||||
          autocorrect = "prompt";
 | 
			
		||||
        };
 | 
			
		||||
        branch = {
 | 
			
		||||
          sort = "-committerdate";
 | 
			
		||||
        };
 | 
			
		||||
        status = {
 | 
			
		||||
          submodulesummary = true;
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
      includes =
 | 
			
		||||
        if config.host.git.workProfile.enable
 | 
			
		||||
        then [
 | 
			
		||||
          {
 | 
			
		||||
            condition = "gitdir:~/work/";
 | 
			
		||||
            contents.user.email = config.host.git.workProfile.email;
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
        else [];
 | 
			
		||||
    };
 | 
			
		||||
    programs.lazygit.enable = true;
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										49
									
								
								modules/home-manager/terminal/nvim/lsp/clangd.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								modules/home-manager/terminal/nvim/lsp/clangd.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,49 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  home.file = {
 | 
			
		||||
    ".clangd".text = ''
 | 
			
		||||
      # keeps clangd from choking when it sees a compiler flag for a different
 | 
			
		||||
      # compiler. (sutch as when acting as an lsp for a project that uses GCC.)
 | 
			
		||||
      CompileFlags:
 | 
			
		||||
        Add: -Wno-unknown-warning-option
 | 
			
		||||
        Remove: [-m*, -f*]
 | 
			
		||||
    '';
 | 
			
		||||
    ".clang-format".text = ''
 | 
			
		||||
      ---
 | 
			
		||||
      #this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other.
 | 
			
		||||
      PointerAlignment: Left
 | 
			
		||||
      ColumnLimit: 80
 | 
			
		||||
      IndentWidth: 4
 | 
			
		||||
      TabWidth: 4
 | 
			
		||||
      UseCRLF: false
 | 
			
		||||
      UseTab: Never
 | 
			
		||||
      AlignAfterOpenBracket: BlockIndent
 | 
			
		||||
      AlwaysBreakBeforeMultilineStrings: true
 | 
			
		||||
      BreakBeforeBraces: Attach
 | 
			
		||||
      AlignOperands: Align
 | 
			
		||||
      BreakBeforeBinaryOperators: NonAssignment
 | 
			
		||||
      ...
 | 
			
		||||
    '';
 | 
			
		||||
    "work/.clang-format" = lib.mkIf config.host.git.workProfile.enable{
 | 
			
		||||
      text = ''
 | 
			
		||||
        ---
 | 
			
		||||
        #this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other.
 | 
			
		||||
        PointerAlignment: Left
 | 
			
		||||
        ColumnLimit: 80
 | 
			
		||||
        IndentWidth: 4
 | 
			
		||||
        TabWidth: 4
 | 
			
		||||
        UseCRLF: false
 | 
			
		||||
        UseTab: Never
 | 
			
		||||
        AlignAfterOpenBracket: BlockIndent
 | 
			
		||||
        AlwaysBreakBeforeMultilineStrings: true
 | 
			
		||||
        BreakBeforeBraces: Allman
 | 
			
		||||
        BreakBeforeBinaryOperators: None
 | 
			
		||||
        ...
 | 
			
		||||
      '';
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -197,49 +197,12 @@
 | 
			
		|||
          }
 | 
			
		||||
        ];
 | 
			
		||||
      };
 | 
			
		||||
      home.file = {
 | 
			
		||||
        ".clangd".text = ''
 | 
			
		||||
          # keeps clangd from choking when it sees a compiler flag for a different
 | 
			
		||||
          # compiler. (sutch as when acting as an lsp for a project that uses GCC.)
 | 
			
		||||
          CompileFlags:
 | 
			
		||||
            Add: -Wno-unknown-warning-option
 | 
			
		||||
            Remove: [-m*, -f*]
 | 
			
		||||
        '';
 | 
			
		||||
        ".clang-format".text = ''
 | 
			
		||||
          ---
 | 
			
		||||
          #this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other.
 | 
			
		||||
          PointerAlignment: Left
 | 
			
		||||
          ColumnLimit: 80
 | 
			
		||||
          IndentWidth: 4
 | 
			
		||||
          TabWidth: 4
 | 
			
		||||
          UseCRLF: false
 | 
			
		||||
          UseTab: Never
 | 
			
		||||
          AlignAfterOpenBracket: BlockIndent
 | 
			
		||||
          AlwaysBreakBeforeMultilineStrings: true
 | 
			
		||||
          BreakBeforeBraces: Attach
 | 
			
		||||
          AlignOperands: Align
 | 
			
		||||
          BreakBeforeBinaryOperators: NonAssignment
 | 
			
		||||
          ...
 | 
			
		||||
        '';
 | 
			
		||||
        "work/.clang-format".text = ''
 | 
			
		||||
          ---
 | 
			
		||||
          #this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other.
 | 
			
		||||
          PointerAlignment: Left
 | 
			
		||||
          ColumnLimit: 80
 | 
			
		||||
          IndentWidth: 4
 | 
			
		||||
          TabWidth: 4
 | 
			
		||||
          UseCRLF: false
 | 
			
		||||
          UseTab: Never
 | 
			
		||||
          AlignAfterOpenBracket: BlockIndent
 | 
			
		||||
          AlwaysBreakBeforeMultilineStrings: true
 | 
			
		||||
          BreakBeforeBraces: Allman
 | 
			
		||||
          BreakBeforeBinaryOperators: None
 | 
			
		||||
          ...
 | 
			
		||||
        '';
 | 
			
		||||
      };
 | 
			
		||||
      home.packages = with pkgs; [
 | 
			
		||||
        alejandra
 | 
			
		||||
      ];
 | 
			
		||||
    };
 | 
			
		||||
  imports = [./rust-tools.nix];
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./rust-tools.nix
 | 
			
		||||
    ./clangd.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,13 +5,7 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  options = {
 | 
			
		||||
    host.enable-speech = lib.mkOption {
 | 
			
		||||
      default = false;
 | 
			
		||||
      type = lib.types.bool;
 | 
			
		||||
      description = ''
 | 
			
		||||
        install a text to speech engine
 | 
			
		||||
      '';
 | 
			
		||||
    };
 | 
			
		||||
    host.enable-speech = lib.mkEnableOption "espeak";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config =
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue