mensa-tts/flake.nix
2024-12-18 17:32:24 +01:00

45 lines
1.4 KiB
Nix

{
description = "A flake for the mensa-tts system.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
};
outputs = inputs@{ self, nixpkgs, ... }:
let
lib = nixpkgs.lib;
allSystems = [ "x86_64-linux" "aarch64-linux" "armv6l-linux" ];
crossPkgs-aarch64-linux = import nixpkgs { localSystem = "x86_64-linux"; crossSystem = "aarch64-linux"; };
crossPkgs-armv6l-linux = import nixpkgs {
localSystem = "x86_64-linux";
crossSystem = {
system = "armv6l-linux";
gcc = {
arch = "armv6k";
fpu = "vfp";
};
};
};
in
{
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
packages = {
x86_64-linux = {
default = nixpkgs.legacyPackages.x86_64-linux.callPackage ./default.nix { };
cross-aarch64-linux = crossPkgs-aarch64-linux.callPackage ./default.nix { };
cross-armv6l-linux = crossPkgs-armv6l-linux.callPackage ./default.nix { };
};
aarch64-linux.default = nixpkgs.legacyPackages.aarch64-linux.callPackage ./default.nix { };
armv6l-linux.default = nixpkgs.legacyPackages.armv6l-linux.callPackage ./default.nix { };
};
nixosModules.default = { config, pkgs, ... }: {
imports = [ ./module.nix ];
_module.args.mensa-tts-pkgs = self.packages;
};
};
}