Compare commits

..

2 Commits

Author SHA1 Message Date
b130423331
flake: disable linters 2023-09-27 17:24:53 +10:00
fc9e687e8d
modules/betanin: simplify configuration
Use secret settings configuration that a handful of other NixOS modules
do. Remove assertions. Remove beets config file setting.
2023-09-27 17:24:50 +10:00
4 changed files with 129 additions and 125 deletions

View File

@ -18,12 +18,13 @@
packages = import ./pkgs/top-level { localSystem = system; inherit pkgs; }; packages = import ./pkgs/top-level { localSystem = system; inherit pkgs; };
checks = { checks = {
nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" '' # FIXME: Disabled until I can work out what to do with generated code.
${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt --check . # nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" ''
''; # ${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt --check .
deadnix = pkgs.writeShellScriptBin "deadnix-check" '' # '';
${pkgs.deadnix}/bin/deadnix --fail . # deadnix = pkgs.writeShellScriptBin "deadnix-check" ''
''; # ${pkgs.deadnix}/bin/deadnix --fail .
# '';
# Ensures that the NUR bot can evaluate and find all our packages. # Ensures that the NUR bot can evaluate and find all our packages.
# Normally we'd also run with `--option restrict-eval true`, but # Normally we'd also run with `--option restrict-eval true`, but
# this is incompatible with flakes because reasons. # this is incompatible with flakes because reasons.

View File

@ -2,10 +2,7 @@
{pkgs ? import <nixpkgs> { {pkgs ? import <nixpkgs> {
inherit system; inherit system;
} }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs_18"}:
, system ? builtins.currentSystem
, nodejs ? pkgs."nodejs_18"
}:
let let
nodeEnv = import ./node-env.nix { nodeEnv = import ./node-env.nix {

View File

@ -96,22 +96,20 @@ let
mkdir -p node_modules mkdir -p node_modules
cd node_modules cd node_modules
'' ''
+ (lib.concatMapStrings + (lib.concatMapStrings (dependency:
(dependency:
'' ''
if [ ! -e "${dependency.packageName}" ]; then if [ ! -e "${dependency.packageName}" ]; then
${composePackage dependency} ${composePackage dependency}
fi fi
'' ''
) ) dependencies)
dependencies)
+ '' + ''
cd .. cd ..
'' ''
); );
# Recursively composes the dependencies of a package # Recursively composes the dependencies of a package
composePackage = { packageName, src, dependencies ? [ ], ... }: composePackage = { name, packageName, src, dependencies ? [], ... }@args:
builtins.addErrorContext "while evaluating node package '${packageName}'" '' builtins.addErrorContext "while evaluating node package '${packageName}'" ''
installPackage "${packageName}" "${src}" installPackage "${packageName}" "${src}"
${includeDependencies { inherit dependencies; }} ${includeDependencies { inherit dependencies; }}
@ -196,7 +194,7 @@ let
# dependencies in the package.json file to the versions that are actually # dependencies in the package.json file to the versions that are actually
# being used. # being used.
pinpointDependenciesOfPackage = { packageName, dependencies ? [ ], production ? true, ... }: pinpointDependenciesOfPackage = { packageName, dependencies ? [], production ? true, ... }@args:
'' ''
if [ -d "${packageName}" ] if [ -d "${packageName}" ]
then then
@ -481,6 +479,7 @@ let
{ name { name
, packageName , packageName
, version ? null , version ? null
, dependencies ? []
, buildInputs ? [] , buildInputs ? []
, production ? true , production ? true
, npmFlags ? "" , npmFlags ? ""
@ -492,8 +491,7 @@ let
, unpackPhase ? "true" , unpackPhase ? "true"
, buildPhase ? "true" , buildPhase ? "true"
, meta ? {} , meta ? {}
, ... , ... }@args:
}@args:
let let
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" "meta" ]; extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" "meta" ];
@ -584,8 +582,7 @@ let
, dontStrip ? true , dontStrip ? true
, unpackPhase ? "true" , unpackPhase ? "true"
, buildPhase ? "true" , buildPhase ? "true"
, ... , ... }@args:
}@args:
let let
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ]; extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ];
@ -643,11 +640,20 @@ let
# Builds a development shell # Builds a development shell
buildNodeShell = buildNodeShell =
{ name { name
, packageName
, version ? null , version ? null
, src
, dependencies ? [] , dependencies ? []
, buildInputs ? [] , buildInputs ? []
, ... , production ? true
}@args: , npmFlags ? ""
, dontNpmInstall ? false
, bypassCache ? false
, reconstructLock ? false
, dontStrip ? true
, unpackPhase ? "true"
, buildPhase ? "true"
, ... }@args:
let let
nodeDependencies = buildNodeDependencies args; nodeDependencies = buildNodeDependencies args;

View File

@ -1,6 +1,6 @@
# This file has been generated by node2nix 1.11.1. Do not edit! # This file has been generated by node2nix 1.11.1. Do not edit!
{ nodeEnv, fetchurl, nix-gitignore, stdenv, lib, globalBuildInputs ? [ ] }: {nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:
let let
sources = { sources = {
@ -9196,7 +9196,8 @@ let
}) })
]; ];
buildInputs = globalBuildInputs; buildInputs = globalBuildInputs;
meta = { }; meta = {
};
production = false; production = false;
bypassCache = true; bypassCache = true;
reconstructLock = false; reconstructLock = false;
@ -9215,8 +9216,7 @@ in
"*" "*"
"!package.json" "!package.json"
"!package-lock.json" "!package-lock.json"
] ] args.src;
args.src;
dontBuild = true; dontBuild = true;
installPhase = "mkdir -p $out; cp -r ./* $out;"; installPhase = "mkdir -p $out; cp -r ./* $out;";
}; };