Format, move overlay to overlays to match ~/.config/nixpkgs/overlays/

This commit is contained in:
Sandro - 2022-12-04 07:48:45 +01:00
parent a9590e3242
commit 695e095d44
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
24 changed files with 332 additions and 288 deletions

View File

@ -202,7 +202,7 @@
extraHostRegistry.hosts = import ./host-registry.nix;
hostRegistry = lib.recursiveUpdate zwHostRegistry extraHostRegistry;
in {
overlay = import ./overlay {
overlay = import ./overlays {
inherit nixos-unstable;
inherit (inputs) tracer bevy-mandelbrot bevy-julia;
};

View File

@ -33,12 +33,14 @@ with final; {
postFixup = ''
patchelf --set-rpath ${lib.makeLibraryPath buildInputs} $out/bin/allcolors-rs
'';
desktopItems = [ (makeDesktopItem {
desktopItems = [
(makeDesktopItem {
name = "allcolors";
desktopName = "Polygon's allcolors-rs";
categories = [ "Game" ];
exec = "allcolors-rs";
}) ];
})
];
};
inherit (bevy-julia.packages.${system}) bevy_julia;

View File

@ -1,5 +1,7 @@
{ fetchFromGitHub, rustPlatform
, pkg-config, llvmPackages
{ fetchFromGitHub
, rustPlatform
, pkg-config
, llvmPackages
, soapysdr-with-plugins
}:

View File

@ -1,8 +1,18 @@
{ naersk, fenix
, curl, nodejs, rustPlatform
, stdenv, fetchFromGitHub, buildEnv, fetchCrate
, pkg-config, gettext, wasm-pack, binaryen
, openssl, postgresql
{ naersk
, fenix
, curl
, nodejs
, rustPlatform
, stdenv
, fetchFromGitHub
, buildEnv
, fetchCrate
, pkg-config
, gettext
, wasm-pack
, binaryen
, openssl
, postgresql
}:
let
@ -80,7 +90,8 @@ let
inherit src version;
nativeBuildInputs = [
pkg-config gettext
pkg-config
gettext
wasm-bindgen-cli
];
buildInputs = [
@ -115,7 +126,10 @@ let
pname = "plume-front";
root = src;
nativeBuildInputs = [
gettext wasm-pack wasm-bindgen-cli binaryen
gettext
wasm-pack
wasm-bindgen-cli
binaryen
];
CARGO_BUILD_TARGET = "wasm32-unknown-unknown";
cargoBuildOptions = x:
@ -133,7 +147,8 @@ let
'';
};
};
in buildEnv {
in
buildEnv {
name = "plume-env";
paths = [ plume plume-front plm ];
passthru = { inherit plume plm; };

View File

@ -1,7 +1,12 @@
{ stdenv, fetchFromGitHub
, pkg-config, protobufc
, ncurses, rrdtool, libusb1
, libbladeRF, librtlsdr
{ stdenv
, fetchFromGitHub
, pkg-config
, protobufc
, ncurses
, rrdtool
, libusb1
, libbladeRF
, librtlsdr
# , libad9361, libiio
}:
stdenv.mkDerivation rec {
@ -17,12 +22,16 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [
pkg-config protobufc
pkg-config
protobufc
];
buildInputs = [
ncurses rrdtool libusb1
libbladeRF librtlsdr
ncurses
rrdtool
libusb1
libbladeRF
librtlsdr
# libad9361 libiio
];

View File

@ -16,15 +16,20 @@ let
# allowing --override-input
inputPaths = lib.escapeShellArgs (builtins.attrValues inputs);
in
lib.attrsets.mapAttrs (system: pkgs:
let overlayPkgs = builtins.intersectAttrs (self.overlay {} {}) pkgs;
in overlayPkgs //
lib.attrsets.mapAttrs
(system: pkgs:
let
overlayPkgs = builtins.intersectAttrs (self.overlay { } { }) pkgs;
in
overlayPkgs //
{
host-registry = pkgs.runCommand "host-registry"
{
host-registry = pkgs.runCommand "host-registry" {
src = builtins.toFile "host-registry.nix" (
lib.generators.toPretty { } hostRegistry
);
} ''
}
''
ln -s $src $out
'';
@ -65,9 +70,11 @@ lib.attrsets.mapAttrs (system: pkgs:
'') (builtins.attrNames self.nixosConfigurations)}
'';
prebuild-all = pkgs.runCommand "prebuild-all" {
prebuild-all = pkgs.runCommand "prebuild-all"
{
preferLocalBuild = true;
} ''
}
''
mkdir $out
${pkgs.lib.concatMapStrings (name: ''
@ -90,16 +97,20 @@ lib.attrsets.mapAttrs (system: pkgs:
} //
builtins.foldl' (result: host: result // {
builtins.foldl'
(result: host: result // {
# TODO: check if the ethernet address is reachable and if not,
# execute wol on a machine in HQ.
"${host}-wake" = pkgs.writeScriptBin "${host}-wake" ''
#!${pkgs.runtimeShell}
exec ${pkgs.wol}/bin/wol ${hostRegistry.hosts."${host}".ether}
'';
}) {} (builtins.attrNames (lib.filterAttrs (_: { wol ? false, ... }: wol) hostRegistry.hosts)) //
})
{ }
(builtins.attrNames (lib.filterAttrs (_: { wol ? false, ... }: wol) hostRegistry.hosts)) //
builtins.foldl' (result: name:
builtins.foldl'
(result: name:
let
host = getHostAddr name;
target = ''root@"${host}"'';
@ -108,7 +119,8 @@ lib.attrsets.mapAttrs (system: pkgs:
# let /var/lib/microvm/*/flake point to the flake-update branch so that
# `microvm -u $NAME` updates to what hydra built today.
selfRef = "git+https://gitea.c3d2.de/c3d2/nix-config?ref=flake-update";
in result // {
in
result // {
# Generate a small script for copying this flake to the
# remote machine and bulding and switching there.
# Can be run with `nix run c3d2#…-nixos-rebuild switch`
@ -257,16 +269,18 @@ lib.attrsets.mapAttrs (system: pkgs:
ssh root@hydra.serv.zentralwerk.org -- \
nomad run -detach $JOB
'';
}) {} (builtins.attrNames self.nixosConfigurations) //
})
{ }
(builtins.attrNames self.nixosConfigurations) //
builtins.foldl' (result: host:
builtins.foldl'
(result: host:
let
inherit (self.nixosConfigurations.${host}) config;
in
result // {
# boot any machine in a microvm
"${host}-vm" = (self.nixosConfigurations.${host}
.extendModules {
"${host}-vm" = (self.nixosConfigurations.${host}.extendModules {
modules = [{
microvm = {
mem = lib.mkForce 2048;
@ -293,13 +307,15 @@ lib.attrsets.mapAttrs (system: pkgs:
}] ++ lib.optionals (! config ? microvm) [
microvm.nixosModules.microvm
];
})
.config.microvm.declaredRunner;
}).config.microvm.declaredRunner;
"${host}-tftproot" =
if config.system.build ? tftproot
then config.system.build.tftproot
else lib.trace "No tftproot for ${host}" null;
}
) {} (builtins.attrNames self.nixosConfigurations)
) self.legacyPackages
)
{ }
(builtins.attrNames self.nixosConfigurations)
)
self.legacyPackages