···170170 default = null;171171 defaultText = literalExpression "username";172172 };173173+174174+ workDir = mkOption {175175+ type = with types; nullOr str;176176+ description = lib.mdDoc ''177177+ Working directory, available as `$GITHUB_WORKSPACE` during workflow runs178178+ and used as a default for [repository checkouts](https://github.com/actions/checkout).179179+ The service cleans this directory on every service start.180180+181181+ A value of `null` will default to the systemd `RuntimeDirectory`.182182+ '';183183+ default = null;184184+ };173185}
···20202121with lib;22222323+let2424+ workDir = if cfg.workDir == null then runtimeDir else cfg.workDir;2525+in2326{2427 description = "GitHub Actions runner";2528···3128 after = [ "network.target" "network-online.target" ];32293330 environment = {3434- HOME = runtimeDir;3131+ HOME = workDir;3532 RUNNER_ROOT = stateDir;3633 } // cfg.extraEnvironment;3734···4542 config.nix.package4643 ] ++ cfg.extraPackages;47444848- serviceConfig = rec {4545+ serviceConfig = {4946 ExecStart = "${cfg.package}/bin/Runner.Listener run --startuptype service";50475148 # Does the following, sequentially:···5754 # - Set up the directory structure by creating the necessary symlinks.5855 ExecStartPre =5956 let6060- # Wrapper script which expects the full path of the state, runtime and logs5757+ # Wrapper script which expects the full path of the state, working and logs6158 # directory as arguments. Overrides the respective systemd variables to provide6259 # unambiguous directory names. This becomes relevant, for example, if the6360 # caller overrides any of the StateDirectory=, RuntimeDirectory= or LogDirectory=···6865 set -euo pipefail69667067 STATE_DIRECTORY="$1"7171- RUNTIME_DIRECTORY="$2"6868+ WORK_DIRECTORY="$2"7269 LOGS_DIRECTORY="$3"73707471 ${lines}7572 '';7676- runnerRegistrationConfig = getAttrs [ "name" "tokenFile" "url" "runnerGroup" "extraLabels" "ephemeral" ] cfg;7373+ runnerRegistrationConfig = getAttrs [ "name" "tokenFile" "url" "runnerGroup" "extraLabels" "ephemeral" "workDir" ] cfg;7774 newConfigPath = builtins.toFile "${svcName}-config.json" (builtins.toJSON runnerRegistrationConfig);7875 currentConfigPath = "$STATE_DIRECTORY/.nixos-current-config.json";7976 newConfigTokenPath= "$STATE_DIRECTORY/.new-token";···122119 else123120 # The state directory is entirely empty which indicates a first start124121 copy_tokens125125- fi '';122122+ fi123123+ '';126124 configureRunner = writeScript "configure" ''127125 if [[ -e "${newConfigTokenPath}" ]]; then128126 echo "Configuring GitHub Actions Runner"129127 args=(130128 --unattended131129 --disableupdate132132- --work "$RUNTIME_DIRECTORY"130130+ --work "$WORK_DIRECTORY"133131 --url ${escapeShellArg cfg.url}134132 --labels ${escapeShellArg (concatStringsSep "," cfg.extraLabels)}135133 --name ${escapeShellArg cfg.name}···157153 ln -s '${newConfigPath}' "${currentConfigPath}"158154 fi159155 '';160160- setupRuntimeDir = writeScript "setup-runtime-dirs" ''161161- # Link _diag dir162162- ln -s "$LOGS_DIRECTORY" "$RUNTIME_DIRECTORY/_diag"156156+ setupWorkDir = writeScript "setup-work-dirs" ''157157+ # Cleanup previous service158158+ ${pkgs.findutils}/bin/find -H "$WORK_DIRECTORY" -mindepth 1 -delete163159164164- # Link the runner credentials to the runtime dir165165- ln -s "$STATE_DIRECTORY"/{${lib.concatStringsSep "," runnerCredFiles}} "$RUNTIME_DIRECTORY/"160160+ # Link _diag dir161161+ ln -s "$LOGS_DIRECTORY" "$WORK_DIRECTORY/_diag"162162+163163+ # Link the runner credentials to the work dir164164+ ln -s "$STATE_DIRECTORY"/{${lib.concatStringsSep "," runnerCredFiles}} "$WORK_DIRECTORY/"166165 '';167166 in168168- map (x: "${x} ${escapeShellArgs [ stateDir runtimeDir logsDir ]}") [167167+ map (x: "${x} ${escapeShellArgs [ stateDir workDir logsDir ]}") [169168 "+${unconfigureRunner}" # runs as root170169 configureRunner171171- setupRuntimeDir170170+ setupWorkDir172171 ];173172174173 # If running in ephemeral mode, restart the service on-exit (i.e., successful de-registration of the runner)···188181 # Home of persistent runner data, e.g., credentials189182 StateDirectory = [ systemdDir ];190183 StateDirectoryMode = "0700";191191- WorkingDirectory = runtimeDir;184184+ WorkingDirectory = workDir;192185193186 InaccessiblePaths = [194187 # Token file path given in the configuration, if visible to the service···238231 "~sethostname"239232 ];240233 RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_UNIX" "AF_NETLINK" ];234234+235235+ BindPaths = lib.optionals (cfg.workDir != null) [ cfg.workDir ];241236242237 # Needs network access243238 PrivateNetwork = false;
+3
nixos/modules/services/hardware/fwupd.nix
···158158159159 services.udev.packages = [ cfg.package ];160160161161+ # required to update the firmware of disks162162+ services.udisks2.enable = true;163163+161164 systemd.packages = [ cfg.package ];162165163166 security.polkit.enable = true;
+6-3
nixos/modules/virtualisation/amazon-options.nix
···22let33 inherit (lib) literalExpression types;44in {55- imports = [66- (lib.mkRemovedOptionModule [ "ec2" "hvm" ] "Only HVM instances are supported, so specifying it is no longer necessary.")77- ];85 options = {96 ec2 = {107 zfs = {···4851 description = lib.mdDoc ''4952 Whether the EC2 instance is using EFI.5053 '';5454+ };5555+ hvm = lib.mkOption {5656+ description = "Unused legacy option. While support for non-hvm has been dropped, we keep this option around so that NixOps remains compatible with a somewhat recent `nixpkgs` and machines with an old `stateVersion`.";5757+ internal = true;5858+ default = true;5959+ readOnly = true;5160 };5261 };5362 };
···16161717 cargoSha256 = "sha256-krQTa9R3hmMVKLoBgnbCw+aSQu9HUXfA3XflB8AZv6w=";18181919+ # fix for compilation on aarch642020+ # see https://github.com/NixOS/nixpkgs/issues/1457262121+ prePatch = ''2222+ rm .cargo/config.toml2323+ '';2424+1925 meta = with lib; {2026 description = "CLI tool to search and replace";2127 homepage = "https://github.com/ms-jpq/sad";