push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
{
mkDerivation,
base,
containers,
emojis,
fetchgit,
hedgehog,
lib,
optparse-applicative,
parsec,
template-haskell,
text,
}:
mkDerivation {
pname = "dconf2nix";
version = "0.1.1";
src = fetchgit {
url = "https://github.com/gvolpe/dconf2nix.git";
sha256 = "0frqnq7ryr4gvkbb67n0615d9h1blps2kp55ic05n7wxyh26adgz";
rev = "2fc3b0dfbbce9f1ea2ee89f3689a7cb95b33b63f";
fetchSubmodules = true;
};
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
base
containers
emojis
optparse-applicative
parsec
text
];
executableHaskellDepends = [ base ];
testHaskellDepends = [
base
containers
hedgehog
parsec
template-haskell
text
];
description = "Convert dconf files to Nix, as expected by Home Manager";
license = lib.licenses.asl20;
mainProgram = "dconf2nix";
}

View File

@@ -0,0 +1,36 @@
{
haskell,
haskellPackages,
lib,
runCommand,
}:
let
dconf2nix = haskell.lib.compose.justStaticExecutables (
haskell.lib.compose.overrideCabal (oldAttrs: {
maintainers = (oldAttrs.maintainers or [ ]) ++ [
lib.maintainers.gvolpe
];
}) haskellPackages.dconf2nix
);
in
dconf2nix.overrideAttrs (oldAttrs: {
passthru = (oldAttrs.passthru or { }) // {
updateScript = ./update.sh;
# These tests can be run with the following command.
#
# $ nix-build -A dconf2nix.passthru.tests
tests =
runCommand "dconf2nix-tests"
{
nativeBuildInputs = [
dconf2nix
];
}
''
dconf2nix > $out
'';
};
})

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p cabal2nix curl jq
#
# This script will update the dconf2nix derivation to the latest version using
# cabal2nix.
set -eo pipefail
# This is the directory of this update.sh script.
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# dconf2nix derivation created with cabal2nix.
dconf2nix_derivation_file="${script_dir}/dconf2nix.nix"
# This is the current revision of dconf2nix in Nixpkgs.
old_version="$(sed -En 's/.*\bversion = "(.*?)".*/\1/p' "$dconf2nix_derivation_file")"
# This is the latest release version of dconf2nix on GitHub.
new_version=$(curl --silent "https://api.github.com/repos/gvolpe/dconf2nix/releases" | jq '.[0].tag_name' --raw-output)
echo "Updating dconf2nix from old version $old_version to new version $new_version."
echo "Running cabal2nix and outputting to ${dconf2nix_derivation_file}..."
cabal2nix --revision "$new_version" "https://github.com/gvolpe/dconf2nix.git" > "$dconf2nix_derivation_file"
echo "Finished."