1
0
Fork 0
forked from UniverseBow/flake

add t2-firmware support

This commit is contained in:
do butterflies cry? 2026-03-26 16:28:53 +10:00
parent 1b7b1e66f0
commit 468f399965
Signed by: cry
GPG key ID: F68745A836CA0412
8 changed files with 75 additions and 6 deletions

16
flake.lock generated
View file

@ -978,6 +978,21 @@
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1774465523,
"narHash": "sha256-4v7HPm63Q90nNn4fgkgKsjW1AH2Klw7XzPtHJr562nM=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "de895be946ad1d8aafa0bb6dfc7e7e0e9e466a29",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1767313136,
@ -1144,6 +1159,7 @@
"nix-flatpak": "nix-flatpak",
"nixcats": "nixcats",
"nixcord": "nixcord",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2",
"nixpkgs-master": "nixpkgs-master",
"nixpkgs-unstable": "nixpkgs-unstable",

View file

@ -8,6 +8,8 @@
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
nixos-hardware.url = "github:NixOS/nixos-hardware";
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";

View file

@ -3,10 +3,6 @@
lib,
...
}: {
imports = [
../../hosts/modules/core/garbage-collector.nix
];
networking = {
networkmanager.enable = true;

View file

@ -4,7 +4,13 @@
# WARNING: for that you need to use `services.ssh-agent.enable`
programs.ssh = {
enable = true;
forwardAgent = false;
addKeysToAgent = "yes";
matchBlocks = {
# * block indicates defaults
"*" = {
forwardAgent = false;
addKeysToAgent = "yes";
};
};
};
}

View file

@ -6,6 +6,7 @@
}: {
imports = [
./hardware.nix
../modules/core/t2-firmware.nix
];
networking.hostName = "MACBOOKI9";

View file

@ -0,0 +1,17 @@
{
inputs,
pkgs,
...
}: {
imports = [
inputs.nixos-hardware.nixosModules.apple-t2
];
environment.systemPackages = with pkgs; [
# t2-firmware dependencies
# REF: https://github.com/t2linux/nixos-t2-iso
python3
dmg2img
get-apple-firmware
];
}

View file

@ -24,6 +24,8 @@
];
};
get-apple-firmware = pkgs.callPackage ../packages/get-apple-firmware.nix {};
sddm-theme-corners = import ../packages/sddm-theme/corners.nix {
inherit pkgs;
};

View file

@ -0,0 +1,29 @@
{
stdenvNoCC,
fetchurl,
lib,
}:
stdenvNoCC.mkDerivation (final: {
pname = "get-apple-firmware";
version = "360156db52c013dbdac0ef9d6e2cebbca46b955b";
src = fetchurl {
url = "https://raw.github.com/t2linux/wiki/${final.version}/docs/tools/firmware.sh";
hash = "sha256-IL7omNdXROG402N2K9JfweretTnQujY67wKKC8JgxBo=";
};
dontUnpack = true;
buildPhase = ''
mkdir -p $out/bin
cp ${final.src} $out/bin/get-apple-firmware
chmod +x $out/bin/get-apple-firmware
'';
meta = {
description = "A script to get needed firmware for T2linux devices";
homepage = "https://t2linux.org";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [soopyc];
mainProgram = "get-apple-firmware";
};
})