From bbf0e547e6b2ab5a93b832d6d9c651f5a944af24 Mon Sep 17 00:00:00 2001 From: Alexander Khodyrev Date: Thu, 12 Sep 2024 21:42:22 +0300 Subject: [PATCH] module v3 --- flake.nix | 33 ++++++++++++++++----------------- module.nix | 2 +- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index 1ff635b..805f831 100644 --- a/flake.nix +++ b/flake.nix @@ -7,21 +7,20 @@ 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; - }) - ); + 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; + }; } diff --git a/module.nix b/module.nix index d933e4b..d072d53 100644 --- a/module.nix +++ b/module.nix @@ -4,7 +4,7 @@ let inherit (pkgs.stdenv.hostPlatform) system; cfg = config.services.birdtown-visit-counter; inherit (lib) types mkOption mkIf; - package = inputs.self.packages."${system}".birdtown-visit-counter; + package = inputs.self.packages."${system}".default; in { options.services.birdtown-visit-counter = { enable = mkOption {