Compare commits
2 Commits
48f1b29083
...
c658500d8b
| Author | SHA1 | Date | |
|---|---|---|---|
| c658500d8b | |||
| 6ee8b07d06 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
target/
|
target/
|
||||||
.idea/
|
.idea/
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
|
flake.lock
|
||||||
|
|||||||
38
flake.nix
Normal file
38
flake.nix
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
description = "cutie flake ~";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
gitignore = { url = "github:hercules-ci/gitignore.nix"; flake = false; };
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
rustup.url = "github:oxalica/rust-overlay";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = inputs@{ self, nixpkgs, flake-utils, rustup, ... }:
|
||||||
|
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system: let
|
||||||
|
overlays = [ (import rustup) ];
|
||||||
|
pkgs = import nixpkgs { inherit system overlays; };
|
||||||
|
libPath = with pkgs; lib.makeLibraryPath [
|
||||||
|
libGL libxkbcommon
|
||||||
|
wayland wayland-utils
|
||||||
|
musl musl-fts musl-obstack
|
||||||
|
makeWrapper pkg-config gcc
|
||||||
|
libiconv libtool autoconf automake
|
||||||
|
];
|
||||||
|
gitignoreSrc = pkgs.callPackage inputs.gitignore { };
|
||||||
|
in rec {
|
||||||
|
packages.hello = pkgs.callPackage ./default.nix { inherit gitignoreSrc; };
|
||||||
|
legacyPackages = packages;
|
||||||
|
defaultPackage = packages.hello;
|
||||||
|
devShell = pkgs.mkShell {
|
||||||
|
CARGO_INSTALL_ROOT = "${toString ./.}/.cargo";
|
||||||
|
|
||||||
|
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
|
||||||
|
LD_LIBRARY_PATH = libPath;
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [ (rust-bin.selectLatestNightlyWith (toolchain: toolchain.complete.override {
|
||||||
|
targets = [ "x86_64-unknown-linux-musl" "wasm32-unknown-unknown" ];
|
||||||
|
})) ];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -145,7 +145,7 @@ impl eframe::App for CatnipApp {
|
|||||||
.wrap_mode(TextWrapMode::Wrap)
|
.wrap_mode(TextWrapMode::Wrap)
|
||||||
.selected_text(format!("{:?}", theme))
|
.selected_text(format!("{:?}", theme))
|
||||||
.show_ui(ui, |ui| {
|
.show_ui(ui, |ui| {
|
||||||
ui.selectable_value(&mut theme, ThemePreference::System, "💻 System", );
|
ui.selectable_value(&mut theme, ThemePreference::System, "💻 System");
|
||||||
ui.selectable_value(&mut theme, ThemePreference::Light, "☀ Light");
|
ui.selectable_value(&mut theme, ThemePreference::Light, "☀ Light");
|
||||||
ui.selectable_value(&mut theme, ThemePreference::Dark, "🌙 Dark");
|
ui.selectable_value(&mut theme, ThemePreference::Dark, "🌙 Dark");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use application_catnip::CatnipApp;
|
use application_catnip::CatnipApp;
|
||||||
use eframe::Renderer;
|
use eframe::{wgpu, Renderer};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
@@ -7,7 +7,7 @@ fn main() {
|
|||||||
"Catnip Editor",
|
"Catnip Editor",
|
||||||
eframe::NativeOptions {
|
eframe::NativeOptions {
|
||||||
centered: true,
|
centered: true,
|
||||||
renderer: Renderer::Wgpu,
|
renderer: Renderer::Glow,
|
||||||
viewport: egui::ViewportBuilder::default()
|
viewport: egui::ViewportBuilder::default()
|
||||||
.with_inner_size([400.0, 300.0])
|
.with_inner_size([400.0, 300.0])
|
||||||
.with_min_inner_size([300.0, 220.0]),
|
.with_min_inner_size([300.0, 220.0]),
|
||||||
@@ -17,6 +17,5 @@ fn main() {
|
|||||||
egui_extras::install_image_loaders(&context.egui_ctx);
|
egui_extras::install_image_loaders(&context.egui_ctx);
|
||||||
Ok(Box::<CatnipApp>::default())
|
Ok(Box::<CatnipApp>::default())
|
||||||
}),
|
}),
|
||||||
)
|
).expect("TODO: panic message");
|
||||||
.expect("TODO: panic message");
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user