diff --git a/data/dconf.settings b/data/dconf.settings index ef613f6..b22d14a 100644 --- a/data/dconf.settings +++ b/data/dconf.settings @@ -319,3 +319,10 @@ recently-installed-apps=['RollerCoaster Tycoon 3 Platinum!.desktop', 'RollerCoas [org/gnome/evolution-data-server/calendar/list-of-equal] reminders-snoozed=['='] + +[org/gnome/Tetravex] +saved-game=@m(yyda(yyyyyyyy)ua(yyyyu)) nothing + +[org/gnome/evince] +document-directory=@ms nothing +pictures-directory=@ms nothing diff --git a/output/dconf.nix b/output/dconf.nix index 30c882d..84f2f17 100644 --- a/output/dconf.nix +++ b/output/dconf.nix @@ -400,5 +400,14 @@ with lib.hm.gvariant; reminders-snoozed = [ "=" ]; }; + "org/gnome/Tetravex" = { + saved-game = mkNothing "(yyda(yyyyyyyy)ua(yyyyu))"; + }; + + "org/gnome/evince" = { + document-directory = mkNothing "s"; + pictures-directory = mkNothing "s"; + }; + }; } diff --git a/src/DConf.hs b/src/DConf.hs index 22a9896..e4e2e81 100644 --- a/src/DConf.hs +++ b/src/DConf.hs @@ -47,6 +47,9 @@ sepOneEndBy p sep = vBool :: Parsec Text () Value vBool = B False <$ string "false" <|> B True <$ string "true" +vNothing :: Parsec Text () Value +vNothing = No <$ string "nothing" + vDouble :: Parsec Text () Value vDouble = try $ do s <- option "" $ string "-" @@ -120,7 +123,7 @@ baseValue = choice value :: Parsec Text () Value value = choice - [vTyped, vDictDictEntry, vList, vJson, baseValue, vCast, vTuple, vVariant] + [vTyped, vDictDictEntry, vList, vJson, baseValue, vCast, vNothing, vTuple, vVariant] vVariant :: Parsec Text () Value vVariant = fmap V $ bracket "<" ">" value diff --git a/src/DConf/Data.hs b/src/DConf/Data.hs index 157e2d9..941430d 100644 --- a/src/DConf/Data.hs +++ b/src/DConf/Data.hs @@ -44,6 +44,7 @@ castName TyObjectpath = "objectpath" data Value = S Text -- String | B Bool -- Bool + | No -- Nothing case of Maybe | I Int -- Int | C Ty Value -- Cast | D Double -- Double diff --git a/src/Nix.hs b/src/Nix.hs index 4ce52f6..13e8032 100644 --- a/src/Nix.hs +++ b/src/Nix.hs @@ -91,6 +91,7 @@ renderValue raw = Nix $ renderValue' raw <> ";" renderValue' (S v) = renderString v renderValue' (B v) = T.toLower . T.pack $ show v + renderValue' (No ) = error "Standalone nothing not supported" renderValue' (I v) = T.pack $ show v renderValue' (D v) = T.pack $ show v renderValue' (C ty v) = @@ -102,6 +103,7 @@ renderValue raw = Nix $ renderValue' raw <> ";" renderValue' (T xs) = "mkTuple " <> renderList xs -- In home-manager, @mkValue []@ emits @\@as []@ renderValue' (Ty "as" (L [])) = renderList [] + renderValue' (Ty ('m':t) No) = "mkNothing " <> T.pack (show t) -- In home-manager, arrays are always typed when using @mkArray@. renderValue' (Ty ('a':t) (L v)) = "mkArray " <> T.pack (show t) <> " " <> renderList v -- TODO: add mkTyped to h-m