update inputs; bpi-r3: build kernel from source

This commit is contained in:
chayleaf 2023-06-11 21:48:35 +07:00
parent a96bd4bbcd
commit 1adde1ba0e
10 changed files with 123 additions and 81 deletions

View file

@ -91,11 +91,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1684824189, "lastModified": 1686391840,
"narHash": "sha256-k3nCkn5Qy67rCguuw6YkGuL6hOUNRKxQoKOjnapk5sU=", "narHash": "sha256-5S0APl6Mfm6a37taHwvuf11UHnAX0+PnoWQbsYbMUnc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "58eb968c21d309a6c2b020ea8d64e25c38ceebba", "rev": "0144ac418ef633bfc9dbd89b8c199ad3a617c59f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -127,11 +127,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1684835544, "lastModified": 1686489662,
"narHash": "sha256-RfxqpIUbVDcKsTw/e4Oc+ywrmWX1p4JrAOfpPFVXZ0k=", "narHash": "sha256-kEuKsjWoFm3EeeiSwqHlUyV1wTxJu6/kfzrhuIwaIEQ=",
"owner": "fufexan", "owner": "fufexan",
"repo": "nix-gaming", "repo": "nix-gaming",
"rev": "057ae3f4ded2a24fecd674a861bc7e08ad74b3ca", "rev": "b32aeea96b838977a27804ba6a2cf2188f4b16af",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -142,11 +142,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1684899633, "lastModified": 1686452266,
"narHash": "sha256-NtwerXX8UFsoNy6k+DukJMriWtEjQtMU/Urbff2O2Dg=", "narHash": "sha256-zLKiX0iu6jZFeZDpR1gE6fNyMr8eiM8GLnj9SoUCjFs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "4cc688ee711159b9bcb5a367be44007934e1a49d", "rev": "2a807ad6e8dc458db08588b78cc3c0f0ec4ff321",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -168,11 +168,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1684964237, "lastModified": 1686468558,
"narHash": "sha256-dDS+GhdZN2MAa2FJKFGM2gpgAXhx+xoMkpVsRx9qpDE=", "narHash": "sha256-K69Ojlx3N8I6tRTZsrKFMIqK4yrnJ6/PjfKZi3wchYg=",
"owner": "simple-nixos-mailserver", "owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver", "repo": "nixos-mailserver",
"rev": "1bcfcf786bc289ca1bd2c9d29d6f02d9141b1da3", "rev": "290d00f6db4e80467013728819ad73dd4a394d9a",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -183,11 +183,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1684844536, "lastModified": 1686412476,
"narHash": "sha256-M7HhXYVqAuNb25r/d3FOO0z4GxPqDIZp5UjHFbBgw0Q=", "narHash": "sha256-inl9SVk6o5h75XKC79qrDCAobTD1Jxh6kVYTZKHzewA=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d30264c2691128adc261d7c9388033645f0e742b", "rev": "21951114383770f96ae528d0ae68824557768e81",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -222,27 +222,26 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1684668267, "lastModified": 1685774289,
"narHash": "sha256-AKnX12OwVEqXDv8Th2QDT96MPvC8Zv5KCtVdqc7l3hY=", "narHash": "sha256-7NXZ2S2FZzYW8lvX+zZ7x3wwCpjMLVK2tNL/u6JdSeE=",
"owner": "chayleaf", "owner": "chayleaf",
"repo": "notlua", "repo": "notlua",
"rev": "469652092f4f2e951b0db29027b05346b32d8122", "rev": "12e810bf2c571ae80ae4fda4f8c63e40b8f9b392",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "chayleaf", "owner": "chayleaf",
"repo": "notlua", "repo": "notlua",
"rev": "469652092f4f2e951b0db29027b05346b32d8122",
"type": "github" "type": "github"
} }
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1684959207, "lastModified": 1686488164,
"narHash": "sha256-lROs3YxWZDGeEPrcv0AYEfyps+gSW01E/VoTkmHU768=", "narHash": "sha256-DGfmD8ZCu9Xp0rB1tUct8FNlvz/orRr30DXeI9+fnPU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "c4e46e935ba827acf70979c5e02a8431cf14cc5a", "rev": "daf7100b6147114c5f0a68583ba50e15d82e9788",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -273,11 +272,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1684894917, "lastModified": 1686450923,
"narHash": "sha256-kwKCfmliHIxKuIjnM95TRcQxM/4AAEIZ+4A9nDJ6cJs=", "narHash": "sha256-a7B9VT2NHJWRCerHmZagAXu3z2QHJKhxUhzjh5vAnXU=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "9ea38d547100edcf0da19aaebbdffa2810585495", "rev": "4b3cb15179af3b8d640a29fa85cc9f332b4123e6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -19,7 +19,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
notlua = { notlua = {
url = "github:chayleaf/notlua/469652092f4f2e951b0db29027b05346b32d8122"; url = "github:chayleaf/notlua";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-mailserver = { nixos-mailserver = {
@ -58,6 +58,7 @@
# can't use callPackage ./pkgs here, idk why; use import instead # can't use callPackage ./pkgs here, idk why; use import instead
overlay = self: super: import ./pkgs { overlay = self: super: import ./pkgs {
pkgs = super; pkgs = super;
pkgs' = self;
lib = super.lib; lib = super.lib;
nur = import nur { nur = import nur {
pkgs = super; pkgs = super;
@ -171,9 +172,10 @@
({ config, pkgs, lib, ...}: { ({ config, pkgs, lib, ...}: {
nixpkgs.overlays = [ overlay ]; nixpkgs.overlays = [ overlay ];
nix.package = lib.mkDefault pkgs.nixFlakes; nix.package = lib.mkDefault pkgs.nixFlakes;
nix.extraOptions = '' # this is only needed if nixos doesnt set plugin-files already
/*nix.extraOptions = ''
plugin-files = ${pkgs.nix-plugins.override { nix = config.nix.package; }}/lib/nix/plugins/libnix-extra-builtins.so plugin-files = ${pkgs.nix-plugins.override { nix = config.nix.package; }}/lib/nix/plugins/libnix-extra-builtins.so
''; '';*/
}) })
(getPrivUser hostname username) (getPrivUser hostname username)
]; ];
@ -206,9 +208,10 @@
({ config, pkgs, lib, ... }: { ({ config, pkgs, lib, ... }: {
nixpkgs.overlays = [ overlay ]; nixpkgs.overlays = [ overlay ];
nix.package = lib.mkDefault pkgs.nixFlakes; nix.package = lib.mkDefault pkgs.nixFlakes;
nix.extraOptions = '' # this is only needed if nixos doesnt set plugin-files already
/*nix.extraOptions = ''
plugin-files = ${pkgs.nix-plugins.override { nix = config.nix.package; }}/lib/nix/plugins/libnix-extra-builtins.so plugin-files = ${pkgs.nix-plugins.override { nix = config.nix.package; }}/lib/nix/plugins/libnix-extra-builtins.so
''; '';*/
}) })
]; ];
}); });

