~kaction/config

6774d2eeaf5dcd8e4843b4bb3f3fe31037cb47fd — Dmitry Bogatov 6 months ago 4aa5a70
Configure official dropbox cli client

It looks more polished than dropbox_uploader.
6 files changed, 17 insertions(+), 20 deletions(-)

M flake.nix
M manifest/default.nix
A manifest/secret/dbx.json
A universe/dbxcli/default.nix
M universe/default.nix
D universe/dropbox_uploader/default.nix
M flake.nix => flake.nix +1 -0
@@ 67,6 67,7 @@
            callPackage ./universe/Documentation { inherit nixpkgs; };
          attach-shell = call ./universe/attach-shell;
          blurdate = callPackage ./universe/blurdate { };
          dbxcli = callPackage ./universe/dbxcli { };
          dvtm =
            import ./universe/dvtm { inherit (pkgs.pkgsStatic) dvtm-unstable; };
          fasm-arch = call ./universe/fasm-arch;

M manifest/default.nix => manifest/default.nix +3 -0
@@ 45,6 45,9 @@ let
        "/home/kaction/Mail/cur" = user-mkdir;
        "/home/kaction/Mail/new" = user-mkdir;
        "/home/kaction/Mail/tmp" = user-mkdir;
        "/home/kaction/.config" = user-mkdir;
        "/home/kaction/.config/dbxcli" = user-mkdir;
        "/home/kaction/.config/dbxcli/auth.json" = symlink ./secret/dbx.json;

        "/etc/group" = symlink "${auth}/group";
        "/etc/gshadow" = { action = "unlink"; };

A manifest/secret/dbx.json => manifest/secret/dbx.json +0 -0
A universe/dbxcli/default.nix => universe/dbxcli/default.nix +12 -0
@@ 0,0 1,12 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
  pname = "dbxcli";
  version = "v3.0.0+";
  src = fetchFromGitHub {
    owner = "dropbox";
    repo = pname;
    rev = "9f870834e8128a78f2ff5ef9f539ae3156cb1d40";
    hash = "sha256-MccjWQHKV3N0x8QbtEa8viXJ77y/SvymSxmvCfYY3zQ";
  };
  vendorSha256 = "sha256-YXaDiRkqUZBDXXKZ9JWOSXqlibJbGn6jS6oJUjSovKg";
}

M universe/default.nix => universe/default.nix +1 -0
@@ 21,6 21,7 @@ in with pkgs; buildEnv {
      dhall-bash
      dhall-json
      dhall-lsp-server
      dbxcli
      fasm
      fasm-arch
      file # This is part of base system.

D universe/dropbox_uploader/default.nix => universe/dropbox_uploader/default.nix +0 -20
@@ 1,20 0,0 @@
{ lib, pass, runCommand, writeScriptBin, curl, execline, bash, busybox, tempfile
}:
let
  source = builtins.fetchGit {
    url = "https://github.com/andreafabrizi/Dropbox-Uploader";
    rev = "5f88da81b84cb0a7d6ae3cd06e86c352367a5df2";
  };
  worker = runCommand "dropbox_uploader.sh" { inherit source; } ''
    cp $source/dropbox_uploader.sh $out
  '';
  path = lib.makeBinPath [ execline curl bash pass busybox tempfile ];
in writeScriptBin "dropbox_uploader.sh" ''
  #!${execline}/bin/execlineb -WS0
  export PATH "${path}"
  exec
  tempfile conf.sh
  importas -in conf.sh conf.sh
  if { redirfd -w 1 ''${conf.sh} pass conf/dropbox_uploader }
  ${worker} -f ''${conf.sh} $@
''