Skip to content

Commit

Permalink
Add support for darwin and update flake
Browse files Browse the repository at this point in the history
  • Loading branch information
storvik committed Oct 18, 2024
1 parent e07ff3d commit a684e7f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 94 deletions.
69 changes: 7 additions & 62 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 21 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,34 @@

nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

flake-utils.url = "github:numtide/flake-utils";

gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};

gomod2nix = {
url = "github:tweag/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
};

};

outputs = inputs@{ self, nixpkgs, flake-utils, gitignore, gomod2nix }:
outputs = inputs@{ self, nixpkgs, gomod2nix }:
let
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [
gomod2nix.overlays.default
self.overlays.default
];
};
linuxSystems = [ "x86_64-linux" "aarch64-linux" ];
darwinSystems = [ "aarch64-darwin" "x86_64-darwin" ];
forAllSystems = function:
nixpkgs.lib.genAttrs (linuxSystems ++ darwinSystems)
(system:
function (import nixpkgs {
inherit system;
overlays = [
gomod2nix.overlays.default
];
config = { };
}));
version = "0.3.0";
inherit (gitignore.lib) gitignoreSource;
in
{

overlays.default = import ./nix/overlay.nix { inherit pkgs; };
overlays = forAllSystems (pkgs: {
default = import ./nix/overlay.nix { inherit pkgs; };
});

nixosModules.goshrt = import ./nix/module.nix self;

Expand All @@ -46,12 +45,14 @@
];
};

packages."x86_64-linux" = {
packages = forAllSystems (pkgs: {
goshrt = pkgs.callPackage ./nix/goshrt.nix { inherit version; };
goshrtc = pkgs.callPackage ./nix/goshrtc.nix { inherit version; };
default = pkgs.callPackage ./nix/goshrt.nix { inherit version; };
};
});

devShells."x86_64-linux".default = import ./shell.nix { inherit pkgs; };
devShells = forAllSystems (pkgs: {
default = import ./shell.nix { inherit pkgs; };
});
};
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/storvik/goshrt

go 1.21
go 1.23.2

require (
github.com/adrg/xdg v0.5.1
Expand Down
20 changes: 10 additions & 10 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ schema = 3

[mod]
[mod."github.com/adrg/xdg"]
version = "v0.5.0"
hash = "sha256-hYxtRzeFzT+4zbslWSZWmUJf+OBDmCiwL0D/0Ry8Z2I="
version = "v0.5.1"
hash = "sha256-Jjl0HQX+BXtQgPe4vAeyfhakjn3zxPWI8IdwXP5dJ9s="
[mod."github.com/cpuguy83/go-md2man/v2"]
version = "v2.0.4"
hash = "sha256-pQ+H8Psh92KWTang8hK0cHFLomH+4X0rMMilIJUQ4Qc="
version = "v2.0.5"
hash = "sha256-UX9FajFqZApVFED3MYcq167iPwztnIck25ehfcOeFD8="
[mod."github.com/go-chi/chi/v5"]
version = "v5.1.0"
hash = "sha256-DpVfbPlJe4zQNdBrirWq9Q37/awSu5zb3IJgcuyEED8="
Expand All @@ -23,11 +23,11 @@ schema = 3
version = "v2.1.0"
hash = "sha256-R+84l1si8az5yDqd5CYcFrTyNZ1eSYlpXKq6nFt4OTQ="
[mod."github.com/urfave/cli/v2"]
version = "v2.27.2"
hash = "sha256-P0yLmx2a2hIQjQ/RXKLG8ehI5eVivnettuMFr8MznFY="
version = "v2.27.5"
hash = "sha256-b/mERhhQ7CHxVEyf2QXfVnZut9pgMMVgL4zs2Wh9s4A="
[mod."github.com/xrash/smetrics"]
version = "v0.0.0-20240312152122-5f08fbb34913"
hash = "sha256-ySUTdeoOUi3QcLEJBYvCDIhVrsrD2Ks6/4V9n4hCvBk="
version = "v0.0.0-20240521201337-686a1a2994c1"
hash = "sha256-CsyN59w6sKERDI5kkdpq0YKmqdixyCHuN4FYE/56/BQ="
[mod."golang.org/x/sys"]
version = "v0.22.0"
hash = "sha256-RbG0XaXGGlErCsl2agvUxMnrkRwdbJLmriYT1H24FwA="
version = "v0.26.0"
hash = "sha256-YjklsWNhx4g4TaWRWfFe1TMFKujbqiaNvZ38bfI35fM="
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pkgs.mkShell
buildInputs = [
# disabled as it does not pickup go version from go.mod
# (pkgs.mkGoEnv { pwd = ./.; })
pkgs.go_1_21
pkgs.go
pkgs.gomod2nix
pkgs.govulncheck
pkgs.golangci-lint
Expand Down

0 comments on commit a684e7f

Please sign in to comment.