View file

@ -3,16 +3,17 @@
services.playerctld.enable = config.wayland.windowManager.sway.enable; services.playerctld.enable = config.wayland.windowManager.sway.enable;
programs.waybar = { programs.waybar = {
enable = config.wayland.windowManager.sway.enable; enable = config.wayland.windowManager.sway.enable;
package = (pkgs.waybar.override { package = pkgs.waybar.override {
withMediaPlayer = true; withMediaPlayer = true;
}).overrideAttrs (old: { };
/*).overrideAttrs (old: {
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "chayleaf"; owner = "chayleaf";
repo = "Waybar"; repo = "Waybar";
rev = "3091cf4a009e92665325c0dd61adf5ab367786a3"; rev = "3091cf4a009e92665325c0dd61adf5ab367786a3";
sha256 = "sha256-zH4hbQ8+9TYRVW/XYqmAVsi0vsSPn1LPqXxr0gi0j1E="; sha256 = "sha256-zH4hbQ8+9TYRVW/XYqmAVsi0vsSPn1LPqXxr0gi0j1E=";
}; };
}); });*/
settings = [{ settings = [{
layer = "bottom"; layer = "bottom";
# position = "bottom"; # position = "bottom";

View file

@ -63,30 +63,9 @@
ghidra cutter ghidra cutter
openrgb piper openrgb piper
steam-run steam steam-run steam
((osu-lazer-bin.override { (osu-lazer-bin.override {
gmrun_enable = false; command_prefix = "${obs-studio-plugins.obs-vkcapture}/bin/obs-gamecapture";
}).overrideAttrs (old: { })
paths = assert builtins.length old.paths == 2;
let
osu = builtins.head old.paths;
osu' = osu.overrideAttrs (old: {
installPhase = builtins.replaceStrings
["runHook postInstall"]
["sed -i 's:exec :exec ${obs-studio-plugins.obs-vkcapture}/bin/obs-gamecapture :g' $out/bin/osu-lazer\nrunHook postInstall"]
old.installPhase;
});
in assert osu.pname == "osu-lazer-bin"; [
osu'
(makeDesktopItem {
name = osu'.pname;
exec = "${osu'.outPath}/bin/osu-lazer";
icon = "${osu'.outPath}/osu.png";
comment = "A free-to-win rhythm game. Rhythm is just a *click* away!";
desktopName = "osu!";
categories = ["Game"];
})
];
}))
taisei taisei
techmino techmino
(wrapOBS { (wrapOBS {

View file

@ -1,2 +1,2 @@
# [ (import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz")) ] # [ (import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz")) ]
[ (import <rust-overlay>) (import <nix-gaming>).overlays.default ] [ (import <self>).overlays.default (import <rust-overlay>) (import <nix-gaming>).overlays.default ]

View file

@ -2,6 +2,7 @@
, lib , lib
, nur , nur
, nix-gaming , nix-gaming
, pkgs' ? pkgs
, ... }: , ... }:
let let
inherit (pkgs) callPackage; inherit (pkgs) callPackage;
@ -159,25 +160,77 @@ rec {
''; '';
fixupPhase = "true"; fixupPhase = "true";
}; };
linux_bpiR3 = (pkgs.buildLinux ({ linux_bpiR3 = pkgs.linux_testing.override {
version = "6.3"; stdenv = pkgs'.ccacheStdenv;
modDirVersion = "6.3.0"; buildPackages = pkgs'.buildPackages // {
stdenv = pkgs'.buildPackages.ccacheStdenv;
src = pkgs.fetchFromGitHub {
owner = "frank-w";
repo = "BPI-Router-Linux";
rev = "6.3-main";
hash = lib.fakeHash;
}; };
structuredExtraConfig = with lib.kernel; {
defconfig = "mt7986a_bpi-r3"; COMMON_CLK_MEDIATEK = yes;
})).overrideAttrs (old: { COMMON_CLK_MT7986 = yes;
postConfigure = '' COMMON_CLK_MT7986_ETHSYS = yes;
sed -i "$buildRoot/.config" -e 's%^CONFIG_LOCALVERSION=.*%CONFIG_LOCALVERSION=""%' MEDIATEK_GE_PHY = yes;
sed -i "$buildRoot/include/config/auto.conf" -e 's%^CONFIG_LOCALVERSION=.*%CONFIG_LOCALVERSION=""%' MEDIATEK_WATCHDOG = yes;
''; MTD_NAND_ECC_MEDIATEK = yes;
}); MTD_NAND_ECC_SW_HAMMING = yes;
MTD_NAND_MTK = yes;
MTD_SPI_NAND = yes;
MTD_UBI = yes;
MTD_UBI_BLOCK = yes;
MTK_EFUSE = yes;
MTK_HSDMA = yes;
MTK_INFRACFG = yes;
MTK_PMIC_WRAP = yes;
MTK_SCPSYS = yes;
MTK_SCPSYS_PM_DOMAINS = yes;
MTK_THERMAL = yes;
MTK_TIMER = yes;
NET_DSA_MT7530 = module;
NET_DSA_TAG_MTK = module;
NET_MEDIATEK_SOC = module;
NET_MEDIATEK_SOC_WED = yes;
NET_MEDIATEK_STAR_EMAC = module;
NET_SWITCHDEV = yes;
NET_VENDOR_MEDIATEK = yes;
PCIE_MEDIATEK = yes;
PCIE_MEDIATEK_GEN3 = yes;
PINCTRL_MT7986 = yes;
PINCTRL_MTK = yes;
PINCTRL_MTK_MOORE = yes;
PINCTRL_MTK_V2 = yes;
PWM_MEDIATEK = yes;
MT7915E = module;
MT7986_WMAC = yes;
SPI_MT65XX = yes;
SPI_MTK_NOR = yes;
SPI_MTK_SNFI = yes;
MMC_MTK = yes;
};
};
linuxPackages_bpiR3 = pkgs.linuxPackagesFor linux_bpiR3; linuxPackages_bpiR3 = pkgs.linuxPackagesFor linux_bpiR3;
ccacheWrapper = pkgs.ccacheWrapper.override {
extraConfig = ''
export CCACHE_COMPRESS=1
export CCACHE_DIR="/var/cache/ccache"
export CCACHE_UMASK=007
if [ ! -d "$CCACHE_DIR" ]; then
echo "====="
echo "Directory '$CCACHE_DIR' does not exist"
echo "Please create it with:"
echo " sudo mkdir -m0770 '$CCACHE_DIR'"
echo " sudo chown root:nixbld '$CCACHE_DIR'"
echo "====="
exit 1
fi
if [ ! -w "$CCACHE_DIR" ]; then
echo "====="
echo "Directory '$CCACHE_DIR' is not accessible for user $(whoami)"
echo "Please verify its access permissions"
echo "====="
exit 1
fi
'';
};
firefox-addons = lib.recurseIntoAttrs (callPackage ./firefox-addons { inherit nur sources; }); firefox-addons = lib.recurseIntoAttrs (callPackage ./firefox-addons { inherit nur sources; });
mpvScripts = pkgs.mpvScripts // (callPackage ./mpv-scripts { }); mpvScripts = pkgs.mpvScripts // (callPackage ./mpv-scripts { });

View file

@ -8,6 +8,13 @@
let let
python = python3.override { python = python3.override {
packageOverrides = self: super: { packageOverrides = self: super: {
aiosqlite = super.aiosqlite.overrideAttrs (old: rec {
version = "0.18.0";
src = old.src.override {
rev = "refs/tags/v${version}";
hash = "sha256-yPGSKqjOz1EY5/V0oKz2EiZ90q2O4TINoXdxHuB7Gqk=";
};
});
sqlalchemy = super.buildPythonPackage rec { sqlalchemy = super.buildPythonPackage rec {
pname = "SQLAlchemy"; pname = "SQLAlchemy";
version = "1.3.24"; version = "1.3.24";

View file

@ -9,8 +9,8 @@
# i'm not about to build a kernel on every update without an arm device... # i'm not about to build a kernel on every update without an arm device...
# i guess i could use my phone for building it, but no, not interested # i guess i could use my phone for building it, but no, not interested
boot.kernelPackages = pkgs.linuxPackages_testing; # boot.kernelPackages = pkgs.linuxPackages_testing;
# boot.kernelPackages = pkgs.linuxPackages_bpiR3; boot.kernelPackages = pkgs.linuxPackages_bpiR3;
hardware.deviceTree.enable = true; hardware.deviceTree.enable = true;
hardware.deviceTree.filter = "*mt7986*"; hardware.deviceTree.filter = "*mt7986*";
@ -18,7 +18,7 @@
# # disable a bunch of useless drivers # # disable a bunch of useless drivers
# boot.initrd.includeDefaultModules = false; # boot.initrd.includeDefaultModules = false;
# boot.initrd.availableKernelModules = [ "mmc_block" "dm_mod" "rfkill" "cfg80211" "mt7915e" "ubi" "sdhci" "sd_mod" "sr_mod" "xhci_pci" ]; boot.initrd.availableKernelModules = [ "mmc_block" "dm_mod" "rfkill" "cfg80211" "mt7915e" ];
boot.kernelParams = [ "console=ttyS0,115200" ]; boot.kernelParams = [ "console=ttyS0,115200" ];
boot.initrd.compressor = "zstd"; boot.initrd.compressor = "zstd";

View file

@ -43,8 +43,8 @@ in {
}; };
}; };
systemd.services.heisenbridge.wants = [ "matrix-synapse.service" ]; # systemd.services.heisenbridge.wants = [ "matrix-synapse.service" ];
systemd.services.heisenbridge.after = [ "matrix-synapse.service" ]; # systemd.services.heisenbridge.after = [ "matrix-synapse.service" ];
services.heisenbridge = { services.heisenbridge = {
enable = true; enable = true;
homeserver = "http://${lib.quoteListenAddr matrixAddr}:${toString matrixPort}/"; homeserver = "http://${lib.quoteListenAddr matrixAddr}:${toString matrixPort}/";

View file

@ -69,7 +69,7 @@ vmTools.runInLinuxVM (runCommand "bpi-r3-fs" {
truncate -s ${toString ((rootPartEnd - rootPartStart + 1) * 512)} ./tmp.img truncate -s ${toString ((rootPartEnd - rootPartStart + 1) * 512)} ./tmp.img
${btrfs-progs}/bin/mkfs.btrfs \ ${btrfs-progs}/bin/mkfs.btrfs \
--label NIXOS_SD \ --label NIXOS_SD \
--uuid "44444444-4444-4444-8888-888888888889" \ --uuid "44444444-4444-4444-8888-888888888888" \
./tmp.img ./tmp.img
''; '';
# i give up on making this work in a nix derivation, just do the rest in a script (./image.sh) # i give up on making this work in a nix derivation, just do the rest in a script (./image.sh)