diff --git a/flake.lock b/flake.lock index e051e80..bf59a5f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,57 +1,39 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, + "nixpkgs": { "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "lastModified": 1712963716, + "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "cfd6b5fc90b15709b780a5a1619695a88505a176", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", "type": "github" } }, - "nixpkgs": { - "locked": { - "lastModified": 1712963716, - "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "cfd6b5fc90b15709b780a5a1619695a88505a176", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "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" } } diff --git a/flake.nix b/flake.nix index db53b52..1f0bd31 100644 --- a/flake.nix +++ b/flake.nix @@ -2,47 +2,53 @@ 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: - let - pkgs = import nixpkgs { - inherit system; + outputs = { self, nixpkgs, systems, ... }: + let + inherit (nixpkgs) lib; + eachSystem = lib.genAttrs (import systems); + pkgsFor = eachSystem (system: import nixpkgs { inherit system; }); + + package = builtins.fromJSON (builtins.readFile ./package.json); + in { + packages = eachSystem (system: let + pkgs = pkgsFor.${system}; + in rec { + default = reidlab-pink; + reidlab-pink = pkgs.buildNpmPackage { + pname = package.name; + inherit (package) version; + + # uncomment this and let the build fail, then get the current hash + # very scuffed but endorsed! + #npmDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; + npmDepsHash = "sha256-XCGUKgLZxW7MonHswkp7mbvgeUlRCgBE3WnRjElf44Q="; + + installPhase = '' + runHook preInstall + + mkdir -p $out + mv ./dist/* $out/ + + runHook postInstall + ''; + + src = ./.; }; - package = builtins.fromJSON (builtins.readFile ./package.json); + }); + + devShells = eachSystem (system: let + pkgs = pkgsFor.${system}; in { - packages = flake-utils.lib.flattenTree rec { - default = reidlab-pink; - reidlab-pink = pkgs.buildNpmPackage { - pname = package.name; - inherit (package) version; - - # uncomment this and let the build fail, then get the current hash - # very scuffed but endorsed! - #npmDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; - npmDepsHash = "sha256-XCGUKgLZxW7MonHswkp7mbvgeUlRCgBE3WnRjElf44Q="; - - installPhase = '' - runHook preInstall - - mkdir -p $out - mv ./dist/* $out/ - - runHook postInstall - ''; - - src = ./.; - }; - }; - - devShells.default = pkgs.mkShell { + default = pkgs.mkShell { packages = with pkgs; [ nodejs nodePackages.npm ]; }; - }); + }); + }; } diff --git a/package.json b/package.json index 1229bfe..d566546 100644 --- a/package.json +++ b/package.json @@ -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",