From 0f6e2e0d40507d79efdeefbc661a3cf9175333ae Mon Sep 17 00:00:00 2001 From: shimun Date: Sat, 24 Dec 2022 17:17:20 +0100 Subject: [PATCH] added: adapt modules --- client/Cargo.toml | 4 +++- modules/home-manager.nix | 7 +++---- modules/nixos.nix | 4 ++-- modules/options.nix | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client/Cargo.toml b/client/Cargo.toml index 74563a3..03a6b9e 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -4,7 +4,9 @@ version = "0.1.0" authors = ["shimun "] edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[[bin]] +name = "ssh-cert-dist" +path = "src/main.rs" [dependencies] anyhow = "1.0.66" diff --git a/modules/home-manager.nix b/modules/home-manager.nix index 64f3308..328ffbb 100644 --- a/modules/home-manager.nix +++ b/modules/home-manager.nix @@ -13,15 +13,14 @@ in Environment = "RUST_LOG=debug"; ExecStart = toString (pkgs.writeShellApplication { name = "ssh-cert-dist-${options.name}"; - runtimeInputs = [ pkgs.ssh-cert-dist ]; + runtimeInputs = [ cfg.package ]; text = '' ${optionalString options.fetch '' - ssh-cert-dist client fetch --cert-dir '${path}' --api-endpoint '${cfg.endpoint}' + ssh-cert-dist fetch --cert-dir '${path}' --api-endpoint '${cfg.endpoint}' ''} ${optionalString options.upload '' - ssh-cert-dist client upload --api-endpoint '${cfg.endpoint}' ${path}/* + ssh-cert-dist upload --api-endpoint '${cfg.endpoint}' ${path}/* ''} - ''; }); }; diff --git a/modules/nixos.nix b/modules/nixos.nix index e1d34b7..b976182 100644 --- a/modules/nixos.nix +++ b/modules/nixos.nix @@ -14,7 +14,7 @@ in }; package = mkOption { type = types.package; - default = pkgs.ssh-cert-dist; + default = pkgs.ssh-cert-dist-server; }; ca = mkOption { type = types.path; @@ -57,7 +57,7 @@ in chown ${cfg.user}:${cfg.group} ${cfg.dataDir} ''}"; User = cfg.user; - ExecStart = "${cfg.package}/bin/ssh-cert-dist server"; + ExecStart = "${cfg.package}/bin/ssh-cert-dist-server"; }; }; }; diff --git a/modules/options.nix b/modules/options.nix index 812d469..3fb8884 100644 --- a/modules/options.nix +++ b/modules/options.nix @@ -22,7 +22,7 @@ }; packageOption = mkOption { type = types.package; - default = pkgs.ssh-cert-dist; + default = pkgs.ssh-cert-dist-client; }; in