A libadwaita/gtk4 app for editing NixOS configurations

Overview

NixOS Configuration Editor

Built with Nix License: MIT

A simple NixOS configuration editor application built with libadwaita, GTK4, and Relm4. The goal of this project is to provide a simple graphical tool for modifying and managing desktop NixOS configurations.

To Do's currently unimplemented

  • Handle <name> and * fields in options
  • Handle files in imports
  • Add easy widgets for modifying simple options like booleans and strings
  • Add an icon
  • Package polkit policy file

Things Done

  • Set and modify configuration options
    • Validate option types
  • Search options
  • Indicate which options are set
  • Rebuild system and show errors

Usage

This tool is extremely new, so there will likely be lots of errors. If you run into an error, please report the issue!

On an flakes enabled system:

nix run github:vlinkz/nixos-conf-editor

On non-flakes enabled system:

nix --extra-experimental-features "nix-command flakes" run github:vlinkz/nixos-conf-editor

Screenshots

Comments
  • Use GPL

    Use GPL

    You used GPLv3 at https://github.com/vlinkz/nix-software-center.

    It would make sense here as well.

    Since there are no contributors yet, you can just change it.

    opened by davidak 1
  • Handle configuration imports

    Handle configuration imports

    Currently only supports reading and editing a single file. Would be more useful if imports could be handled, read, and edited as well. Perhaps automatically detect a list, as well as support manually choosing files.

    Related: https://github.com/vlinkz/nix-editor/issues/7 #6

    opened by vlinkz 0
  • Build fails

    Build fails

      nixos-conf-editor = (import (pkgs.fetchFromGitHub {
        owner = "vlinkz";
        repo = "nixos-conf-editor";
        rev = "0.0.4";
        sha256 = "sha256-esyfFl72t5k2XNq6DCRgfIC6TYgIMyGKla9GaEEN0Oo=";
      })) {};
    
       Compiling relm4 v0.5.0-beta.1 (https://github.com/Relm4/Relm4?tag=v0.5.0-beta.1#a7d24329)
    error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
      --> /build/nixos-conf-editor-0.0.4-vendor.tar.gz/relm4/src/shared_state.rs:35:6
       |
    35 | impl<Data> SharedState<Data>
       |      ^^^^
    ...
    51 |     pub const fn new() -> Self {
       |     -------------------------- function declared as const here
       |
       = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
    
    error[E0658]: function pointer casts are not allowed in constant functions
      --> /build/nixos-conf-editor-0.0.4-vendor.tar.gz/relm4/src/shared_state.rs:53:29
       |
    53 |             data: Lazy::new(|| RwLock::new(Data::default())),
       |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
    
    error[E0658]: function pointer casts are not allowed in constant functions
      --> /build/nixos-conf-editor-0.0.4-vendor.tar.gz/relm4/src/shared_state.rs:54:36
       |
    54 |             subscribers: Lazy::new(|| RwLock::new(Vec::default())),
       |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
    
    For more information about this error, try `rustc --explain E0658`.
    error: could not compile `relm4` due to 3 previous errors
    warning: build failed, waiting for other jobs to finish...
    error: build failed
    [3/5] Generating data/dev.vlinkz.NixosConfEditor.metainfo.xml with a custom command
    FAILED: src/nixos-conf-editor 
    /nix/store/p643r4aczmzb0dhyrx3dj592f0s5v7xj-coreutils-9.0/bin/env CARGO_HOME=/build/nfar6ph3pgm6kcyqrk9zdiyafb5xgcfn-source/build/cargo-home /nix/store/2gwhsd2jcz90zni0pwlhhfbmfbflixws-cargo-1.60.0/bin/cargo build --manifest-path /build/nfar6ph3pgm6kcyqrk9zdiyafb5xgcfn-source/Cargo.toml --target-dir /build/nfar6ph3pgm6kcyqrk9zdiyafb5xgcfn-source/build/src --release && cp src/release/nixos-conf-editor src/nixos-conf-editor
    ninja: build stopped: subcommand failed.
    error: builder for '/nix/store/2v8pjhcxrcnsgsv34j2jdw4y8wk21gxa-nixos-conf-editor-0.0.4.drv' failed with exit code 1
    

    • system: "x86_64-linux"
    • host os: Linux 5.15.67, NixOS, 22.05 (Quokka), 22.05.3201.bcc68429a50
    • multi-user?: yes
    • sandbox: yes
    • version: nix-env (Nix) 2.8.1
    • channels(root): "home-manager-22.05.tar.gz, nixos-22.05, nixos-hardware, nixos-unstable"
    • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
    opened by davidak 3
  • Could not load cache

    Could not load cache

    Opening the application just gives me the "Could not load cache" error. I can't do anything, and it doesn't look enabling the debug flag shows anything useful.

    RUST_LOG=nixos_conf_editor=trace nixos-conf-editor                                                                 
     DEBUG nixos_conf_editor::ui::optionpage > opt changing valuebuf to ""
     DEBUG nixos_conf_editor::ui::optionpage > conf changing valuebuf to ""
     DEBUG nixos_conf_editor::ui::optionpage > valuetracker changing valuebuf to ""
     INFO  nixos_conf_editor::ui::optionpage > OptPageMsg::UpdateConfMod
     INFO  nixos_conf_editor::ui::optionpage > pre_view
     DEBUG nixos_conf_editor::ui::optionpage > valuetracker changing valuebuf to "0"
     DEBUG nixos_conf_editor::ui::optionpage > valuebuf changed to "0"
     INFO  nixos_conf_editor::ui::optionpage > OptPageMsg::UpdateConf
     INFO  nixos_conf_editor::ui::optionpage > pre_view
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::SetDarkMode
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::SetConfPath
     INFO  nixos_conf_editor::ui::optionpage > OptPageMsg::SetScheme
     INFO  nixos_conf_editor::ui::optionpage > pre_view
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::TryLoad
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::LoadError
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::TryLoad
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::LoadError
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::TryLoad
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::LoadError
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::TryLoad
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::LoadError
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::TryLoad
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::LoadError
     INFO  nixos_conf_editor::ui::window     > Received AppMsg::Close
    
    opened by baduhai 4
  • Location dialog not usable

    Location dialog not usable

    I see this in terminal when i open the location selection:

    If you handle this event, you must return GDK_EVENT_PROPAGATE so the default handler gets the event as well

    I can click around, but nothing happens.

    Screenshot from 2022-06-02 01-44-56

    opened by davidak 1
  • 'tokio-runtime-worker' panicked at 'Invalid Data'

    'tokio-runtime-worker' panicked at 'Invalid Data'

    [davidak@gaming:~]$ RUST_BACKTRACE=full nix run github:vlinkz/nixos-conf-editor
    thread 'tokio-runtime-worker' panicked at 'Invalid Data', src/parse/cache.rs:96:21
    stack backtrace:
       0:     0x560cbfbb4e9c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf9a1e5015c7372de
       1:     0x560cbfbe838e - core::fmt::write::h9fe85dc123605e26
       2:     0x560cbfbc3838 - std::io::Write::write_fmt::hb015af194a783782
       3:     0x560cbfbcb936 - std::panicking::default_hook::{{closure}}::h5be0c3f8bc5f82d3
       4:     0x560cbfbcb5cc - std::panicking::default_hook::h26c625e8da3d12e5
       5:     0x560cbfbcbf79 - std::panicking::rust_panic_with_hook::h9e5373efea59497b
       6:     0x560cbfbb5af7 - std::panicking::begin_panic_handler::{{closure}}::h6675d1d897d2268b
       7:     0x560cbfbb4fc4 - std::sys_common::backtrace::__rust_end_short_backtrace::h2eebb466dcccf8e7
       8:     0x560cbfbcba72 - rust_begin_unwind
       9:     0x560cbfa42823 - core::panicking::panic_fmt::h388cf0442c96c658
      10:     0x560cbfaa0668 - core::panicking::panic_display::h61c4d900c29807b1
      11:     0x560cbfa9d608 - nixos_conf_editor::parse::cache::setupcache::h4609d58d2cc23251
      12:     0x560cbfa9bf57 - nixos_conf_editor::parse::cache::checkcache::h20d165e451c4fabb
      13:     0x560cbfaa4235 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hcf8af2b3e258255f
      14:     0x560cbfad0a68 - tokio::runtime::task::harness::poll_future::h4d33085fbd2d268e
      15:     0x560cbfaccb81 - tokio::runtime::task::harness::Harness<T,S>::poll::h88f018d0b34dc369
      16:     0x560cbfb969b0 - std::thread::local::LocalKey<T>::with::h6aad474042249cd8
      17:     0x560cbfb926ff - tokio::runtime::thread_pool::worker::Context::run_task::h0205d63632eef786
      18:     0x560cbfb919ae - tokio::runtime::thread_pool::worker::Context::run::h4d1ffb63402bc56c
      19:     0x560cbfb9966b - tokio::macros::scoped_tls::ScopedKey<T>::set::h948f9a7e6e4c22ef
      20:     0x560cbfb9140c - tokio::runtime::thread_pool::worker::run::h2ad3722576d6694e
      21:     0x560cbfb95439 - tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut::h0c0a6e6e04726100
      22:     0x560cbfb9555b - tokio::runtime::task::harness::Harness<T,S>::poll::h01f71bc729e6cdcb
      23:     0x560cbfb8a298 - tokio::runtime::blocking::pool::Inner::run::h4b76ae400a65d8f5
      24:     0x560cbfb9a25c - std::sys_common::backtrace::__rust_begin_short_backtrace::h8c1e74afd8363ea7
      25:     0x560cbfb8d3bf - core::ops::function::FnOnce::call_once{{vtable.shim}}::h50a132585e9d20ea
      26:     0x560cbfbc8e23 - std::sys::unix::thread::Thread::new::thread_start::h17b4aae352c54ef4
      27:     0x7f8bae31fff2 - start_thread
      28:     0x7f8bae3a2bfc - clone3
      29:                0x0 - <unknown>
    

    My structure is that /etc/nixos/configuration.nix is a symlink to /root/nixos/machines/gaming/configuration.nix which is https://codeberg.org/davidak/nixos-config/src/branch/master/machines/gaming/configuration.nix (with few uncommitted updates)

    opened by davidak 8
Releases(0.0.4)
Owner
Victor Fuentes
Linux fan | he/him
Victor Fuentes
Intuitive GTK4/LibAdwaita music player

Resonance Harmonize your listening experience with Resonance. Resonance is an intuitive music player application written in Rust & Python, with a clea

Nathanael 25 Apr 7, 2023
Command line tool for editing .ini files

Edit-ini Command line tool for editing .ini files Usage Usage: edit-ini [OPTIONS] Options: -i, --input <file> Input file to read f

null 3 Dec 28, 2022
Command-line tool that provides a workflow for extending, editing, diffing, and writing to vim-style grep lines.

Grug Grug is a command-line tool that provides a workflow for expanding, editing, diffing, and writing edits to files using vim-styled grep lines (suc

null 4 Apr 25, 2023
Tool for editing FFXI DAT files.

XI Tinkerer Tool for decoding and encoding FFXI DAT files. It can export DATs into human-readable files (YAML), which can then be edited and re-encode

InoUno 3 Sep 21, 2023
Neovim Configuration Manager (Swap/Backup/Try Configurations Easily)

ncm-rs Neovim Configuration Manager (Swap/Backup/Try Configurations Easily) I created this package because I wanted to try out Lazyvim (which is why i

instance.id 4 Mar 5, 2023
Contains challenges, write-ups, and deployment configurations from b01lersCTF 2023.

CTF Name A template repository for a CTF competition. This is a description of the CTF event. CTFTime Link Structure Challenges are organized by categ

null 7 Mar 29, 2023
WIP GUI for NixOS documentation + configuration

nixos-druid Highly experimental GUI for NixOS. For now I expect to frequently make large changes and break stuff whenever I'm working on this. Screens

Sybrand Aarnoutse 6 Aug 23, 2022
Secure Boot for NixOS [maintainers=@blitz @raitobezarius @nikstur]

Lanzaboote: Secure Boot for NixOS This repository contains tooling for UEFI Secure Boot on NixOS. The goal is to make Secure Boot available from nixpk

Nix community projects 79 Jan 6, 2023
An anyrun plugin that lets you search NixOS options.

anyrun-nixos-options An anyrun plugin that lets you search NixOS options. how 2 build? nix build ... or cargo build optionally :) Configuration This p

Michał 4 Aug 24, 2023
Microscopic fetch tool in Rust, for NixOS systems, with special emphasis on speed

Microfetch Stupidly simple, laughably fast fetch tool. Written in Rust for speed and ease of maintainability. Runs in a fraction of a millisecond and

raf 27 Oct 21, 2024
A todo list app that indexes your app to find TODO:'s

forgot A todo list app that indexes your app to find TODO:'s Usage to list all your todos forgot list list all your todos ignoring search in ./target,

null 2 Oct 6, 2022
CLI calculator app and library

calc Yet another CLI calculator. Inspired by the excellent https://github.com/alfredxing/calc. Installation With a Rust toolchain in place: cargo inst

Peter Goodspeed-Niklaus 34 Nov 13, 2022
belt is a command line app that can show your time from a list of selected time zones

A CLI app to show your time from a list of selected time zones, and a rust lib to parse dates in string formats that are commonly used.

Rollie Ma 23 Nov 4, 2022
Simple Interactive Terminal Todo App in Rust

todo-rs Simple Interactive Terminal Todo App in Rust Quick Start $ cargo run TODO Controls Keys Description k, j Move cursor up and down Shift+K, Shif

Tsoding 56 Dec 8, 2022
CLI app to display list of trending anime, music charts or recommend anime to watch or song to listen to.

Description Anitrendz is a cli app that uses data from the anitiop api to list the top anime and songs or recommend a random anime to watch or song to

Jimmy 9 Jun 11, 2022
Replace an app's icon from a png with a single terminal script. Made with Rust

Replace macOS App Icon Replace an app's icon from a png with a single terminal CLI. Made with Rust

Kunal Bagaria 8 Aug 3, 2022
Turbine is a toy CLI app for converting Rails schema declarations into equivalent type declarations in other languages.

Turbine Turbine is a toy CLI app for converting Rails schema declarations into equivalent type declarations in other languages. It’s described as a to

Justin 2 Jan 21, 2022
Simple test app based on rust-psp

PSP Test App Simple test app based on rust-psp. Demonstrating the usage of C libs. Build Download and unzip the prebuilt PSPSDK (built from clang-psp)

Yifeng Wang 4 Nov 28, 2022
An ultra-fast CLI app that fixes JSON files in large codebase or folders

minosse An ultra fast CLI app that fixes json files in large codebase or folders USAGE: minosse [OPTIONS] <input-dir> FLAGS: -h, --help Prints

Antonino Bertulla 5 Oct 17, 2022