feat(nasp): enable registry
This commit is contained in:
		
							parent
							
								
									619b0c998e
								
							
						
					
					
						commit
						4dc50acbe8
					
				@ -143,6 +143,21 @@ in
 | 
			
		||||
  ];
 | 
			
		||||
  programs.zsh.enable = true;
 | 
			
		||||
  services.cron.enable = true;
 | 
			
		||||
  systemd.timers."registry" = {
 | 
			
		||||
    wantedBy = [ "timers.target" ];
 | 
			
		||||
    timerConfig = {
 | 
			
		||||
      OnCalendar = "*:0/5:0";
 | 
			
		||||
      Unit = "registry.service";
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
  systemd.services."registry" = {
 | 
			
		||||
    serviceConfig = {
 | 
			
		||||
      Type = "oneshot";
 | 
			
		||||
      User = "root";
 | 
			
		||||
    };
 | 
			
		||||
    script = builtins.readFile ./scripts/registry.sh;
 | 
			
		||||
    path = [ pkgs.git pkgs.bash pkgs.su ];
 | 
			
		||||
  };
 | 
			
		||||
  ## user config
 | 
			
		||||
  users.users.root.shell = pkgs.zsh;
 | 
			
		||||
  ## dotfiles.cn
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										12
									
								
								hosts/modules/scripts/registry.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								hosts/modules/scripts/registry.sh
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
set -ex
 | 
			
		||||
 | 
			
		||||
if [[ ! -e /opt/registry/scripts/testbed_cron.sh ]]; then
 | 
			
		||||
    mkdir -p /opt
 | 
			
		||||
    cd /opt
 | 
			
		||||
    git clone https://git.nasp.fit/NASP/registry.git
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cd /opt/registry
 | 
			
		||||
git pull
 | 
			
		||||
bash /opt/registry/scripts/testbed_cron.sh
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user