module v3

This commit is contained in:
Alexander Khodyrev 2024-09-12 21:42:22 +03:00
parent a8822d7581
commit 54b4f78eb3
2 changed files with 17 additions and 18 deletions

View file

@ -7,21 +7,20 @@
inputs.gomod2nix.inputs.nixpkgs.follows = "nixpkgs"; inputs.gomod2nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.gomod2nix.inputs.flake-utils.follows = "flake-utils"; inputs.gomod2nix.inputs.flake-utils.follows = "flake-utils";
outputs = inputs @ { self, nixpkgs, flake-utils, gomod2nix }: outputs = inputs@{ self, nixpkgs, flake-utils, gomod2nix }:
(flake-utils.lib.eachDefaultSystem (flake-utils.lib.eachDefaultSystem (system:
(system: let
let pkgs = nixpkgs.legacyPackages.${system};
pkgs = nixpkgs.legacyPackages.${system}; callPackage =
callPackage = pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage; pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage;
in in {
{ packages.default = callPackage ./. {
packages.default = callPackage ./. { inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication; };
}; devShells.default = callPackage ./shell.nix {
devShells.default = callPackage ./shell.nix { inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix;
inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix; };
}; })) // {
nixosModules.default = import ./module.nix inputs; nixosModules.default = import ./module.nix inputs;
}) };
);
} }

View file

@ -4,7 +4,7 @@ let
inherit (pkgs.stdenv.hostPlatform) system; inherit (pkgs.stdenv.hostPlatform) system;
cfg = config.services.birdtown-visit-counter; cfg = config.services.birdtown-visit-counter;
inherit (lib) types mkOption mkIf; inherit (lib) types mkOption mkIf;
package = inputs.self.packages."${system}".birdtown-visit-counter; package = inputs.self.packages.birdtown-visit-counter;
in { in {
options.services.birdtown-visit-counter = { options.services.birdtown-visit-counter = {
enable = mkOption { enable = mkOption {