bring in flake-utils
This commit is contained in:
parent
ac442d3813
commit
f4c39ef325
4 changed files with 84 additions and 19 deletions
10
TODO
10
TODO
|
@ -1,7 +1,13 @@
|
||||||
* add second build target `world.c`
|
* add second build target `world.c`
|
||||||
* add GitHub workflow to build all targets, upload/publish all artifacts
|
* add GitHub workflow to build all targets, upload/publish all artifacts
|
||||||
|
* deb, rpm, tgz of source
|
||||||
|
* Docker container on DockerHub, GitHub Container Repository (ghcr.io)
|
||||||
|
* containers could have multiple tags as in `latest` and `1.0.0`
|
||||||
* add Nix Flake
|
* add Nix Flake
|
||||||
* devshell
|
* devshell
|
||||||
* direnv/envrc
|
* direnv/envrc
|
||||||
* build windows
|
* build windows MSYS2
|
||||||
|
* formatting
|
||||||
|
* lint
|
||||||
|
* security audits
|
||||||
|
* Gitpod
|
||||||
|
|
69
flake.lock
69
flake.lock
|
@ -1,24 +1,75 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1659914493,
|
"lastModified": 1673956053,
|
||||||
"narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=",
|
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||||
"owner": "NixOS",
|
"owner": "edolstra",
|
||||||
"repo": "nixpkgs",
|
"repo": "flake-compat",
|
||||||
"rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf",
|
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"owner": "edolstra",
|
||||||
"ref": "nixos-21.05",
|
"repo": "flake-compat",
|
||||||
"type": "indirect"
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1694529238,
|
||||||
|
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1694532420,
|
||||||
|
"narHash": "sha256-eOebmMxt5B8nmW5u8P6BkYR9tLwcyq74fnsBBZmBSNQ=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "80616a47486f85bbe60650b6770cf8129333a26f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
20
flake.nix
20
flake.nix
|
@ -2,9 +2,16 @@
|
||||||
description = "An over-engineered Hello World in C";
|
description = "An over-engineered Hello World in C";
|
||||||
|
|
||||||
# Nixpkgs / NixOS version to use.
|
# Nixpkgs / NixOS version to use.
|
||||||
inputs.nixpkgs.url = "nixpkgs/nixos-21.05";
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
flake-compat = {
|
||||||
|
url = "github:edolstra/flake-compat";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs }:
|
outputs = { self, nixpkgs, flake-utils, flake-compat }:
|
||||||
let
|
let
|
||||||
|
|
||||||
# to work with older version of flakes
|
# to work with older version of flakes
|
||||||
|
@ -36,6 +43,7 @@
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook ];
|
nativeBuildInputs = [ autoreconfHook ];
|
||||||
|
enableParallelBuilding = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -46,12 +54,12 @@
|
||||||
inherit (nixpkgsFor.${system}) hello;
|
inherit (nixpkgsFor.${system}) hello;
|
||||||
});
|
});
|
||||||
|
|
||||||
# The default package for 'nix build'. This makes sense if the
|
# The default package for 'nix build'. This makes sense if the flake
|
||||||
# flake provides only one package or there is a clear "main"
|
# provides only one package or there is a clear "main" package.
|
||||||
# package.
|
|
||||||
defaultPackage = forAllSystems (system: self.packages.${system}.hello);
|
defaultPackage = forAllSystems (system: self.packages.${system}.hello);
|
||||||
|
|
||||||
# A NixOS module, if applicable (e.g. if the package provides a system service).
|
# A NixOS module, if applicable (e.g. if the package provides a system
|
||||||
|
# service).
|
||||||
nixosModules.hello =
|
nixosModules.hello =
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
|
4
hello.c
4
hello.c
|
@ -1,6 +1,6 @@
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
|
|
||||||
int main(int argc, char * * argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
printf("Hello Nixers!\n");
|
printf("Hello, world!\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue