moved home-manager options to the "home" namespace
this frees up the "host" namespace for host-wide options.
This commit is contained in:
		
							parent
							
								
									ec2a7506a3
								
							
						
					
					
						commit
						9eb783a3e8
					
				
					 17 changed files with 64 additions and 55 deletions
				
			
		| 
						 | 
				
			
			@ -5,21 +5,21 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  services.accounts-daemon.enable = true;
 | 
			
		||||
  services.displayManager = {
 | 
			
		||||
    defaultSession = "none+i3";
 | 
			
		||||
    autoLogin = {
 | 
			
		||||
      user = config.host.user;
 | 
			
		||||
      enable = true;
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
  services.xserver = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    displayManager = {
 | 
			
		||||
      defaultSession = "none+i3";
 | 
			
		||||
      autoLogin = {
 | 
			
		||||
        user = config.host.user;
 | 
			
		||||
        enable = true;
 | 
			
		||||
      };
 | 
			
		||||
      lightdm = {
 | 
			
		||||
        enable = true;
 | 
			
		||||
        greeters.gtk.enable = false;
 | 
			
		||||
        greeter.enable = false;
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
    windowManager.i3.enable = true;
 | 
			
		||||
    displayManager.lightdm = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      greeters.gtk.enable = false;
 | 
			
		||||
      greeter.enable = false;
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
  home-manager.users.${config.host.user} = {config, ...}: {
 | 
			
		||||
    home.packages = with pkgs; [
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,4 +18,7 @@
 | 
			
		|||
      settings.max-jobs = "auto";
 | 
			
		||||
      gc.automatic = true;
 | 
			
		||||
    };
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../hostopts.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,14 +5,14 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  options = {
 | 
			
		||||
    host.nvim.enable-completions =
 | 
			
		||||
    home.nvim.enable-completions =
 | 
			
		||||
      (lib.mkEnableOption "basic completion in nvim")
 | 
			
		||||
      // {
 | 
			
		||||
        default = config.host.nvim.enable-treesitter || config.host.nvim.enable-lsp;
 | 
			
		||||
        default = false;
 | 
			
		||||
      };
 | 
			
		||||
  };
 | 
			
		||||
  config =
 | 
			
		||||
    lib.mkIf config.host.nvim.enable-completions
 | 
			
		||||
    lib.mkIf config.home.nvim.enable-completions
 | 
			
		||||
    {
 | 
			
		||||
      programs.nixvim = {
 | 
			
		||||
        plugins.luasnip.enable = true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,7 +28,7 @@
 | 
			
		|||
      BreakBeforeBinaryOperators: NonAssignment
 | 
			
		||||
      ...
 | 
			
		||||
    '';
 | 
			
		||||
    "work/.clang-format" = lib.mkIf config.host.git.workProfile.enable {
 | 
			
		||||
    "work/.clang-format" = lib.mkIf config.home.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.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,13 +5,13 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  options = {
 | 
			
		||||
    host.nvim.enable-lsp = lib.mkEnableOption "nvim lsp";
 | 
			
		||||
    home.nvim.enable-lsp = lib.mkEnableOption "nvim lsp";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config =
 | 
			
		||||
    lib.mkIf config.host.nvim.enable-lsp
 | 
			
		||||
    lib.mkIf config.home.nvim.enable-lsp
 | 
			
		||||
    {
 | 
			
		||||
      host.nvim.enable-completions = true;
 | 
			
		||||
      home.nvim.enable-completions = true;
 | 
			
		||||
      programs.nixvim = {
 | 
			
		||||
        plugins.lsp = {
 | 
			
		||||
          enable = true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  config =
 | 
			
		||||
    lib.mkIf config.host.nvim.enable-lsp
 | 
			
		||||
    lib.mkIf config.home.nvim.enable-lsp
 | 
			
		||||
    {
 | 
			
		||||
      programs.nixvim = {
 | 
			
		||||
        plugins.rust-tools = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  config =
 | 
			
		||||
    lib.mkIf config.host.nvim.enable-treesitter
 | 
			
		||||
    lib.mkIf config.home.nvim.enable-treesitter
 | 
			
		||||
    {
 | 
			
		||||
      programs.nixvim = {
 | 
			
		||||
        keymaps = [
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  options = {
 | 
			
		||||
    host.nvim.enable-treesitter = lib.mkOption {
 | 
			
		||||
    home.nvim.enable-treesitter = lib.mkOption {
 | 
			
		||||
      default = false;
 | 
			
		||||
      type = lib.types.bool;
 | 
			
		||||
      description = ''
 | 
			
		||||
| 
						 | 
				
			
			@ -14,9 +14,9 @@
 | 
			
		|||
    };
 | 
			
		||||
  };
 | 
			
		||||
  config =
 | 
			
		||||
    lib.mkIf config.host.nvim.enable-treesitter
 | 
			
		||||
    lib.mkIf config.home.nvim.enable-treesitter
 | 
			
		||||
    {
 | 
			
		||||
      host.nvim.enable-completions = true;
 | 
			
		||||
      home.nvim.enable-completions = true;
 | 
			
		||||
      programs.nixvim = {
 | 
			
		||||
        plugins.treesitter = {
 | 
			
		||||
          enable = true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  config =
 | 
			
		||||
    lib.mkIf config.host.nvim.enable-treesitter
 | 
			
		||||
    lib.mkIf config.home.nvim.enable-treesitter
 | 
			
		||||
    {
 | 
			
		||||
      programs.nixvim = {
 | 
			
		||||
        plugins.rainbow-delimiters = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  config =
 | 
			
		||||
    lib.mkIf config.host.nvim.enable-treesitter
 | 
			
		||||
    lib.mkIf config.home.nvim.enable-treesitter
 | 
			
		||||
    {
 | 
			
		||||
      programs.nixvim = let
 | 
			
		||||
        nu-grammar = pkgs.tree-sitter.buildGrammar {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,21 +5,25 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  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";
 | 
			
		||||
    home = {
 | 
			
		||||
      git = {
 | 
			
		||||
        workProfile = {
 | 
			
		||||
          enable = lib.mkEnableOption "git work profile";
 | 
			
		||||
          email = lib.mkOption {
 | 
			
		||||
            type = lib.types.str;
 | 
			
		||||
            description = "email for work profile.";
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
        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";
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
| 
						 | 
				
			
			@ -43,8 +47,8 @@
 | 
			
		|||
      };
 | 
			
		||||
      # difftastic.enable=true;
 | 
			
		||||
      # difftastic.background="dark";
 | 
			
		||||
      userEmail = config.host.git.profile.email;
 | 
			
		||||
      userName = config.host.git.profile.name;
 | 
			
		||||
      userEmail = config.home.git.profile.email;
 | 
			
		||||
      userName = config.home.git.profile.name;
 | 
			
		||||
      extraConfig = {
 | 
			
		||||
        init = {
 | 
			
		||||
          defaultBranch = "main";
 | 
			
		||||
| 
						 | 
				
			
			@ -73,11 +77,11 @@
 | 
			
		|||
        };
 | 
			
		||||
      };
 | 
			
		||||
      includes =
 | 
			
		||||
        if config.host.git.workProfile.enable
 | 
			
		||||
        if config.home.git.workProfile.enable
 | 
			
		||||
        then [
 | 
			
		||||
          {
 | 
			
		||||
            condition = "gitdir:~/work/**";
 | 
			
		||||
            contents.user.email = config.host.git.workProfile.email;
 | 
			
		||||
            contents.user.email = config.home.git.workProfile.email;
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
        else [];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,11 +5,11 @@
 | 
			
		|||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  options = {
 | 
			
		||||
    host.enable-speech = lib.mkEnableOption "espeak";
 | 
			
		||||
    home.enable-speech = lib.mkEnableOption "espeak";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config =
 | 
			
		||||
    lib.mkIf config.host.enable-speech
 | 
			
		||||
    lib.mkIf config.home.enable-speech
 | 
			
		||||
    {
 | 
			
		||||
      home.shellAliases = {
 | 
			
		||||
        say = "espeak -p 10 -s 150 -a 200";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue