neoidiosyn/flake.nix
2024-11-21 21:39:33 +01:00

112 lines
2.6 KiB
Nix

{
description = "I do not have to explain myself";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
lix = {
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
flake = false;
};
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
inputs.lix.follows = "lix";
};
};
nixConfig = {
extra-experimental-features = [ "pipe-operator" "pipe-operators" ];
extra-substituters = [ "https://cache.kyouma.net" ];
extra-trusted-public-keys = [ "cache.kyouma.net:Frjwu4q1rnwE/MnSTmX9yx86GNA/z3p/oElGvucLiZg=" ];
};
outputs = { self, nixpkgs, lix-module, ... }: let
lib = nixpkgs.lib.extend (final: prev: {
neoidiosyn = {
systems = {
riscv64 = "rv64gc";
aarch64 = "armv8.2-a";
x86_64 = "x86-64-v3";
} |> final.mapAttrs' (cpu: arch: {
name = "${cpu}-linux";
value = {
config = "${cpu}-unknown-linux-musl";
useLLVM = true;
linker = "lld";
gcc = { inherit arch; };
};
});
};
});
in {
inherit lib;
overlays.default = lib.composeExtensions
lix-module.overlays.default
(import ./overlay.nix { inherit lib; });
legacyPackages = lib.neoidiosyn.systems
|> lib.mapAttrs (system: crossSystem: let
pkgs = import nixpkgs {
localSystem = "x86_64-linux";
inherit crossSystem;
overlays = [ self.overlays.default ];
config = {
allowBroken = true;
allowUnsupportedSystem = true;
};
};
in pkgs // {
config = let
stdenv = import ./stdenv.nix { inherit lib pkgs; };
in pkgs.config or { } // {
replaceStdenv = stdenv;
replaceCrossStdenv = stdenv;
};
});
nixosModules = {
default = import ./module.nix;
} // lib.mapAttrs (system: pkgs: {
nixpkgs = {
inherit (pkgs)
buildPlatform
hostPlatform
overlays
config;
};
}) self.legacyPackages;
hydraJobs = lib.mapAttrs (system: pkgs: lib.mapAttrs (name: pkg: lib.hydraJob pkg) {
inherit (pkgs)
cargo
clang
dbus-broker
ffmpeg
jaq
kitty
lix
lld
mesa
musl
nftables
nushell
openssh
pipewire
python3
qemu-user
ripgrep
rustc
sd
sioyek
stdenv
sudo-rs
systemd
wayland;
}) self.legacyPackages;
};
}