commit 582faef52c632c8ac388553c379b35f1d9dcc880 Author: bluepython508 Date: Tue Dec 30 13:20:11 2025 +0000 Initial Commit diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..34c99b2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,8 @@ +{ + outputs = {self}: { + templates.default = self.templates.naersk; + templates.naersk = { + path = ./naersk; + }; + }; +} diff --git a/naersk/.envrc b/naersk/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/naersk/.envrc @@ -0,0 +1 @@ +use flake diff --git a/naersk/.gitignore b/naersk/.gitignore new file mode 100644 index 0000000..052de26 --- /dev/null +++ b/naersk/.gitignore @@ -0,0 +1,3 @@ +/target +/result +/.direnv diff --git a/naersk/Cargo.toml b/naersk/Cargo.toml new file mode 100644 index 0000000..3d0e65f --- /dev/null +++ b/naersk/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rust-nix-template" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/naersk/flake.nix b/naersk/flake.nix new file mode 100644 index 0000000..0ba3c89 --- /dev/null +++ b/naersk/flake.nix @@ -0,0 +1,31 @@ +{ + description = ""; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + naersk.url = "github:nix-community/naersk"; + }; + + outputs = { self, nixpkgs, naersk }: let + inherit (nixpkgs) lib; + systems = ["x86_64-linux" "aarch64-linux"]; + eachSystem = f: lib.genAttrs systems (system: f { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + naersk = nixpkgs.legacyPackages.${system}.callPackage naersk {}; + ownPkgs = self.packages.${system}; + }); + in { + packages = eachSystem ({naersk, ...}: { + default = naersk.buildPackage { + src = ./.; + }; + }); + devShells = eachSystem ({pkgs, ownPkgs, ...}: { + default = pkgs.mkShell { + inputsFrom = [ownPkgs.default]; + packages = [pkgs.clippy pkgs.rust-analyzer pkgs.rustfmt]; + }; + }); + }; +} diff --git a/naersk/src/main.rs b/naersk/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/naersk/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}