make home manager optional
This commit is contained in:
		
							parent
							
								
									e65ba7c8a6
								
							
						
					
					
						commit
						69026cb461
					
				
					 3 changed files with 10 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
{lib, ...}: {
 | 
			
		||||
  mkIfElse = p: yes: no:
 | 
			
		||||
    lib.mkMerge [
 | 
			
		||||
      (mkIf p yes)
 | 
			
		||||
      (mkIf (!p) no)
 | 
			
		||||
      (lib.mkIf p yes)
 | 
			
		||||
      (lib.mkIf (!p) no)
 | 
			
		||||
    ];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,7 +23,7 @@ in {
 | 
			
		|||
    services.openssh = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      settings = {
 | 
			
		||||
        PermitRootLogin = helpers.mkIfElse config.my.server.enable "yes" "no";
 | 
			
		||||
        # PermitRootLogin = "no"; # this is managed through authorized keys
 | 
			
		||||
        PasswordAuthentication = false;
 | 
			
		||||
        KbdInteractiveAuthentication = false;
 | 
			
		||||
      };
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,12 +6,13 @@
 | 
			
		|||
}: let
 | 
			
		||||
  cfg = config.my.home;
 | 
			
		||||
in {
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./vinzenz.nix
 | 
			
		||||
    ./ronja.nix
 | 
			
		||||
    # enable home manager
 | 
			
		||||
    <home-manager/nixos>
 | 
			
		||||
  ];
 | 
			
		||||
  imports =
 | 
			
		||||
    [
 | 
			
		||||
      ./vinzenz.nix
 | 
			
		||||
      ./ronja.nix
 | 
			
		||||
      # enable home manager
 | 
			
		||||
    ]
 | 
			
		||||
    ++ lib.optional (builtins.pathExists <home-manager/nixos>) <home-manager/nixos>;
 | 
			
		||||
 | 
			
		||||
  options.my.home = {
 | 
			
		||||
    enable = lib.mkEnableOption "my home management";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue