Skip to content

Commit

Permalink
feat(pkgs): add headscale beta version (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunziping2016 authored Jul 31, 2024
1 parent 788b6a2 commit 3424d8f
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 14 deletions.
3 changes: 1 addition & 2 deletions flake/devshell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
jq
sops
ssh-to-age
nixd
nixpkgs-fmt
nvfetcher
];
devshell.startup = {
nixago.text = config.nixago.shellHook;
Expand Down
23 changes: 22 additions & 1 deletion pkgs/_sources/generated.json
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
{}
{
"headscale": {
"cargoLocks": null,
"date": null,
"extract": null,
"name": "headscale",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "juanfont",
"repo": "headscale",
"rev": "v0.23.0-beta1",
"sha256": "sha256-uOaVK+3/DoUDbccelGYRx9zwAG6wYLywYbNN+7epnk0=",
"type": "github"
},
"version": "v0.23.0-beta1"
}
}
19 changes: 12 additions & 7 deletions pkgs/_sources/generated.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# This file was generated by nvfetcher, please do not modify it manually.
{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }:
{
fetchgit,
fetchurl,
fetchFromGitHub,
dockerTools,
}:
{

headscale = {
pname = "headscale";
version = "v0.23.0-beta1";
src = fetchFromGitHub {
owner = "juanfont";
repo = "headscale";
rev = "v0.23.0-beta1";
fetchSubmodules = false;
sha256 = "sha256-uOaVK+3/DoUDbccelGYRx9zwAG6wYLywYbNN+7epnk0=";
};
};
}
8 changes: 5 additions & 3 deletions pkgs/flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
perSystem =
{ pkgs, config, ... }:
let
_ = pkgs.callPackages (import ./_sources/generated.nix) { };
sources = pkgs.callPackages (import ./_sources/generated.nix) { };
in
{
overlayAttrs = {
inherit (config.packages);
inherit (config.packages) headscale-beta;
};
packages = {
headscale-beta = pkgs.callPackage (import ./headscale-beta) { inherit sources; };
};
packages = { };
};
}
31 changes: 31 additions & 0 deletions pkgs/headscale-beta/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
lib,
headscale,
sources,
buildGoModule,
}:
let
source = sources.headscale;
in
headscale.override {
buildGoModule =
args:
buildGoModule (
args
// rec {
inherit (source) pname src;
version = lib.strings.removePrefix "v" source.version;

# no longer needs the backported patch juanfont/headscale#1697
patches = [ ];

ldflags = [
"-s"
"-w"
"-X github.com/juanfont/headscale/cmd/headscale/cli.Version=v${version}"
];

vendorHash = "sha256-EorT2AVwA3usly/LcNor6r5UIhLCdj3L4O4ilgTIC2o=";
}
);
}
4 changes: 3 additions & 1 deletion pkgs/nvfetcher.toml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@

[headscale]
src.github_tag = "juanfont/headscale"
fetch.github = "juanfont/headscale"

0 comments on commit 3424d8f

Please sign in to comment.