From 27f6371c2c33eec86a3ab1b2819f736c2a21b2e4 Mon Sep 17 00:00:00 2001 From: electria Date: Sun, 16 Aug 2026 14:26:32 -0700 Subject: [PATCH 1/3] iced-template: factor out Element, explicit Error the type alias Element is quite useful for defining subfunctions for view and it also helps to not pull unnecessary things into scope --- src/app/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/mod.rs b/src/app/mod.rs index 7b9c9ca..db11f02 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1,4 +1,6 @@ -use iced::{Color, Element, Renderer, Task, Theme, application, theme, widget}; +use iced::{Color, Task, application, theme, widget}; + +type Element<'a> = iced::Element<'a, Message, iced::Theme, iced::Renderer>; enum Message {} @@ -11,12 +13,12 @@ impl State { fn update(&mut self, message: Message) -> Task { Task::none() } - fn view(&self) -> Element<'_, Message, Theme, Renderer> { + fn view(&self) -> Element<'_> { widget::text("hiiiiiii").into() } } -pub fn run() -> Result<(), impl std::error::Error> { +pub fn run() -> Result<(), iced::Error> { application(State::new, State::update, State::view) .theme(theme::Theme::custom( "high-contrast-dark", From 9c3419782be4b5a64edccddbcbceeaa41d058089 Mon Sep 17 00:00:00 2001 From: electria Date: Sun, 16 Aug 2026 21:17:36 -0700 Subject: [PATCH 2/3] iced-template: remove nonexistent icon --- flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/flake.nix b/flake.nix index 5633e8c..220a03c 100644 --- a/flake.nix +++ b/flake.nix @@ -49,7 +49,6 @@ desktopItem = pkgs.makeDesktopItem { inherit name; desktopName = name; - icon = name; exec = name; }; in From 8ead7e6eb0a40a1c7ef4f66d07240e94dec1773f Mon Sep 17 00:00:00 2001 From: electria Date: Mon, 17 Aug 2026 10:42:08 -0700 Subject: [PATCH 3/3] iced-template: use more efficient nixpkgs input --- flake.lock | 17 +++++++---------- flake.nix | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index e328700..e29f5a4 100644 --- a/flake.lock +++ b/flake.lock @@ -20,18 +20,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1785747939, - "narHash": "sha256-D740uKsMbgsfK2oaDenJLLPIZfq7W0/g4KN/Fls8eKs=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "104240a772428cc2e20d8fd86c9ddbb886bbaff2", - "type": "github" + "lastModified": 1786862985, + "narHash": "sha256-kSR/jfpR4cE26YRZ8exQkoRbEA30vyWimajwZANYYaE=", + "rev": "e5bdc4a41d4c072fe1e3787eaa0320a384741d44", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1055335.e5bdc4a41d4c/nixexprs.tar.zst?lastModified=1786862985&rev=e5bdc4a41d4c072fe1e3787eaa0320a384741d44" }, "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst" } }, "root": { diff --git a/flake.nix b/flake.nix index 220a03c..785a77e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst"; flake-utils.url = "github:numtide/flake-utils"; };