fix: module
This commit is contained in:
53
flake.nix
53
flake.nix
@@ -99,53 +99,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
nixosModules.default = { config, pkgs, lib, ... }: with lib; let cfg = config.services.ssh-cert-dist; in {
|
||||
options.services.ssh-cert-dist = {
|
||||
enable = mkEnableOption "ssh-cert-dist";
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
default = "127.0.0.1";
|
||||
};
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 6877;
|
||||
};
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.ssh-cert-dist;
|
||||
};
|
||||
dataDir = mkOption {
|
||||
type = types.path;
|
||||
default = "/var/lib/ssh-cert-dist";
|
||||
};
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "cert-dist";
|
||||
};
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "cert-dist";
|
||||
};
|
||||
};
|
||||
config = mkIf {
|
||||
users = {
|
||||
users.${cfg.user} = {
|
||||
isSystemUser = true;
|
||||
group = cfg.group;
|
||||
};
|
||||
groups.${cfg.group} = { };
|
||||
|
||||
};
|
||||
systemd.services.ssh-cert-dist = {
|
||||
preStart = ''
|
||||
chown ${cfg.user}:${cfg.group} ${cfg.dataDir}
|
||||
'';
|
||||
serviceConfig.User = cfg.user;
|
||||
serviceConfig.ExecStart = "${cfg.package}/bin/ssh-cert-dist server --address ${cfg.host}:${toString cfg.port} -c ${cfg.dataDir} --ca ${cfg.ca}";
|
||||
};
|
||||
};
|
||||
};
|
||||
homeManagerModules.default = { config, pkgs, lib, ... }: with lib; let cfg = config.services.ssh-cert-dist; in { };
|
||||
nixosModules.default = {
|
||||
imports = [ ./modules/nixos.nix ];
|
||||
};
|
||||
homeManagerModules.default = {
|
||||
imports = [ ./modules/home-manager.nix ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user