sheep_net: init (#423744)

This commit is contained in:
Matthew Croughan 2025-07-16 17:06:11 +01:00 committed by GitHub
commit ca573e60c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 73 additions and 3 deletions

View File

@ -0,0 +1,34 @@
{
config,
lib,
...
}:
let
cfg = config.hardware.sheep_net;
in
{
options.hardware.sheep_net = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enables sheep_net udev rules, ensures 'sheep_net' group exists, and adds
sheep-net to boot.kernelModules and boot.extraModulePackages
'';
};
};
config = lib.mkIf cfg.enable {
services.udev.extraRules = ''
KERNEL=="sheep_net", GROUP="sheep_net"
'';
boot.kernelModules = [
"sheep_net"
];
boot.extraModulePackages = [
config.boot.kernelPackages.sheep-net
];
users.groups.sheep_net = { };
};
meta.maintainers = with lib.maintainers; [ matthewcroughan ];
}

View File

@ -104,6 +104,7 @@
./hardware/sata.nix
./hardware/sensor/hddtemp.nix
./hardware/sensor/iio.nix
./hardware/sheep-net.nix
./hardware/steam-hardware.nix
./hardware/system-76.nix
./hardware/tuxedo-drivers.nix

View File

@ -11,13 +11,15 @@
}:
stdenv.mkDerivation (finalAttrs: {
pname = "basiliskii";
version = "unstable-2022-09-30";
version = "unstable-2025-07-16";
# This src is also used to build pkgs/os-specific/linux/sheep-net
# Therefore changes to it may effect the sheep-net package
src = fetchFromGitHub {
owner = "kanjitalk755";
repo = "macemu";
rev = "2fa17a0783cf36ae60b77b5ed930cda4dc1824af";
sha256 = "+jkns6H2YjlewbUzgoteGSQYWJL+OWVu178aM+BtABM=";
rev = "030599cf8d31cb80afae0e1b086b5706dbdd2eea";
sha256 = "sha256-gxaj+2ymelH6uWmjMLXi64xMNrToo6HZcJ7RW7sVMzo=";
};
sourceRoot = "${finalAttrs.src.name}/BasiliskII/src/Unix";
patches = [ ./remove-redhat-6-workaround-for-scsi-sg.h.patch ];

View File

@ -0,0 +1,31 @@
{
kernel,
kernelModuleMakeFlags,
stdenv,
basiliskii,
lib,
}:
stdenv.mkDerivation (finalAttrs: {
name = "sheep_net";
version = basiliskii.version;
src = basiliskii.src;
sourceRoot = "${finalAttrs.src.name}/BasiliskII/src/Unix/Linux/NetDriver";
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = kernelModuleMakeFlags ++ [
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}"
];
installPhase = ''
runHook preInstall
mkdir -p $out/lib/modules/${kernel.modDirVersion}/drivers/net
install -Dm444 sheep_net.ko $out/lib/modules/${kernel.modDirVersion}/drivers/net/sheep_net.ko
runHook postInstall
'';
meta = {
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [ matthewcroughan ];
platforms = lib.platforms.linux;
};
})

View File

@ -593,6 +593,8 @@ in
rr-zen_workaround = callPackage ../development/tools/analysis/rr/zen_workaround.nix { };
sheep-net = callPackage ../os-specific/linux/sheep-net { };
shufflecake = callPackage ../os-specific/linux/shufflecake { };
sysdig = callPackage ../os-specific/linux/sysdig { };