diff --git a/default.nix b/default.nix index 9a9975b..5810a98 100644 --- a/default.nix +++ b/default.nix @@ -1,14 +1,9 @@ -{ pkgs ? ( - let - inherit (builtins) fetchTree fromJSON readFile; - inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix; - in - import (fetchTree nixpkgs.locks) { - overlays = [ - (import "${fetchTree gomod2nix.locked}/overlay.nix") - ]; - } -), buildGoApplication ? pkgs.buildGoApplication }: +{ pkgs ? (let + inherit (builtins) fetchTree fromJSON readFile; + inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix; +in import (fetchTree nixpkgs.locks) { + overlays = [ (import "${fetchTree gomod2nix.locked}/overlay.nix") ]; +}), buildGoApplication ? pkgs.buildGoApplication }: buildGoApplication { pname = "yakdash"; version = "0.1"; diff --git a/flake.lock b/flake.lock index b6aef6c..6017cc8 100644 --- a/flake.lock +++ b/flake.lock @@ -20,12 +20,8 @@ }, "gomod2nix": { "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] + "flake-utils": ["flake-utils"], + "nixpkgs": ["nixpkgs"] }, "locked": { "lastModified": 1705314449, diff --git a/flake.nix b/flake.nix index 20f0c01..30deb1e 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,8 @@ # The current default sdk for macOS fails to compile go projects, so we use a newer one for now. # This has no effect on other platforms. - callPackage = pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage; + callPackage = + pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage; in { packages.default = callPackage ./default.nix { inherit (gomod2nix.legacyPackages.${system}) buildGoApplication; diff --git a/shell.nix b/shell.nix index 63a4aa6..5414e52 100644 --- a/shell.nix +++ b/shell.nix @@ -1,22 +1,12 @@ -{ pkgs ? ( - let - inherit (builtins) fetchTree fromJSON readFile; - inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix; - in - import (fetchTree nixpkgs.locked) { - overlays = [ - (import "${fetchTree gomod2nix.locked}/overlay.nix") - ]; - } - ) -, mkGoEnv ? pkgs.mkGoEnv -, gomod2nix ? pkgs.gomod2nix -}: +{ pkgs ? (let + inherit (builtins) fetchTree fromJSON readFile; + inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix; +in import (fetchTree nixpkgs.locked) { + overlays = [ (import "${fetchTree gomod2nix.locked}/overlay.nix") ]; +}), mkGoEnv ? pkgs.mkGoEnv, gomod2nix ? pkgs.gomod2nix }: -let - goEnv = mkGoEnv { pwd = ./.; }; -in -pkgs.mkShell { +let goEnv = mkGoEnv { pwd = ./.; }; +in pkgs.mkShell { packages = with pkgs; [ goEnv gomod2nix