diff --git a/default.nix b/default.nix index b6fb6c5..b49369f 100644 --- a/default.nix +++ b/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" + ]; + }; } diff --git a/flake.nix b/flake.nix index 510c6a2..2049a04 100644 --- a/flake.nix +++ b/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; diff --git a/src/main.rs b/src/main.rs index 0f0cddc..4b8526a 100644 --- a/src/main.rs +++ b/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> = 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_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