blob: 6a8a28972b71edb42a7a89890fc25f17af61e1dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
{ lib, pkgs, ... }:
with lib;
{
simpleScript = name: content:
pkgs.stdenv.mkDerivation {
inherit name;
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
ln -s ${pkgs.writeScript name content} $out/bin/${name}
'';
};
getDefaultGateway = ip:
concatStringsSep "." (take 3 (splitString "." ip) ++ ["1"]);
}
|