[ssh] Move to actual module
This commit is contained in:
		
							parent
							
								
									197fcdbb81
								
							
						
					
					
						commit
						37b3968722
					
				
					 10 changed files with 100 additions and 78 deletions
				
			
		|  | @ -1,8 +1,7 @@ | |||
| { lib, ... }: | ||||
| 
 | ||||
| { | ||||
|   imports = [ | ||||
|     ./programs | ||||
|     ./services | ||||
|     ./users | ||||
|     ./virtualisation | ||||
|   ]; | ||||
|  |  | |||
|  | @ -1,6 +1,7 @@ | |||
| { | ||||
|   imports = [ | ||||
|     ./home-manager | ||||
|     ./ssh | ||||
|     ./zellij | ||||
|   ]; | ||||
| } | ||||
|  |  | |||
							
								
								
									
										13
									
								
								nixos/modules/programs/ssh/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								nixos/modules/programs/ssh/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | |||
| { config, lib, pkgs, ... }: | ||||
| 
 | ||||
| let | ||||
|   cfg = config.sisyphus.programs.ssh; | ||||
| in { | ||||
|   options.sisyphus.programs.ssh.enable = lib.mkEnableOption "SSH"; | ||||
| 
 | ||||
|   config = lib.mkIf cfg.enable { | ||||
|     programs.ssh = { | ||||
|       enableAskPassword = false; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										5
									
								
								nixos/modules/services/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								nixos/modules/services/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,5 @@ | |||
| { | ||||
|   imports = [ | ||||
|     ./openssh | ||||
|   ]; | ||||
| } | ||||
							
								
								
									
										17
									
								
								nixos/modules/services/openssh/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								nixos/modules/services/openssh/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| { config, lib, pkgs, ... }: | ||||
| 
 | ||||
| let | ||||
|   cfg = config.sisyphus.services.openssh; | ||||
| in { | ||||
|   options.sisyphus.services.openssh.enable = lib.mkEnableOption "OpenSSH"; | ||||
| 
 | ||||
|   config = lib.mkIf cfg.enable { | ||||
|     services.openssh = { | ||||
|       enable = true; | ||||
|       settings = { | ||||
|         PasswordAuthentication = false; | ||||
|         PermitRootLogin = "no"; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  | @ -21,6 +21,8 @@ in { | |||
| 
 | ||||
|     fonts.fonts = with pkgs; [ | ||||
|       font-awesome_5        # Dependency of Vifm config | ||||
|       noto-fonts            # Dependency of Zellij config | ||||
|       noto-fonts-cjk        # Dependency of Zellij config | ||||
|     ]; | ||||
| 
 | ||||
|     home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable { | ||||
|  | @ -48,6 +50,7 @@ in { | |||
|           unzip | ||||
|           vifm                  # File manager | ||||
|           zathura               # PDF viewer | ||||
|           zellij                # Tmux + screen alternative | ||||
|         ]) ++ (with pkgs-unstable; [ | ||||
|           mpv | ||||
|         ]); | ||||
|  | @ -66,6 +69,10 @@ in { | |||
|             source = ../../../../stow/mpv/.config/mpv; | ||||
|           }; | ||||
| 
 | ||||
|           ".ssh/config" = { # Always put SSH configuration | ||||
|             source = ../../../../stow/ssh/.ssh/config; | ||||
|           }; | ||||
| 
 | ||||
|           # Put Vifm files separately so history fill still works. | ||||
|           ".config/vifm/colors" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) { | ||||
|             source = ../../../../stow/vifm/.config/vifm/colors; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue