1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 19:49:45 +01:00

ludusavi: update module formatting

This commit is contained in:
PopeRigby 2024-07-09 20:21:34 -07:00
parent 506976a970
commit 8121d1ec72

View file

@ -1,21 +1,14 @@
{ { config, lib, pkgs, ... }:
config,
lib,
pkgs,
...
}:
let let
cfg = config.services.ludusavi; cfg = config.services.ludusavi;
settingsFormat = pkgs.formats.yaml { }; settingsFormat = pkgs.formats.yaml { };
configFile = configFile = if cfg.configFile == null then
if cfg.configFile == null then settingsFormat.generate "config.yaml" cfg.settings
settingsFormat.generate "config.yaml" cfg.settings else
else cfg.configFile;
cfg.configFile; in {
in
{
meta.maintainers = [ lib.maintainers.PopeRigby ]; meta.maintainers = [ lib.maintainers.PopeRigby ];
options.services.ludusavi = { options.services.ludusavi = {
@ -31,7 +24,8 @@ in
settings = lib.mkOption { settings = lib.mkOption {
type = settingsFormat.type; type = settingsFormat.type;
default = { default = {
manifest.url = "https://raw.githubusercontent.com/mtkennerly/ludusavi-manifest/master/data/manifest.yaml"; manifest.url =
"https://raw.githubusercontent.com/mtkennerly/ludusavi-manifest/master/data/manifest.yaml";
roots = [ ]; roots = [ ];
backup.path = "~/.local/state/backups/ludusavi"; backup.path = "~/.local/state/backups/ludusavi";
restore.path = "~/.local/state/backups/ludusavi"; restore.path = "~/.local/state/backups/ludusavi";
@ -39,12 +33,10 @@ in
example = { example = {
language = "en-US"; language = "en-US";
theme = "light"; theme = "light";
roots = [ roots = [{
{ path = "~/.local/share/Steam";
path = "~/.local/share/Steam"; store = "steam";
store = "steam"; }];
}
];
backup.path = "~/.local/state/backups/ludusavi"; backup.path = "~/.local/state/backups/ludusavi";
restore.path = "~/.local/state/backups/ludusavi"; restore.path = "~/.local/state/backups/ludusavi";
}; };
@ -57,12 +49,11 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
assertions = [ assertions = [{
{ assertion = (cfg.settings != { }) != (cfg.configFile != null);
assertion = (cfg.settings != { }) != (cfg.configFile != null); message =
message = "The `settings` and `configFile` options are mutually exclusive."; "The `settings` and `configFile` options are mutually exclusive.";
} }];
];
systemd.user = { systemd.user = {
services.ludusavi = { services.ludusavi = {