init repo
This commit is contained in:
commit
1949a815ee
7 changed files with 4152 additions and 0 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
use flake
|
||||||
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
/target
|
||||||
|
|
||||||
|
/.direnv
|
||||||
|
/result
|
||||||
3943
Cargo.lock
generated
Normal file
3943
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
7
Cargo.toml
Normal file
7
Cargo.toml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[package]
|
||||||
|
name = "todo"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
iced = "0.14.0"
|
||||||
77
flake.lock
generated
Normal file
77
flake.lock
generated
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"crane": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1781825982,
|
||||||
|
"narHash": "sha256-SlXKwIRIhrOSAcTjCB3ftPLzJWZStQIPS7J1FlZPnKk=",
|
||||||
|
"owner": "ipetkov",
|
||||||
|
"repo": "crane",
|
||||||
|
"rev": "469fd08d0bcf6926321fa973c6777fbc87785dd7",
|
||||||
|
"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": 1782175435,
|
||||||
|
"narHash": "sha256-EMzXKmnOtBQ2MnvpiNOm7E+kOMvdPrIKaeg52Tip2Uk=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "89570f24e97e614aa34aa9ab1c927b6578a43775",
|
||||||
|
"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
|
||||||
|
}
|
||||||
102
flake.nix
Normal file
102
flake.nix
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
|
crane.url = "github:ipetkov/crane";
|
||||||
|
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
inputs:
|
||||||
|
inputs.flake-utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = import inputs.nixpkgs { inherit system; };
|
||||||
|
lib = pkgs.lib;
|
||||||
|
craneLib = inputs.crane.mkLib pkgs;
|
||||||
|
|
||||||
|
cargoToml = fromTOML (builtins.readFile ./Cargo.toml);
|
||||||
|
name = cargoToml.package.name;
|
||||||
|
|
||||||
|
dlDeps = with pkgs; [
|
||||||
|
# needed for both x11 and wayland
|
||||||
|
libxkbcommon
|
||||||
|
|
||||||
|
wayland
|
||||||
|
|
||||||
|
libx11
|
||||||
|
libxcursor
|
||||||
|
libxi
|
||||||
|
];
|
||||||
|
|
||||||
|
commonArgs = {
|
||||||
|
# all that's needed for artifacts and checks
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
];
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
];
|
||||||
|
|
||||||
|
src = craneLib.cleanCargoSource ./.;
|
||||||
|
};
|
||||||
|
|
||||||
|
LD_LIBRARY_PATH = lib.makeLibraryPath dlDeps;
|
||||||
|
|
||||||
|
# Build *just* the cargo dependencies,
|
||||||
|
# to reuse them for build and test derivations.
|
||||||
|
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
|
||||||
|
|
||||||
|
# Build the actual crate itself,
|
||||||
|
# reusing the dependency artifacts from above.
|
||||||
|
crate =
|
||||||
|
let
|
||||||
|
desktopItem = pkgs.makeDesktopItem {
|
||||||
|
inherit name;
|
||||||
|
desktopName = name;
|
||||||
|
icon = "image-x-generic";
|
||||||
|
exec = name;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
craneLib.buildPackage (
|
||||||
|
commonArgs
|
||||||
|
// {
|
||||||
|
inherit cargoArtifacts;
|
||||||
|
|
||||||
|
nativeBuildInputs = commonArgs.nativeBuildInputs ++ [
|
||||||
|
pkgs.autoPatchelfHook
|
||||||
|
];
|
||||||
|
|
||||||
|
runtimeDependencies = dlDeps;
|
||||||
|
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
postFixup = ''
|
||||||
|
mkdir -p "$out/share/applications"
|
||||||
|
ln -s "${desktopItem}"/share/applications/* "$out/share/applications/"
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages.default = crate;
|
||||||
|
|
||||||
|
checks = {
|
||||||
|
crate-clippy = craneLib.cargoClippy (
|
||||||
|
commonArgs
|
||||||
|
// {
|
||||||
|
inherit cargoArtifacts;
|
||||||
|
|
||||||
|
cargoClippyExtraArgs = "-- --deny warnings";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
devShells.default = craneLib.devShell {
|
||||||
|
inherit LD_LIBRARY_PATH;
|
||||||
|
|
||||||
|
inputsFrom = [ crate ];
|
||||||
|
packages = [ pkgs.rust-analyzer ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
18
src/main.rs
Normal file
18
src/main.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
use iced::{Element, Renderer, Theme, widget};
|
||||||
|
|
||||||
|
enum Message {}
|
||||||
|
|
||||||
|
struct State {}
|
||||||
|
impl State {
|
||||||
|
fn new() -> Self {
|
||||||
|
Self {}
|
||||||
|
}
|
||||||
|
fn view(&self) -> Element<'_, Message, Theme, Renderer> {
|
||||||
|
widget::space().into()
|
||||||
|
}
|
||||||
|
fn update(&mut self, message: Message) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() -> Result<(), iced::Error> {
|
||||||
|
iced::application(State::new, State::update, State::view).run()
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue