Rewrite to flake-utils

This commit is contained in:
Andreas Zweili 2024-04-09 19:59:40 +02:00
parent c677343b54
commit cfacdf4e58
2 changed files with 53 additions and 26 deletions

View File

@ -1,5 +1,23 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1711163522,
@ -18,8 +36,24 @@
},
"root": {
"inputs": {
"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",

View File

@ -2,25 +2,21 @@
description = "A simple flake to generate DKIM reports.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ self, nixpkgs }:
let
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
forEachSystem = nixpkgs.lib.genAttrs systems;
in
{
packages = forEachSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
self,
flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
packages = rec {
dkim-report = pkgs.writeShellApplication {
name = "reports";
runtimeInputs = [
@ -29,15 +25,12 @@
];
text = (builtins.readFile ./reports.sh);
};
default = self.packages.${system}.dkim-report;
}
);
apps = forEachSystem (system: {
dkim-report = {
type = "app";
program = "${self.packages.${system}.dkim-report}/bin/reports";
default = dkim-report;
};
default = self.apps.${system}.dkim-report;
});
};
apps = rec {
dkim-report = flake-utils.lib.mkApp { drv = self.packages.${system}.dkim-report; };
default = dkim-report;
};
}
);
}