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:
parent
506976a970
commit
8121d1ec72
1 changed files with 17 additions and 26 deletions
|
@ -1,21 +1,14 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.services.ludusavi;
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
|
||||
configFile =
|
||||
if cfg.configFile == null then
|
||||
configFile = if cfg.configFile == null then
|
||||
settingsFormat.generate "config.yaml" cfg.settings
|
||||
else
|
||||
cfg.configFile;
|
||||
in
|
||||
{
|
||||
in {
|
||||
meta.maintainers = [ lib.maintainers.PopeRigby ];
|
||||
|
||||
options.services.ludusavi = {
|
||||
|
@ -31,7 +24,8 @@ in
|
|||
settings = lib.mkOption {
|
||||
type = settingsFormat.type;
|
||||
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 = [ ];
|
||||
backup.path = "~/.local/state/backups/ludusavi";
|
||||
restore.path = "~/.local/state/backups/ludusavi";
|
||||
|
@ -39,12 +33,10 @@ in
|
|||
example = {
|
||||
language = "en-US";
|
||||
theme = "light";
|
||||
roots = [
|
||||
{
|
||||
roots = [{
|
||||
path = "~/.local/share/Steam";
|
||||
store = "steam";
|
||||
}
|
||||
];
|
||||
}];
|
||||
backup.path = "~/.local/state/backups/ludusavi";
|
||||
restore.path = "~/.local/state/backups/ludusavi";
|
||||
};
|
||||
|
@ -57,12 +49,11 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertions = [{
|
||||
assertion = (cfg.settings != { }) != (cfg.configFile != null);
|
||||
message = "The `settings` and `configFile` options are mutually exclusive.";
|
||||
}
|
||||
];
|
||||
message =
|
||||
"The `settings` and `configFile` options are mutually exclusive.";
|
||||
}];
|
||||
|
||||
systemd.user = {
|
||||
services.ludusavi = {
|
||||
|
|
Loading…
Reference in a new issue