chore: switch to flake-parts
This commit is contained in:
parent
b8d9ac366e
commit
c52c7d095d
3 changed files with 65 additions and 37 deletions
23
flake.nix
23
flake.nix
|
@ -3,7 +3,7 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
fenix = {
|
||||
url = "github:nix-community/fenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
@ -12,17 +12,22 @@
|
|||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
inputs@{
|
||||
flake-parts,
|
||||
fenix,
|
||||
naersk,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [
|
||||
"aarch64-linux"
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
perSystem =
|
||||
{ system, pkgs, ... }:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
naersk' = pkgs.callPackage naersk { };
|
||||
defaultBuildOpts = {
|
||||
cargo = fenix.packages.${system}.stable.cargo;
|
||||
|
@ -53,6 +58,6 @@
|
|||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use cartographer::libcanvas::CanvasClient;
|
||||
use reqwest::{Error, Url};
|
||||
use std::env;
|
||||
use ui;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Error> {
|
||||
|
|
22
src/ui.rs
Normal file
22
src/ui.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
use std::io;
|
||||
|
||||
use ratatui::{
|
||||
crossterm::event::{self, KeyCode, KeyEventKind},
|
||||
style::Stylize,
|
||||
widgets::Paragraph,
|
||||
DefaultTerminal,
|
||||
};
|
||||
|
||||
fn run(mut terminal: DefaultTerminal) -> io::Result<()> {
|
||||
loop {
|
||||
terminal.draw(|frame| {
|
||||
let greeting = paragraph
|
||||
.new("Hello Ratatui! (press 'q' to quit)")
|
||||
.white()
|
||||
.on_blue();
|
||||
frame.render_widget(greeting, frame.area());
|
||||
|
||||
if let event::Event::Key(key) -
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue