Files
ft_ping/flake.nix
2025-08-11 13:29:04 +02:00

94 lines
2.4 KiB
Nix

{
description = "A devshell flake for my ft_ping project";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
keyzconf = {
url = "github:keyzox71/nixos-config";
};
};
outputs =
inputs@{
nixpkgs,
self,
...
}:
let
inherit (self) outputs;
supportedSystems = [ "x86_64-linux" ];
forEachSupportedSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
f {
pkgs = import nixpkgs { inherit system; };
system = system;
}
);
in
{
devShells = forEachSupportedSystem (
{ pkgs, system }:
{
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
gcc
clang
];
hardeningDisable = [ "all" ];
packages = with pkgs; [
gdb
valgrind
compiledb
inetutils
nixfmt-rfc-style
];
};
}
);
apps = forEachSupportedSystem (
{ pkgs, system }:
{
virtualBoyy =
let
scriptName = "run-virtualBoyy-vm";
script = pkgs.writeShellScriptBin "${scriptName}" ''
${self.packages.${system}.virtualBoyy { mount-enabled = true; }}/bin/run-virtualBoyy-vm \
-enable-kvm \
-m 8G \
-smp 4 \
-virtfs local,path=$(${pkgs.coreutils}/bin/pwd),mount_tag=host0,security_model=mapped-xattr,id=host0
'';
in
{
type = "app";
program = "${script}/bin/${scriptName}";
};
virtualBoyy-headless =
let
scriptName = "run-virtualBoyy-vm-headless";
script = pkgs.writeShellScriptBin "${scriptName}" ''
${inputs.keyzconf.packages.${system}.virtualBoyy { mount-enabled = true; }}/bin/run-virtualBoyy-vm \
-enable-kvm \
-nographic \
-m 8G \
-smp 4 \
-virtfs local,path=$(${pkgs.coreutils}/bin/pwd),mount_tag=host0,security_model=mapped-xattr,id=host0
'';
in
{
type = "app";
program = "${script}/bin/${scriptName}";
};
}
);
};
}