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 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
|
||||
* devshell
|
||||
* direnv/envrc
|
||||
* build windows
|
||||
|
||||
* build windows MSYS2
|
||||
* formatting
|
||||
* lint
|
||||
* security audits
|
||||
* Gitpod
|
||||
|
|
69
flake.lock
69
flake.lock
|
@ -1,24 +1,75 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1659914493,
|
||||
"narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf",
|
||||
"lastModified": 1673956053,
|
||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-21.05",
|
||||
"type": "indirect"
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"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": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"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",
|
||||
|
|
20
flake.nix
20
flake.nix
|
@ -2,9 +2,16 @@
|
|||
description = "An over-engineered Hello World in C";
|
||||
|
||||
# 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
|
||||
|
||||
# to work with older version of flakes
|
||||
|
@ -36,6 +43,7 @@
|
|||
src = ./.;
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook ];
|
||||
enableParallelBuilding = true;
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -46,12 +54,12 @@
|
|||
inherit (nixpkgsFor.${system}) hello;
|
||||
});
|
||||
|
||||
# The default package for 'nix build'. This makes sense if the
|
||||
# flake provides only one package or there is a clear "main"
|
||||
# package.
|
||||
# The default package for 'nix build'. This makes sense if the flake
|
||||
# provides only one package or there is a clear "main" package.
|
||||
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 =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
|
4
hello.c
4
hello.c
|
@ -1,6 +1,6 @@
|
|||
#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