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

cjdns-tools: init at 21.1 #115459

Merged
merged 1 commit into from
Apr 19, 2021
Merged

cjdns-tools: init at 21.1 #115459

merged 1 commit into from
Apr 19, 2021

Conversation

mkg20001
Copy link
Member

@mkg20001 mkg20001 commented Mar 8, 2021

This adds cjdns-tools which is exposing the tools from
$cjdns/tools/ under a command named cjdns-tools
(so for ex cjdns "ping" is accessible as cjdns-tools ping )

Additionally patches cjdns tools to read admin pw from /etc/cjdns.keys

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@r-rmcgibbo
Copy link

r-rmcgibbo commented Mar 8, 2021

Result of nixpkgs-review pr 115459 at 043a5fda run on x86_64-linux 1

1 package built:
2 suggestions:
  • warning: missing-phase-hooks

    buildPhase should probably contain runHook preBuild and runHook postBuild.

    Near pkgs/tools/admin/cjdns-tools/default.nix:22:3:

       |
    22 |   buildPhase = ''
       |   ^
    
  • warning: missing-phase-hooks

    installPhase should probably contain runHook preInstall and runHook postInstall.

    Near pkgs/tools/admin/cjdns-tools/default.nix:29:3:

       |
    29 |   installPhase = ''
       |   ^
    

Result of nixpkgs-review pr 115459 at 043a5fda run on aarch64-linux 1

1 package built:
2 suggestions:
  • warning: missing-phase-hooks

    buildPhase should probably contain runHook preBuild and runHook postBuild.

    Near pkgs/tools/admin/cjdns-tools/default.nix:22:3:

       |
    22 |   buildPhase = ''
       |   ^
    
  • warning: missing-phase-hooks

    installPhase should probably contain runHook preInstall and runHook postInstall.

    Near pkgs/tools/admin/cjdns-tools/default.nix:29:3:

       |
    29 |   installPhase = ''
       |   ^
    

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

just some bashism

buildPhase = ''
patchShebangs tools

sed -e "s|'password': 'NONE'|'password': Fs.readFileSync('/etc/cjdns.keys').toString().split('\\\\n').map(v => v.split('=')).filter(v => v[0] === 'CJDNS_ADMIN_PASSWORD').map(v => v[1])[0]|g" \
Copy link
Member

Choose a reason for hiding this comment

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

This line is quite long. Can we break it somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure - sed doesn't like multiline

pkgs/tools/admin/cjdns-tools/wrapper.sh Outdated Show resolved Hide resolved
pkgs/tools/admin/cjdns-tools/wrapper.sh Outdated Show resolved Hide resolved
pkgs/tools/admin/cjdns-tools/wrapper.sh Outdated Show resolved Hide resolved
pkgs/tools/admin/cjdns-tools/wrapper.sh Outdated Show resolved Hide resolved
pkgs/tools/admin/cjdns-tools/wrapper.sh Outdated Show resolved Hide resolved
This adds cjdns-tools which is exposing the tools from
$cjdns/tools/ under a command named cjdns-tools
(so for ex cjdns "ping" is accessible as cjdns-tools ping <ip>)

Additionally patches cjdns tools to read admin pw from /etc/cjdns.keys

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
@mkg20001 mkg20001 merged commit 21a0a2d into NixOS:master Apr 19, 2021
@mkg20001 mkg20001 deleted the cjd-tools branch April 19, 2021 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants