~aasg/nixexprs

1286f4fa6d0b5c8409fd60ae92d1bb2e69a39da9 — Aluísio Augusto Silva Gonçalves 24 days ago 7cdebde + b7e91a3
Merge branch 'macos-ci' into master
A .github/workflows/darwin.yml => .github/workflows/darwin.yml +20 -0
@@ 0,0 1,20 @@
name: "macOS"
on:
  push:
jobs:
  build:
    strategy:
      matrix:
        platform: ["macos-latest"]
        channel: ["nixpkgs-unstable"]
    runs-on: "${{ matrix.platform }}"
    steps:
      - uses: actions/checkout@v2
      - uses: cachix/install-nix-action@v12
        with:
          nix_path: "nixpkgs=channel:${{ matrix.channel }}"
      - uses: cachix/cachix-action@v7
        with:
          name: "aasg-nixexprs"
          signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
      - run: "nix-build --no-out-link --keep-going --show-trace ./ci.nix"

M README.md => README.md +7 -1
@@ 1,6 1,11 @@
# ~aasg/nixexprs

[![builds.sr.ht status](https://builds.sr.ht/~aasg/nixexprs.svg)](https://builds.sr.ht/~aasg/nixexprs?)
<!-- BEGIN badges -->
[![Linux (nixpkgs-unstable) build status badge](https://builds.sr.ht/~aasg/nixexprs/commits/nixpkgs-unstable.yml.svg?name=%E2%97%AF%20Linux%C2%A0)](https://builds.sr.ht/~aasg/nixexprs/commits/nixpkgs-unstable.yml?)
[![macOS (nixpkgs-unstable) build status badge](https://github.com/AluisioASG/nixexprs/workflows/macOS/badge.svg)](https://github.com/AluisioASG/nixexprs/actions?query=workflow%3AmacOS)
[![NixOS 20.03 build status badge](https://builds.sr.ht/~aasg/nixexprs/commits/nixos-20.03.yml.svg?name=NixOS%2020.03)](https://builds.sr.ht/~aasg/nixexprs/commits/nixos-20.03.yml?)
[![NixOS 20.09 build status badge](https://builds.sr.ht/~aasg/nixexprs/commits/nixos-20.09.yml.svg?name=NixOS%2020.09)](https://builds.sr.ht/~aasg/nixexprs/commits/nixos-20.09.yml?)
<!-- END badges -->

This is (or should be) a [NUR]-compatible repository of Nix packages and NixOS modules that I've written for personal use and not yet upstreamed to [Nixpkgs].



@@ 11,3 16,4 @@ Send patches and questions to [~aasg/nixexprs@lists.sr.ht].
[NUR]: https://github.com/nix-community/NUR
[Nixpkgs]: https://github.com/NixOS/nixpkgs
[~aasg/nixexprs@lists.sr.ht]: https://lists.sr.ht/~aasg/nixexprs


M ci.nix => ci.nix +8 -3
@@ 1,16 1,21 @@
{ pkgs ? import <nixpkgs> { } }:
let
  inherit (pkgs) recurseIntoAttrs;
  inherit (pkgs.lib) deepSeq filterAttrs isDerivation mapAttrs pipe;
  inherit (pkgs) recurseIntoAttrs stdenv;
  inherit (pkgs.lib) deepSeq filterAttrs hasPrefix isDerivation mapAttrs pipe;

  selectDerivations = set:
    let
      derivationTree = value:
        if isDerivation value
        # Output derivations directly, but only if they're compatible
        # with this platform.
        if isDerivation value && builtins.elem pkgs.system value.meta.platforms
        then value
        else if value ? recurseForDerivations && value.recurseForDerivations == true
        then
          pipe value [
            # Don't evaluate linuxPackages outside Linux, or it will
            # break everything.
            (filterAttrs (name: value: ! stdenv.isLinux -> ! hasPrefix "linuxPackages" name))
            (mapAttrs (name: derivationTree))
            (filterAttrs (name: value: value != null))
            recurseIntoAttrs

M pkgs/overlay.nix => pkgs/overlay.nix +3 -1
@@ 4,7 4,9 @@ final: prev:

  dma = final.callPackage ./tools/networking/dma { };

  drep = final.callPackage ./tools/text/drep { };
  drep = final.callPackage ./tools/text/drep {
    inherit (final.darwin.apple_sdk.frameworks) CoreServices;
  };

  dyndnsc = final.callPackage ./tools/networking/dyndnsc { };


M pkgs/tools/networking/dma/default.nix => pkgs/tools/networking/dma/default.nix +1 -1
@@ 34,7 34,7 @@ stdenv.mkDerivation rec {
    '';
    homepage = "https://github.com/corecode/dma";
    license = licenses.bsd3;
    platforms = platforms.unix;
    platforms = with platforms; linux ++ freebsd ++ netbsd ++ openbsd;
    maintainers = with maintainers; [ AluisioASG ];
  };
}

M pkgs/tools/networking/dyndnsc/default.nix => pkgs/tools/networking/dyndnsc/default.nix +22 -8
@@ 1,4 1,4 @@
{ lib, python3Packages }:
{ stdenv, python3Packages }:

python3Packages.buildPythonApplication rec {
  pname = "dyndnsc";


@@ 23,18 23,32 @@ python3Packages.buildPythonApplication rec {
    substituteInPlace setup.py --replace "bottle==" "bottle>="
  '';

  # Disable tests not supported in the sandbox.
  checkPhase = ''
    runHook preCheck
  checkPhase =
    let
      inherit (stdenv.lib) concatStringsSep optional;
      # dnswanip connects to an external server to discover the
      # machine's IP address.
      #
      # The tests that spawn a server using Bottle cannot be run on
      # macOS or Windows as the default multiprocessing start method
      # on those platforms is 'spawn', which requires the code to be
      # run to be picklable, which this code isn't.
      # Additionaly, other start methods are unsafe and prone to failure
      # on macOS; see https://bugs.python.org/issue33725.
      testsToDisable = [ "dnswanip" ]
        ++ optional stdenv.isDarwin "BottleServer";
    in
    ''
      runHook preCheck

    py.test -k 'not dnswanip'
      python -m pytest -k '${concatStringsSep " and " (map (test: "not ${test}") testsToDisable)}'

    runHook postCheck
  '';
      runHook postCheck
    '';
  # Allow tests involving localhost on macOS.
  __darwinAllowLocalNetworking = true;

  meta = with lib; {
  meta = with stdenv.lib; {
    description = "Dynamic DNS update client with support for multiple protocols";
    longDescription = ''
      Dyndnsc is a command line client for sending updates to Dynamic

M pkgs/tools/text/drep/default.nix => pkgs/tools/text/drep/default.nix +3 -2
@@ 1,9 1,10 @@
{ lib, callPackage, defaultCrateOverrides }:
{ stdenv, callPackage, defaultCrateOverrides, CoreServices }:

(callPackage ./Cargo.nix { }).workspaceMembers.drep.build.override {
  crateOverrides = defaultCrateOverrides // {
    drep = attrs: {
      meta = with lib; {
      buildInputs = stdenv.lib.optional stdenv.isDarwin CoreServices;
      meta = with stdenv.lib; {
        description = "A grep with runtime reloadable filters";
        homepage = "https://github.com/maxpert/drep";
        license = licenses.mit;