From b917a895f016734a69c0c3901fc94f7ddd8ed1fd Mon Sep 17 00:00:00 2001 From: Roman Lubij Date: Fri, 27 Mar 2026 18:58:06 +0100 Subject: [PATCH] Add justfile Update lock Add treefmt --- Justfile | 21 +++++++++++++++++++++ cpp/flake.lock | 6 +++--- cpp/flake.nix | 48 ++++++++++++++++++++++++------------------------ treefmt.toml | 3 +++ 4 files changed, 51 insertions(+), 27 deletions(-) create mode 100644 Justfile create mode 100644 treefmt.toml diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..59a8002 --- /dev/null +++ b/Justfile @@ -0,0 +1,21 @@ +update: + #!/usr/bin/env bash + echo "Starting update scan..." + for dir in */; do + dirname=${dir%/} + if [ -f "$dir/flake.nix" ]; then + echo "-------------------------------------------" + echo "Updating flake in: $dirname" + (cd "$dir" && nix flake update) + else + echo "Skipping $dirname (no flake.nix found)" + fi + done + echo "-------------------------------------------" + echo "Update complete." + +update-lang lang: + cd {{lang}} && nix flake update + +format: + treefmt . \ No newline at end of file diff --git a/cpp/flake.lock b/cpp/flake.lock index 5b7bff5..d9d86bb 100644 --- a/cpp/flake.lock +++ b/cpp/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1771932323, - "narHash": "sha256-3PadsTzuMJT/x0KmiD/Me1GG6rW8kaHoWVduSs0ue7o=", + "lastModified": 1774612448, + "narHash": "sha256-+uVDNwxihd82I6aZTgNvIXqFyLcfUBkg/Y0A8UBgycg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "89bb5c5da7a857869cc88ef9b856bffdff8af264", + "rev": "b55b0e0c856ac73c7f507336780f97aa7a9746e2", "type": "github" }, "original": { diff --git a/cpp/flake.nix b/cpp/flake.nix index 1bd81bc..21c3af9 100644 --- a/cpp/flake.nix +++ b/cpp/flake.nix @@ -2,30 +2,30 @@ description = "Central C++ Dev Shell"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small"; - outputs = - { self, nixpkgs }: - let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in - { - devShells.${system}.default = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - gcc - cmake - ninja - gdb - pkg-config - valgrind - bind - perf - ]; + outputs = { + self, + nixpkgs, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + devShells.${system}.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + gcc + cmake + ninja + gdb + pkg-config + valgrind + bind + perf + ]; - buildInputs = with pkgs; [ - ]; - shellHook = '' - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH - ''; - }; + buildInputs = with pkgs; [ + ]; + shellHook = '' + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH + ''; }; + }; } diff --git a/treefmt.toml b/treefmt.toml new file mode 100644 index 0000000..f267269 --- /dev/null +++ b/treefmt.toml @@ -0,0 +1,3 @@ +[formatter.alejandra] +command = "alejandra" +includes = ["*.nix"]