Add flake.nix

This commit is contained in:
2025-04-15 20:49:16 +02:00
parent f488a08851
commit 6f7b89f2a2
2 changed files with 56 additions and 0 deletions

27
flake.lock generated Normal file
View File

@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1744463964,
"narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

29
flake.nix Normal file
View File

@@ -0,0 +1,29 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, ... }: let
forAllSystems = f: (nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: let
pkgs = import nixpkgs { inherit system; };
in f { inherit pkgs system; } ));
in {
packages = forAllSystems ({pkgs, system, ...}: {
dhcpv6stateless = pkgs.rustPlatform.buildRustPackage rec {
pname = "dhcpv6stateless";
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
};
default = self.packages."${system}".dhcpv6stateless;
});
hydraJobs = {
inherit (self)
packages;
};
};
}