diff --git a/.gitignore b/.gitignore index f379076..51c07cf 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ !flake.lock !LICENSE !README.md +!hello +!hello/** +!test +!test/** diff --git a/hello/.gitignore b/hello/.gitignore new file mode 100644 index 0000000..e69d076 --- /dev/null +++ b/hello/.gitignore @@ -0,0 +1,7 @@ +# ignore all +* + +# and then whitelist what you want to track +!.gitignore +!test +!test/** diff --git a/hello/test/.gitignore b/hello/test/.gitignore new file mode 100644 index 0000000..59e5d58 --- /dev/null +++ b/hello/test/.gitignore @@ -0,0 +1,7 @@ +# ignore all +* + +# and then whitelist what you want to track +!.gitignore +!hi +!hi/** diff --git a/hello/test/hi/.gitignore b/hello/test/hi/.gitignore new file mode 100644 index 0000000..ce54152 --- /dev/null +++ b/hello/test/hi/.gitignore @@ -0,0 +1,9 @@ +# ignore all +* + +# and then whitelist what you want to track +!flake.lock +!CONTRIBUTE.md +!.gitignore +!flake.nix +!README.md diff --git a/hello/test/hi/CONTRIBUTE.md b/hello/test/hi/CONTRIBUTE.md new file mode 100644 index 0000000..b87a18f --- /dev/null +++ b/hello/test/hi/CONTRIBUTE.md @@ -0,0 +1,36 @@ +# Contribute to hello/test/hi: + +## Develop: + +### Repository Structure: + +| File or Folder | What does it do? | When should you modify it? | +| :------------- | :--------------- | :------------------------- | +| | | | +## Test: + +## Document: + +## Deploy: + + diff --git a/hello/test/hi/README.md b/hello/test/hi/README.md new file mode 100644 index 0000000..f501133 --- /dev/null +++ b/hello/test/hi/README.md @@ -0,0 +1,46 @@ +# hello/test/hi + + + + +## How to use hello/test/hi: + +### Installation: + +### API Methods | Modules: + +## How Project Name works: + +## Roadmap: + +## [Contribute](./CONTRIBUTE.md) diff --git a/hello/test/hi/flake.lock b/hello/test/hi/flake.lock new file mode 100644 index 0000000..b3e93c6 --- /dev/null +++ b/hello/test/hi/flake.lock @@ -0,0 +1,40 @@ +{ + "nodes": { + "flake-schemas": { + "locked": { + "lastModified": 1772200446, + "narHash": "sha256-hcUPpu25+VLvQsf961cu4zTeA//Ab35MaMjqSS/Ojqc=", + "rev": "d6a6b7cfa25bea552c197c9e227cd293ff801dbb", + "revCount": 115, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.3.0/019c9f61-e746-760e-a1fe-53f05b10d026/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%2A" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1771848320, + "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "revCount": 953160, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.953160%2Brev-2fc6539b481e1d2569f25f8799236694180c0993/019c8e05-d2f6-7c7e-9ead-612154b18bfb/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A" + } + }, + "root": { + "inputs": { + "flake-schemas": "flake-schemas", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/hello/test/hi/flake.nix b/hello/test/hi/flake.nix new file mode 100644 index 0000000..4febc57 --- /dev/null +++ b/hello/test/hi/flake.nix @@ -0,0 +1,92 @@ +# see parse-manifest-flake_nix.nix to find out how +# project-lint, project-lint-semver, project-build, and +# project-test are run against this flake +{ + description = "build and test for hi"; + + inputs = { + flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*"; + + nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*"; + }; + + outputs = { + flake-schemas, + nixpkgs, + self, + ... + }: let + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + forEachSupportedSystem = f: + nixpkgs.lib.genAttrs supportedSystems (system: + f { + pkgs = import nixpkgs {inherit system;}; + }); + in { + # https://determinate.systems/blog/flake-schemas/#defining-your-own-schemas + schemas = + flake-schemas.schemas + // { + nixVersion = { + version = 1; + doc = "The nix version required to run this flake"; + type = "string"; + }; + }; + + # nixVersion specifies the nix version needed to run this flake + nixVersion = "2.33.1"; + + packages = forEachSupportedSystem ({pkgs}: { + default = pkgs.stdenv.mkDerivation { + name = "hi"; + src = "../../../"; # Include entire repo as source + version = "0.0.3"; + + nativeBuildInputs = with pkgs; [ + coreutils + # INCLUDE THE TOOLS YOU NEED TO BUILD YOUR PACKAGE HERE + ]; + + phases = [ + # "unpackPhase" + # "patchPhase" + # "configurePhase" + "buildPhase" + # "checkPhase" + # "installPhase" + # "fixupPhase" + # "installCheckPhase" + ]; + + buildPhase = '' + + # make dirs included in package FHS + # see https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html + # + mkdir -p "$out"/{bin,lib,share,include} + + # copy executables to bin/ so they can be nix run + # copy libraries to lib/ + # copy docs, data to share/ + # copy headers to include/ + ''; + }; + }); + + checks = forEachSupportedSystem ({pkgs}: { + exampleTest = + pkgs.runCommand "exampleTest" { + nativeBuildInputs = [self.packages.${pkgs.system}.default]; + } '' + # name of bin to run default package + echo "test passed" > "$out" + ''; + }); + }; +} diff --git a/test/.gitignore b/test/.gitignore new file mode 100644 index 0000000..50dbb9d --- /dev/null +++ b/test/.gitignore @@ -0,0 +1,7 @@ +# ignore all +* + +# and then whitelist what you want to track +!.gitignore +!another +!another/** diff --git a/test/another/.gitignore b/test/another/.gitignore new file mode 100644 index 0000000..ab39d47 --- /dev/null +++ b/test/another/.gitignore @@ -0,0 +1,9 @@ +# ignore all +* + +# and then whitelist what you want to track +!CONTRIBUTE.md +!flake.lock +!.gitignore +!README.md +!flake.nix diff --git a/test/another/CONTRIBUTE.md b/test/another/CONTRIBUTE.md new file mode 100644 index 0000000..24a9c7e --- /dev/null +++ b/test/another/CONTRIBUTE.md @@ -0,0 +1,36 @@ +# Contribute to test/another: + +## Develop: + +### Repository Structure: + +| File or Folder | What does it do? | When should you modify it? | +| :------------- | :--------------- | :------------------------- | +| | | | +## Test: + +## Document: + +## Deploy: + + diff --git a/test/another/README.md b/test/another/README.md new file mode 100644 index 0000000..0f6f529 --- /dev/null +++ b/test/another/README.md @@ -0,0 +1,46 @@ +# test/another + + + + +## How to use test/another: + +### Installation: + +### API Methods | Modules: + +## How Project Name works: + +## Roadmap: + +## [Contribute](./CONTRIBUTE.md) diff --git a/test/another/flake.lock b/test/another/flake.lock new file mode 100644 index 0000000..b3e93c6 --- /dev/null +++ b/test/another/flake.lock @@ -0,0 +1,40 @@ +{ + "nodes": { + "flake-schemas": { + "locked": { + "lastModified": 1772200446, + "narHash": "sha256-hcUPpu25+VLvQsf961cu4zTeA//Ab35MaMjqSS/Ojqc=", + "rev": "d6a6b7cfa25bea552c197c9e227cd293ff801dbb", + "revCount": 115, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.3.0/019c9f61-e746-760e-a1fe-53f05b10d026/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%2A" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1771848320, + "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "revCount": 953160, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.953160%2Brev-2fc6539b481e1d2569f25f8799236694180c0993/019c8e05-d2f6-7c7e-9ead-612154b18bfb/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A" + } + }, + "root": { + "inputs": { + "flake-schemas": "flake-schemas", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/test/another/flake.nix b/test/another/flake.nix new file mode 100644 index 0000000..7ca42d7 --- /dev/null +++ b/test/another/flake.nix @@ -0,0 +1,92 @@ +# see parse-manifest-flake_nix.nix to find out how +# project-lint, project-lint-semver, project-build, and +# project-test are run against this flake +{ + description = "build and test for another"; + + inputs = { + flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*"; + + nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*"; + }; + + outputs = { + flake-schemas, + nixpkgs, + self, + ... + }: let + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + forEachSupportedSystem = f: + nixpkgs.lib.genAttrs supportedSystems (system: + f { + pkgs = import nixpkgs {inherit system;}; + }); + in { + # https://determinate.systems/blog/flake-schemas/#defining-your-own-schemas + schemas = + flake-schemas.schemas + // { + nixVersion = { + version = 1; + doc = "The nix version required to run this flake"; + type = "string"; + }; + }; + + # nixVersion specifies the nix version needed to run this flake + nixVersion = "2.33.1"; + + packages = forEachSupportedSystem ({pkgs}: { + default = pkgs.stdenv.mkDerivation { + name = "another"; + src = "../../"; # Include entire repo as source + version = "0.3.2"; + + nativeBuildInputs = with pkgs; [ + coreutils + # INCLUDE THE TOOLS YOU NEED TO BUILD YOUR PACKAGE HERE + ]; + + phases = [ + # "unpackPhase" + # "patchPhase" + # "configurePhase" + "buildPhase" + # "checkPhase" + # "installPhase" + # "fixupPhase" + # "installCheckPhase" + ]; + + buildPhase = '' + + # make dirs included in package FHS + # see https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html + # + mkdir -p "$out"/{bin,lib,share,include} + + # copy executables to bin/ so they can be nix run + # copy libraries to lib/ + # copy docs, data to share/ + # copy headers to include/ + ''; + }; + }); + + checks = forEachSupportedSystem ({pkgs}: { + exampleTest = + pkgs.runCommand "exampleTest" { + nativeBuildInputs = [self.packages.${pkgs.system}.default]; + } '' + # name of bin to run default package + echo "test passed" > "$out" + ''; + }); + }; +}