Compare commits
5 changed files with 792 additions and 761 deletions
1367
Cargo.lock
generated
1367
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
87
flake.lock
generated
87
flake.lock
generated
|
|
@ -1,41 +1,102 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"crane": {
|
"fenix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"naersk",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-analyzer-src": "rust-analyzer-src"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1785541369,
|
"lastModified": 1752475459,
|
||||||
"narHash": "sha256-6VCYI5xashcnAR1lambqt9FGh0F6kYhg1P2Z0VDlr48=",
|
"narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=",
|
||||||
"owner": "ipetkov",
|
"owner": "nix-community",
|
||||||
"repo": "crane",
|
"repo": "fenix",
|
||||||
"rev": "508ff4829aefddee8ea62291e86b144b58365724",
|
"rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "ipetkov",
|
"owner": "nix-community",
|
||||||
"repo": "crane",
|
"repo": "fenix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"naersk": {
|
||||||
|
"inputs": {
|
||||||
|
"fenix": "fenix",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1752689277,
|
||||||
|
"narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "naersk",
|
||||||
|
"rev": "0e72363d0938b0208d6c646d10649164c43f4d64",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "naersk",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nix-filter": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731533336,
|
||||||
|
"narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "nix-filter",
|
||||||
|
"rev": "f7653272fd234696ae94229839a99b73c9ab7de0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "nix-filter",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1785386831,
|
"lastModified": 1757545623,
|
||||||
"narHash": "sha256-sPS3CaXH8RAT3FZRuy4VcV47iuYIWMMfa0GbyJKC3o4=",
|
"narHash": "sha256-mCxPABZ6jRjUQx3bPP4vjA68ETbPLNz9V2pk9tO7pRQ=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "21ea275a7c46aef9d4d6ddc962e6d562e9d94183",
|
"rev": "8cd5ce828d5d1d16feff37340171a98fc3bf6526",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-26.05",
|
"ref": "nixos-25.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"crane": "crane",
|
"naersk": "naersk",
|
||||||
|
"nix-filter": "nix-filter",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"rust-analyzer-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1752428706,
|
||||||
|
"narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=",
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"rev": "591e3b7624be97e4443ea7b5542c191311aa141d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"ref": "nightly",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
18
flake.nix
18
flake.nix
|
|
@ -2,15 +2,20 @@
|
||||||
description = "Flake for servicepoint-simulator";
|
description = "Flake for servicepoint-simulator";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
|
||||||
crane.url = "github:ipetkov/crane";
|
nix-filter.url = "github:numtide/nix-filter";
|
||||||
|
naersk = {
|
||||||
|
url = "github:nix-community/naersk";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{
|
{
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
crane,
|
naersk,
|
||||||
|
nix-filter,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
|
|
@ -35,8 +40,8 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
rec {
|
rec {
|
||||||
servicepoint-simulator = import ./servicepoint-simulator.nix {
|
servicepoint-simulator = import ./servicepoint-simulator.nix {
|
||||||
inherit pkgs;
|
inherit nix-filter pkgs;
|
||||||
craneLib = crane.mkLib pkgs;
|
naersk' = pkgs.callPackage naersk { };
|
||||||
};
|
};
|
||||||
default = servicepoint-simulator;
|
default = servicepoint-simulator;
|
||||||
}
|
}
|
||||||
|
|
@ -47,8 +52,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
overlays.default = final: prev: {
|
overlays.default = final: prev: {
|
||||||
servicepoint-simulator =
|
servicepoint-simulator = self.legacyPackages."${prev.system}".servicepoint-simulator;
|
||||||
self.legacyPackages."${prev.stdenv.hostPlatform.system}".servicepoint-simulator;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
legacyPackages = packages;
|
legacyPackages = packages;
|
||||||
|
|
|
||||||
|
|
@ -1,63 +1,74 @@
|
||||||
{
|
{
|
||||||
craneLib,
|
naersk',
|
||||||
pkgs,
|
pkgs,
|
||||||
|
nix-filter,
|
||||||
}:
|
}:
|
||||||
let
|
naersk'.buildPackage rec {
|
||||||
commonArgs = {
|
src = nix-filter.lib.filter {
|
||||||
src = craneLib.cleanCargoSource ./.;
|
root = ./.;
|
||||||
nativeBuildInputs = with pkgs; [
|
include = [
|
||||||
pkg-config
|
./Cargo.toml
|
||||||
makeWrapper
|
./Cargo.lock
|
||||||
|
./src
|
||||||
|
./Web437_IBM_BIOS.woff
|
||||||
|
./README.md
|
||||||
|
./LICENSE
|
||||||
];
|
];
|
||||||
strictDeps = true;
|
};
|
||||||
buildInputs =
|
nativeBuildInputs = with pkgs; [
|
||||||
|
pkg-config
|
||||||
|
makeWrapper
|
||||||
|
];
|
||||||
|
strictDeps = true;
|
||||||
|
buildInputs =
|
||||||
|
with pkgs;
|
||||||
|
[
|
||||||
|
xe
|
||||||
|
xz
|
||||||
|
|
||||||
|
roboto
|
||||||
|
]
|
||||||
|
++ lib.optionals pkgs.stdenv.isLinux (
|
||||||
with pkgs;
|
with pkgs;
|
||||||
[
|
[
|
||||||
xe
|
# gpu
|
||||||
xz
|
libGL
|
||||||
|
vulkan-headers
|
||||||
|
vulkan-loader
|
||||||
|
vulkan-tools
|
||||||
|
vulkan-tools-lunarg
|
||||||
|
vulkan-extension-layer
|
||||||
|
vulkan-validation-layers
|
||||||
|
|
||||||
roboto
|
# keyboard
|
||||||
|
libxkbcommon
|
||||||
|
|
||||||
|
# font loading
|
||||||
|
fontconfig
|
||||||
|
freetype
|
||||||
|
|
||||||
|
# WINIT_UNIX_BACKEND=wayland
|
||||||
|
wayland
|
||||||
|
|
||||||
|
# WINIT_UNIX_BACKEND=x11
|
||||||
|
xorg.libXcursor
|
||||||
|
xorg.libXrandr
|
||||||
|
xorg.libXi
|
||||||
|
xorg.libX11
|
||||||
|
xorg.libX11.dev
|
||||||
]
|
]
|
||||||
++ lib.optionals pkgs.stdenv.isLinux (
|
)
|
||||||
with pkgs;
|
++ lib.optionals pkgs.stdenv.isDarwin (
|
||||||
[
|
with pkgs.darwin.apple_sdk.frameworks;
|
||||||
# gpu
|
[
|
||||||
libGL
|
Carbon
|
||||||
vulkan-headers
|
QuartzCore
|
||||||
vulkan-loader
|
AppKit
|
||||||
vulkan-tools
|
]
|
||||||
vulkan-tools-lunarg
|
);
|
||||||
vulkan-extension-layer
|
|
||||||
vulkan-validation-layers
|
|
||||||
|
|
||||||
# keyboard
|
postInstall = ''
|
||||||
libxkbcommon
|
wrapProgram $out/bin/servicepoint-simulator \
|
||||||
|
--suffix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath buildInputs}
|
||||||
# font loading
|
'';
|
||||||
fontconfig
|
}
|
||||||
freetype
|
|
||||||
|
|
||||||
# WINIT_UNIX_BACKEND=wayland
|
|
||||||
wayland
|
|
||||||
|
|
||||||
# WINIT_UNIX_BACKEND=x11
|
|
||||||
libxcursor
|
|
||||||
libxrandr
|
|
||||||
libxi
|
|
||||||
libx11
|
|
||||||
libx11.dev
|
|
||||||
]
|
|
||||||
);
|
|
||||||
};
|
|
||||||
in
|
|
||||||
craneLib.buildPackage (
|
|
||||||
commonArgs
|
|
||||||
// {
|
|
||||||
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
wrapProgram $out/bin/servicepoint-simulator \
|
|
||||||
--suffix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath commonArgs.buildInputs}
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ impl GuiWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_buffer(&mut self) -> Buffer<'_, Rc<Window>, Rc<Window>> {
|
pub fn get_buffer(&mut self) -> Buffer<Rc<Window>, Rc<Window>> {
|
||||||
self.surface.buffer_mut().unwrap()
|
self.surface.buffer_mut().unwrap()
|
||||||
}
|
}
|
||||||
pub(crate) fn request_redraw(&self) {
|
pub(crate) fn request_redraw(&self) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue