fix: unocss in nixos derivation
This commit is contained in:
58
derivation.nix
Normal file
58
derivation.nix
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs>,
|
||||
lib,
|
||||
templ ? pkgs.templ,
|
||||
gitignore,
|
||||
...
|
||||
}: let
|
||||
v = "2024-12-15";
|
||||
|
||||
npm = pkgs.buildNpmPackage {
|
||||
name = "Keiko's Work NPM Build";
|
||||
version = v;
|
||||
|
||||
src = gitignore.lib.gitignoreSource ./.;
|
||||
|
||||
npmDepsHash = "sha256-8J4oIl4B9gOQcfq4KPUMPnrlgB1vde3x0YVOUBdWCU8=";
|
||||
npmPackFlags = ["--ignore-scripts"];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
npm run unocss
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out
|
||||
cp -r ./* $out
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
in
|
||||
pkgs.buildGoModule {
|
||||
name = "Keiko's Work";
|
||||
pname = "keikos.work";
|
||||
|
||||
version = v;
|
||||
|
||||
src = npm;
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgs.nodejs_20
|
||||
];
|
||||
|
||||
vendorHash = "sha256-Hhvyh4M64LyuWbcKWSVWR20idIDIH/ZqLSDT2gGFqj4=";
|
||||
|
||||
preBuild = ''
|
||||
${lib.escapeShellArg (lib.getExe' templ "templ")} generate .
|
||||
'';
|
||||
|
||||
meta = {
|
||||
mainProgram = "keikos.work";
|
||||
};
|
||||
}
|
||||
29
flake.lock
generated
29
flake.lock
generated
@@ -34,6 +34,26 @@
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709087332,
|
||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"templ",
|
||||
@@ -78,11 +98,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1733759999,
|
||||
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
|
||||
"lastModified": 1734119587,
|
||||
"narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
|
||||
"rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -110,6 +130,7 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"templ": "templ"
|
||||
}
|
||||
@@ -131,7 +152,7 @@
|
||||
},
|
||||
"templ": {
|
||||
"inputs": {
|
||||
"gitignore": "gitignore",
|
||||
"gitignore": "gitignore_2",
|
||||
"gomod2nix": "gomod2nix",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"xc": "xc"
|
||||
|
||||
17
flake.nix
17
flake.nix
@@ -3,6 +3,10 @@
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
templ.url = "github:a-h/templ?ref=v0.2.793";
|
||||
gitignore = {
|
||||
url = "github:hercules-ci/gitignore.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
outputs = {
|
||||
self,
|
||||
@@ -22,13 +26,12 @@
|
||||
f system pkgs);
|
||||
templ = system: inputs.templ.packages.${system}.templ;
|
||||
in {
|
||||
packages = forAllSystems (system: pkgs: let
|
||||
musl = pkgs.musl;
|
||||
derivation =
|
||||
pkgs.buildGoModule {
|
||||
};
|
||||
in {
|
||||
default = derivation;
|
||||
packages = forAllSystems (system: pkgs: {
|
||||
keikos = pkgs.callPackage ./derivation.nix {
|
||||
templ = templ system;
|
||||
gitignore = inputs.gitignore;
|
||||
};
|
||||
default = self.packages.${system}.keikos;
|
||||
});
|
||||
|
||||
devShells = forAllSystems (system: pkgs: {
|
||||
|
||||
Reference in New Issue
Block a user