h3c 的 iNodeClient可以运行了
This commit is contained in:
parent
e8e111d337
commit
b8434ed1ea
22
flake.nix
22
flake.nix
@ -47,25 +47,11 @@
|
||||
};
|
||||
|
||||
packages."${system}" = {
|
||||
dev-inode =
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
pkgs.buildFHSEnv {
|
||||
name = "inode-dev-shell";
|
||||
targetPkgs = pkgs: [ pkgs.makeWrapper ] ++ packages-inode;
|
||||
profile = ''
|
||||
export FHS=1
|
||||
export PROMPT_COMMAND="echo -n '(FHS)'"
|
||||
'';
|
||||
|
||||
extraBuildCommands = ''
|
||||
echo $PATH
|
||||
# mount --bind $HOME/.config/iNode/ $out/iNodeClient/clientfiles
|
||||
'';
|
||||
};
|
||||
|
||||
h3c-inode-client = pkgs.callPackage ./h3c-inode-client/package.nix { };
|
||||
};
|
||||
|
||||
nixosModules = {
|
||||
h3c-inode-client = import ./h3c-inode-client/module.nix;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
35
h3c-inode-client/module.nix
Normal file
35
h3c-inode-client/module.nix
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.h3c-inode-client;
|
||||
in
|
||||
{
|
||||
options.services.h3c-inode-client = {
|
||||
enable = lib.mkEnableOption "H3C iNodeClient - ssl vpn client.";
|
||||
package = lib.mkPackageOption pkgs "h3c-inode-client" { };
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.etc."iNode/inodesys.conf".source = "${cfg.package}/etc/iNode/inodesys.conf";
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
systemd.services.h3c-inode-client = {
|
||||
wantedBy = [
|
||||
"network-online.target"
|
||||
"graphical.target"
|
||||
];
|
||||
after = [ "network-online.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
RemainAfterExit = "yes";
|
||||
ExecStartPre = "${cfg.package}/bin/setup.sh";
|
||||
ExecStart = "${cfg.package}/bin/AuthenMngService";
|
||||
ExecStop = "${cfg.package}/bin/AuthenMngService -k";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -115,8 +115,7 @@ stdenv.mkDerivation {
|
||||
mkdir -p $out/bin
|
||||
cat > $out/bin/h3c-inode-client <<EOF
|
||||
#!/usr/bin/env bash
|
||||
#$out${install_dir}/.iNode/iNodeClient
|
||||
bash
|
||||
$out${install_dir}/.iNode/iNodeClient
|
||||
EOF
|
||||
chmod +x $out/bin/h3c-inode-client
|
||||
|
||||
@ -130,8 +129,6 @@ stdenv.mkDerivation {
|
||||
|
||||
[ -d /var/log/inode/cmd ] || mkdir -p /var/log/inode/cmd
|
||||
chmod 777 -R /var/log/inode
|
||||
|
||||
[ -e /etc/iNode/inodesys.conf ] || (mkdir -p /etc/iNode && ln -sf $out/etc/iNode/inodesys.conf /etc/iNode/inodesys.conf)
|
||||
EOF
|
||||
chmod +x $out/bin/setup
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user