Skip to content

Instantly share code, notes, and snippets.

@Emantor
Created May 25, 2020 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Emantor/1dc949426a150ad618a0ec4d67a9931f to your computer and use it in GitHub Desktop.
Save Emantor/1dc949426a150ad618a0ec4d67a9931f to your computer and use it in GitHub Desktop.
Dconf read-only DB for NixOS
# Create a read-only DB with default theme and font settings.
programs.dconf.enable = true;
programs.dconf.profiles.user =
let
customDconf = pkgs.writeTextFile {
name = "nixos-user-dconf";
destination = "/dconf/nixos-user-custom";
text = ''
[org/gnome/desktop/interface]
cursor-theme='Numix-Cursor'
font-name='Source Sans Pro 10'
'';
};
customDconfDb = pkgs.stdenv.mkDerivation {
name = "nixos-user-dconf-db";
buildCommand = ''
${pkgs.gnome3.dconf}/bin/dconf compile $out ${customDconf}/dconf
'';
};
in pkgs.stdenv.mkDerivation {
name = "dconf-nixos-user-profile";
buildCommand = ''
# create a custom user profile
echo -e "user-db:user\nfile-db:${customDconfDb}" > $out
'';
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment