From 30b4700d3b838c9f0fecad860aca6b0ec374a747 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 7 Sep 2023 17:40:51 -0400 Subject: flake: use cool module arguments --- .github/workflows/update-lock.yaml | 4 ++-- nix/module.nix | 12 ++++++------ nix/packages.nix | 12 ++++++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/update-lock.yaml b/.github/workflows/update-lock.yaml index 6ab7eb7..ec3ccc4 100644 --- a/.github/workflows/update-lock.yaml +++ b/.github/workflows/update-lock.yaml @@ -21,6 +21,6 @@ jobs: uses: DeterminateSystems/update-flake-lock@v20 id: update with: - commit-msg: "flake: update inputs" - pr-title: "flake: update inputs" + commit-msg: "deps(flake): update inputs" + pr-title: "deps(flake): update inputs" token: ${{ github.token }} diff --git a/nix/module.nix b/nix/module.nix index 10f09c3..abf348e 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -10,7 +10,7 @@ self: { (lib) literalExpression mkDefault - mkDoc + mdDoc mkEnableOption mkIf mkMerge @@ -24,12 +24,12 @@ self: { hostPortSubmodule = { options = { host = mkOption { - description = mkDoc "the hostname"; + description = mdDoc "the hostname"; type = types.str; }; port = mkOption { - description = mkDoc "the port"; + description = mdDoc "the port"; type = types.port; }; }; @@ -39,7 +39,7 @@ in { enable = mkEnableOption "guzzle-api"; listen = mkOption { - description = mkDoc "address and port to listen to"; + description = mdDoc "address and port to listen to"; type = types.submodule hostPortSubmodule; default = { host = "localhost"; @@ -54,12 +54,12 @@ in { }; domain = mkOption { - description = mkDoc "FQDN for guzzle_api endpoint"; + description = mdDoc "FQDN for guzzle_api endpoint"; type = types.str; }; nginx = mkOption { - description = mkDoc '' + description = mdDoc '' With this option, you can customize an nginx virtual host which already has sensible defaults for Dolibarr. Set to {} if you do not need any customization to the virtual host. If enabled, then by default, the {option}`serverName` is diff --git a/nix/packages.nix b/nix/packages.nix index 0adf42f..8722ad1 100644 --- a/nix/packages.nix +++ b/nix/packages.nix @@ -2,11 +2,15 @@ version = builtins.substring 0 8 self.lastModifiedDate or "dirty"; commonArgs = {inherit self version;}; in { - perSystem = {pkgs, ...}: { - packages = rec { + perSystem = { + pkgs, + self', + ... + }: { + packages = { guzzle-api = pkgs.python311Packages.callPackage ./derivation.nix commonArgs; - guzzle-api-server = pkgs.python311Packages.callPackage ./server.nix {inherit guzzle-api;}; - default = guzzle-api; + guzzle-api-server = pkgs.python311Packages.callPackage ./server.nix {inherit (self'.packages) guzzle-api;}; + default = self'.packages.guzzle-api; }; }; -- cgit v1.2.3