dconf2nix: init at 0.5.0

+83
+2
pkgs/development/haskell-modules/non-hackage-packages.nix
··· 10 10 multi-ghc-travis = throw ("haskellPackages.multi-ghc-travis has been renamed" 11 11 + " to haskell-ci, which is now on hackage"); 12 12 13 + dconf2nix = self.callPackage ../tools/haskell/dconf2nix/dconf2nix.nix { }; 14 + 13 15 # https://github.com/channable/vaultenv/issues/1 14 16 vaultenv = self.callPackage ../tools/haskell/vaultenv { }; 15 17
+21
pkgs/development/tools/haskell/dconf2nix/dconf2nix.nix
··· 1 + { mkDerivation, base, containers, fetchgit, optparse-applicative 2 + , parsec, stdenv, text 3 + }: 4 + mkDerivation { 5 + pname = "dconf2nix"; 6 + version = "0.0.5"; 7 + src = fetchgit { 8 + url = "https://github.com/gvolpe/dconf2nix.git"; 9 + sha256 = "0immbx4bgfq3xmbbrpw441nx0sdpm4cp64s7qbvcbvllp4gbivpg"; 10 + rev = "848ff9966db21c66e61a19c04ab6dfc9270eb78e"; 11 + fetchSubmodules = true; 12 + }; 13 + isLibrary = true; 14 + isExecutable = true; 15 + libraryHaskellDepends = [ 16 + base containers optparse-applicative parsec text 17 + ]; 18 + executableHaskellDepends = [ base ]; 19 + description = "Convert dconf files to Nix, as expected by Home Manager"; 20 + license = stdenv.lib.licenses.asl20; 21 + }
+32
pkgs/development/tools/haskell/dconf2nix/default.nix
··· 1 + { haskell, haskellPackages, lib, runCommand }: 2 + 3 + let 4 + dconf2nix = 5 + haskell.lib.justStaticExecutables 6 + (haskell.lib.overrideCabal haskellPackages.dconf2nix (oldAttrs: { 7 + maintainers = (oldAttrs.maintainers or []) ++ [ 8 + lib.maintainers.gvolpe 9 + ]; 10 + })); 11 + in 12 + 13 + dconf2nix.overrideAttrs (oldAttrs: { 14 + passthru = (oldAttrs.passthru or {}) // { 15 + updateScript = ./update.sh; 16 + 17 + # These tests can be run with the following command. 18 + # 19 + # $ nix-build -A dconf2nix.passthru.tests 20 + tests = 21 + runCommand 22 + "dconf2nix-tests" 23 + { 24 + nativeBuildInputs = [ 25 + dconf2nix 26 + ]; 27 + } 28 + '' 29 + dconf2nix > $out 30 + ''; 31 + }; 32 + })
+26
pkgs/development/tools/haskell/dconf2nix/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p cabal2nix curl jq 3 + # 4 + # This script will update the dconf2nix derivation to the latest version using 5 + # cabal2nix. 6 + 7 + set -eo pipefail 8 + 9 + # This is the directory of this update.sh script. 10 + script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 11 + 12 + # dconf2nix derivation created with cabal2nix. 13 + dconf2nix_derivation_file="${script_dir}/dconf2nix.nix" 14 + 15 + # This is the current revision of dconf2nix in Nixpkgs. 16 + old_version="$(sed -En 's/.*\bversion = "(.*?)".*/\1/p' "$dconf2nix_derivation_file")" 17 + 18 + # This is the latest release version of dconf2nix on GitHub. 19 + new_version=$(curl --silent "https://api.github.com/repos/gvolpe/dconf2nix/releases" | jq '.[0].tag_name' --raw-output) 20 + 21 + echo "Updating dconf2nix from old version $old_version to new version $new_version." 22 + echo "Running cabal2nix and outputting to ${dconf2nix_derivation_file}..." 23 + 24 + cabal2nix --revision "$new_version" "https://github.com/gvolpe/dconf2nix.git" > "$dconf2nix_derivation_file" 25 + 26 + echo "Finished."
+2
pkgs/top-level/all-packages.nix
··· 2921 2921 2922 2922 dclxvi = callPackage ../development/libraries/dclxvi { }; 2923 2923 2924 + dconf2nix = callPackage ../development/tools/haskell/dconf2nix { }; 2925 + 2924 2926 dcraw = callPackage ../tools/graphics/dcraw { }; 2925 2927 2926 2928 dcfldd = callPackage ../tools/system/dcfldd { };