birdtown-leaderboard/flake.nix
2024-09-17 18:08:09 +03:00

43 lines
1.8 KiB
Nix

# This file is part of birdtown-leaderboard, and is © 2024 Alexander Khodyrev.
#
# Full source code is available at https://git.akho.name/akho/birdtown-leaderboard
#
# birdtown-leaderboard is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# birdtown-leaderboard is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
# for more details.
#
# You should have received a copy of the GNU Affero General Public License along
# with birdtown-leaderboard. If not, see <https://www.gnu.org/licenses/>.
{
description = "birdtown-visit-counter";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.gomod2nix.url = "github:nix-community/gomod2nix";
inputs.gomod2nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.gomod2nix.inputs.flake-utils.follows = "flake-utils";
outputs = inputs@{ self, nixpkgs, flake-utils, gomod2nix }:
(flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
callPackage =
pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage;
in {
packages.default = callPackage ./. {
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
};
devShells.default = callPackage ./shell.nix {
inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix;
};
})) // {
nixosModules.default = import ./module.nix inputs;
};
}