diff --git a/flake.lock b/flake.lock index 48aaa8d..4621c53 100644 --- a/flake.lock +++ b/flake.lock @@ -2,19 +2,18 @@ "nodes": { "devshell": { "inputs": { - "flake-utils": [ - "flake-utils" - ], "nixpkgs": [ + "platform-engineering", "nixpkgs" - ] + ], + "systems": "systems" }, "locked": { - "lastModified": 1678957337, - "narHash": "sha256-Gw4nVbuKRdTwPngeOZQOzH/IFowmz4LryMPDiJN/ah4=", + "lastModified": 1687173957, + "narHash": "sha256-GOds2bAQcZ94fb9/Nl/aM+r+0wGSi4EKYuZYR8Dw4R8=", "owner": "numtide", "repo": "devshell", - "rev": "3e0e60ab37cd0bf7ab59888f5c32499d851edb47", + "rev": "2cf83bb31720fcc29a999aee28d6da101173e66a", "type": "github" }, "original": { @@ -25,14 +24,14 @@ }, "flake-utils": { "inputs": { - "systems": "systems" + "systems": "systems_2" }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1687171271, + "narHash": "sha256-BJlq+ozK2B1sJDQXS3tzJM5a+oVZmi1q0FlBK/Xqv7M=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "abfb11bd1aec8ced1c9bb9adfe68018230f4fb3c", "type": "github" }, "original": { @@ -41,9 +40,30 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "platform-engineering", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "gomod2nix": { "inputs": { - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "utils": "utils" }, "locked": { @@ -60,7 +80,38 @@ "type": "github" } }, + "nix-filter": { + "locked": { + "lastModified": 1687178632, + "narHash": "sha256-HS7YR5erss0JCaUijPeyg2XrisEb959FIct3n2TMGbE=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "d90c75e8319d0dd9be67d933d8eb9d0894ec9174", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1687306699, + "narHash": "sha256-7FSpk1d9drY1m1dsXYWHzNLE0vf64pwbTOrkMBybXPU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "03091c9ffd7033ea855d0216111c4a9975c5780f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1658285632, "narHash": "sha256-zRS5S/hoeDGUbO+L95wXG9vJNwsSYcl93XiD0HQBXLk=", @@ -76,28 +127,49 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { - "lastModified": 1681762469, - "narHash": "sha256-RYdEbufT7G+NKu/Gdz/XVCXprtzQid9eBKTQqBG1aM4=", - "owner": "NixOS", + "lastModified": 1686960236, + "narHash": "sha256-AYCC9rXNLpUWzD9hm+askOfpliLEC9kwAo7ITJc4HIw=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "f25d4846d7a12a4d9d008aec86742d238b3b13c8", + "rev": "04af42f3b31dba0ef742d254456dc4c14eedac86", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "release-22.11", + "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, + "platform-engineering": { + "inputs": { + "devshell": "devshell", + "flake-utils": "flake-utils", + "gitignore": "gitignore", + "gomod2nix": "gomod2nix", + "nix-filter": "nix-filter", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1687309848, + "narHash": "sha256-yZ+Elf718qXfh6irS92DgzBrRXuAlYRMLYI+ccdgOS0=", + "owner": "slimslenderslacks", + "repo": "nix-modules", + "rev": "f492d1c93967c7f0c4444e2ccb659eda9373c06f", + "type": "github" + }, + "original": { + "owner": "slimslenderslacks", + "repo": "nix-modules", + "type": "github" + } + }, "root": { "inputs": { - "devshell": "devshell", - "flake-utils": "flake-utils", - "gomod2nix": "gomod2nix", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs", + "platform-engineering": "platform-engineering" } }, "systems": { @@ -115,6 +187,21 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "utils": { "locked": { "lastModified": 1653893745, diff --git a/flake.nix b/flake.nix index e0a3757..a407466 100644 --- a/flake.nix +++ b/flake.nix @@ -2,70 +2,14 @@ description = "Docker Pod"; inputs = { + platform-engineering.url = "github:slimslenderslacks/nix-modules"; nixpkgs.url = "github:NixOS/nixpkgs/release-22.11"; - flake-utils.url = "github:numtide/flake-utils"; - gomod2nix.url = "github:nix-community/gomod2nix"; - devshell = { - url = "github:numtide/devshell"; - inputs.flake-utils.follows = "flake-utils"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; - outputs = { self, nixpkgs, flake-utils, gomod2nix, devshell }: - - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs - { - inherit system; - overlays = [ gomod2nix.overlays.default devshell.overlays.default ]; - }; - in + outputs = { nixpkgs, ... }@inputs: + inputs.platform-engineering.golang-project { - devShells.default = pkgs.devshell.mkShell { - packages = with pkgs; [ go gotools golangci-lint gopls gopkgs go-outline gomod2nix.packages.${system}.default - (clojure.override { jdk = temurin-bin; }) - clojure-lsp temurin-bin neovim]; - commands = [ - { - name = "update-gomod2nix"; - help = "update gomod2nix.toml"; - command = "gomod2nix"; - } - ]; - }; - packages = rec { - app = pkgs.buildGoApplication { - pname = "babashka-pod-docker"; - version = "0.0.1"; - src = ./.; - pwd = ./.; - CGO_ENABLED = 0; - modules = ./gomod2nix.toml; - }; - - docker = pkgs.dockerTools.buildImage { - name = "docker-pod"; - tag = "latest"; - config = { - Cmd = [ "${app}/bin/babashka-pod-docker" ]; - }; - }; - - default-linux = app.overrideAttrs (old: old // { GOOS = "linux"; GOARCH = "arm64"; }); - - default = pkgs.writeShellScriptBin "entrypoint" '' - ${app}/bin/babashka-pod-docker - ''; - - docker-arm64 = pkgs.dockerTools.buildImage { - name = "docker-pod"; - tag = "latest"; - config = { - Cmd = [ "${default-linux}/bin/linux_arm64/babashka-pod-docker" ]; - }; - }; - }; - }); + inherit nixpkgs; + dir = ./.; + }; }