treewide: remove bower

Changed files
+16 -339
doc
languages-frameworks
release-notes
pkgs
build-support
fetchbower
by-name
bo
bower2nix
development
bower-modules
generic
node-packages
top-level
-147
doc/languages-frameworks/bower.section.md
···
-
# Bower {#sec-bower}
-
-
[Bower](https://bower.io) is a package manager for web site front-end components. Bower packages (comprising of build artifacts and sometimes sources) are stored in `git` repositories, typically on Github. The package registry is run by the Bower team with package metadata coming from the `bower.json` file within each package.
-
-
The end result of running Bower is a `bower_components` directory which can be included in the web app's build process.
-
-
Bower can be run interactively, by installing `nodePackages.bower`. More interestingly, the Bower components can be declared in a Nix derivation, with the help of `bower2nix`.
-
-
## bower2nix usage {#ssec-bower2nix-usage}
-
-
Suppose you have a `bower.json` with the following contents:
-
-
### Example bower.json {#ex-bowerJson}
-
-
```json
-
"name": "my-web-app",
-
"dependencies": {
-
"angular": "~1.5.0",
-
"bootstrap": "~3.3.6"
-
}
-
```
-
-
Running `bower2nix` will produce something like the following output:
-
-
```nix
-
{ fetchbower, buildEnv }:
-
buildEnv {
-
name = "bower-env";
-
ignoreCollisions = true;
-
paths = [
-
(fetchbower "angular" "1.5.3" "~1.5.0" "1749xb0firxdra4rzadm4q9x90v6pzkbd7xmcyjk6qfza09ykk9y")
-
(fetchbower "bootstrap" "3.3.6" "~3.3.6" "1vvqlpbfcy0k5pncfjaiskj3y6scwifxygfqnw393sjfxiviwmbv")
-
(fetchbower "jquery" "2.2.2" "1.9.1 - 2" "10sp5h98sqwk90y4k6hbdviwqzvzwqf47r3r51pakch5ii2y7js1")
-
];
-
}
-
```
-
-
Using the `bower2nix` command line arguments, the output can be redirected to a file. A name like `bower-packages.nix` would be fine.
-
-
The resulting derivation is a union of all the downloaded Bower packages (and their dependencies). To use it, they still need to be linked together by Bower, which is where `buildBowerComponents` is useful.
-
-
## buildBowerComponents function {#ssec-build-bower-components}
-
-
The function is implemented in [pkgs/development/bower-modules/generic/default.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/bower-modules/generic/default.nix).
-
-
### Example buildBowerComponents {#ex-buildBowerComponents}
-
-
```nix
-
{
-
bowerComponents = buildBowerComponents {
-
name = "my-web-app";
-
generated = ./bower-packages.nix; # note 1
-
src = myWebApp; # note 2
-
};
-
}
-
```
-
-
In ["buildBowerComponents" example](#ex-buildBowerComponents) the following arguments are of special significance to the function:
-
-
1. `generated` specifies the file which was created by {command}`bower2nix`.
-
2. `src` is your project's sources. It needs to contain a {file}`bower.json` file.
-
-
`buildBowerComponents` will run Bower to link together the output of `bower2nix`, resulting in a `bower_components` directory which can be used.
-
-
Here is an example of a web frontend build process using `gulp`. You might use `grunt`, or anything else.
-
-
### Example build script (gulpfile.js) {#ex-bowerGulpFile}
-
-
```javascript
-
var gulp = require('gulp');
-
-
gulp.task('default', [], function () {
-
gulp.start('build');
-
});
-
-
gulp.task('build', [], function () {
-
console.log("Just a dummy gulp build");
-
gulp
-
.src(["./bower_components/**/*"])
-
.pipe(gulp.dest("./gulpdist/"));
-
});
-
```
-
-
### Example Full example — default.nix {#ex-buildBowerComponentsDefaultNix}
-
-
```nix
-
{
-
myWebApp ? {
-
outPath = ./.;
-
name = "myWebApp";
-
},
-
pkgs ? import <nixpkgs> { },
-
}:
-
-
pkgs.stdenv.mkDerivation {
-
name = "my-web-app-frontend";
-
src = myWebApp;
-
-
buildInputs = [ pkgs.nodePackages.gulp ];
-
-
bowerComponents = pkgs.buildBowerComponents {
-
# note 1
-
name = "my-web-app";
-
generated = ./bower-packages.nix;
-
src = myWebApp;
-
};
-
-
nativeBuildInputs = [
-
writableTmpDirAsHomeHook # note 3
-
];
-
-
buildPhase = ''
-
runHook preBuild
-
-
cp --reflink=auto --no-preserve=mode -R $bowerComponents/bower_components . # note 2
-
${pkgs.nodePackages.gulp}/bin/gulp build # note 4
-
-
runHook postBuild
-
'';
-
-
installPhase = ''
-
runHook preInstall
-
-
mv gulpdist $out
-
-
runHook postInstall
-
'';
-
}
-
```
-
-
A few notes about [Full example — `default.nix`](#ex-buildBowerComponentsDefaultNix):
-
-
1. The result of `buildBowerComponents` is an input to the frontend build.
-
2. Whether to symlink or copy the {file}`bower_components` directory depends on the build tool in use.
-
In this case, a copy is used to avoid {command}`gulp` silliness with permissions.
-
3. {command}`gulp` requires `HOME` to refer to a writeable directory.
-
4. The actual build command in this example is {command}`gulp`. Other tools could be used instead.
-
-
## Troubleshooting {#ssec-bower2nix-troubleshooting}
-
-
### ENOCACHE errors from buildBowerComponents {#enocache-errors-from-buildbowercomponents}
-
-
This means that Bower was looking for a package version which doesn't exist in the generated `bower-packages.nix`.
-
-
If `bower.json` has been updated, then run `bower2nix` again.
-
-
It could also be a bug in `bower2nix` or `fetchbower`. If possible, try reformulating the version specification in `bower.json`.
-1
doc/languages-frameworks/index.md
···
android.section.md
astal.section.md
beam.section.md
-
bower.section.md
chicken.section.md
coq.section.md
cosmic.section.md
+10 -28
doc/redirects.json
···
"release-notes.html#sec-nixpkgs-release-25.11-highlights"
],
"sec-nixpkgs-release-25.11-incompatibilities": [
-
"release-notes.html#sec-nixpkgs-release-25.11-incompatibilities"
+
"release-notes.html#sec-nixpkgs-release-25.11-incompatibilities",
+
"index.html#enocache-errors-from-buildbowercomponents",
+
"index.html#ex-bowerGulpFile",
+
"index.html#ex-bowerJson",
+
"index.html#ex-buildBowerComponents",
+
"index.html#ex-buildBowerComponentsDefaultNix",
+
"index.html#sec-bower",
+
"index.html#ssec-bower2nix-troubleshooting",
+
"index.html#ssec-bower2nix-usage",
+
"index.html#ssec-build-bower-components"
],
"sec-nixpkgs-release-25.11-lib": [
"release-notes.html#sec-nixpkgs-release-25.11-lib"
···
],
"elixir---phoenix-project": [
"index.html#elixir---phoenix-project"
-
],
-
"sec-bower": [
-
"index.html#sec-bower"
-
],
-
"ssec-bower2nix-usage": [
-
"index.html#ssec-bower2nix-usage"
-
],
-
"ex-bowerJson": [
-
"index.html#ex-bowerJson"
-
],
-
"ssec-build-bower-components": [
-
"index.html#ssec-build-bower-components"
-
],
-
"ex-buildBowerComponents": [
-
"index.html#ex-buildBowerComponents"
-
],
-
"ex-bowerGulpFile": [
-
"index.html#ex-bowerGulpFile"
-
],
-
"ex-buildBowerComponentsDefaultNix": [
-
"index.html#ex-buildBowerComponentsDefaultNix"
-
],
-
"ssec-bower2nix-troubleshooting": [
-
"index.html#ssec-bower2nix-troubleshooting"
-
],
-
"enocache-errors-from-buildbowercomponents": [
-
"index.html#enocache-errors-from-buildbowercomponents"
],
"sec-chicken": [
"index.html#sec-chicken"
+2
doc/release-notes/rl-2511.section.md
···
- `mono4` and `mono5` have been removed. Use `mono6` or `mono` instead.
+
- Everything related to `bower` was removed, as it is deprecated and not used by anything in nixpkgs.
+
- The `offrss` package was removed due to lack of upstream maintenance since 2012. It's recommended for users to migrate to another RSS reader
- `installShellFiles`: Allow installManPage to take a piped input, add the `--name` flag for renaming the file when installed. Can also append `--` to opt-out of all subsequent parsing.
-41
pkgs/build-support/fetchbower/default.nix
···
-
{
-
stdenvNoCC,
-
lib,
-
bower2nix,
-
cacert,
-
}:
-
let
-
bowerVersion =
-
version:
-
let
-
components = lib.splitString "#" version;
-
hash = lib.last components;
-
ver = if builtins.length components == 1 then (cleanName version) else hash;
-
in
-
ver;
-
-
cleanName = name: lib.replaceStrings [ "/" ":" ] [ "-" "-" ] name;
-
-
fetchbower =
-
name: version: target: outputHash:
-
stdenvNoCC.mkDerivation {
-
name = "${cleanName name}-${bowerVersion version}";
-
buildCommand = ''
-
fetch-bower --quiet --out=$PWD/out "${name}" "${target}" "${version}"
-
# In some cases, the result of fetchBower is different depending
-
# on the output directory (e.g. if the bower package contains
-
# symlinks). So use a local output directory before copying to
-
# $out.
-
cp -R out $out
-
'';
-
outputHashMode = "recursive";
-
outputHashAlgo = "sha256";
-
inherit outputHash;
-
nativeBuildInputs = [
-
bower2nix
-
cacert
-
];
-
};
-
-
in
-
fetchbower
-44
pkgs/by-name/bo/bower2nix/package.nix
···
-
{
-
buildNpmPackage,
-
fetchFromGitHub,
-
git,
-
lib,
-
nix,
-
unstableGitUpdater,
-
}:
-
-
buildNpmPackage rec {
-
pname = "bower2nix";
-
version = "3.2.0-unstable-2024-06-25";
-
-
src = fetchFromGitHub {
-
owner = "rvl";
-
repo = "bower2nix";
-
rev = "b5da44f055c7561ed7a46226b3be0070e07d80e6";
-
hash = "sha256-da+m2UWQ83tW1o0P1qvw35KpsXL/BDTeShg4KxL+7Ck=";
-
};
-
-
npmDepsHash = "sha256-TK1sqF2J/hQuP3bgGA4MolLA7LWWuYNnqf4gDyU154k=";
-
-
npmBuildScript = "prepare";
-
-
makeWrapperArgs = [
-
"--prefix PATH : ${
-
lib.makeBinPath [
-
git
-
nix
-
]
-
}"
-
];
-
-
passthru.updateScript = unstableGitUpdater { tagPrefix = "v"; };
-
-
meta = {
-
changelog = "https://github.com/rvl/bower2nix/releases/tag/v${version}";
-
description = "Generate nix expressions to fetch bower dependencies";
-
homepage = "https://github.com/rvl/bower2nix";
-
license = lib.licenses.gpl3Only;
-
mainProgram = "bower2nix";
-
maintainers = [ ];
-
};
-
}
-51
pkgs/development/bower-modules/generic/default.nix
···
-
{ pkgs }:
-
-
{
-
buildInputs ? [ ],
-
generated,
-
...
-
}@attrs:
-
-
let
-
# Fetches the bower packages. `generated` should be the result of a
-
# `bower2nix` command.
-
bowerPackages = import generated {
-
inherit (pkgs) buildEnv fetchbower;
-
};
-
-
in
-
pkgs.stdenv.mkDerivation (
-
attrs
-
// {
-
name = "bower_components-" + attrs.name;
-
-
inherit bowerPackages;
-
-
builder = builtins.toFile "builder.sh" ''
-
# The project's bower.json is required
-
cp $src/bower.json .
-
-
# Dereference symlinks -- bower doesn't like them
-
cp --recursive --reflink=auto \
-
--dereference --no-preserve=mode \
-
$bowerPackages bc
-
-
# Bower install in offline mode -- links together the fetched
-
# bower packages.
-
HOME=$PWD bower \
-
--config.storage.packages=bc/packages \
-
--config.storage.registry=bc/registry \
-
--offline install
-
-
# Sets up a single bower_components directory within
-
# the output derivation.
-
mkdir -p $out
-
mv bower_components $out
-
'';
-
-
buildInputs = buildInputs ++ [
-
pkgs.git
-
pkgs.nodePackages.bower
-
];
-
}
-
)
+1
pkgs/development/node-packages/aliases.nix
···
inherit (pkgs) bash-language-server; # added 2024-06-07
bibtex-tidy = pkgs.bibtex-tidy; # added 2023-07-30
bitwarden-cli = pkgs.bitwarden-cli; # added 2023-07-25
+
bower = throw "bower was removed because it was deprecated"; # added 2025-09-17
inherit (pkgs) bower2nix; # added 2024-08-23
inherit (pkgs) btc-rpc-explorer; # added 2023-08-17
inherit (pkgs) carbon-now-cli; # added 2023-08-17
-1
pkgs/development/node-packages/node-packages.json
···
, "audiosprite"
, "aws-cdk"
, "awesome-lint"
-
, "bower"
, "browserify"
, "browser-sync"
, "cdk8s-cli"
-18
pkgs/development/node-packages/node-packages.nix
···
bypassCache = true;
reconstructLock = true;
-
bower = nodeEnv.buildNodePackage {
-
name = "bower";
-
packageName = "bower";
-
version = "1.8.14";
-
src = fetchurl {
-
url = "https://registry.npmjs.org/bower/-/bower-1.8.14.tgz";
-
sha512 = "8Rq058FD91q9Nwthyhw0la9fzpBz0iwZTrt51LWl+w+PnJgZk9J+5wp3nibsJcIUPglMYXr4NRBaR+TUj0OkBQ==";
-
};
-
buildInputs = globalBuildInputs;
-
meta = {
-
description = "The browser package manager";
-
homepage = "http://bower.io";
-
license = "MIT";
-
};
-
production = true;
-
bypassCache = true;
-
reconstructLock = true;
-
};
browserify = nodeEnv.buildNodePackage {
name = "browserify";
packageName = "browserify";
+3
pkgs/top-level/aliases.nix
···
boost184 = throw "Boost 1.84 has been removed as it is obsolete and no longer used by anything in Nixpkgs"; # Added 2024-11-24
boost185 = throw "Boost 1.85 has been removed as it is obsolete and no longer used by anything in Nixpkgs"; # Added 2024-11-24
boost_process = throw "boost_process has been removed as it is included in regular boost"; # Added 2024-05-01
+
bower2nix = throw "bower2nix has been removed as bower was removed. It is recommended to migrate to yarn."; # Added 2025-09-17
bpb = throw "bpb has been removed as it is unmaintained and not compatible with recent Rust versions"; # Added 2024-04-30
bpftool = throw "'bpftool' has been renamed to/replaced by 'bpftools'"; # Converted to throw 2024-10-17
brasero-original = lib.warnOnInstantiate "Use 'brasero-unwrapped' instead of 'brasero-original'" brasero-unwrapped; # Added 2024-09-29
···
budgie = throw "The `budgie` scope has been removed and all packages moved to the top-level"; # Added 2024-07-14
budgiePlugins = throw "The `budgiePlugins` scope has been removed and all packages moved to the top-level"; # Added 2024-07-14
buildBarebox = throw "buildBarebox has been removed due to lack of interest in maintaining it in nixpkgs"; # Added 2025-04-19
+
buildBowerComponents = throw "buildBowerComponents has been removed as bower was removed. It is recommended to migrate to yarn."; # Added 2025-09-17
buildGo122Module = throw "Go 1.22 is end-of-life, and 'buildGo122Module' has been removed. Please use a newer builder version."; # Added 2025-03-28
buildGo123Module = throw "Go 1.23 is end-of-life, and 'buildGo123Module' has been removed. Please use a newer builder version."; # Added 2025-08-13
buildGoPackage = throw "`buildGoPackage` has been deprecated and removed, see the Go section in the nixpkgs manual for details"; # Added 2024-11-18
···
fdr = throw "fdr has been removed, as it cannot be built from source and depends on Python 2.x"; # Added 2025-03-19
inherit (luaPackages) fennel; # Added 2022-09-24
ferdi = throw "'ferdi' has been removed, upstream does not exist anymore and the package is insecure"; # Added 2024-08-22
+
fetchbower = throw "fetchbower has been removed as bower was removed. It is recommended to migrate to yarn."; # Added 2025-09-17
fetchFromGithub = throw "You meant fetchFromGitHub, with a capital H"; # preserve, reason: common typo
ffmpeg_5 = throw "ffmpeg_5 has been removed, please use another version"; # Added 2024-07-12
ffmpeg_5-headless = throw "ffmpeg_5-headless has been removed, please use another version"; # Added 2024-07-12
-8
pkgs/top-level/all-packages.nix
···
python3Packages = python311Packages;
};
-
fetchbower = callPackage ../build-support/fetchbower { };
-
fetchbzr = callPackage ../build-support/fetchbzr { };
fetchcvs =
···
saxon_11-he
saxon_12-he
-
-
### DEVELOPMENT / LIBRARIES / JAVASCRIPT
-
-
### DEVELOPMENT / BOWER MODULES (JAVASCRIPT)
-
-
buildBowerComponents = callPackage ../development/bower-modules/generic { };
### DEVELOPMENT / GO