From 7f40877af8048a549357648e49fcd83f28033bea Mon Sep 17 00:00:00 2001 From: ners Date: Wed, 29 Nov 2023 13:08:11 +0100 Subject: [PATCH] default all dconf settings --- flake.lock | 24 ++++++++++++------------ lib/attrsets.nix | 3 ++- lib/dconf.nix | 6 ++++-- modules/home/dconf.nix | 11 ++++++++--- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index b4e8382..56ce09c 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1699781810, - "narHash": "sha256-LD+PIUbm1yQmQmGIbSsc/PB1dtJtGqXFgxRc1C7LlfQ=", + "lastModified": 1700927249, + "narHash": "sha256-iqmIWiEng890/ru7ZBf4nUezFPyRm2fjRTvuwwxqk2o=", "owner": "nix-community", "repo": "disko", - "rev": "2d7d77878c5d70f66f3d676ff66708d8d4f9d7df", + "rev": "3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22", "type": "github" }, "original": { @@ -43,11 +43,11 @@ ] }, "locked": { - "lastModified": 1700847865, - "narHash": "sha256-uWaOIemGl9LF813MW0AEgCBpKwFo2t1Wv3BZc6e5Frw=", + "lastModified": 1701071203, + "narHash": "sha256-lQywA7QU/vzTdZ1apI0PfgCWNyQobXUYghVrR5zuIeM=", "owner": "nix-community", "repo": "home-manager", - "rev": "8cedd63eede4c22deb192f1721dd67e7460e1ebe", + "rev": "db1878f013b52ba5e4034db7c1b63e8d04173a86", "type": "github" }, "original": { @@ -112,11 +112,11 @@ }, "nixpkgs-23.05": { "locked": { - "lastModified": 1700851152, - "narHash": "sha256-3PWITNJZyA3jz5IGREJRfSykM6xSLmD8u5A3WpBCyDM=", + "lastModified": 1701053011, + "narHash": "sha256-8QQ7rFbKFqgKgLoaXVJRh7Ik5LtI3pyBBCfOnNOGkF0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1216a5ba22a93a4a3a3bfdb4bff0f4727c576fcc", + "rev": "5b528f99f73c4fad127118a8c1126b5e003b01a9", "type": "github" }, "original": { @@ -128,11 +128,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1700612854, - "narHash": "sha256-yrQ8osMD+vDLGFX7pcwsY/Qr5PUd6OmDMYJZzZi0+zc=", + "lastModified": 1701068326, + "narHash": "sha256-vmMceA+q6hG1yrjb+MP8T0YFDQIrW3bl45e7z24IEts=", "owner": "nixos", "repo": "nixpkgs", - "rev": "19cbff58383a4ae384dea4d1d0c823d72b49d614", + "rev": "8cfef6986adfb599ba379ae53c9f5631ecd2fd9c", "type": "github" }, "original": { diff --git a/lib/attrsets.nix b/lib/attrsets.nix index 75dfec7..63418dc 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -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 ]; diff --git a/lib/dconf.nix b/lib/dconf.nix index 7b52c5e..0f9ef6b 100644 --- a/lib/dconf.nix +++ b/lib/dconf.nix @@ -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; } diff --git a/modules/home/dconf.nix b/modules/home/dconf.nix index 55d1240..2464fff 100644 --- a/modules/home/dconf.nix +++ b/modules/home/dconf.nix @@ -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"; @@ -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; }; }; };