From 0c5d27a013541167cb3f7c060f055bd2c69b1f1b Mon Sep 17 00:00:00 2001 From: Malte Tammena Date: Sat, 4 Nov 2023 11:44:12 +0100 Subject: [PATCH] flake-parts and new rust template --- .gitignore | 1 + flake.lock | 70 +++---- flake.nix | 220 ++++++++++++---------- rust/.envrc | 1 + rust/.gitignore | 4 + rust/Cargo.lock | 7 + rust/Cargo.toml | 8 + rust/flake.lock | 263 +++++++++++++++++++++++++++ rust/flake.nix | 128 +++++++++++++ rust/nix/packages/change-my-name.nix | 27 +++ rust/src/main.rs | 3 + 11 files changed, 601 insertions(+), 131 deletions(-) create mode 100644 rust/.envrc create mode 100644 rust/.gitignore create mode 100644 rust/Cargo.lock create mode 100644 rust/Cargo.toml create mode 100644 rust/flake.lock create mode 100644 rust/flake.nix create mode 100644 rust/nix/packages/change-my-name.nix create mode 100644 rust/src/main.rs diff --git a/.gitignore b/.gitignore index 92b2793..4841846 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .direnv +.pre-commit-config.yaml \ No newline at end of file diff --git a/flake.lock b/flake.lock index 7241b67..9734f7d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,54 +1,60 @@ { "nodes": { - "flake-utils": { - "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "fup": { + "flake-parts": { "inputs": { - "flake-utils": "flake-utils" + "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1657226504, - "narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=", - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a", + "lastModified": 1698882062, + "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", "type": "github" }, "original": { - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", + "owner": "hercules-ci", + "repo": "flake-parts", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1692447944, - "narHash": "sha256-fkJGNjEmTPvqBs215EQU4r9ivecV5Qge5cF/QDLVn3U=", - "path": "/nix/store/s4jqyj35hii03rs7j5n6vn7gpgp6ja81-source", - "rev": "d680ded26da5cf104dd2735a51e88d2d8f487b4d", - "type": "path" + "lastModified": 1699065553, + "narHash": "sha256-j8UmH8fqXcOgL6WrlMcvV2m2XQ6OzU0IBucyuJ0vnyQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8ab9c53eee434651ce170dee1d9727b974e9a6b6", + "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1698611440, + "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "root": { "inputs": { - "fup": "fup", + "flake-parts": "flake-parts", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 77161e2..6807645 100644 --- a/flake.nix +++ b/flake.nix @@ -1,120 +1,142 @@ { - description = "A very basic flake"; - inputs.fup.url = "github:gytis-ivaskevicius/flake-utils-plus"; + description = "All things development"; + inputs.flake-parts.url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=nixpkgs-unstable"; nixConfig = { nix = ["http://cache.home"]; }; - outputs = { + outputs = inputs @ { + flake-parts, self, - fup, - nixpkgs, + ... }: - fup.lib.eachSystem [fup.lib.system.x86_64-linux] (system: let - pkgs = import nixpkgs {inherit system;}; + flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86_64-linux"]; + perSystem = { + config, + self', + pkgs, + lib, + ... + }: let + mdpls = let + version = "30761508593d85b5743ae39c4209947740eec92d"; + in + pkgs.rustPlatform.buildRustPackage { + inherit version; + pname = "mdpls"; - mdpls = let - version = "30761508593d85b5743ae39c4209947740eec92d"; - in - pkgs.rustPlatform.buildRustPackage rec { - inherit version; - pname = "mdpls"; + src = pkgs.fetchFromGitHub { + owner = "euclio"; + repo = "mdpls"; + rev = version; + sha256 = "sha256-4n1MX8hS7JmKzaL8GfMq2q3IdwE4fvMmWOYo7rY+cdY="; + }; - src = pkgs.fetchFromGitHub { - owner = "euclio"; - repo = "mdpls"; - rev = version; - sha256 = "sha256-4n1MX8hS7JmKzaL8GfMq2q3IdwE4fvMmWOYo7rY+cdY="; + cargoSha256 = "sha256-J49A43BSCJGqaY7AX7XsoMwy6sgyaIx2Vz57Z1cFItc="; }; - cargoSha256 = "sha256-J49A43BSCJGqaY7AX7XsoMwy6sgyaIx2Vz57Z1cFItc="; + packagesSharedByAll = with pkgs; [ + diff-so-fancy + ]; + + scripts = { + beste-schule-set-missing-grades = pkgs.writeShellApplication { + name = "set-missing-grades"; + runtimeInputs = [ + pkgs.coreutils + pkgs.jq + pkgs.curl + ]; + text = builtins.readFile ./scripts/set-missing-grades.sh; + }; }; - packagesSharedByAll = with pkgs; [ - diff-so-fancy - ]; + shells = { + nix = { + name = "generic nix"; + packages = with pkgs; [ + alejandra + nil + ]; + }; + node = { + name = "generic node"; + packages = with pkgs; [ + nodejs + yarn + nodePackages.vls + nodePackages.typescript-language-server + nodePackages.yaml-language-server + nodePackages.vscode-json-languageserver-bin + nodePackages.vscode-html-languageserver-bin + nodePackages.vscode-css-languageserver-bin + ]; + }; + nodeIonic = { + name = "generic node + ionic"; + packages = + shells.node.packages + ++ (with pkgs; [ + android-studio + ]); + }; + php = { + name = "generic php"; + packages = with pkgs; [ + php + phpPackages.composer + ]; + }; + nodePhp = { + name = "generic node + php"; + packages = with shells; node.packages ++ php.packages; + }; + python = { + name = "generic python"; + packages = with pkgs; [ + python3Packages.python-lsp-server + ]; + }; + markdown = { + name = "generic markdown"; + packages = [mdpls]; + }; + "beste-schule" = { + name = "beste.schule"; + packages = + [ + scripts.beste-schule-set-missing-grades + ] + ++ shells.nodePhp.packages; + }; + }; + in { + devShells = pkgs.lib.attrsets.mapAttrs (name: value: + pkgs.mkShell (pkgs.lib.recursiveUpdate value { + packages = value.packages ++ packagesSharedByAll; + })) + shells; - scripts = { - beste-schule-set-missing-grades = pkgs.writeShellApplication { - name = "set-missing-grades"; - runtimeInputs = [ - pkgs.coreutils - pkgs.jq - pkgs.curl - ]; - text = builtins.readFile ./scripts/set-missing-grades.sh; + packages = { + inherit mdpls; }; }; + flake = { + hydraJobs = + builtins.mapAttrs (name: value: { + x86_64-linux = value; + }) + self.devShells.x86_64-linux; - shells = { - nix = { - name = "generic nix"; - packages = with pkgs; [ - alejandra - nil - ]; - }; - node = { - name = "generic node"; - packages = with pkgs; [ - nodejs - yarn - nodePackages.vls - nodePackages.typescript-language-server - nodePackages.yaml-language-server - nodePackages.vscode-json-languageserver-bin - nodePackages.vscode-html-languageserver-bin - nodePackages.vscode-css-languageserver-bin - ]; - }; - nodeIonic = { - name = "generic node + ionic"; - packages = - shells.node.packages - ++ (with pkgs; [ - android-studio - ]); - }; - php = { - name = "generic php"; - packages = with pkgs; [ - php - phpPackages.composer - ]; - }; - nodePhp = { - name = "generic node + php"; - packages = with shells; node.packages ++ php.packages; - }; - python = { - name = "generic python"; - packages = with pkgs; [ - python3Packages.python-lsp-server - ]; - }; - markdown = { - name = "generic markdown"; - packages = [mdpls]; - }; - "beste-schule" = { - name = "beste.schule"; - packages = [ - scripts.beste-schule-set-missing-grades - ] ++ shells.nodePhp.packages; + templates = { + rust = { + path = ./rust; + description = "Simple Rust + Nix template"; + }; }; }; - in { - devShells = pkgs.lib.attrsets.mapAttrs (name: value: - pkgs.mkShell (pkgs.lib.recursiveUpdate value { - packages = value.packages ++ packagesSharedByAll; - })) - shells; - - hydraJobs = self.devShells.${system}; - - packages = { - inherit mdpls; - }; - }); + }; } diff --git a/rust/.envrc b/rust/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/rust/.envrc @@ -0,0 +1 @@ +use flake diff --git a/rust/.gitignore b/rust/.gitignore new file mode 100644 index 0000000..2328d65 --- /dev/null +++ b/rust/.gitignore @@ -0,0 +1,4 @@ +.direnv +result* +target/ +.pre-commit-config.yaml diff --git a/rust/Cargo.lock b/rust/Cargo.lock new file mode 100644 index 0000000..0c2e81c --- /dev/null +++ b/rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "change-my-name" +version = "0.1.0" diff --git a/rust/Cargo.toml b/rust/Cargo.toml new file mode 100644 index 0000000..425a218 --- /dev/null +++ b/rust/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "change-my-name" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rust/flake.lock b/rust/flake.lock new file mode 100644 index 0000000..8b8ed0a --- /dev/null +++ b/rust/flake.lock @@ -0,0 +1,263 @@ +{ + "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1699078825, + "narHash": "sha256-Np1XuKxZG1J4AdMm6m9PogFTWHnvKvmyoILvAXUahFM=", + "owner": "nix-community", + "repo": "fenix", + "rev": "ec493cf412f94155daac4b95c95eb11ddcb347e5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1698882062, + "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1699065553, + "narHash": "sha256-j8UmH8fqXcOgL6WrlMcvV2m2XQ6OzU0IBucyuJ0vnyQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8ab9c53eee434651ce170dee1d9727b974e9a6b6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1698611440, + "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1685801374, + "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1689261696, + "narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "df1eee2aa65052a18121ed4971081576b25d6b5c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1695644571, + "narHash": "sha256-asS9dCCdlt1lPq0DLwkVBbVoEKuEuz+Zi3DG7pR/RxA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6500b4580c2a1f3d0f980d32d285739d8e156d92", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks-nix": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1698852633, + "narHash": "sha256-Hsc/cCHud8ZXLvmm8pxrXpuaPEeNaaUttaCvtdX/Wug=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "dec10399e5b56aa95fcd530e0338be72ad6462a0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "fenix": "fenix", + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs", + "pre-commit-hooks-nix": "pre-commit-hooks-nix", + "treefmt-nix": "treefmt-nix" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1698994377, + "narHash": "sha256-PY6A0JiJmv5ef0uf10ediOznKbqCKlqgT3Vtu+Z5fRQ=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "0fec61aabf62faab0c9f9b33b40ea5d5977792c8", + "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_3" + }, + "locked": { + "lastModified": 1698438538, + "narHash": "sha256-AWxaKTDL3MtxaVTVU5lYBvSnlspOS0Fjt8GxBgnU0Do=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "5deb8dc125a9f83b65ca86cf0c8167c46593e0b1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/rust/flake.nix b/rust/flake.nix new file mode 100644 index 0000000..ea5b41d --- /dev/null +++ b/rust/flake.nix @@ -0,0 +1,128 @@ +{ + inputs.flake-parts.url = "github:hercules-ci/flake-parts"; + inputs.treefmt-nix.url = "github:numtide/treefmt-nix"; + inputs.pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + inputs.fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = inputs @ { + self, + flake-parts, + treefmt-nix, + pre-commit-hooks-nix, + fenix, + ... + }: + flake-parts.lib.mkFlake {inherit inputs self;} { + imports = [ + treefmt-nix.flakeModule + pre-commit-hooks-nix.flakeModule + ]; + + systems = [ + "x86_64-linux" + ]; + + flake.hydraJobs.packages.x86_64-linux = self.packages.x86_64-linux; + flake.hydraJobs.devShells.x86_64-linux = self.devShells.x86_64-linux; + flake.hydraJobs.checks.x86_64-linux = self.checks.x86_64-linux; + + perSystem = { + self', + pkgs, + config, + system, + ... + }: let + rustToolchain = with fenix.packages.${system}; + combine [ + (complete.withComponents [ + "cargo" + "clippy" + "rust-src" + "rustc" + "rustfmt" + ]) + rust-analyzer + ]; + + rustPlatform = pkgs.makeRustPlatform { + cargo = rustToolchain; + rustc = rustToolchain; + }; + + rename = pkgs.writeShellApplication { + name = "rename"; + runtimeInputs = [ + pkgs.fd + pkgs.coreutils + ]; + text = '' + stat nix/packages/change-my-name.nix 2>/dev/null >/dev/null || echo "Can only be done once!" + newName="$1" + pushd "$(git rev-parse --show-toplevel)" + fd --type f --exec sed "s/change-my-name/$newName/g" -i '{}' + mv nix/packages/change-my-name.nix "nix/packages/$newName.nix" + ''; + }; + in { + pre-commit.check.enable = true; + pre-commit.settings.hooks.markdownlint.enable = true; + pre-commit.settings.hooks.nil.enable = true; + pre-commit.settings.hooks.format = { + enable = true; + entry = "${self'.formatter}/bin/fmt"; + pass_filenames = false; + }; + pre-commit.settings.hooks.my-clippy = { + enable = true; + name = "clippy"; + description = "Lint Rust code."; + entry = "${rustToolchain}/bin/cargo-clippy clippy --offline -- -D warnings"; + files = "\\.rs$"; + pass_filenames = false; + }; + pre-commit.settings.hooks.my-cargo-check = { + enable = true; + description = "check the cargo package for errors."; + entry = "${rustToolchain}/bin/cargo check --offline"; + files = "\\.rs$"; + pass_filenames = false; + }; + + treefmt.projectRootFile = "flake.nix"; + treefmt.programs = { + rustfmt.enable = true; + alejandra.enable = true; + }; + treefmt.flakeFormatter = true; + + packages.change-my-name = pkgs.callPackage ./nix/packages/change-my-name.nix {inherit rustPlatform;}; + packages.default = self'.packages.change-my-name; + + devShells.default = pkgs.mkShell { + name = "change-my-name"; + shellHook = '' + ${config.pre-commit.installationScript} + # This is only used to prevent the literal name from appearing here, as the rename would find it! + oldName=$(echo 'change_my_name' | sed 's/_/-/g') + echo -e 1>&2 "\n\n Welcome to the development shell!" + stat "nix/packages/$oldName.nix" 2>/dev/null >/dev/null && echo -e 1>&2 "\n \033[31mChange this projects name with \033[1mrename NEW-NAME\033[0m" + echo -e 1>&2 "\n" + ''; + nativeBuildInputs = [ + config.treefmt.package + pkgs.cargo-workspaces + pkgs.nil + rustToolchain + rename + ]; + RUST_LOG = "trace"; + }; + devShells.pre-commit = config.pre-commit.devShell; + }; + }; +} diff --git a/rust/nix/packages/change-my-name.nix b/rust/nix/packages/change-my-name.nix new file mode 100644 index 0000000..85dadc7 --- /dev/null +++ b/rust/nix/packages/change-my-name.nix @@ -0,0 +1,27 @@ +{ + rustPlatform, + lib, +}: let + config = lib.trivial.importTOML ../../Cargo.toml; +in + rustPlatform.buildRustPackage { + pname = config.package.name; + version = config.package.version; + + src = lib.sources.cleanSource ../..; + + cargoDeps = { + lockFile = "../../Cargo.lock"; + }; + + cargoLock = { + lockFile = ../../Cargo.lock; + }; + + meta = { + # description = "Awesome program description"; + # homepage = "https://your.new.homepage"; + # license = licenses.mit; + # maintainers = []; + }; + } diff --git a/rust/src/main.rs b/rust/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/rust/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}