mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 13:39:46 +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
|
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 = "The `settings` and `configFile` options are mutually exclusive.";
|
message =
|
||||||
}
|
"The `settings` and `configFile` options are mutually exclusive.";
|
||||||
];
|
}];
|
||||||
|
|
||||||
systemd.user = {
|
systemd.user = {
|
||||||
services.ludusavi = {
|
services.ludusavi = {
|
||||||
|
|
Loading…
Reference in a new issue