From e462de6272ed7153f7aeed2a4ce499e1e76574c0 Mon Sep 17 00:00:00 2001 From: John Babich <166637847+babichgh@users.noreply.github.com> Date: Fri, 29 May 2026 23:58:03 +0300 Subject: [PATCH 1/4] Update user input prompts to read from /dev/tty Redirect input for user prompts to /dev/tty for better compatibility. --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 61ff798..54c6b0a 100755 --- a/install.sh +++ b/install.sh @@ -61,7 +61,7 @@ select_channel() { echo "Choose channel:" echo " 1) Latest stable release (default)" echo " 2) Latest dev (pre-release)" - read -r -p "Enter 1 or 2 [1]: " choice + read -r -p "Enter 1 or 2 [1]: " choice < /dev/tty case "${choice:-1}" in 1) CHANNEL="stable" ;; @@ -74,7 +74,7 @@ select_install_mode() { echo "Choose installation mode:" echo " 1) Download prebuilt binary from GitHub Release (recommended)" echo " 2) Build from git" - read -r -p "Enter 1 or 2 [1]: " choice + read -r -p "Enter 1 or 2 [1]: " choice < /dev/tty case "${choice:-1}" in 1) INSTALL_MODE="release" ;; @@ -215,4 +215,4 @@ main() { log "Log saved to $LOGFILE" } -main "$@" \ No newline at end of file +main "$@" From ea1546b13a5c790dd4c4017faf4c12ad8b086909 Mon Sep 17 00:00:00 2001 From: Dexoron Date: Mon, 1 Jun 2026 02:49:06 +0800 Subject: [PATCH 2/4] Create FUNDING.yml --- .github/FUNDING.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..7bdba97 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,15 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +polar: # Replace with a single Polar username +buy_me_a_coffee: # Replace with a single Buy Me a Coffee username +thanks_dev: # Replace with a single thanks.dev username +custom: 'https://dalink.to/dexoron' From 772d50811fdac24676ff0476c1502cc99e718fe0 Mon Sep 17 00:00:00 2001 From: Alexandr_Croitor Date: Sun, 31 May 2026 22:37:57 +0300 Subject: [PATCH 3/4] build(nix): configure flake for dcr project - Set package name/version from Cargo.toml (dcr 0.6.9) - Add cmake and perl for vendored libgit2/openssl builds - Switch to stable toolchain (complete was overkill) - Generate flake.lock --- flake.lock | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 112 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 247 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..84c8fc9 --- /dev/null +++ b/flake.lock @@ -0,0 +1,135 @@ +{ + "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1780218205, + "narHash": "sha256-c4MSlBQw5MIDRkad9UNUUnBaOHAHnhuCXrDt90FDVrg=", + "owner": "nix-community", + "repo": "fenix", + "rev": "96e0fc9f1a9b37f6477fa11c3fd48575354773ed", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1779560665, + "narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1770107345, + "narHash": "sha256-tbS0Ebx2PiA1FRW8mt8oejR0qMXmziJmPaU1d4kYY9g=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "4533d9293756b63904b7238acb84ac8fe4c8c2c4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "fenix": "fenix", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "treefmt-nix": "treefmt-nix" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1780179631, + "narHash": "sha256-61A3gj4V1DyPP6lVHTdui4+dvG66pkMZSMd1Kke3Rz8=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "cce33f2f1565958787bb763ae751a6a5f56b95e3", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1780220602, + "narHash": "sha256-eynAfOmbmxJnkp7YewvCEbShNnnYJ9gLLqkzsYtBPeM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "db947814a175b7ca6ded66e21383d938df01c227", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..53da1d0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,112 @@ +{ + description = "DCR — Cargo-like utility for managing C/C++ projects"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + flake-utils.url = "github:numtide/flake-utils"; + + treefmt-nix.url = "github:numtide/treefmt-nix"; + + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + treefmt-nix, + fenix, + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs { + inherit system; + }; + + packageName = "dcr"; + + rustToolchain = fenix.packages.${system}.stable.toolchain; + + rustPlatform = pkgs.makeRustPlatform { + cargo = rustToolchain; + rustc = rustToolchain; + }; + + treefmtEval = treefmt-nix.lib.evalModule pkgs { + projectRootFile = "flake.nix"; + + programs.alejandra.enable = true; + programs.rustfmt.enable = true; + programs.taplo.enable = true; + }; + + app = rustPlatform.buildRustPackage { + pname = packageName; + version = "0.6.9"; + + src = ./.; + + cargoLock.lockFile = ./Cargo.lock; + + nativeBuildInputs = [ + pkgs.pkg-config + pkgs.cmake + pkgs.perl + ]; + + buildInputs = pkgs.lib.optionals pkgs.stdenv.isDarwin [ + pkgs.darwin.apple_sdk.frameworks.Security + pkgs.darwin.apple_sdk.frameworks.SystemConfiguration + ]; + + # Tests require external services; run separately. + doCheck = false; + }; + in { + packages = { + default = app; + dcr = app; + }; + + apps = let + defaultApp = + (flake-utils.lib.mkApp { + drv = app; + }) + // { + meta.description = "Run ${packageName}"; + }; + in { + default = defaultApp; + dcr = defaultApp; + }; + + checks = { + dcr = app; + formatting = treefmtEval.config.build.check self; + }; + + formatter = treefmtEval.config.build.wrapper; + + devShells.default = pkgs.mkShell { + inputsFrom = [app]; + + packages = [ + rustToolchain + + pkgs.rust-analyzer + pkgs.just + pkgs.podman-compose + + treefmtEval.config.build.wrapper + ]; + + shellHook = '' + export RUST_SRC_PATH="${rustToolchain}/lib/rustlib/src/rust/library" + ''; + }; + }); +} From 8e21432764366ebb6cabd99648f562b80e22ae6c Mon Sep 17 00:00:00 2001 From: Alexandr_Croitor Date: Mon, 1 Jun 2026 13:23:12 +0300 Subject: [PATCH 4/4] chore: remove unused dev shell tools --- flake.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/flake.nix b/flake.nix index 53da1d0..6128b32 100644 --- a/flake.nix +++ b/flake.nix @@ -96,10 +96,7 @@ packages = [ rustToolchain - pkgs.rust-analyzer - pkgs.just - pkgs.podman-compose treefmtEval.config.build.wrapper ];