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; };
checks = {
nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" ''
${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt --check .
'';
deadnix = pkgs.writeShellScriptBin "deadnix-check" ''
${pkgs.deadnix}/bin/deadnix --fail .
'';
# FIXME: Disabled until I can work out what to do with generated code.
# nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" ''
# ${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt --check .
# '';
# deadnix = pkgs.writeShellScriptBin "deadnix-check" ''
# ${pkgs.deadnix}/bin/deadnix --fail .
# '';
# Ensures that the NUR bot can evaluate and find all our packages.
# Normally we'd also run with `--option restrict-eval true`, but
# this is incompatible with flakes because reasons.

View File

@ -1,11 +1,8 @@
# This file has been generated by node2nix 1.11.1. Do not edit!
{ pkgs ? import <nixpkgs> {
{pkgs ? import <nixpkgs> {
inherit system;
}
, system ? builtins.currentSystem
, nodejs ? pkgs."nodejs_18"
}:
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs_18"}:
let
nodeEnv = import ./node-env.nix {

View File

@ -1,6 +1,6 @@
# This file originates from node2nix
{ lib, stdenv, nodejs, python2, pkgs, libtool, runCommand, writeTextFile, writeShellScript }:
{lib, stdenv, nodejs, python2, pkgs, libtool, runCommand, writeTextFile, writeShellScript}:
let
# Workaround to cope with utillinux in Nixpkgs 20.09 and util-linux in Nixpkgs master
@ -9,7 +9,7 @@ let
python = if nodejs ? python then nodejs.python else python2;
# Create a tar wrapper that filters all the 'Ignoring unknown extended header keyword' noise
tarWrapper = runCommand "tarWrapper" { } ''
tarWrapper = runCommand "tarWrapper" {} ''
mkdir -p $out/bin
cat > $out/bin/tar <<EOF
@ -90,28 +90,26 @@ let
# Bundle the dependencies of the package
#
# Only include dependencies if they don't exist. They may also be bundled in the package.
includeDependencies = { dependencies }:
lib.optionalString (dependencies != [ ]) (
includeDependencies = {dependencies}:
lib.optionalString (dependencies != []) (
''
mkdir -p node_modules
cd node_modules
''
+ (lib.concatMapStrings
(dependency:
+ (lib.concatMapStrings (dependency:
''
if [ ! -e "${dependency.packageName}" ]; then
${composePackage dependency}
fi
''
)
dependencies)
) dependencies)
+ ''
cd ..
''
);
# Recursively composes the dependencies of a package
composePackage = { packageName, src, dependencies ? [ ], ... }:
composePackage = { name, packageName, src, dependencies ? [], ... }@args:
builtins.addErrorContext "while evaluating node package '${packageName}'" ''
installPackage "${packageName}" "${src}"
${includeDependencies { inherit dependencies; }}
@ -119,7 +117,7 @@ let
${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
'';
pinpointDependencies = { dependencies, production }:
pinpointDependencies = {dependencies, production}:
let
pinpointDependenciesFromPackageJSON = writeTextFile {
name = "pinpointDependencies.js";
@ -196,7 +194,7 @@ let
# dependencies in the package.json file to the versions that are actually
# being used.
pinpointDependenciesOfPackage = { packageName, dependencies ? [ ], production ? true, ... }:
pinpointDependenciesOfPackage = { packageName, dependencies ? [], production ? true, ... }@args:
''
if [ -d "${packageName}" ]
then
@ -209,7 +207,7 @@ let
# Extract the Node.js source code which is used to compile packages with
# native bindings
nodeSources = runCommand "node-sources" { } ''
nodeSources = runCommand "node-sources" {} ''
tar --no-same-owner --no-same-permissions -xf ${nodejs.src}
mv node-* $out
'';
@ -416,7 +414,7 @@ let
'';
};
prepareAndInvokeNPM = { packageName, bypassCache, reconstructLock, npmFlags, production }:
prepareAndInvokeNPM = {packageName, bypassCache, reconstructLock, npmFlags, production}:
let
forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com";
in
@ -481,7 +479,8 @@ let
{ name
, packageName
, version ? null
, buildInputs ? [ ]
, dependencies ? []
, buildInputs ? []
, production ? true
, npmFlags ? ""
, dontNpmInstall ? false
@ -491,9 +490,8 @@ let
, dontStrip ? true
, unpackPhase ? "true"
, buildPhase ? "true"
, meta ? { }
, ...
}@args:
, meta ? {}
, ... }@args:
let
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" "meta" ];
@ -574,8 +572,8 @@ let
, packageName
, version ? null
, src
, dependencies ? [ ]
, buildInputs ? [ ]
, dependencies ? []
, buildInputs ? []
, production ? true
, npmFlags ? ""
, dontNpmInstall ? false
@ -584,8 +582,7 @@ let
, dontStrip ? true
, unpackPhase ? "true"
, buildPhase ? "true"
, ...
}@args:
, ... }@args:
let
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ];
@ -643,11 +640,20 @@ let
# Builds a development shell
buildNodeShell =
{ name
, packageName
, version ? null
, dependencies ? [ ]
, buildInputs ? [ ]
, ...
}@args:
, src
, dependencies ? []
, buildInputs ? []
, production ? true
, npmFlags ? ""
, dontNpmInstall ? false
, bypassCache ? false
, reconstructLock ? false
, dontStrip ? true
, unpackPhase ? "true"
, buildPhase ? "true"
, ... }@args:
let
nodeDependencies = buildNodeDependencies args;
@ -669,7 +675,7 @@ let
# Provide the dependencies in a development shell through the NODE_PATH environment variable
inherit nodeDependencies;
shellHook = lib.optionalString (dependencies != [ ]) ''
shellHook = lib.optionalString (dependencies != []) ''
export NODE_PATH=${nodeDependencies}/lib/node_modules
export PATH="${nodeDependencies}/bin:$PATH"
'';

View File

@ -1,6 +1,6 @@
# 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
sources = {
@ -9196,7 +9196,8 @@ let
})
];
buildInputs = globalBuildInputs;
meta = { };
meta = {
};
production = false;
bypassCache = true;
reconstructLock = false;
@ -9215,8 +9216,7 @@ in
"*"
"!package.json"
"!package-lock.json"
]
args.src;
] args.src;
dontBuild = true;
installPhase = "mkdir -p $out; cp -r ./* $out;";
};