Handout
This commit is contained in:
43
utils/flake.lock
generated
Normal file
43
utils/flake.lock
generated
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1740560979,
|
||||
"narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5135c59491985879812717f4c9fea69604e7f26f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1680978846,
|
||||
"narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "x86_64-linux",
|
||||
"rev": "2ecfcac5e15790ba6ce360ceccddb15ad16d08a8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "x86_64-linux",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
64
utils/flake.nix
Normal file
64
utils/flake.nix
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* This file allows you to run `nix develop` to get a shell with all external dependencies (`make` plus the tools it calls) of this repo (and maybe some beyond).
|
||||
* The only thing required is an installation of the "Nix" package manager for Linux (/WSL) or MacOS: https://nixos.org/download/
|
||||
*/
|
||||
{
|
||||
description = ''
|
||||
The educational operating system StuBS.
|
||||
'';
|
||||
inputs = {
|
||||
|
||||
# The rolling-release of the Nix(OS) package definitions. Use `nix flake lock` to update
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
# Some boilerplate:
|
||||
systems.url = "github:nix-systems/x86_64-linux"; # no cross compiling and only x86(_64) for now (darwin (MacOS) might work)
|
||||
};
|
||||
outputs =
|
||||
inputs:
|
||||
let
|
||||
lib = inputs.nixpkgs.lib;
|
||||
eachSystem =
|
||||
f:
|
||||
lib.foldAttrs lib.mergeAttrs { } (
|
||||
map (s: lib.mapAttrs (_: v: { ${s} = v; }) (f s)) (import inputs.systems)
|
||||
);
|
||||
in
|
||||
{ }
|
||||
// (eachSystem (
|
||||
localSystem:
|
||||
let
|
||||
pkgs = import inputs.nixpkgs { system = localSystem; };
|
||||
in
|
||||
{
|
||||
|
||||
# The shell environment definition used by `nix develop`:
|
||||
devShells.default = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
|
||||
nativeBuildInputs =
|
||||
with pkgs;
|
||||
[
|
||||
# for all tasks and maintenance
|
||||
gdb
|
||||
qemu_kvm
|
||||
nasm
|
||||
ccache
|
||||
unixtools.xxd
|
||||
git
|
||||
libisoburn # for building iso images
|
||||
grub2
|
||||
python3
|
||||
bear # make compile_commands.json
|
||||
clang-tools # for clangd and clang-format
|
||||
]
|
||||
++ (lib.filter (
|
||||
pkg: lib.isDerivation pkg && pkg.pname or "" != "glibc"
|
||||
) pkgs.stdenv.allowedRequisites); # basic tools + compilers (gcc/g++)
|
||||
env = {
|
||||
# This will tell the iso builder where the grub tools may be found
|
||||
GRUBBIN="${pkgs.grub2}/lib/grub/i386-pc";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
));
|
||||
}
|
||||
Reference in New Issue
Block a user