openorienteering-mapper.nix (1394B)
1 { 2 config, 3 lib, 4 pkgs, 5 ... 6 }: 7 8 with lib; 9 let 10 cfg = config.programs.openorienteering-mapper; 11 configDir = "${config.xdg.configHome}/OpenOrienteering.org"; 12 configFile = "${configDir}/Mapper.conf"; 13 domain = "org.openorienteering.Mapper"; 14 in 15 { 16 meta.maintainers = [ maintainers.sikmir ]; 17 18 options.programs.openorienteering-mapper = { 19 enable = mkEnableOption "An orienteering mapmaking program"; 20 21 package = mkOption { 22 default = pkgs.openorienteering-mapper; 23 defaultText = literalExpression "pkgs.openorienteering-mapper"; 24 example = "pkgs.nur.repos.sikmir.openorienteering-mapper-bin"; 25 description = "OpenOrienteering Mapper package to install."; 26 type = types.package; 27 }; 28 }; 29 30 config = mkIf cfg.enable (mkMerge [ 31 { home.packages = [ cfg.package ]; } 32 33 (mkIf pkgs.stdenv.isLinux { 34 home.activation.createConfigFile = lib.hm.dag.entryAfter [ "writeBoundary" ] '' 35 $DRY_RUN_CMD mkdir -p ${configDir} 36 $DRY_RUN_CMD touch ${configFile} 37 ''; 38 }) 39 40 { 41 home.activation.tipsVisible = lib.hm.dag.entryAfter [ "writeBoundary" ] ( 42 if pkgs.stdenv.isDarwin then 43 "$DRY_RUN_CMD /usr/bin/defaults write ${domain} HomeScreen.tipsVisible -bool false" 44 else 45 "$DRY_RUN_CMD ${pkgs.crudini}/bin/crudini $VERBOSE_ARG --set ${configFile} HomeScreen tipsVisible 0" 46 ); 47 } 48 ]); 49 }