create own library for globals and net.nix

This commit is contained in:
Pim Kunis 2024-04-13 17:28:31 +02:00
parent c8023afceb
commit 8b937fdfc4
12 changed files with 31 additions and 33 deletions

View file

@ -1,19 +1,19 @@
{ flake-utils, hostPkgs, ... }: flake-utils.lib.eachDefaultSystem (system:
{ flake-utils, pkgs, ... }: flake-utils.lib.eachDefaultSystem (system:
let
createScript = name: runtimeInputs: scriptPath:
let
script = (hostPkgs.writeScriptBin name (builtins.readFile scriptPath)).overrideAttrs (old: {
script = (pkgs.writeScriptBin name (builtins.readFile scriptPath)).overrideAttrs (old: {
buildCommand = "${old.buildCommand}\n patchShebangs $out";
});
in
hostPkgs.symlinkJoin {
pkgs.symlinkJoin {
inherit name;
paths = [ script ] ++ runtimeInputs;
buildInputs = [ hostPkgs.makeWrapper ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = "wrapProgram $out/bin/${name} --set PATH $out/bin";
};
in
{
packages.bootstrap = createScript "bootstrap" (with hostPkgs; [ libsecret coreutils nixos-anywhere ]) ./bootstrap.sh;
packages.gen-k3s-cert = createScript "create-k3s-cert" (with hostPkgs; [ openssl coreutils openssh yq ]) ./gen-k3s-cert.sh;
packages.bootstrap = createScript "bootstrap" (with pkgs; [ libsecret coreutils nixos-anywhere ]) ./bootstrap.sh;
packages.gen-k3s-cert = createScript "create-k3s-cert" (with pkgs; [ openssl coreutils openssh yq ]) ./gen-k3s-cert.sh;
})