From 2fbcf3d2e74fb4f395237b30e1ab578a4e6953b5 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 27 Dec 2024 10:58:51 +0800 Subject: [PATCH] lib/builders: prototype dconf builder function --- lib/builders/build-dconf-db.nix | 9 +++++++++ lib/builders/default.nix | 1 + lib/default.nix | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 lib/builders/build-dconf-db.nix diff --git a/lib/builders/build-dconf-db.nix b/lib/builders/build-dconf-db.nix new file mode 100644 index 00000000..57fa809a --- /dev/null +++ b/lib/builders/build-dconf-db.nix @@ -0,0 +1,9 @@ +# A standalone version of the dconf profile generation build step based from +# the nixpkgs' NixOS dconf module. +{ lib, runCommand, dconf }: + +{ dir, name ? baseNameOf dir, keyfiles, profile }@args: + +runCommand "dconf-${name}" { + nativeBuildInputs = [ (lib.getBin dconf) ]; +} "dconf compile $out ${dir}" diff --git a/lib/builders/default.nix b/lib/builders/default.nix index a2752526..7bf4bd95 100644 --- a/lib/builders/default.nix +++ b/lib/builders/default.nix @@ -9,4 +9,5 @@ buildHugoSite = pkgs.callPackage ./hugo-build-site { }; buildFDSEnv = pkgs.callPackage ./build-fds-env.nix { extendedStdenv = self.stdenv; }; + buildDconfDb = pkgs.callPackage ./build-dconf-db.nix { }; } diff --git a/lib/default.nix b/lib/default.nix index a61dbd19..ce502233 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -39,7 +39,7 @@ in pkgs.lib.makeExtensible (self: inherit (self.builders) makeXDGMimeAssociationList makeXDGPortalConfiguration makeXDGDesktopEntry - buildHugoSite buildFDSEnv; + buildHugoSite buildFDSEnv buildDconfDb; inherit (self.trivial) countAttrs filterAttrs'; inherit (self.data) importYAML renderTeraTemplate renderMustacheTemplate; inherit (self.fetchers) fetchInternetArchive fetchUgeeDriver;