- //tvix: address new clippy lints - //users/tazjin: Satisfy gonic module's new need for a playlist folder. - //users/aspen/games: adjust for changed location of df's default init.txt and d_init.txt. Change-Id: I00a2adb506ae866206fb6f88c39c9a6af320380f Reviewed-on: https://cl.tvl.fyi/c/depot/+/11509 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI Reviewed-by: aspen <root@gws.fyi>
		
			
				
	
	
		
			51 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{ config, lib, pkgs, ... }:
 | 
						|
 | 
						|
with pkgs;
 | 
						|
with lib;
 | 
						|
 | 
						|
let
 | 
						|
 | 
						|
  df-orig = dwarf-fortress-packages.dwarf-fortress-original;
 | 
						|
 | 
						|
  df-full = (dwarf-fortress-packages.dwarf-fortress-full.override {
 | 
						|
    theme = null;
 | 
						|
    enableIntro = false;
 | 
						|
    enableFPS = true;
 | 
						|
    enableDFHack = true;
 | 
						|
  });
 | 
						|
 | 
						|
  init = runCommand "init.txt" { } ''
 | 
						|
    substitute "${df-orig}/data/init/init_default.txt" $out \
 | 
						|
      --replace "[INTRO:YES]" "[INTRO:NO]" \
 | 
						|
      --replace "[VOLUME:255]" "[VOLUME:0]" \
 | 
						|
      --replace "[FPS:NO]" "[FPS:YES]"
 | 
						|
  '';
 | 
						|
 | 
						|
  d_init = runCommand "d_init.txt" { } ''
 | 
						|
    substitute "${df-orig}/data/init/d_init_default.txt" $out \
 | 
						|
      --replace "[AUTOSAVE:NONE]" "[AUTOSAVE:SEASONAL]" \
 | 
						|
      --replace "[AUTOSAVE_PAUSE:NO]" "[AUTOSAVE_PAUSE:YES]" \
 | 
						|
      --replace "[INITIAL_SAVE:NO]" "[INITIAL_SAVE:YES]" \
 | 
						|
      --replace "[EMBARK_WARNING_ALWAYS:NO]" "[EMBARK_WARNING_ALWAYS:YES]" \
 | 
						|
      --replace "[VARIED_GROUND_TILES:YES]" "[VARIED_GROUND_TILES:NO]" \
 | 
						|
      --replace "[SHOW_FLOW_AMOUNTS:NO]" "[SHOW_FLOW_AMOUNTS:YES]"
 | 
						|
  '';
 | 
						|
 | 
						|
  df = runCommand "dwarf-fortress" { } ''
 | 
						|
    mkdir -p $out/bin
 | 
						|
    sed \
 | 
						|
      -e '4icp -f ${init} "$DF_DIR/data/init/init.txt"' \
 | 
						|
      -e '4icp -f ${d_init} "$DF_DIR/data/init/d_init.txt"' \
 | 
						|
      < "${df-full}/bin/dwarf-fortress" >"$out/bin/dwarf-fortress"
 | 
						|
 | 
						|
    shopt -s extglob
 | 
						|
    ln -s ${df-full}/bin/!(dwarf-fortress) $out/bin
 | 
						|
 | 
						|
    chmod +x $out/bin/dwarf-fortress
 | 
						|
  '';
 | 
						|
 | 
						|
in
 | 
						|
mkMerge [
 | 
						|
  { home.packages = [ crawl ]; }
 | 
						|
  (mkIf stdenv.isLinux { home.packages = [ df prismlauncher ]; })
 | 
						|
]
 |