-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
59 lines (48 loc) · 1.45 KB
/
Copy pathflake.nix
File metadata and controls
59 lines (48 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = {
self,
nixpkgs,
}: let
forAllSystems = function:
nixpkgs.lib.genAttrs [
"x86_64-linux"
] (system: function nixpkgs.legacyPackages.${system});
in {
devShells = forAllSystems (pkgs: {
default = pkgs.mkShellNoCC {
packages =
(builtins.attrValues self.packages.${pkgs.system})
++ (with pkgs; [
grub2
libisoburn
qemu
compiledb
jq
clang # somehow this fixes clangd lsp
# and prevent lookup to system headers
]);
shellHook = ''
. ${./config.sh}
'';
};
});
formatter = forAllSystems (pkgs: pkgs.alejandra);
packages = forAllSystems (pkgs: let
pkgs' = self.packages.${pkgs.system};
inherit (pkgs) lib callPackage writeShellScriptBin;
in {
binutils = callPackage ./nix/binutils-2-42.nix {};
# gcc invoke ar through the environment (AR), but has as hardcorded
as = callPackage ./nix/as.nix pkgs';
gcc = callPackage ./nix/gcc-14-2-0.nix pkgs';
libc = callPackage ./nix/libc.nix pkgs';
lpl-kernel = callPackage ./nix/lpl-kernel.nix pkgs';
iso = callPackage ./nix/iso.nix pkgs';
default = pkgs'.run-vm;
run-vm = writeShellScriptBin "run-vm" ''
${lib.getExe pkgs.qemu} -cdrom ${pkgs'.iso}/lpl.iso
'';
});
};
}