krebs.retiolum: define type of hosts
This commit is contained in:
parent
e082da2c23
commit
faf5f6c172
@ -89,7 +89,6 @@ in
|
||||
imports = [ ../../3modules/krebs/retiolum.nix ];
|
||||
krebs.retiolum = {
|
||||
enable = true;
|
||||
hosts = ../../Zhosts;
|
||||
connectTo = [
|
||||
"fastpoke"
|
||||
"pigstarter"
|
||||
|
@ -32,7 +32,6 @@ with lib;
|
||||
imports = [ ../../3modules/krebs/retiolum.nix ];
|
||||
krebs.retiolum = {
|
||||
enable = true;
|
||||
hosts = ../../Zhosts;
|
||||
connectTo = [
|
||||
"cd"
|
||||
"fastpoke"
|
||||
|
@ -40,7 +40,6 @@ with lib;
|
||||
imports = [ ../../3modules/krebs/retiolum.nix ];
|
||||
krebs.retiolum = {
|
||||
enable = true;
|
||||
hosts = ../../Zhosts;
|
||||
connectTo = [
|
||||
"gum"
|
||||
"pigstarter"
|
||||
|
@ -32,7 +32,6 @@ with lib;
|
||||
imports = [ ../../3modules/krebs/retiolum.nix ];
|
||||
krebs.retiolum = {
|
||||
enable = true;
|
||||
hosts = ../../Zhosts;
|
||||
connectTo = [
|
||||
"cd"
|
||||
"mkdir"
|
||||
|
@ -148,7 +148,6 @@ in
|
||||
imports = [ ../../3modules/krebs/retiolum.nix ];
|
||||
krebs.retiolum = {
|
||||
enable = true;
|
||||
hosts = ../../Zhosts;
|
||||
connectTo = [
|
||||
"gum"
|
||||
"pigstarter"
|
||||
|
@ -57,9 +57,9 @@ let
|
||||
};
|
||||
|
||||
hosts = mkOption {
|
||||
default = null;
|
||||
type = with types; either package path;
|
||||
default = ../../Zhosts;
|
||||
description = ''
|
||||
Hosts package or path to use.
|
||||
If a path is given, then it will be used to generate an ad-hoc package.
|
||||
'';
|
||||
};
|
||||
@ -127,24 +127,20 @@ let
|
||||
};
|
||||
|
||||
tinc = cfg.tincPackage;
|
||||
hostsType = builtins.typeOf cfg.hosts;
|
||||
hosts =
|
||||
if hostsType == "package" then
|
||||
# use package as is
|
||||
cfg.hosts
|
||||
else if hostsType == "path" then
|
||||
# use path to generate a package
|
||||
pkgs.stdenv.mkDerivation {
|
||||
|
||||
hosts = getAttr (typeOf cfg.hosts) {
|
||||
package = cfg.hosts;
|
||||
path = pkgs.stdenv.mkDerivation {
|
||||
name = "custom-retiolum-hosts";
|
||||
src = cfg.hosts;
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
find . -name .git -prune -o -type f -print0 | xargs -0 cp --target-directory $out
|
||||
find . -name .git -prune -o -type f -print0 \
|
||||
| xargs -0 cp --target-directory $out
|
||||
'';
|
||||
}
|
||||
else
|
||||
abort "The option `services.retiolum.hosts' must be set to a package or a path"
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
iproute = cfg.iproutePackage;
|
||||
|
||||
retiolumExtraHosts = import (pkgs.runCommand "retiolum-etc-hosts"
|
||||
@ -222,5 +218,5 @@ let
|
||||
|
||||
chmod +x $out/tinc-up
|
||||
'';
|
||||
in
|
||||
out
|
||||
|
||||
in out
|
||||
|
Loading…
Reference in New Issue
Block a user