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": { "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1712963716, "lastModified": 1712963716,
@ -36,22 +18,22 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "nixpkgs": "nixpkgs",
"nixpkgs": "nixpkgs" "systems": "systems"
} }
}, },
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1689347949,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "default-linux",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "default-linux",
"type": "github" "type": "github"
} }
} }

View file

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

View file

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