diff options
author | Vincent Ambo <mail@tazj.in> | 2022-01-30T16·06+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-01-31T16·11+0000 |
commit | aa122cbae78ce97d60c0c98ba14df753d97e40b1 (patch) | |
tree | 12b98d85c4b18fe870feb26de70db9ba61837bd7 /users/Profpatsch/ytextr | |
parent | 2d10d60fac0fd00a71b65cfdcb9fba0477b2086c (diff) |
style: format entire depot with nixpkgs-fmt r/3723
This CL can be used to compare the style of nixpkgs-fmt against other formatters (nixpkgs, alejandra). Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: lukegb <lukegb@tvl.fyi> Reviewed-by: wpcarro <wpcarro@gmail.com> Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: cynthia <cynthia@tvl.fyi> Reviewed-by: edef <edef@edef.eu> Reviewed-by: eta <tvl@eta.st> Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'users/Profpatsch/ytextr')
-rw-r--r-- | users/Profpatsch/ytextr/create-symlink-farm.nix | 13 | ||||
-rw-r--r-- | users/Profpatsch/ytextr/default.nix | 91 |
2 files changed, 64 insertions, 40 deletions
diff --git a/users/Profpatsch/ytextr/create-symlink-farm.nix b/users/Profpatsch/ytextr/create-symlink-farm.nix index 583a3a90f5c5..7b3a45b91681 100644 --- a/users/Profpatsch/ytextr/create-symlink-farm.nix +++ b/users/Profpatsch/ytextr/create-symlink-farm.nix @@ -1,9 +1,10 @@ { # list of package attribute names to get at run time - packageNamesAtRuntimeJsonPath, + packageNamesAtRuntimeJsonPath +, }: let - pkgs = import <nixpkgs> {}; + pkgs = import <nixpkgs> { }; getPkg = pkgName: pkgs.${pkgName}; @@ -12,7 +13,7 @@ let runtime = map getPkg packageNamesAtRuntime; in - pkgs.symlinkJoin { - name = "symlink-farm"; - paths = runtime; - } +pkgs.symlinkJoin { + name = "symlink-farm"; + paths = runtime; +} diff --git a/users/Profpatsch/ytextr/default.nix b/users/Profpatsch/ytextr/default.nix index dba6bbb8b400..ac630603b90c 100644 --- a/users/Profpatsch/ytextr/default.nix +++ b/users/Profpatsch/ytextr/default.nix @@ -12,48 +12,71 @@ let bins = depot.nix.getBins pkgs.nix [ "nix-build" ] - // depot.nix.getBins pkgs.bubblewrap [ "bwrap" ]; + // depot.nix.getBins pkgs.bubblewrap [ "bwrap" ]; # Run a command, with the given packages in scope, and `packageNamesAtRuntime` being fetched at the start in the given nix `channel`. - nix-run-with-channel = { - # The channel to get `packageNamesAtRuntime` from - channel, - # executable to run with `packageNamesAtRuntime` in PATH - # and the argv - executable, - # A list of nixpkgs package attribute names that should be put into PATH when running `command`. - packageNamesAtRuntime, - }: depot.nix.writeExecline "nix-run-with-channel-${channel}" {} [ - # TODO: prevent race condition by writing a temporary gc root - "backtick" "-iE" "storepath" [ - bins.nix-build - "-I" "nixpkgs=channel:${channel}" + nix-run-with-channel = + { + # The channel to get `packageNamesAtRuntime` from + channel + , # executable to run with `packageNamesAtRuntime` in PATH + # and the argv + executable + , # A list of nixpkgs package attribute names that should be put into PATH when running `command`. + packageNamesAtRuntime + , + }: depot.nix.writeExecline "nix-run-with-channel-${channel}" { } [ + # TODO: prevent race condition by writing a temporary gc root + "backtick" + "-iE" + "storepath" + [ + bins.nix-build + "-I" + "nixpkgs=channel:${channel}" "--arg" - "packageNamesAtRuntimeJsonPath" - (pkgs.writeText "packageNamesAtRuntime.json" (builtins.toJSON packageNamesAtRuntime)) + "packageNamesAtRuntimeJsonPath" + (pkgs.writeText "packageNamesAtRuntime.json" (builtins.toJSON packageNamesAtRuntime)) ./create-symlink-farm.nix - ] - "importas" "-ui" "PATH" "PATH" - "export" "PATH" "\${storepath}/bin:\${PATH}" - executable "$@" - ]; + ] + "importas" + "-ui" + "PATH" + "PATH" + "export" + "PATH" + "\${storepath}/bin:\${PATH}" + executable + "$@" + ]; -in nix-run-with-channel { +in +nix-run-with-channel { channel = "nixos-unstable"; packageNamesAtRuntime = [ "yt-dlp" ]; executable = depot.nix.writeExecline "ytextr" { readNArgs = 1; } [ - "getcwd" "-E" "cwd" + "getcwd" + "-E" + "cwd" bins.bwrap - "--ro-bind" "/nix/store" "/nix/store" - "--ro-bind" "/etc" "/etc" - "--bind" "$cwd" "$cwd" - "yt-dlp" - "--no-playlist" - "--write-sub" - "--all-subs" - "--embed-subs" - "--merge-output-format" "mkv" - "-f" "bestvideo[height<=?1080]+bestaudio/best" - "$1" + "--ro-bind" + "/nix/store" + "/nix/store" + "--ro-bind" + "/etc" + "/etc" + "--bind" + "$cwd" + "$cwd" + "yt-dlp" + "--no-playlist" + "--write-sub" + "--all-subs" + "--embed-subs" + "--merge-output-format" + "mkv" + "-f" + "bestvideo[height<=?1080]+bestaudio/best" + "$1" ]; } |