gostui-setup #1
13
default.nix
13
default.nix
@@ -1,11 +1,24 @@
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
pkg-config,
|
||||
}:
|
||||
rustPlatform.buildRustPackage {
|
||||
name = "garandos-tui";
|
||||
pname = "garandos-tui";
|
||||
version = "0.1.0";
|
||||
|
||||
src = ./.;
|
||||
# buildInputs = [ ];
|
||||
nativeBuildInputs = [pkg-config];
|
||||
cargoHash = "sha256-cFAkKwgLzj6Hr2pq7W/1Ps1G3yKzgEam/qV6p31gadA=";
|
||||
|
||||
meta = {
|
||||
description = "TUI for managing GarandsOS' hosts enabled modules";
|
||||
homepage = "https://gitea.garandplg.com/GarandPLG/garandos-tui";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [
|
||||
"Garand_PLG"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
13
flake.nix
13
flake.nix
@@ -1,5 +1,5 @@
|
||||
{
|
||||
description = "TUI for managing GarandsOS' hosts configuration";
|
||||
description = "TUI for managing GarandsOS' hosts enabled modules";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
@@ -23,11 +23,7 @@
|
||||
nixpkgs,
|
||||
naersk,
|
||||
fenix,
|
||||
lib,
|
||||
cfg,
|
||||
}: let
|
||||
inherit (lib) mkOption mkIf types;
|
||||
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
@@ -49,6 +45,13 @@
|
||||
};
|
||||
|
||||
nixosModules.garandos-tui = {
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkOption mkIf types;
|
||||
cfg = config.programs.garandos-tui;
|
||||
in {
|
||||
options.programs.garandos-tui = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
|
||||
10
src/main.rs
10
src/main.rs
@@ -12,11 +12,6 @@ use std::{
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let nix_modules: NixModules = get_modules();
|
||||
|
||||
for module in &nix_modules.system_modules {
|
||||
println!("{} - ({})", module.category, module.path);
|
||||
}
|
||||
|
||||
let mut terminal: Terminal<CrosstermBackend<Stdout>> = ratatui::init();
|
||||
let mut app: App = App {
|
||||
exit: false,
|
||||
@@ -38,11 +33,6 @@ fn main() -> Result<()> {
|
||||
handle_input_events(tx_to_input_events);
|
||||
});
|
||||
|
||||
// let tx_to_file_edit_events: Sender<Event> = event_tx.clone();
|
||||
// thread::spawn(move || {
|
||||
// // handle_file_edit_events(tx_to_file_edit_events);
|
||||
// });
|
||||
|
||||
let app_result: Result<()> = app.run(&mut terminal, event_rx);
|
||||
ratatui::restore();
|
||||
app_result
|
||||
|
||||
Reference in New Issue
Block a user