use nix-systems

This commit is contained in:
Reid 2025-12-14 13:55:51 -08:00
parent 5fe76f6f45
commit c21185aef8
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
3 changed files with 57 additions and 69 deletions

32
flake.lock generated
View file

@ -1,23 +1,5 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1712963716,
@ -36,22 +18,22 @@
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"repo": "default-linux",
"type": "github"
}
}

View file

@ -2,19 +2,21 @@
description = "reidlab.pink";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
outputs = { self, nixpkgs, systems, ... }:
let
pkgs = import nixpkgs {
inherit system;
};
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system: import nixpkgs { inherit system; });
package = builtins.fromJSON (builtins.readFile ./package.json);
in {
packages = flake-utils.lib.flattenTree rec {
packages = eachSystem (system: let
pkgs = pkgsFor.${system};
in rec {
default = reidlab-pink;
reidlab-pink = pkgs.buildNpmPackage {
pname = package.name;
@ -36,13 +38,17 @@
src = ./.;
};
};
});
devShells.default = pkgs.mkShell {
devShells = eachSystem (system: let
pkgs = pkgsFor.${system};
in {
default = pkgs.mkShell {
packages = with pkgs; [
nodejs
nodePackages.npm
];
};
});
};
}

View file

@ -2,6 +2,8 @@
"name": "reidlab-pink",
"version": "1.0.0",
"description": "reidlab.pink",
"author": "reidlab",
"license": "MIT",
"scripts": {
"dev": "astro dev",
"build": "npm run lint && astro check && astro build",
@ -9,8 +11,6 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"author": "reidlab",
"license": "MIT",
"dependencies": {
"@astrojs/check": "^0.7.0",
"@astrojs/sitemap": "^3.1.5",