all repos — website @ 30e4cb4e4af3a6eebd3b4fb431828d284a72a10a

My website

use nix to build docker images

Alan Pearce
commit

30e4cb4e4af3a6eebd3b4fb431828d284a72a10a

parent

0fc79f324d54cc7a45c0ad0ffa9c75cd716e0126

1 file changed, 15 insertions(+), 18 deletions(-)

changed files
M flake.nixflake.nix
@@ -12,37 +12,34 @@ inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "utils"; }; - outputs = { nixpkgs, utils, gomod2nix, ... }: + outputs = { self, nixpkgs, utils, gomod2nix, ... }: utils.lib.eachDefaultSystem (system: let - pkgs = nixpkgs.legacyPackages.${system}; - nativeBuildInputs = with pkgs; [ - git - go - ]; + pkgs = import nixpkgs { + inherit system; + overlays = [ gomod2nix.overlays.default ]; + }; + nativeBuildInputs = with pkgs; [ go ]; + packages = import ./nix/default.nix { + inherit pkgs self; + }; in - rec { + { + inherit packages; devShells = { default = pkgs.mkShell { packages = with pkgs; [ gopls gotools go-tools - go-licenses gomod2nix.packages.${system}.default gci flyctl - (writeShellScriptBin "watch-builder" '' - ${pkgs.watchexec}/bin/watchexec -r -w flake.nix --shell fish "direnv exec . watchexec -i server.go -i public -r go run ./cmd/build $@" - '') - (writeShellScriptBin "watch-server" '' - ${pkgs.watchexec}/bin/watchexec -r -w flake.nix --shell fish "direnv exec . watchexec -r go run ./server.go $@" - '') - (writeShellScriptBin "check-licenses" '' - ${pkgs.go-licenses}/bin/go-licenses check --include_tests ./... --disallowed_types=restricted,forbidden - '') - ] ++ nativeBuildInputs; + ] + ++ (import ./nix/scripts.nix { + inherit pkgs; + }); }; }; });