diff options
author | Cara Salter <cara@devcara.com> | 2022-05-27 16:29:49 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-05-27 16:29:49 -0400 |
commit | ca5c737f047119f31e42a8700b8ae1ad4fabd17a (patch) | |
tree | 9b0b7a202a081319500a719871ee62cf1b2b17f6 | |
download | homeworld-ca5c737f047119f31e42a8700b8ae1ad4fabd17a.tar.gz homeworld-ca5c737f047119f31e42a8700b8ae1ad4fabd17a.zip |
Initial Commit
-rw-r--r-- | .envrc | 1 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Cargo.lock | 7 | ||||
-rw-r--r-- | Cargo.toml | 8 | ||||
-rw-r--r-- | flake.lock | 74 | ||||
-rw-r--r-- | flake.nix | 33 | ||||
-rw-r--r-- | src/main.rs | 3 |
7 files changed, 128 insertions, 0 deletions
@@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0e71e34 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +.direnv/ diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..d7f03b8 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "homeworld" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..f96297e --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "homeworld" +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/flake.lock b/flake.lock new file mode 100644 index 0000000..1dbda15 --- /dev/null +++ b/flake.lock @@ -0,0 +1,74 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1652776076, + "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1653413650, + "narHash": "sha256-wojDHjb+eU80MPH+3HQaK0liUy8EgR95rvmCl24i58Y=", + "owner": "nix-community", + "repo": "naersk", + "rev": "69daaceebe12c070cd5ae69ba38f277bbf033695", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1653326962, + "narHash": "sha256-W8feCYqKTsMre4nAEpv5Kx1PVFC+hao/LwqtB2Wci/8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "41cc1d5d9584103be4108c1815c350e07c807036", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1653326962, + "narHash": "sha256-W8feCYqKTsMre4nAEpv5Kx1PVFC+hao/LwqtB2Wci/8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "41cc1d5d9584103be4108c1815c350e07c807036", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "naersk": "naersk", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..4764b03 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + naersk.url = "github:nix-community/naersk"; + }; + + outputs = { self, nixpkgs, flake-utils, naersk }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = nixpkgs.legacyPackages."${system}"; + naersk-lib = naersk.lib."${system}"; + in + rec { + # `nix build` + packages.homeworld = naersk-lib.buildPackage { + pname = "homeworld"; + root = ./.; + }; + defaultPackage = packages.homeworld; + + # `nix run` + apps.homeworld = flake-utils.lib.mkApp { + drv = packages.homeworld; + }; + defaultApp = apps.homeworld; + + # `nix develop` + devShell = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ rustc cargo ]; + }; + } + ); +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} |