This commit is contained in:
parent
9e05fafbcb
commit
908991eb68
|
@ -1,10 +1,13 @@
|
|||
on: push
|
||||
jobs:
|
||||
Publish:
|
||||
runs-on: docker
|
||||
runs-on: flakes-action
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
name: Checkout
|
||||
- name: Build
|
||||
run: |
|
||||
echo "Hello World!"
|
||||
nix build
|
||||
- name: Run
|
||||
run: |
|
||||
./result/bin/hello
|
||||
|
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
result/
|
26
flake.lock
Normal file
26
flake.lock
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1695673361,
|
||||
"narHash": "sha256-Y8TzvhN7zBKooJrIQ0FjKZSZ0iuistIURCx89C4DPXE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0fbc32585c7617c1fb7b7acbb1db9f13d54c3d04",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
24
flake.nix
Normal file
24
flake.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
description = "A flake for building Hello World";
|
||||
|
||||
inputs.nixpkgs.url = github:NixOS/nixpkgs;
|
||||
|
||||
outputs = { self, nixpkgs }: {
|
||||
defaultPackage.x86_64-linux =
|
||||
with import nixpkgs { system = "x86_64-linux"; };
|
||||
stdenv.mkDerivation {
|
||||
name = "hello";
|
||||
src = self;
|
||||
buildPhase = "cc -o hello ./hello.c";
|
||||
installPhase = "mkdir -p $out/bin; install -t $out/bin hello";
|
||||
};
|
||||
defaultPackage.aarch64-darwin =
|
||||
with import nixpkgs { system = "aarch64-darwin"; };
|
||||
stdenv.mkDerivation {
|
||||
name = "hello";
|
||||
src = self;
|
||||
buildPhase = "cc -o hello ./hello.c";
|
||||
installPhase = "mkdir -p $out/bin; install -t $out/bin hello";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue