From 903d1b81d11f7181943b46a6685add810716e2be Mon Sep 17 00:00:00 2001 From: niten Date: Mon, 22 Aug 2022 09:30:34 -0700 Subject: [PATCH] Update dependencies --- flake.lock | 8 ++++---- flake.nix | 53 +++++++++++++++++++++++++++++------------------------ module.nix | 3 +-- 3 files changed, 34 insertions(+), 30 deletions(-) diff --git a/flake.lock b/flake.lock index e7e1ffb..4bcbdc1 100644 --- a/flake.lock +++ b/flake.lock @@ -76,16 +76,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1655278232, - "narHash": "sha256-H6s7tnHYiDKFCcLADS4sl1sUq0dDJuRQXCieguk/6SA=", + "lastModified": 1659446231, + "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8b538fcb329a7bc3d153962f17c509ee49166973", + "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-22.05", + "ref": "nixos-21.11", "type": "indirect" } }, diff --git a/flake.nix b/flake.nix index c29265b..c1d9873 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Fudo Coinbase Price Bot."; inputs = { - nixpkgs.url = "nixpkgs/nixos-22.05"; + nixpkgs.url = "nixpkgs/nixos-21.11"; utils.url = "github:numtide/flake-utils"; clj-nix = { url = "github:jlesquembre/clj-nix"; @@ -11,28 +11,33 @@ }; outputs = { self, nixpkgs, utils, clj-nix, ... }: - let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages."${system}"; - cljpkgs = clj-nix.packages."${system}"; - update-deps = pkgs.writeShellScriptBin "update-deps.sh" '' - ${clj-nix.packages."${system}".deps-lock}/bin/deps-lock - ''; - in { - packages."${system}".fudo-pricebot = cljpkgs.mkCljBin { - projectSrc = ./.; - name = "org.fudo/pricebot"; - main-ns = "pricebot.core"; - jdkRunner = pkgs.jdk17_headless; - version = "0.1"; + utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages."${system}"; + mkCljBin = clj-nix.packages."${system}".mkCljBin; + update-deps = pkgs.writeShellScriptBin "update-deps.sh" '' + ${clj-nix.packages."${system}".deps-lock}/bin/deps-lock + ''; + in { + packages = rec { + fudo-pricebot = mkCljBin { + projectSrc = ./.; + name = "org.fudo/pricebot"; + main-ns = "pricebot.core"; + jdkRunner = pkgs.jdk17_headless; + version = "0.1"; + }; + + default = fudo-pricebot; + }; + + legacyPackages = { + fudo-pricebot = self.packages."${system}".fudo-pricebot; + }; + + devShells.default = + pkgs.mkShell { buildInputs = with pkgs; [ update-deps ]; }; + }) // { + nixosModules.default = import ./module.nix; }; - - defaultPackage."${system}" = self.packages."${system}".fudo-pricebot; - - nixosModule = - pkgs.callPackage ./module.nix self.packages."${system}".fudo-pricebot; - - devShell."${system}" = - pkgs.mkShell { buildInputs = with pkgs; [ clojure update-deps ]; }; - }; } diff --git a/module.nix b/module.nix index 02013ad..b394580 100644 --- a/module.nix +++ b/module.nix @@ -1,4 +1,3 @@ -pricebot: { config, lib, pkgs, ... }: with lib; @@ -68,7 +67,7 @@ in { }; serviceConfig = { ExecStart = pkgs.writeShellScript "launch-pricebot-${currency}.sh" '' - ${pricebot}/bin/pricebot --bebot-auth-token-file=$CREDENTIALS_DIRECTORY/auth.token + ${pkgs.pricebot}/bin/pricebot --bebot-auth-token-file=$CREDENTIALS_DIRECTORY/auth.token ''; DynamicUser = true; PrivateTmp = true;