Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default all dconf settings #13

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/attrsets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ with lib;
# merged into a single string, and may change the value as well.
flattenAttrsWith = cond: merge: pipef [
(flattenAttrs cond)
(map (pipef [ merge nameValuePairToAttrs ]))
(map merge)
(map nameValuePairToAttrs)
recursiveConcat
];

Expand Down
6 changes: 4 additions & 2 deletions lib/dconf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
with builtins;
with lib;
{
dconfFlatten =
dconfFlattenWith = f:
let
cond = x: not (hasAttr "_type" x);
merge = { name, value }:
assert assertMsg
(length name > 1)
"dconf configuration requires at least two-level names!";
nameValuePair (concatStringsSep "/" (init name)) { ${last name} = value; };
nameValuePair (concatStringsSep "/" (init name)) { ${last name} = f value; };
in
flattenAttrsWith cond merge;

dconfFlatten = dconfFlattenWith id;
}
11 changes: 8 additions & 3 deletions modules/home/dconf.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{ lib, ... }:

let
inherit (lib.hm.gvariant) mkUint32;
inherit (lib) mkDefault;
in
{
dconf = {
enable = true;
settings =
lib.dconfFlatten
lib.dconfFlattenWith mkDefault
{
org.gnome = {
Console.theme = "night";
desktop = {
interface = {
font-antialiasing = "grayscale";
Expand All @@ -25,8 +30,8 @@
mouse.speed = 0.5;
keyboard = {
repeat = true;
delay = lib.hm.gvariant.mkUint32 240;
repeat-interval = lib.hm.gvariant.mkUint32 16;
delay = mkUint32 240;
repeat-interval = mkUint32 16;
};
};
};
Expand Down