forked from jan-leila/nix-config
		
	set up makemkv persistence
This commit is contained in:
		
							parent
							
								
									7363fc97bc
								
							
						
					
					
						commit
						0f26b73f6a
					
				
					 5 changed files with 45 additions and 2 deletions
				
			
		|  | @ -13,6 +13,7 @@ in { | ||||||
|     ./direnv.nix |     ./direnv.nix | ||||||
|     ./openssh.nix |     ./openssh.nix | ||||||
|     ./git.nix |     ./git.nix | ||||||
|  |     ./makemkv.nix | ||||||
|   ]; |   ]; | ||||||
| 
 | 
 | ||||||
|   config = lib.mkMerge [ |   config = lib.mkMerge [ | ||||||
|  |  | ||||||
							
								
								
									
										17
									
								
								configurations/home-manager/leyla/packages/makemkv.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								configurations/home-manager/leyla/packages/makemkv.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | ||||||
|  | { | ||||||
|  |   config, | ||||||
|  |   inputs, | ||||||
|  |   ... | ||||||
|  | }: { | ||||||
|  |   config = { | ||||||
|  |     sops.secrets = { | ||||||
|  |       "application-keys/makemkv" = { | ||||||
|  |         sopsFile = "${inputs.secrets}/application-keys.yaml"; | ||||||
|  |       }; | ||||||
|  |     }; | ||||||
|  |     programs.makemkv = { | ||||||
|  |       appKeyFile = config.sops.placeholder."application-keys/makemkv"; | ||||||
|  |       destinationDir = "/home/leyla/downloads/makemkv"; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
|  | @ -1,6 +1,7 @@ | ||||||
| # this folder container modules that are for home manager only | # this folder container modules that are for home manager only | ||||||
| {...}: { | {...}: { | ||||||
|   imports = [ |   imports = [ | ||||||
|  |     ./sops.nix | ||||||
|     ./user.nix |     ./user.nix | ||||||
|     ./flipperzero.nix |     ./flipperzero.nix | ||||||
|     ./i18n.nix |     ./i18n.nix | ||||||
|  |  | ||||||
|  | @ -7,6 +7,12 @@ | ||||||
| }: { | }: { | ||||||
|   options.programs.makemkv = { |   options.programs.makemkv = { | ||||||
|     enable = lib.mkEnableOption "enable makemkv"; |     enable = lib.mkEnableOption "enable makemkv"; | ||||||
|  |     appKeyFile = lib.mkOption { | ||||||
|  |       type = lib.types.str; | ||||||
|  |     }; | ||||||
|  |     destinationDir = lib.mkOption { | ||||||
|  |       type = lib.types.str; | ||||||
|  |     }; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   config = lib.mkIf config.programs.makemkv.enable (lib.mkMerge [ |   config = lib.mkIf config.programs.makemkv.enable (lib.mkMerge [ | ||||||
|  | @ -14,11 +20,22 @@ | ||||||
|       home.packages = with pkgs; [ |       home.packages = with pkgs; [ | ||||||
|         makemkv |         makemkv | ||||||
|       ]; |       ]; | ||||||
|       # TODO: write config file for makemkv | 
 | ||||||
|  |       sops.templates."MakeMKV.settings.conf".content = '' | ||||||
|  |         app_DestinationDir = "${config.programs.makemkv.destinationDir}" | ||||||
|  |         app_DestinationType = "2" | ||||||
|  |         app_Key = "${config.programs.makemkv.appKeyFile}" | ||||||
|  |       ''; | ||||||
|  | 
 | ||||||
|  |       home.file.".MakeMKV/settings.conf".source = config.lib.file.mkOutOfStoreSymlink config.sops.templates."MakeMKV.settings.conf".path; | ||||||
|     } |     } | ||||||
|     ( |     ( | ||||||
|       lib.mkIf osConfig.host.impermanence.enable { |       lib.mkIf osConfig.host.impermanence.enable { | ||||||
|         # TODO: map impermanence for makemkv |         home.persistence."/persist${config.home.homeDirectory}" = { | ||||||
|  |           directories = [ | ||||||
|  |             ".MakeMKV" | ||||||
|  |           ]; | ||||||
|  |         }; | ||||||
|       } |       } | ||||||
|     ) |     ) | ||||||
|   ]); |   ]); | ||||||
|  |  | ||||||
							
								
								
									
										7
									
								
								modules/home-manager-modules/sops.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								modules/home-manager-modules/sops.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,7 @@ | ||||||
|  | {...}: { | ||||||
|  |   config = { | ||||||
|  |     sops = { | ||||||
|  |       age.keyFile = "/var/lib/sops-nix/key.txt"; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue