Install and enable atticd cache server
This commit is contained in:
		
							
								
								
									
										30
									
								
								flake.nix
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								flake.nix
									
									
									
									
									
								
							| @ -6,9 +6,13 @@ | ||||
|       inputs.nixpkgs.follows = "nixpkgs"; | ||||
|       inputs.darwin.follows = ""; | ||||
|     }; | ||||
|     attic = { | ||||
|       url = "github:zhaofengli/attic"; | ||||
|       inputs.nixpkgs.follows = "nixpkgs"; | ||||
|     }; | ||||
|   }; | ||||
|  | ||||
|   outputs = { self, nixpkgs, agenix, ... }@attrs: | ||||
|   outputs = { self, nixpkgs, agenix, attic, ... }@attrs: | ||||
|     let | ||||
|       containerDef = import ./containers.nix; | ||||
|       serviceContainers = containerDef.containers; | ||||
| @ -36,7 +40,11 @@ | ||||
|           modules = [ | ||||
|             ({ modulesPath, ... }: { | ||||
|  | ||||
|               imports = [ agenix.nixosModules.default ./hardware-configuration.nix ]; | ||||
|               imports = [  | ||||
|                 agenix.nixosModules.default  | ||||
|                 attic.nixosModules.atticd | ||||
|                 ./hardware-configuration.nix  | ||||
|               ]; | ||||
|  | ||||
|               nix = { | ||||
|                 buildMachines = [ ]; | ||||
| @ -68,6 +76,21 @@ | ||||
|                   enable = true; | ||||
|                 }; | ||||
|  | ||||
|                 atticd = { | ||||
|                   enable = true; | ||||
|                   credentialsFile =  | ||||
|                     self.nixosConfigurations.eve-psr-nix0.config.age.secrets.attic_token.path; | ||||
|                   settings = { | ||||
|                     listen = "0.0.0.0:8040"; | ||||
| 										chunking = { | ||||
|       							  nar-size-threshold = 64 * 1024; # 64 KiB | ||||
|       							  min-size = 16 * 1024; # 16 KiB | ||||
|       							  avg-size = 64 * 1024; # 64 KiB | ||||
|       							  max-size = 256 * 1024; # 256 KiB | ||||
|       						 	}; | ||||
|       						}; | ||||
| 								}; | ||||
|  | ||||
|                 hydra = { | ||||
|                   enable = true; | ||||
|                   hydraURL = "https://hydra.matri.cx"; | ||||
| @ -98,7 +121,7 @@ | ||||
|                 users = { | ||||
|                   sezycei = { | ||||
|                     isNormalUser = true; | ||||
|                     passwordFile = config.age.secrets.sezycei.path; | ||||
|                     passwordFile = self.nixosConfigurations.eve-psr-nix0.config.age.secrets.sezycei.path; | ||||
|                     extraGroups = [ "wheel" ]; | ||||
|                     packages = with pkgs; [  | ||||
|                       byobu  | ||||
| @ -114,6 +137,7 @@ | ||||
|  | ||||
|               age = { | ||||
|                 secrets = { | ||||
|                   attic_token.file = ./secrets/attic_token.age; | ||||
|                   keys.file = ./secrets/keys.age; | ||||
|                   sezycei.file = ./secrets/sezycei.age; | ||||
|                 }; | ||||
|  | ||||
							
								
								
									
										11
									
								
								secrets.nix
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								secrets.nix
									
									
									
									
									
								
							| @ -4,6 +4,13 @@ let | ||||
|   all = [ james eve-psr-nix0 ]; | ||||
| in | ||||
| { | ||||
|   "secrets/keys.age".publicKeys = all; | ||||
|   "secrets/sezycei.age".publicKeys = all; | ||||
|   "secrets/attic_token.age" = { | ||||
|     publicKeys = all; | ||||
|   }; | ||||
|   "secrets/keys.age" = {  | ||||
|     publicKeys = all; | ||||
|   }; | ||||
|   "secrets/sezycei.age" = { | ||||
|     publicKeys = all; | ||||
|   }; | ||||
| } | ||||
|  | ||||
							
								
								
									
										
											BIN
										
									
								
								secrets/attic_token.age
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								secrets/attic_token.age
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user