Compare commits

..

5 Commits
main ... rsshub

Author SHA1 Message Date
chn
23ff0f7788 switch to upstream pnpm2nix-nzbr 2024-02-04 23:50:47 +08:00
chn
a07800192d system.gurb: fix efishell 2024-02-04 11:37:36 +08:00
chn
13b0c77e7a do not archive 2024-02-04 11:13:34 +08:00
chn
43e8215fc6 Merge branch 'main' into production 2024-02-03 20:52:43 +08:00
chn
21e8b5300a switch to production 2024-02-03 20:49:59 +08:00
7 changed files with 46 additions and 121 deletions

View File

@@ -10,16 +10,16 @@ inputs:
{
mount =
{
vfat."/dev/disk/by-uuid/E58F-416A" = "/boot/efi";
vfat."/dev/disk/by-uuid/3F57-0EBE" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/066be4fd-8617-4fe1-9654-c133c2996d33"."/" = "/boot";
"/dev/disk/by-uuid/02e426ec-cfa2-4a18-b3a5-57ef04d66614"."/" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
decrypt.auto =
{
"/dev/disk/by-uuid/4c73288c-bcd8-4a7e-b683-693f9eed2d81" = { mapper = "root"; ssd = true; };
"/dev/disk/by-uuid/55fdd19f-0f1d-4c37-bd4e-6df44fc31f26" = { mapper = "root"; ssd = true; };
"/dev/disk/by-uuid/4be45329-a054-4c20-8965-8c5b7ee6b35d" =
{ mapper = "swap"; ssd = true; before = [ "root" ]; };
};
@@ -77,7 +77,7 @@ inputs:
};
services =
{
# snapper.enable = true;
snapper.enable = true;
fontconfig.enable = true;
samba =
{

16
flake.lock generated
View File

@@ -1429,11 +1429,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1706959166,
"narHash": "sha256-vEbBSmakksQN+Ho7FHDWeoTpfOZRthhOWOysYD9nf5g=",
"lastModified": 1707017659,
"narHash": "sha256-FZ3Q2WARF/hF9xvNvHnpg0fw7R8XdgvNMhb24ZYUQwc=",
"owner": "CHN-beta",
"repo": "nixpkgs",
"rev": "910dd75760e1fea2a6e78d567adc7f1a7c309038",
"rev": "aa42cddc25be43252a175c369ad07aafc38db2a1",
"type": "github"
},
"original": {
@@ -1724,15 +1724,15 @@
]
},
"locked": {
"lastModified": 1705976239,
"narHash": "sha256-pHeHvy4Dq3veNtzL/oojh0KEAzZRZOSqgX1RT0kqM2s=",
"owner": "CHN-beta",
"lastModified": 1706694632,
"narHash": "sha256-ytyTwNPiUR8aq74QlxFI+Wv3MyvXz5POO1xZxQIoi0c=",
"owner": "nzbr",
"repo": "pnpm2nix-nzbr",
"rev": "a71234b70e90ac147b5ae1f35f07b95ba60ca59e",
"rev": "0366b7344171accc2522525710e52a8abbf03579",
"type": "github"
},
"original": {
"owner": "CHN-beta",
"owner": "nzbr",
"repo": "pnpm2nix-nzbr",
"type": "github"
}

View File

@@ -29,7 +29,7 @@
napalm = { url = "github:nix-community/napalm"; inputs.nixpkgs.follows = "nixpkgs"; };
nixpak = { url = "github:nixpak/nixpak"; inputs.nixpkgs.follows = "nixpkgs"; };
deploy-rs = { url = "github:serokell/deploy-rs"; inputs.nixpkgs.follows = "nixpkgs"; };
pnpm2nix-nzbr = { url = "github:CHN-beta/pnpm2nix-nzbr"; inputs.nixpkgs.follows = "nixpkgs"; };
pnpm2nix-nzbr = { url = "github:nzbr/pnpm2nix-nzbr"; inputs.nixpkgs.follows = "nixpkgs"; };
# oneapi
lmix = { url = "github:CHN-beta/lmix"; inputs.nixpkgs.follows = "nixpkgs"; };
# nvhpc
@@ -144,6 +144,6 @@
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks inputs.self.deploy) inputs.deploy-rs.lib;
overlays.default = final: prev:
{ localPackages = (import ./local/pkgs { inherit (inputs) lib; pkgs = final; }); };
config.production = false;
config.archive = false;
};
}

View File

