trying to make the dev env work

This commit is contained in:
2025-10-23 14:54:14 +01:00
parent bda1d3a4be
commit b6affcc3dc
7 changed files with 4425 additions and 5 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
/target /target
result* result*
.direnv

4305
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,3 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
iced = { version = "0.13.1", features = ["smol"] }

77
flake.lock generated Normal file
View File

@@ -0,0 +1,77 @@
{
"nodes": {
"crane": {
"locked": {
"lastModified": 1760924934,
"narHash": "sha256-tuuqY5aU7cUkR71sO2TraVKK2boYrdW3gCSXUkF4i44=",
"owner": "ipetkov",
"repo": "crane",
"rev": "c6b4d5308293d0d04fcfeee92705017537cad02f",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1760965567,
"narHash": "sha256-0JDOal5P7xzzAibvD0yTE3ptyvoVOAL0rcELmDdtSKg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "cb82756ecc37fa623f8cf3e88854f9bf7f64af93",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"crane": "crane",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@@ -69,9 +69,21 @@
# MY_CUSTOM_DEVELOPMENT_VAR = "something else"; # MY_CUSTOM_DEVELOPMENT_VAR = "something else";
# Extra inputs can be added here; cargo and rustc are provided by default. # Extra inputs can be added here; cargo and rustc are provided by default.
packages = [ packages = with pkgs; [
# pkgs.ripgrep expat
fontconfig
freetype
freetype.dev
libGL
pkg-config
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
wayland
libxkbcommon
]; ];
LD_LIBRARY_PATH = "${pkgs.libGL}/lib:${pkgs.fontconfig}/lib:${pkgs.freetype}/lib:${pkgs.vulkan-loader}/lib:${pkgs.wayland}";
}; };
} }
); );

View File

@@ -1,3 +1,28 @@
fn main() { use iced;
println!("Hello, world!"); use iced::widget::{button, column, text, Column};
// use iced::Application::View;
#[derive(Default)]
struct Todo {}
#[derive(Debug, Copy, Clone)]
pub enum UpdateMessage {
Meow,
}
impl Todo {
pub fn view(&self) -> Column<UpdateMessage> {
column![text("meow").size(24)]
}
pub fn update(&mut self, msg: UpdateMessage) {
match msg {
UpdateMessage::Meow => {
print!("meow");
}
}
}
}
fn main() {
iced::run("", Todo::update, Todo::view);
} }