stockholm/lass/4lib/default.nix
2015-10-21 02:23:57 +02:00

21 lines
379 B
Nix

{ 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"]);
}