@@ -1,67 +1,22 @@
{
lib, stdenv, mkPnpmPackage, fetchurl, nodejs, writeShellScript, buildFHSEnv,
lib, mkPnpmPackage, nodejs, writeShellScriptBin,
bash, cypress, vips, pkg-config, src
}:
let
name = "misskey";
originalPnpmPackage = mkPnpmPackage
unwrapped = mkPnpmPackage
{
inherit name src nodejs;
inherit src nodejs;
name = "misskey-unwrapped";
installEnv = { CYPRESS_RUN_BINARY = "${cypress}/bin/Cypress"; NODE_ENV = "production"; };
copyPnpmStore = true;
distDir = ".";
noDevDependencies = true;
};
startScript = writeShellScript "misskey"
''
export PATH=${lib.makeBinPath [ bash nodejs nodejs.pkgs.pnpm nodejs.pkgs.gulp cypress ]}:$PATH
export CYPRESS_RUN_BINARY="${cypress}/bin/Cypress"
export NODE_ENV=production
pnpm run migrateandstart
'';
in
stdenv.mkDerivation rec
{
inherit src name;
buildInputs =
[
bash nodejs nodejs.pkgs.typescript nodejs.pkgs.pnpm nodejs.pkgs.gulp cypress vips pkg-config
];
nativeBuildInputs = buildInputs;
CYPRESS_RUN_BINARY = "${cypress}/bin/Cypress";
NODE_ENV = "production";
configurePhase =
''
export HOME=$NIX_BUILD_TOP # Some packages need a writable HOME
export npm_config_nodedir=${nodejs}
runHook preConfigure
store=$(pnpm store path)
mkdir -p $(dirname $store)
cp -f ${originalPnpmPackage.passthru.patchedLockfileYaml} pnpm-lock.yaml
cp -RL ${originalPnpmPackage.passthru.pnpmStore} $store
chmod -R +w $store
pnpm install --frozen-lockfile --offline
runHook postConfigure
'';
buildPhase =
''
runHook preBuild
pnpm run build
runHook postBuild
'';
installPhase =
''
runHook preInstall
mkdir -p $out
mv * .* $out
mkdir -p $out/bin
cp ${startScript} $out/bin/misskey
mkdir -p $out/files
runHook postInstall
'';
passthru =
{
inherit originalPnpmPackage startScript;
};
}
in writeShellScriptBin "misskey"
''
cd ${unwrapped}
export PATH=${lib.makeBinPath [ bash nodejs nodejs.pkgs.pnpm nodejs.pkgs.gulp cypress ]}:$PATH
export CYPRESS_RUN_BINARY="${cypress}/bin/Cypress"
export NODE_ENV=production
pnpm run migrateandstart
''

View File

@@ -1,50 +1,20 @@
{
lib, stdenv, mkPnpmPackage, nodejs, writeShellScript,
chromium, bash, src
lib, mkPnpmPackage, nodejs, writeShellScriptBin, src,
chromium, bash
}:
let
name = "rsshub";
originalPnpmPackage = mkPnpmPackage { inherit name src nodejs; };
nodeModules = originalPnpmPackage.nodeModules.overrideAttrs { PUPPETEER_SKIP_DOWNLOAD = true; };
rsshub-unwrapped = stdenv.mkDerivation
unwrapped = mkPnpmPackage
{
inherit src;
name = "${name}-unwrapped";
configurePhase =
''
export HOME=$NIX_BUILD_TOP # Some packages need a writable HOME
export npm_config_nodedir=${nodejs}
runHook preConfigure
ln -s ${nodeModules}/. node_modules
runHook postConfigure
'';
installPhase =
''
runHook preInstall
mkdir -p $out
mv * .* $out
runHook postInstall
'';
name = "rsshub-unwrapped";
inherit src nodejs;
installEnv.PUPPETEER_SKIP_DOWNLOAD = "1";
script = "build:all";
distDir = ".";
};
startScript = writeShellScript "rsshub"
''
cd ${rsshub-unwrapped}
export PATH=${lib.makeBinPath [ bash nodejs nodejs.pkgs.pnpm chromium ]}:$PATH
export CHROMIUM_EXECUTABLE_PATH=chromium
pnpm start
'';
in stdenv.mkDerivation
{
inherit name;
phases = [ "installPhase" ];
installPhase =
''
runHook preInstall
mkdir -p $out/bin
cp ${startScript} $out/bin/rsshub
runHook postInstall
'';
}
in writeShellScriptBin "rsshub"
''
cd ${unwrapped}
export PATH=${lib.makeBinPath [ bash nodejs nodejs.pkgs.pnpm chromium ]}:$PATH
export CHROMIUM_EXECUTABLE_PATH=chromium
pnpm start
''

View File

@@ -72,7 +72,7 @@ inputs:
menuentry "UEFI Shell" {
insmod fat
insmod chain
chainloader /shell.efi
chainloader @bootRoot@/shell.efi
}
''
)

View File

@@ -4,7 +4,7 @@ inputs:
{
# marches allowed to be compiled on this machine
marches = mkOption { type = types.nullOr (types.listOf types.nonEmptyStr); default = null; };
includeBuildDependencies = mkOption { type = types.bool; default = inputs.topInputs.self.config.production; };
includeBuildDependencies = mkOption { type = types.bool; default = inputs.topInputs.self.config.archive; };
substituters = mkOption { type = types.nullOr (types.listOf types.nonEmptyStr); default = null; };
autoOptimiseStore = mkOption { type = types.bool; default = false; };
};