Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake lock update #929

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
1 change: 0 additions & 1 deletion docs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ let
# TODO this hides the other modules (e.g. microvm.nix)
# But they are stilled passed as options modules ???
if lib.strings.hasPrefix "ghaf" x.name then x else x // { visible = false; };
markdownByDefault = true;
}).optionsCommonMark;
combinedSrc = runCommandLocal "ghaf-doc-src" { } ''
mkdir $out
Expand Down
76 changes: 38 additions & 38 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,9 @@

nixos-hardware.url = "github:NixOS/nixos-hardware";

jetpack-nixos = {
#url = "github:anduril/jetpack-nixos
url = "github:anduril/jetpack-nixos/793716c1ca29a1be6d9bea84296a933c4acdddc1";
#inputs.nixpkgs.follows = "nixpkgs";
};
#jetpack-nixos.url = "flake:mylocaljetpack";
#pinned to the pr https://github.com/anduril/jetpack-nixos/pull/257 until merged
jetpack-nixos.url = "github:anduril/jetpack-nixos/4dc254268aea59921268206628b9d911b6703e9e";

disko = {
url = "github:nix-community/disko";
Expand Down
12 changes: 8 additions & 4 deletions lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ nixpkgs.lib.extend (
lib.filterAttrs (
_: value:
let
platforms = lib.attrByPath [
"meta"
"platforms"
] [ ] value;
platforms =
lib.attrByPath
[
"meta"
"platforms"
]
[ ]
value;
in
lib.elem system platforms
);
Expand Down
66 changes: 1 addition & 65 deletions lib/mk-flash-script/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,6 @@
#
# Function to generate NVIDIA Jetson Orin flash script
{
nixpkgs,
hostConfiguration,
jetpack-nixos,
flash-tools-system,
}:
let
cfg = hostConfiguration.config.hardware.nvidia-jetpack;
inherit (jetpack-nixos.legacyPackages.${flash-tools-system}) flash-tools;

# jetpack-nixos has the cross-compilation set up in a slightly strange way,
# the packages under x86_64-linux are actually cross-compiled packages for
# aarch64-linux. So we will get devicePkgs from x86_64-linux if we are cross
# compiling, otherwise we end up building UEFI firmware etc. binaries used by
# flash-script natively.
isCross =
hostConfiguration.config.nixpkgs.buildPlatform.system
!= hostConfiguration.config.nixpkgs.hostPlatform.system;
devicePkgsSystem = if isCross then "x86_64-linux" else "aarch64-linux";
devicePkgs =
jetpack-nixos.legacyPackages.${devicePkgsSystem}.devicePkgsFromNixosConfig
hostConfiguration.config;

inherit (jetpack-nixos.legacyPackages.${devicePkgsSystem}) l4tVersion;

flashScript = devicePkgs.mkFlashScript {
flash-tools = flash-tools.overrideAttrs (
{
postPatch ? "",
...
}:
{
postPatch = postPatch + cfg.flashScriptOverrides.postPatch;
}
);
preFlashCommands =
nixpkgs.lib.optionalString (flash-tools-system == "aarch64-linux") ''
echo "WARNING! WARNING! WARNING!"
echo "You are trying to run aarch64-linux hosted version of the flash-script."
echo "It runs flashing tools with QEMU using user-mode emulation of x86 cpu."
echo "There are no known reports from anyone who would have gotten this working ever."
echo "If this fails, YOU HAVE BEEN WARNED, and don't open a bug report!"
echo ""
''
+ hostConfiguration.config.ghaf.hardware.nvidia.orin.flashScriptOverrides.preFlashCommands;
};

patchFlashScript =
builtins.replaceStrings
[
"@pzstd@"
"@sed@"
"@patch@"
"@l4tVersion@"
"@isCross@"
]
[
"${nixpkgs.legacyPackages.${flash-tools-system}.zstd}/bin/pzstd"
"${nixpkgs.legacyPackages.${flash-tools-system}.gnused}/bin/sed"
"${nixpkgs.legacyPackages.${flash-tools-system}.patch}/bin/patch"
"${l4tVersion}"
"${if isCross then "true" else "false"}"
];
in
nixpkgs.legacyPackages.${flash-tools-system}.writeShellApplication {
name = "flash-ghaf";
text = patchFlashScript flashScript;
}
hostConfiguration.pkgs.nvidia-jetpack.flashScript
3 changes: 2 additions & 1 deletion modules/common/boot/systemd-boot-dtb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ in

config = mkIf cfg.enable {
boot.loader.systemd-boot = {
extraFiles."dtbs/${config.hardware.deviceTree.name}" = "${config.hardware.deviceTree.package}/${config.hardware.deviceTree.name}";
extraFiles."dtbs/${config.hardware.deviceTree.name}" =
"${config.hardware.deviceTree.package}/${config.hardware.deviceTree.name}";
extraInstallCommands = ''
# Find out the latest generation from loader.conf
default_cfg=$(${pkgs.coreutils}/bin/cat /boot/loader/loader.conf | ${pkgs.gnugrep}/bin/grep default | ${pkgs.gawk}/bin/awk '{print $2}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
## Apparmor profile for Chromium
config.security.apparmor.policies."bin.chrome" = lib.mkIf config.ghaf.security.apparmor.enable {
enforce = lib.mkForce true;
state = "enforce";
profile = ''
abi <abi/3.0>,
include <tunables/global>
Expand Down
6 changes: 5 additions & 1 deletion modules/desktop/graphics/fonts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ let
in
{
config = lib.mkIf labwc.enable {
fonts.packages = builtins.attrValues { inherit (pkgs) inter fira-code-nerdfont hack-font; };
fonts.packages = [
pkgs.inter
pkgs.nerd-fonts.fira-code
pkgs.hack-font
];
};
}
Loading
Loading