diff options
| author | Petri Hienonen <petri.hienonen@gmail.com> | 2025-12-04 18:05:00 +0200 |
|---|---|---|
| committer | Petri Hienonen <petri.hienonen@gmail.com> | 2025-12-04 20:39:41 +0200 |
| commit | 4d7fbc33a139d6484ae86c45b570b2c99fc737ef (patch) | |
| tree | 46c5788b8ed0eaf6f6581b3b7a87d633d842a8dd /home/fast-p/flake.nix | |
| parent | 7ab57a27c9648b3a8e12f755e03fc84eb50291b4 (diff) | |
| download | nixos-4d7fbc33a139d6484ae86c45b570b2c99fc737ef.tar.zst | |
Test
Diffstat (limited to 'home/fast-p/flake.nix')
| -rw-r--r-- | home/fast-p/flake.nix | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/home/fast-p/flake.nix b/home/fast-p/flake.nix new file mode 100644 index 0000000..f12cd44 --- /dev/null +++ b/home/fast-p/flake.nix @@ -0,0 +1,49 @@ +{ + description = "A Nix flake for building the fast-p Go binary"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + }; + + outputs = + { self, nixpkgs }: + let + # Support multiple systems + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + ]; + + # Helper function to generate outputs for each system + forEachSystem = + f: + nixpkgs.lib.genAttrs supportedSystems ( + system: + f { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + } + ); + + in + { + packages = forEachSystem ( + { system, pkgs }: + { + default = pkgs.buildGoModule { + pname = "fast-p"; + version = "0.1.0"; + src = ./.; + vendorHash = "sha256-/lKWY6NZrw8aGe1/R2jspT4EZQxAxP0ujckpwZQGn2w="; # Run `nix build` to get actual hash + }; + } + ); + + devShells = forEachSystem ( + { pkgs, ... }: + { + default = pkgs.mkShell { packages = with pkgs; [ go ]; }; + } + ); + }; +} |
