nixos/nvrs: init module

Co-authored-by: azey <me@azey.net>
Signed-off-by: adam <me@adamperkowski.dev>
This commit is contained in:
Adam Perkowski
2025-11-23 13:49:17 +01:00
co-authored by azey
parent 61b868358e
commit 9352b63375
+43
View File
@@ -0,0 +1,43 @@
{
lib,
pkgs,
config,
...
}:
let
cfg = config.programs.nvrs;
settingsFormat = pkgs.formats.toml { };
in
{
meta.maintainers = with lib.maintainers; [ adamperkowski ];
options.programs.nvrs = {
enable = lib.mkEnableOption "nvrs";
package = lib.mkPackageOption pkgs "nvrs" { };
settings = lib.mkOption {
type = lib.types.submodule {
freeformType = settingsFormat.type;
};
default = { };
description = ''
Configuration written to {file}`$XDG_CONFIG_HOME/nvrs/config.toml`
See <https://nvrs.adamperkowski.dev/configuration.html> for details.
'';
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
environment.etc = {
"nvrs/nvrs.toml" = lib.mkIf (cfg.settings != { }) {
source = settingsFormat.generate "nvrs-config.toml" cfg.settings;
};
};
};
}