diff --git a/flake.lock b/flake.lock index 3ee584f4a8abd3a68880830bbf2f29a3666f73d8..7ab83a56ee8684d980665f3b8295633e0bba14c3 100644 --- a/flake.lock +++ b/flake.lock @@ -1,17 +1,34 @@ { "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1747060738, - "narHash": "sha256-ByfPRQuqj+nhtVV0koinEpmJw0KLzNbgcgi9EF+NVow=", + "lastModified": 1747144303, + "narHash": "sha256-6WZAP0wiFxH9EYnyLOl9kRKrxmWlRR1sBYFvUzP9adw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "eaeed9530c76ce5f1d2d8232e08bec5e26f18ec1", + "rev": "a59b0f1dfd64ca1cf96f7a6e7338f430428c3c17", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -50,9 +67,25 @@ } }, "root": { "inputs": { + "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", "tailwind-ctp": "tailwind-ctp", "tailwind-ctp-lsp": "tailwind-ctp-lsp" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" } }, "tailwind-ctp": { diff --git a/flake.nix b/flake.nix index 6b523df58dcae41945ec079f998a8648e01200fb..0dc781402a23d7cd2328b7ff1948fd046c1d581e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,67 +1,47 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "github:nixos/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; tailwind-ctp.url = "git+https://git.jojodev.com/jolheiser/tailwind-ctp"; tailwind-ctp-lsp.url = "git+https://git.jojodev.com/jolheiser/tailwind-ctp-intellisense"; }; outputs = - inputs: - let - systems = [ - "x86_64-linux" - "i686-linux" - "x86_64-darwin" - "aarch64-linux" - "armv6l-linux" - "armv7l-linux" - ]; - forAllSystems = - f: - inputs.nixpkgs.lib.genAttrs systems ( - system: - f { - pkgs = import inputs.nixpkgs { - inherit system; - overlays = [ inputs.self.overlays.default ]; - }; - } - ); - in { - overlays.default = final: prev: { - tailwind-ctp = inputs.tailwind-ctp.packages.${prev.system}.default; - tailwind-ctp-lsp = inputs.tailwind-ctp-lsp.packages.${prev.system}.default; - }; - packages = forAllSystems ( - { pkgs }: - { - default = pkgs.buildGoModule { - pname = "jolheiser.com"; - version = "site"; - src = ./.; - vendorHash = inputs.nixpkgs.lib.fileContents ./go.mod.sri; - nativeBuildInputs = [ inputs.tailwind-ctp ]; - excludedPackages = "."; - postBuild = '' - go generate - mv dist $out - ''; - }; - } - ); - devShells = forAllSystems ( - { pkgs }: - { - default = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - go - tailwind-ctp - tailwind-ctp-lsp - vscode-langservers-extracted - ]; - }; - } - ); - }; + self, + flake-utils, + nixpkgs, + tailwind-ctp, + tailwind-ctp-lsp, + }@inputs: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + tailwind-ctp = inputs.tailwind-ctp.packages.${system}.default; + tailwind-ctp-lsp = inputs.tailwind-ctp-lsp.packages.${system}.default; + in + { + packages.default = pkgs.buildGoModule { + pname = "jolheiser.com"; + version = "site"; + src = ./.; + vendorHash = nixpkgs.lib.fileContents ./go.mod.sri; + nativeBuildInputs = [ tailwind-ctp ]; + excludedPackages = "."; + postBuild = '' + go generate + mv dist $out + ''; + }; + devShells.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + go + tailwind-ctp + tailwind-ctp-lsp + vscode-langservers-extracted + ]; + }; + } + ); }