initial commit, with lots of old code that i may need again later
This commit is contained in:
commit
79b4f7454d
8 changed files with 294 additions and 0 deletions
11
aeolia-config.nix
Normal file
11
aeolia-config.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ pkgs, modulesPath, fetchzip, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/minimal.nix")
|
||||
./base.nix
|
||||
];
|
||||
|
||||
# boot.kernelPackages = pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor (pkgs.callPackage ./kernel-aeolia.nix {}));
|
||||
boot.kernelPackages = pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor (pkgs.callPackage ./kernel-aeolia-5.3.nix {}));
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
51
base.nix
Normal file
51
base.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{ config, pkgs, modulesPath, ... }: {
|
||||
fileSystems = {
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-label/nixos-boot";
|
||||
fsType = "vfat";
|
||||
options = [ "nofail" "noauto" ];
|
||||
};
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/nixos-root";
|
||||
fsType = "ext4";
|
||||
};
|
||||
};
|
||||
|
||||
boot.loader.grub.enable = false;
|
||||
|
||||
system.build.rootFileSystem = pkgs.callPackage (modulesPath + "/../lib/make-ext4-fs.nix") {
|
||||
storePaths = with pkgs; [
|
||||
config.system.build.toplevel
|
||||
busybox
|
||||
];
|
||||
volumeLabel = "nixos-root";
|
||||
};
|
||||
|
||||
# system.build.usbImage = pkgs.callPackage ({ stdenvNoCC }: stdenvNoCC.mkDerivation {
|
||||
# name = "nixos-ps4-usbimage";
|
||||
|
||||
# nativeBuildInputs = with pkgs; [ mtools ];
|
||||
|
||||
# buildCommand = ''
|
||||
# mkdir $out
|
||||
# dd if=/dev/zero of=$out/nixos.img bs=1M count=2
|
||||
# mformat -F -i $out/nixos.img ::
|
||||
# mcopy -i $out/nixos.img ${config.system.build.system.kernel}/bzImage
|
||||
# '';
|
||||
# }) {};
|
||||
|
||||
boot.initrd.preFailCommands = ''
|
||||
export allowShell=1
|
||||
'';
|
||||
|
||||
users.users.nixos = {
|
||||
isNormalUser = true;
|
||||
password = "nixos";
|
||||
extraGroups = [ "wheel" ];
|
||||
};
|
||||
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
programs.fish.enable = true;
|
||||
|
||||
services.getty.autologinUser = "nixos";
|
||||
}
|
3
default.nix
Normal file
3
default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
# pkgs.callPackage ./kernel-aeolia.nix {}
|
||||
pkgs.callPackage ./kernel-aeolia-5.3.nix {}
|
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1732014248,
|
||||
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
38
flake.nix
Normal file
38
flake.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }: {
|
||||
nixosConfigurations = {
|
||||
"aeolia" = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
({ pkgs, ... }: { nixpkgs.overlays = [
|
||||
(final: super: {
|
||||
makeModulesClosure = x:
|
||||
super.makeModulesClosure (x // { allowMissing = true; });
|
||||
})
|
||||
]; })
|
||||
./aeolia-config.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
usb.aeolia = nixpkgs.legacyPackages.x86_64-linux.stdenvNoCC.mkDerivation {
|
||||
name = "nixos-ps4-usb-aeolia";
|
||||
|
||||
kernel = self.nixosConfigurations.aeolia.config.system.build.kernel;
|
||||
initrd = self.nixosConfigurations.aeolia.config.system.build.initialRamdisk;
|
||||
rootfs = self.nixosConfigurations.aeolia.config.system.build.rootFileSystem;
|
||||
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/boot $out/root
|
||||
cp $kernel/bzImage $out/boot/bzImage
|
||||
cp $initrd/initrd.gz $out/boot/initramfs.cpio.gz
|
||||
cp $rootfs $out/root/rootfs.img
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
22
kernel-aeolia-5.3.nix
Normal file
22
kernel-aeolia-5.3.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ fetchFromGitHub, linuxManualConfig, runCommand, linux-firmware, gcc8Stdenv, ... }:
|
||||
((linuxManualConfig rec {
|
||||
src = fetchFromGitHub {
|
||||
owner = "Nomkid";
|
||||
repo = "ps4-linux-nixos";
|
||||
rev = "refs/heads/aeolia";
|
||||
hash = "sha256-Gdf6pBWD885ZXUuswSQQZQgpNp1t5dn6rHs0p2DqKcw=";
|
||||
};
|
||||
|
||||
version = "5.3.18-PS4";
|
||||
modDirVersion = "5.3.18";
|
||||
|
||||
configfile = runCommand "concat-config" {} ''
|
||||
cat "${src}/config" > $out
|
||||
echo "CONFIG_EXTRA_FIRMWARE_DIR=\"${linux-firmware}/lib/firmware\"" >> $out
|
||||
'';
|
||||
allowImportFromDerivation = true;
|
||||
}).override {
|
||||
stdenv = gcc8Stdenv;
|
||||
}).overrideAttrs {
|
||||
NIX_CFLAGS_COMPILE = "-Wno-redundant-decls -Wno-use-after-free";
|
||||
}
|
66
kernel-aeolia-prebuilt.nix
Normal file
66
kernel-aeolia-prebuilt.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{ lib, stdenvNoCC, runCommand, fetchurl, fetchFromGitHub, ... }:
|
||||
let
|
||||
src = fetchFromGitHub {
|
||||
owner = "ps4boot";
|
||||
repo = "ps4-linux";
|
||||
rev = "refs/heads/aeolia";
|
||||
hash = "sha256-urNDgnoGC76WYvzAlypCJ+w8IIsPcN2kQMzlYF/h+mo=";
|
||||
};
|
||||
|
||||
bzImage = fetchurl {
|
||||
url = "https://github.com/ps4boot/ps4-linux/releases/download/v1/bzImageAeolia";
|
||||
hash = "sha256-0P02KJe8OCuliHjjkJqlPXQBHDuEGLUIp78lWa5hYdw=";
|
||||
};
|
||||
|
||||
# parse the configfile into a nix attrset
|
||||
# from https://github.com/NixOS/nixpkgs/blob/a253c2d94cbf75cfd0f7eea242d8385214332dda/pkgs/os-specific/linux/kernel/manual-config.nix#L11
|
||||
parseConfig = configfile: import (runCommand "config.nix" {} ''
|
||||
echo "{" > "$out"
|
||||
while IFS='=' read key val; do
|
||||
[ "x''${key#CONFIG_}" != "x$key" ] || continue
|
||||
no_firstquote="''${val#\"}";
|
||||
echo ' "'"$key"'" = "'"''${no_firstquote%\"}"'";' >> "$out"
|
||||
done < "${configfile}"
|
||||
echo "}" >> $out
|
||||
'').outPath;
|
||||
|
||||
# make a hacky wrapper around the bzImage so it's
|
||||
# compatible with the nixos module system
|
||||
# kernelFn = { ... }:
|
||||
# runCommand "kernel-aeolia-prebuilt" {
|
||||
# version = "5.3.18";
|
||||
# config = parseConfig "${src}/config";
|
||||
# } ''
|
||||
# mkdir $out
|
||||
# cp ${bzImage} $out/bzImage
|
||||
# '';
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = "kernel-aeolia-prebuilt";
|
||||
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp ${bzImage} $out/bzImage
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
version = "5.3.18";
|
||||
|
||||
# functions for checking config options
|
||||
# from https://github.com/NixOS/nixpkgs/blob/a253c2d94cbf75cfd0f7eea242d8385214332dda/pkgs/os-specific/linux/kernel/manual-config.nix#L98
|
||||
config = let
|
||||
config = parseConfig "${src}/config";
|
||||
attrName = attr: "CONFIG_" + attr;
|
||||
in rec {
|
||||
isSet = attr: builtins.hasAttr (attrName attr) config;
|
||||
getValue = attr: if isSet attr then builtins.getAttr (attrName attr) config else null;
|
||||
isYes = attr: (getValue attr) == "y";
|
||||
isNo = attr: (getValue attr) == "n";
|
||||
isModule = attr: (getValue attr) == "m";
|
||||
isEnabled = attr: (isModule attr) || (isYes attr);
|
||||
isDisabled = attr: (!(isSet attr)) || (isNo attr);
|
||||
} // config;
|
||||
};
|
||||
}
|
||||
# lib.makeOverridable kernelFn {}
|
76
kernel-aeolia.nix
Normal file
76
kernel-aeolia.nix
Normal file
|
@ -0,0 +1,76 @@
|
|||
{ lib, fetchgit, buildLinux, linuxManualConfig, linux-firmware, runCommand, ... }:
|
||||
(linuxManualConfig {
|
||||
src = fetchgit {
|
||||
url = "https://git.jeevio.xyz/jeeves/linux-ps4";
|
||||
rev = "refs/heads/5.4.y-aeolia";
|
||||
hash = "";
|
||||
};
|
||||
|
||||
version = "5.4.286-PS4";
|
||||
modDirVersion = "5.4.286";
|
||||
|
||||
# we need to tell Kconfig where the firmware files are
|
||||
configfile = runCommand "concat-config" {} ''
|
||||
cat "${./config-aeolia}" > $out
|
||||
echo "CONFIG_EXTRA_FIRMWARE_DIR=\"${linux-firmware}/lib/firmware\"" >> $out
|
||||
'';
|
||||
allowImportFromDerivation = true;
|
||||
})
|
||||
# buildLinux {
|
||||
# src = fetchgit {
|
||||
# url = "https://git.jeevio.xyz/jeeves/linux-ps4";
|
||||
# rev = "refs/heads/5.4.y-aeolia";
|
||||
# hash = "sha256-e73eslMQAwSFgpmQZfYezKDdldUGi3JlR+Ip5vc3Af8=";
|
||||
# };
|
||||
# version = "5.4.286";
|
||||
|
||||
# ignoreConfigErrors = true;
|
||||
# autoModules = false;
|
||||
# kernelPreferBuiltin = true;
|
||||
|
||||
# structuredExtraConfig = with lib; {
|
||||
# X86_PS4 = kernel.yes;
|
||||
|
||||
# CPU_SUP_AMD = kernel.yes;
|
||||
# MICROCODE_AMD = kernel.yes;
|
||||
# MICROCODE_OLD_INTERFACE = kernel.yes;
|
||||
|
||||
# AMD_IOMMU = kernel.yes;
|
||||
# DMAR_TABLE = kernel.yes;
|
||||
# IRQ_REMAP = kernel.yes;
|
||||
|
||||
# DRM_NOUVEAU = mkForce kernel.no;
|
||||
# DRM_I915 = mkForce kernel.no;
|
||||
|
||||
# AGP = kernel.yes;
|
||||
# AGP_AMD64 = kernel.yes;
|
||||
# VGA_ARB = kernel.yes;
|
||||
# VGA_ARB_MAX_GPUS = kernel.freeform "2";
|
||||
|
||||
# DRM = kernel.yes;
|
||||
# DRM_KMS_HELPER = kernel.yes;
|
||||
# DRM_KMS_FB_HELPER = kernel.yes;
|
||||
# DRM_FBDEV_EMULATION = kernel.yes;
|
||||
# DRM_LOAD_EDID_FIRMWARE = kernel.yes;
|
||||
# DRM_TTM = kernel.yes;
|
||||
# DRM_SCHED = kernel.yes;
|
||||
|
||||
# DRM_AMDGPU = kernel.yes;
|
||||
# DRM_AMDGPU_CIK = kernel.yes;
|
||||
|
||||
# DRM_AMD_DC = kernel.yes;
|
||||
# DRM_AMD_DC_DCN1_0 = kernel.yes;
|
||||
|
||||
# SQUASHFS = kernel.yes;
|
||||
# # USB_UAS = kernel.yes;
|
||||
# OVERLAY_FS = kernel.yes;
|
||||
# # SATA_NV = kernel.yes; # why is this required??? how can i make it not? the PS4 has no nvidia
|
||||
# # SATA_VIA = kernel.yes;
|
||||
# # SATA_SIS = kernel.yes;
|
||||
# # SATA_ULI = kernel.yes;
|
||||
# PATA_MARVELL = kernel.yes;
|
||||
# # NVMEM = kernel.yes;
|
||||
|
||||
# # VIRT_DRIVERS = mkForce kernel.no;
|
||||
# };
|
||||
# }
|
Loading…
Add table
Reference in a new issue