]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: use Nix flake
authorVincent Bernat <vincent@bernat.ch>
Sun, 6 Feb 2022 08:53:41 +0000 (09:53 +0100)
committerVincent Bernat <vincent@bernat.ch>
Sun, 6 Feb 2022 08:56:10 +0000 (09:56 +0100)
default.nix [deleted file]
flake.lock [new file with mode: 0644]
flake.nix [new file with mode: 0644]

diff --git a/default.nix b/default.nix
deleted file mode 100644 (file)
index 4b33658..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-{ pkgs ? import <nixpkgs> {}
-}:
-
-with pkgs;
-stdenv.mkDerivation rec {
-  name = "lldpd";
-  src = nix-gitignore.gitignoreSource [] ./.;
-  configureFlags = [
-    "--localstatedir=/var"
-    "--enable-pie"
-    "--with-snmp"
-    "--with-systemdsystemunitdir=\${out}/lib/systemd/system"
-  ];
-
-  nativeBuildInputs = [ pkgconfig autoreconfHook git check ];
-  buildInputs = [ libevent readline net-snmp openssl ];
-  outputs = [ "out" "dev" "man" "doc" ];
-}
diff --git a/flake.lock b/flake.lock
new file mode 100644 (file)
index 0000000..972ca2e
--- /dev/null
@@ -0,0 +1,42 @@
+{
+  "nodes": {
+    "flake-utils": {
+      "locked": {
+        "lastModified": 1642700792,
+        "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1644135594,
+        "narHash": "sha256-EV+8+YsN0apcVm+rBRc9iY1HzWU1gXqGIXSoYIU8QZU=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "bb96e481b317c770281c1bfd9e6face9bfe0888f",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "flake-utils": "flake-utils",
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644 (file)
index 0000000..e548477
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,27 @@
+{
+  inputs = {
+    nixpkgs.url = "github:nixos/nixpkgs";
+    flake-utils.url = "github:numtide/flake-utils";
+  };
+  outputs = { self, flake-utils, ... }@inputs:
+    flake-utils.lib.eachDefaultSystem (system:
+      let
+        pkgs = inputs.nixpkgs.legacyPackages."${system}";
+      in
+      {
+        defaultPackage = pkgs.stdenv.mkDerivation rec {
+          name = "lldpd";
+          src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
+          configureFlags = [
+            "--localstatedir=/var"
+            "--enable-pie"
+            "--with-snmp"
+            "--with-systemdsystemunitdir=\${out}/lib/systemd/system"
+          ];
+
+          nativeBuildInputs = with pkgs; [ pkgconfig autoreconfHook git check ];
+          buildInputs = with pkgs; [ libevent readline net-snmp openssl ];
+          outputs = [ "out" "dev" "man" "doc" ];
+        };
+      });
+}