Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdrive: init at 2.1.0 #24848

Merged
merged 2 commits into from Apr 16, 2017
Merged

gdrive: init at 2.1.0 #24848

merged 2 commits into from Apr 16, 2017

Conversation

rzetterberg
Copy link
Member

Motivation for this change

Needed to upload some stuff to Google Drive, didn't find gdrive in nixpkgs,
created a package, installed it, it worked, thought "why not add the package?".

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS (17.09pre102667.2839b10)
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

This package should work in macOS too, but I have not tested it on macOS, therefor I added platforms.linux

Running this script in the root of the nixpkgs project:

#!/usr/bin/env bash

set -e

nixpkgs_root=$(pwd)
tmp_shell_file=$(mktemp)

cat <<EOF > "$tmp_shell_file"
{ system ? builtins.currentSystem }:

let
  pkgs = import <nixpkgs> { inherit system; };
in
  pkgs.callPackage "$nixpkgs_root/pkgs/applications/networking/gdrive/default.nix" {
    inherit (pkgs);
  }
EOF

nix-env -i -f "$tmp_shell_file"

gdrive version

rm "$tmp_shell_file"

Should result in the following output:

installing ‘gdrive-2.1.0’
building path(s) ‘/nix/store/fa7vcac8fgg6dg2bgk3kwm7n9m2gggry-user-environment’
created 1125 symlinks in user environment
gdrive: 2.1.0
Golang: go1.7.4
OS/Arch: linux/amd64

I tested running the list command against a newly created google account. After
authenticating it worked:

2017-04-12-184410_1364x729_scrot

I have also successfully uploaded files.

homepage = https://github.com/prasmussen/gdrive;
description = "A command line utility for interacting with Google Drive";
platforms = platforms.linux;
license = licenses.mit;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to maintain this package?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mic92 Yes! I'm not part of nixpkgs/lib/maintainers.nix, should I add myself in a separate PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just do it in this one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, preferably in a separate commit. So commit 1: add lib/maintainers.entry, commit 2: add package using your new entry in maintainers.nix.

Reasoning: sometimes when backporting to the stable branch, it's nice if the maintainers entry is decoupled from other changes.

Adds the go-based Google Drive CLI application "gdrive".
@rzetterberg
Copy link
Member Author

rzetterberg commented Apr 16, 2017

Made changes suggested from review by @Mic92 and @bjornfor.

Edit: I also added the package to top-level since I forgot that in my initial commit.

After I made the changes I ran:

$ nix-env -e gdrive
$ nix-env -i gdrive -f .
... truncated lines
lzjf-bash-4.4-p12/bin/bash"
/nix/store/936mlgszb7spsq4sf5ik1zxahfd7jy01-gdrive-2.1.0/share/go/src/github.com/prasmussen/gdrive/_release/upload.sh: interpreter directive changed from "/usr/local/bin/bash" to "/nix/store/fibk8jc2iwswn1q1d7aw98pcw2l3lzjf-bash-4.4-p12/bin/bash"
building path(s) ‘/nix/store/88csbvf519rv816r211bgjqwghd3xx2q-user-environment’
created 1135 symlinks in user environment

$ gdrive version
gdrive: 2.1.0
Golang: go1.8
OS/Arch: linux/amd64

@Mic92 Mic92 merged commit 69d77ea into NixOS:master Apr 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants