nix: Update Nix flake

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
This commit is contained in:
Steffen Vogel
2024-06-11 03:47:35 +02:00
committed by Steffen Vogel
parent 12e34eca1b
commit 22fc92cd3e
7 changed files with 75 additions and 97 deletions

View File

@@ -7,10 +7,6 @@ Files: website/static/CNAME pkg/selfupdate/keys/09BE3BAE8D55D4CD8579285A9675EAC3
Copyright: 2023 Steffen Vogel <post@steffenvogel.de> Copyright: 2023 Steffen Vogel <post@steffenvogel.de>
License: CC0-1.0 License: CC0-1.0
Files: go.sum scripts/go.sum website/package.json website/yarn.lock nix/flake.lock docs/usage/** .renovaterc.json *.drawio *.svg Files: go.sum scripts/go.sum website/package.json website/yarn.lock nix/flake.lock docs/usage/** .renovaterc.json *.drawio *.svg flake.lock
Copyright: 2023 Steffen Vogel <post@steffenvogel.de> Copyright: 2023 Steffen Vogel <post@steffenvogel.de>
License: Apache-2.0 License: Apache-2.0
Files: nix/flake.lock
Copyright: 2023 Philipp Jungkamp <p.jungkamp@gmx.net>
License: Apache-2.0

View File

@@ -5,11 +5,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1706830856, "lastModified": 1717285511,
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1708214945, "lastModified": 1717893485,
"narHash": "sha256-LwP/lKuPasVLqUX+XFf6DbW4BWmM7o5K5unx/dXCJWY=", "narHash": "sha256-WMU6ZRZrBgEUDIF0siu2aIyVAXcxfElSwzZtS/mSpN4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e015f24e508c549ab2ab2ad74dcdad3ae07513fe", "rev": "3bcedce9f4de37570242faf16e1e143583407eab",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -36,20 +36,14 @@
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"dir": "lib", "lastModified": 1717284937,
"lastModified": 1706550542, "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=",
"narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", "type": "tarball",
"owner": "NixOS", "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
"repo": "nixpkgs",
"rev": "97b17f32362e475016f942bbdfda4a4a72a8a652",
"type": "github"
}, },
"original": { "original": {
"dir": "lib", "type": "tarball",
"owner": "NixOS", "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
} }
}, },
"root": { "root": {

41
flake.nix Normal file
View File

@@ -0,0 +1,41 @@
# SPDX-FileCopyrightText: 2023 Philipp Jungkamp <p.jungkamp@gmx.net>
# SPDX-License-Identifier: Apache-2.0
{
description = "cunīcu is a user-space daemon managing WireGuard® interfaces to establish a mesh of peer-to-peer VPN connections in harsh network environments.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs =
inputs@{
nixpkgs,
self,
flake-parts,
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
perSystem =
{
pkgs,
self',
system,
...
}:
let
pkgs = import nixpkgs { inherit system; };
in
{
formatter = pkgs.nixfmt-rfc-style;
devShells.default = import ./nix/dev.nix { inherit pkgs self'; };
packages = {
cunicu = import ./nix/default.nix { inherit pkgs; };
packages.default = self'.packages.cunicu;
};
};
};
}

View File

@@ -12,7 +12,11 @@ buildGoModule {
inherit src; inherit src;
CGO_ENABLED = 0; CGO_ENABLED = 0;
# These packages contain networking dependent tests which fail in the sandbox # These packages contain networking dependent tests which fail in the sandbox
excludedPackages = ["pkg/config" "pkg/selfupdate" "pkg/tty"]; excludedPackages = [
"pkg/config"
"pkg/selfupdate"
"pkg/tty"
];
postBuild = '' postBuild = ''
cunicu=$GOPATH/bin/cunicu cunicu=$GOPATH/bin/cunicu
$cunicu docs --with-frontmatter $cunicu docs --with-frontmatter

View File

@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2023 Philipp Jungkamp <p.jungkamp@gmx.net> # SPDX-FileCopyrightText: 2023 Philipp Jungkamp <p.jungkamp@gmx.net>
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
{ pkgs ? import <nixpkgs> {} }: {
pkgs.callPackage ./cunicu.nix { pkgs ? import <nixpkgs> { },
src = ./..; }:
} pkgs.callPackage ./cunicu.nix { src = ./..; }

View File

@@ -1,10 +1,6 @@
# SPDX-FileCopyrightText: 2023 Philipp Jungkamp <p.jungkamp@gmx.net> # SPDX-FileCopyrightText: 2023 Philipp Jungkamp <p.jungkamp@gmx.net>
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
{ { self', pkgs, ... }:
self',
pkgs,
...
}:
pkgs.mkShell { pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
yarn-berry yarn-berry
@@ -19,8 +15,7 @@ pkgs.mkShell {
protoc-gen-go protoc-gen-go
protoc-gen-go-grpc protoc-gen-go-grpc
(buildGoModule (buildGoModule {
{
name = "gocov-merger"; name = "gocov-merger";
src = fetchFromGitHub { src = fetchFromGitHub {
@@ -36,7 +31,5 @@ pkgs.mkShell {
# coturn # coturn
]; ];
inputsFrom = [ inputsFrom = [ self'.packages.cunicu ];
self'.packages.cunicu
];
} }

View File

@@ -1,50 +0,0 @@
# SPDX-FileCopyrightText: 2023 Philipp Jungkamp <p.jungkamp@gmx.net>
# SPDX-License-Identifier: Apache-2.0
{
description = "cunīcu is a user-space daemon managing WireGuard® interfaces to establish a mesh of peer-to-peer VPN connections in harsh network environments.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs @ {
nixpkgs,
self,
flake-parts,
}
:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
perSystem = {
pkgs,
self',
system,
...
}: let
go122 = final: prev: {
go = prev.go_1_22;
buildGoModule = prev.buildGo122Module;
buildGoPackage = prev.buildGo122Package;
};
pkgs = import nixpkgs {
inherit system;
overlays = [go122];
};
in {
formatter = pkgs.alejandra;
devShells.default = import ./dev.nix {
inherit pkgs self';
};
packages = {
cunicu = import ./default.nix {
inherit pkgs;
};
packages.default = self'.packages.cunicu;
};
};
};
}