expose nix overlays

This commit is contained in:
Charlotte 🦝 Delenk 2024-11-22 18:57:25 +01:00
parent 3a1ddeb0cd
commit 80fc93efe5
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
6 changed files with 77 additions and 41 deletions

View file

@ -1,13 +1,40 @@
{
inTester,
system,
self,
rust-overlay,
nix-vscode-extensions,
...
}:
{
imports =
if !inTester then
[
./inputs-overlay.nix
]
(
[
./inputs-overlay.nix
]
++ (
if system == "riscv64-linux" then
[
./riscv.nix
./riscv-cross-packages.nix
]
else
[ ]
)
)
else
[ ];
}
// (
if !inTester then
{
nixpkgs.overlays = [
self.overlays.default
(import rust-overlay)
nix-vscode-extensions.overlays.default
];
}
else
{ }
)

View file

@ -0,0 +1,40 @@
# Cross compiled packages for when shit breaks
{
nixpkgs,
lix,
...
}:
let
pkgs_x86_64 = import nixpkgs {
system = "x86_64-linux";
crossSystem.system = "riscv64-linux";
overlays = [ lix.overlays.default ];
};
pkgs_x86_64_2 = import nixpkgs {
system = "x86_64-linux";
crossSystem.system = "riscv64-linux";
};
in
{
nixpkgs.overlays = [
(self: super: {
inherit (pkgs_x86_64) lix;
inherit (pkgs_x86_64_2) nixos-option;
})
];
environment.etc."nix/inputs/nixpkgs-overlays/riscv-cross-packages.nix".text = ''
self: _: let pkgs_x86_64 = import <nixpkgs> {
system = "x86_64-linux";
crossSystem.system = "riscv64-linux";
overlays = [self.inputs.lix.overlays.default];
}
pkgs_x86_64_2 = import <nixpkgs> {
system = "x86_64-linux";
crossSystem.system = "riscv64-linux";
overlays = [];
}; in {
inherit (pkgs_x86_64) lix;
inherit (pkgs_x86_64_2) nixos-option;
}
'';
}

View file

@ -0,0 +1,7 @@
{ riscv-overlay }:
{
nixpkgs.overlays = [
riscv-overlay.overlays.default
];
environment.etc."nix/inputs/nixpkgs-overlays/riscv-overlay.nix".text = "import ${riscv-overlay}/overlay.nix";
}

View file

@ -1,25 +0,0 @@
# Cross compiled packages for when shit breaks
{
nixpkgs,
lix,
...
}:
let
pkgs_x86_64 = import nixpkgs {
system = "x86_64-linux";
crossSystem.system = "riscv64-linux";
overlays = [ lix.overlays.default ];
};
pkgs_x86_64_2 = import nixpkgs {
system = "x86_64-linux";
crossSystem.system = "riscv64-linux";
};
in
{
nixpkgs.overlays = [
(self: super: {
inherit (pkgs_x86_64) lix;
inherit (pkgs_x86_64_2) nixos-option;
})
];
}

View file

@ -9,7 +9,6 @@
"${nixos-config}/config"
./disko.nix
./hardware.nix
./cross-packages.nix
"${nixpkgs}/nixos/modules/profiles/minimal.nix"
];
system.stateVersion = "24.11";

View file

@ -23,16 +23,4 @@ with lib;
options.isInstaller = mkEnableOption "Whether or not this configuration is an installer and has no access to secrets";
options.isNSFW = mkEnableOption "Whether or not this configuration is NSFW";
options.isIntelGPU = mkEnableOption "Whether or not this configuration uses an Intel GPU";
config =
if !inTester then
{
nixpkgs.overlays = [
self.overlays.default
(import rust-overlay)
nix-vscode-extensions.overlays.default
];
}
else
{ };
}