aboutsummaryrefslogtreecommitdiff
path: root/.vim/snippets/module.nix
diff options
context:
space:
mode:
Diffstat (limited to '.vim/snippets/module.nix')
-rw-r--r--.vim/snippets/module.nix40
1 files changed, 39 insertions, 1 deletions
diff --git a/.vim/snippets/module.nix b/.vim/snippets/module.nix
index 8debed4..bc9d52e 100644
--- a/.vim/snippets/module.nix
+++ b/.vim/snippets/module.nix
@@ -4,15 +4,53 @@ let
service = "";
cfg = config.services.${service};
+ settings = pkgs.formats.json { };
in {
options.services.${service} = {
+
enable = lib.mkOption {
type = lib.types.bool;
default = false;
};
+
+ user = lib.mkOption {
+ type = lib.types.str;
+ default = service;
+ };
+
+ group = lib.mkOption {
+ type = lib.types.str;
+ default = service;
+ };
+
+ directory = lib.mkOption {
+ type = lib.types.str;
+ default = "/var/empty";
+ };
+
+ settings = lib.mkOption {
+ type = settings.type;
+ default = { };
+ };
};
- config = lib.mkIf cfg.enable { };
+ config = lib.mkIf cfg.enable {
+
+ services.${service}.settings = { };
+
+ users = {
+ groups.${cfg.user} = { gid = 9999; };
+ users.${cfg.group} = {
+ uid = 9999;
+ shell = pkgs.shadow;
+ home = cfg.directory;
+ group = cfg.group;
+ createHome = true;
+ isSystemUser = true;
+ };
+ };
+
+ };
}