modernize flake

Signed-off-by: jolheiser <git@jolheiser.com>
main
jolheiser 2025-05-13 09:15:58 -05:00
parent 60dc0dbc55
commit 51cb9f3126
No known key found for this signature in database
2 changed files with 62 additions and 75 deletions

View File

@ -1,34 +1,17 @@
{
"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": 1747144303,
"narHash": "sha256-6WZAP0wiFxH9EYnyLOl9kRKrxmWlRR1sBYFvUzP9adw=",
"lastModified": 1747060738,
"narHash": "sha256-ByfPRQuqj+nhtVV0koinEpmJw0KLzNbgcgi9EF+NVow=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a59b0f1dfd64ca1cf96f7a6e7338f430428c3c17",
"rev": "eaeed9530c76ce5f1d2d8232e08bec5e26f18ec1",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
@ -67,27 +50,11 @@
},
"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": {
"inputs": {
"nixpkgs": "nixpkgs_2"

View File

@ -1,47 +1,67 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
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
{
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
];
};
}
);
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
];
};
}
);
};
}