gostui-setup #1
13
default.nix
13
default.nix
@@ -1,11 +1,24 @@
|
|||||||
{
|
{
|
||||||
|
lib,
|
||||||
rustPlatform,
|
rustPlatform,
|
||||||
pkg-config,
|
pkg-config,
|
||||||
}:
|
}:
|
||||||
rustPlatform.buildRustPackage {
|
rustPlatform.buildRustPackage {
|
||||||
name = "garandos-tui";
|
name = "garandos-tui";
|
||||||
|
pname = "garandos-tui";
|
||||||
|
version = "0.1.0";
|
||||||
|
|
||||||
src = ./.;
|
src = ./.;
|
||||||
# buildInputs = [ ];
|
# buildInputs = [ ];
|
||||||
nativeBuildInputs = [pkg-config];
|
nativeBuildInputs = [pkg-config];
|
||||||
cargoHash = "sha256-cFAkKwgLzj6Hr2pq7W/1Ps1G3yKzgEam/qV6p31gadA=";
|
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 = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
@@ -23,11 +23,7 @@
|
|||||||
nixpkgs,
|
nixpkgs,
|
||||||
naersk,
|
naersk,
|
||||||
fenix,
|
fenix,
|
||||||
lib,
|
|
||||||
cfg,
|
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkOption mkIf types;
|
|
||||||
|
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
@@ -49,6 +45,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
nixosModules.garandos-tui = {
|
nixosModules.garandos-tui = {
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkOption mkIf types;
|
||||||
|
cfg = config.programs.garandos-tui;
|
||||||
|
in {
|
||||||
options.programs.garandos-tui = {
|
options.programs.garandos-tui = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
|||||||
10
src/main.rs
10
src/main.rs
@@ -12,11 +12,6 @@ use std::{
|
|||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
let nix_modules: NixModules = get_modules();
|
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 terminal: Terminal<CrosstermBackend<Stdout>> = ratatui::init();
|
||||||
let mut app: App = App {
|
let mut app: App = App {
|
||||||
exit: false,
|
exit: false,
|
||||||
@@ -38,11 +33,6 @@ fn main() -> Result<()> {
|
|||||||
handle_input_events(tx_to_input_events);
|
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);
|
let app_result: Result<()> = app.run(&mut terminal, event_rx);
|
||||||
ratatui::restore();
|
ratatui::restore();
|
||||||
app_result
|
app_result
|
||||||
|
|||||||
Reference in New Issue
Block a user