diff options
author | Sandro Jäckel <sandro.jaeckel@gmail.com> | 2022-06-03 03:06:37 +0200 |
---|---|---|
committer | Sandro Jäckel <sandro.jaeckel@sap.com> | 2022-06-03 11:41:40 +0200 |
commit | e438fad5e900d9df93db400cd1c112ebf1e07ba9 (patch) | |
tree | 0c33d6fdbddb98bf7a3fd7fcf3260db5ac222319 /nixos/modules/services/games/asf.nix | |
parent | 17ec7e4401eedb410b94617b6887fafb5d4ad419 (diff) | |
download | nixpkgs-e438fad5e900d9df93db400cd1c112ebf1e07ba9.tar nixpkgs-e438fad5e900d9df93db400cd1c112ebf1e07ba9.tar.gz nixpkgs-e438fad5e900d9df93db400cd1c112ebf1e07ba9.tar.bz2 nixpkgs-e438fad5e900d9df93db400cd1c112ebf1e07ba9.tar.lz nixpkgs-e438fad5e900d9df93db400cd1c112ebf1e07ba9.tar.xz nixpkgs-e438fad5e900d9df93db400cd1c112ebf1e07ba9.tar.zst nixpkgs-e438fad5e900d9df93db400cd1c112ebf1e07ba9.zip |
nixos/asf: format
Diffstat (limited to 'nixos/modules/services/games/asf.nix')
-rw-r--r-- | nixos/modules/services/games/asf.nix | 75 |
1 files changed, 36 insertions, 39 deletions
diff --git a/nixos/modules/services/games/asf.nix b/nixos/modules/services/games/asf.nix index fd441ec950f..31a112d6c74 100644 --- a/nixos/modules/services/games/asf.nix +++ b/nixos/modules/services/games/asf.nix @@ -83,8 +83,7 @@ in type = format.type; description = '' The ASF.json file, all the options are documented <link xlink:href="https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Configuration#global-config">here</link>. - Do note that `AutoRestart` and `UpdateChannel` is always to `false` -respectively `0` because NixOS takes care of updating everything. + Do note that `AutoRestart` and `UpdateChannel` is always to `false` respectively `0` because NixOS takes care of updating everything. `Headless` is also always set to `true` because there is no way to provide inputs via a systemd service. You should try to keep ASF up to date since upstream does not provide support for anything but the latest version and you're exposing yourself to all kinds of issues - as is outlined <link xlink:href="https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Configuration#updateperiod">here</link>. ''; @@ -122,14 +121,12 @@ respectively `0` because NixOS takes care of updating everything. options = { username = mkOption { type = types.str; - description = - "Name of the user to log in. Default is attribute name."; + description = "Name of the user to log in. Default is attribute name."; default = ""; }; passwordFile = mkOption { type = types.path; - description = - "Path to a file containig the password. The file must be readable by the <literal>asf</literal> user/group."; + description = "Path to a file containig the password. The file must be readable by the <literal>asf</literal> user/group."; }; enabled = mkOption { type = types.bool; @@ -138,8 +135,7 @@ respectively `0` because NixOS takes care of updating everything. }; settings = mkOption { type = types.attrs; - description = - "Additional settings that are documented <link xlink:href=\"https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Configuration#bot-config\">here</link>."; + description = "Additional settings that are documented <link xlink:href=\"https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Configuration#bot-config\">here</link>."; default = { }; }; }; @@ -184,8 +180,7 @@ respectively `0` because NixOS takes care of updating everything. Group = "asf"; WorkingDirectory = cfg.dataDir; Type = "simple"; - ExecStart = - "${cfg.package}/bin/ArchiSteamFarm --path ${cfg.dataDir} --process-required --no-restart --service --no-config-migrate"; + ExecStart = "${cfg.package}/bin/ArchiSteamFarm --path ${cfg.dataDir} --process-required --no-restart --service --no-config-migrate"; # mostly copied from the default systemd service PrivateTmp = true; @@ -210,36 +205,38 @@ respectively `0` because NixOS takes care of updating everything. } ]; - preStart = let - createBotsScript = pkgs.runCommandLocal "ASF-bots" {} '' - mkdir -p $out - # clean potential removed bots - rm -rf $out/*.json - for i in ${strings.concatStringsSep " " (lists.map (x: "${getName x},${x}") (attrsets.mapAttrsToList mkBot cfg.bots))}; do IFS=","; - set -- $i - ln -fs $2 $out/$1 - done + preStart = + let + createBotsScript = pkgs.runCommandLocal "ASF-bots" { } '' + mkdir -p $out + # clean potential removed bots + rm -rf $out/*.json + for i in ${strings.concatStringsSep " " (lists.map (x: "${getName x},${x}") (attrsets.mapAttrsToList mkBot cfg.bots))}; do IFS=","; + set -- $i + ln -fs $2 $out/$1 + done + ''; + replaceSecretBin = "${pkgs.replace-secret}/bin/replace-secret"; + in + '' + mkdir -p config + + cp --no-preserve=mode ${asf-config} config/ASF.json + ${replaceSecretBin} '#ipcPassword#' '${cfg.ipcPasswordFile}' config/ASF.json + + ${optionalString (cfg.ipcSettings != {}) '' + ln -fs ${ipc-config} config/IPC.config + ''} + + ${optionalString (cfg.ipcSettings != {}) '' + ln -fs ${createBotsScript}/* config/ + ''} + + rm -f www + ${optionalString cfg.web-ui.enable '' + ln -s ${cfg.web-ui.package}/lib/dist www + ''} ''; - replaceSecretBin = "${pkgs.replace-secret}/bin/replace-secret"; - in '' - mkdir -p config - - cp --no-preserve=mode ${asf-config} config/ASF.json - ${replaceSecretBin} '#ipcPassword#' '${cfg.ipcPasswordFile}' config/ASF.json - - ${optionalString (cfg.ipcSettings != {}) '' - ln -fs ${ipc-config} config/IPC.config - ''} - - ${optionalString (cfg.ipcSettings != {}) '' - ln -fs ${createBotsScript}/* config/ - ''} - - rm -f www - ${optionalString cfg.web-ui.enable '' - ln -s ${cfg.web-ui.package}/lib/dist www - ''} - ''; }; }; }; |