This commit is contained in:
Chris Cochrun 2023-10-08 13:57:57 -05:00
commit 1af939a901
8 changed files with 3559 additions and 0 deletions

5
.envrc Normal file
View file

@ -0,0 +1,5 @@
export DATABASE_URL=sqlite://~/.local/share/lumina/library-db.sqlite3
use flake . --impure
# eval $(guix shell -D --search-paths)
# use guix --development -f guix.scm

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target

3283
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

11
Cargo.toml Normal file
View file

@ -0,0 +1,11 @@
[package]
name = "lumina-iced-test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
iced = { version = "0.10.0", features = ["image", "debug"] }
iced_aw = "0.7.0"
iced_winit = "0.10.0"

94
flake.lock Normal file
View file

@ -0,0 +1,94 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"naersk": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1694081375,
"narHash": "sha256-vzJXOUnmkMCm3xw8yfPP5m8kypQ3BhAIRe4RRCWpzy8=",
"owner": "nix-community",
"repo": "naersk",
"rev": "3f976d822b7b37fc6fb8e6f157c2dd05e7e94e89",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1696725822,
"narHash": "sha256-B7uAOS7TkLlOg1aX01rQlYbydcyB6ZnLJSfaYbKVww8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5aabb5780a11c500981993d49ee93cfa6df9307b",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1696604326,
"narHash": "sha256-YXUNI0kLEcI5g8lqGMb0nh67fY9f2YoJsILafh6zlMo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "87828a0e03d1418e848d3dd3f3014a632e4a4f64",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"naersk": "naersk",
"nixpkgs": "nixpkgs_2"
}
},
"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
}

82
flake.nix Normal file
View file

@ -0,0 +1,82 @@
{
description = "A Church Presentation Application";
inputs = {
# cargo2nix.url = "github:cargo2nix/cargo2nix/release-0.11.0";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
naersk.url = "github:nix-community/naersk";
flake-utils.url = "github:numtide/flake-utils";
# nixpkgs.follows = "cargo2nix/nixpkgs";
};
outputs = inputs: with inputs;
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
# overlays = [cargo2nix.overlays.default];
};
naersk' = pkgs.callPackage naersk {};
# src = ./.;
# rustPkgs = pkgs.rustBuilder.makePackageSet {
# rustVersion = "1.61.0";
# packageFun = import ./Cargo.nix;
# };
# The workspace defines a development shell with all of the dependencies
# and environment settings necessary for a regular `cargo build`.
# Passes through all arguments to pkgs.mkShell for adding supplemental
# dependencies.
# workspaceShell = rustPkgs.workspaceShell {
# packages = with pkgs; [
# gcc
# stdenv
# bintools
# gnumake
# gdb
# qtcreator
# cmake
# extra-cmake-modules
# pkg-config
# libsForQt5.wrapQtAppsHook
# makeWrapper
# clang-tools
# clang
# libclang
# qt5.qtbase
# qt5.qttools
# qt5.qtquickcontrols2
# qt5.qtx11extras
# qt5.qtmultimedia
# qt5.qtwayland
# qt5.qtwebengine
# libsForQt5.kirigami2
# libsForQt5.qqc2-desktop-style
# libsForQt5.karchive
# mpv
# ffmpeg_6-full
# # Rust tools
# clippy
# rustc
# cargo
# rustfmt
# rust-analyzer
# corrosion
# ];
# # shellHook = ''
# # export PS1="\033[0;31m☠dev-shell☠ $ \033[0m"
# # '';
# };
in rec
{
# packages = {
# crate = (rustPkgs.workspace.libre-presenter { }).bin;
# default = packages.crate;
# };
devShell = import ./shell.nix { inherit pkgs; };
defaultPackage = pkgs.libsForQt5.callPackage ./default.nix { };
}
);
}

52
shell.nix Normal file
View file

@ -0,0 +1,52 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
mkShell rec {
name = "lumina";
nativeBuildInputs = [
gtk-layer-shell
gtk3
];
buildInputs = [
gcc
stdenv
gnumake
gdb
pkg-config
makeWrapper
vulkan-loader
wayland
wayland-protocols
libxkbcommon
# podofo
mpv
ffmpeg_5-full
# yt-dlp
# Rust tools
clippy
rustc
cargo
rustfmt
rust-analyzer
];
# cargoDeps = rustPlatform.importCargoLock {
# lockFile = ./Cargo.lock;
# };
RUST_BACKTRACE = "full";
CMAKE_C_COMPILER = "${gcc}/bin/gcc";
CMAKE_CXX_COMPILER = "${gcc}/bin/g++";
# This creates the proper qt env so that plugins are found right.
# shellHook = ''
# setQtEnvironment=$(mktemp --suffix .setQtEnvironment.sh)
# echo "shellHook: setQtEnvironment = $setQtEnvironment"
# makeQtWrapper "/bin/sh" "$setQtEnvironment" "''${qtWrapperArgs[@]}"
# sed "/^exec/d" -i "$setQtEnvironment"
# source "$setQtEnvironment"
# export QT_PLUGIN_PATH="$QT_PLUGIN_PATH:/nix/store/85jx8w2nh1ln4kb0hf3dc6ky0dh6ri24-lightly-qt-0.4.1/lib/qt-5.15.9/plugins"
# '';
}

31
src/main.rs Normal file
View file

@ -0,0 +1,31 @@
use iced::executor;
use iced::{Application, Command, Element, Settings, Theme};
fn main() -> iced::Result {
App::run(Settings::default())
}
struct App;
impl Application for App {
type Executor = executor::Default;
type Flags = ();
type Message = ();
type Theme = Theme;
fn new(_flags: ()) -> (App, Command<Self::Message>) {
(App, Command::none())
}
fn title(&self) -> String {
String::from("A cool application")
}
fn update(&mut self, _message: Self::Message) -> Command<Self::Message> {
Command::none()
}
fn view(&self) -> Element<Self::Message> {
"Hello, world!".into()
}
}