forked from lix-project/nixos-module
Compare commits
15 commits
release-2.
...
main
Author | SHA1 | Date | |
---|---|---|---|
jade | aa2846680f | ||
jade | 6391b9f659 | ||
jade | 691193879d | ||
jade | fd186f535a | ||
Fabián Heredia Montiel | 81d9ff97c9 | ||
jade | 7dd3d652a3 | ||
jade | ca0cc16273 | ||
jade | bb51b2d161 | ||
Fabián Heredia Montiel | b3457b78ac | ||
jade | b0e6f35950 | ||
jade | daeb420858 | ||
Morgan Helton | 0dda988746 | ||
eldritch horrors | 353b25f0b6 | ||
jade | cecf70b775 | ||
jade | 542fb09131 |
22
flake.lock
22
flake.lock
|
@ -5,11 +5,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710146030,
|
"lastModified": 1731533236,
|
||||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -36,24 +36,24 @@
|
||||||
"lix": {
|
"lix": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723503926,
|
"lastModified": 1731683711,
|
||||||
"narHash": "sha256-Rosl9iA9MybF5Bud4BTAQ9adbY81aGmPfV8dDBGl34s=",
|
"narHash": "sha256-bq21I1EjXJa/s5Rra9J9ot2NkPCnI0F5uNPurwYLdpE=",
|
||||||
"rev": "bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2",
|
"rev": "c859d03013712b349d82ee6223948d6d03e63a8d",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2.tar.gz?rev=bcaeb6388b8916ac6d1736e3aa2b13313e6a6bd2"
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/c859d03013712b349d82ee6223948d6d03e63a8d.tar.gz?rev=c859d03013712b349d82ee6223948d6d03e63a8d"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz"
|
"url": "https://git.lix.systems/lix-project/lix/archive/main.tar.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723175592,
|
"lastModified": 1731676054,
|
||||||
"narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=",
|
"narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5e0ca22929f3342b19569b21b2f3462f053e497b",
|
"rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
inputs.lix = {
|
inputs.lix = {
|
||||||
url = "https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz";
|
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
{
|
{
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
packages = {
|
packages = {
|
||||||
default = pkgs.nixVersions.nix_2_18;
|
default = pkgs.nix;
|
||||||
inherit (pkgs) nix-doc nix-eval-jobs;
|
inherit (pkgs) nix-doc nix-eval-jobs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,6 +57,7 @@
|
||||||
|
|
||||||
checks = {
|
checks = {
|
||||||
inherit (self.packages.${system}) default nix-eval-jobs;
|
inherit (self.packages.${system}) default nix-eval-jobs;
|
||||||
|
inherit (pkgs) nixos-option nix-doc;
|
||||||
} // lib.optionalAttrs (lib.elem system linux64BitSystems) {
|
} // lib.optionalAttrs (lib.elem system linux64BitSystems) {
|
||||||
# wrongMajor intentionally not included here since it is expected to fail
|
# wrongMajor intentionally not included here since it is expected to fail
|
||||||
inherit (self.nixosTests.${system}) it-builds;
|
inherit (self.nixosTests.${system}) it-builds;
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
# Temporary replacement of the nix-doc package with
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/296523 so that we can have working Lix
|
|
||||||
# with nix-doc on 23.11 and 24.05-pre
|
|
||||||
#
|
|
||||||
# Can be removed when that commit is in 23.11 and 24.05-pre, or 24.05 is
|
|
||||||
# released with the commit.
|
|
||||||
{ lib
|
|
||||||
, stdenv
|
|
||||||
, rustPlatform
|
|
||||||
, fetchFromGitHub
|
|
||||||
, boost
|
|
||||||
, nix
|
|
||||||
, pkg-config
|
|
||||||
# Whether to build the nix-doc plugin for Nix
|
|
||||||
, withPlugin ? true
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
packageFlags = [ "-p" "nix-doc" ] ++ lib.optionals withPlugin [ "-p" "nix-doc-plugin" ];
|
|
||||||
in
|
|
||||||
rustPlatform.buildRustPackage rec {
|
|
||||||
pname = "nix-doc";
|
|
||||||
version = "0.6.5";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
rev = "v${version}";
|
|
||||||
owner = "lf-";
|
|
||||||
repo = "nix-doc";
|
|
||||||
sha256 = "sha256-9cuNzq+CBA2jz0LkZb7lh/WISIlKklfovGBAbSo1Mgk=";
|
|
||||||
};
|
|
||||||
|
|
||||||
doCheck = true;
|
|
||||||
buildInputs = lib.optionals withPlugin [ boost nix ];
|
|
||||||
|
|
||||||
nativeBuildInputs = lib.optionals withPlugin [ pkg-config nix ];
|
|
||||||
|
|
||||||
cargoBuildFlags = packageFlags;
|
|
||||||
cargoTestFlags = packageFlags;
|
|
||||||
|
|
||||||
# Packaging support for making the nix-doc plugin load cleanly as a no-op on
|
|
||||||
# the wrong Nix version (disabling bindnow permits loading libraries
|
|
||||||
# requiring unavailable symbols if they are unreached)
|
|
||||||
hardeningDisable = lib.optionals withPlugin [ "bindnow" ];
|
|
||||||
# Due to a Rust bug, setting -Z relro-level to anything including "off" on
|
|
||||||
# macOS will cause link errors
|
|
||||||
env = lib.optionalAttrs (withPlugin && stdenv.isLinux) {
|
|
||||||
# nix-doc does not use nightly features, however, there is no other way to
|
|
||||||
# set relro-level
|
|
||||||
RUSTC_BOOTSTRAP = 1;
|
|
||||||
RUSTFLAGS = "-Z relro-level=partial";
|
|
||||||
};
|
|
||||||
|
|
||||||
cargoSha256 = "sha256-CHagzXTG9AfrFd3WmHanQ+YddMgmVxSuB8vK98A1Mlw=";
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "An interactive Nix documentation tool";
|
|
||||||
longDescription = "An interactive Nix documentation tool providing a CLI for function search, a Nix plugin for docs in the REPL, and a ctags implementation for Nix script";
|
|
||||||
homepage = "https://github.com/lf-/nix-doc";
|
|
||||||
license = licenses.lgpl3Plus;
|
|
||||||
maintainers = [ maintainers.lf- ];
|
|
||||||
platforms = platforms.unix;
|
|
||||||
mainProgram = "nix-doc";
|
|
||||||
};
|
|
||||||
}
|
|
60
overlay.nix
60
overlay.nix
|
@ -1,16 +1,14 @@
|
||||||
{ lix, versionSuffix ? "" }:
|
{ lix, versionSuffix ? "" }:
|
||||||
final: prev:
|
final: prev:
|
||||||
let
|
let
|
||||||
# This is kind of scary to not override the nix version to pretend to be
|
|
||||||
# 2.18 since nixpkgs can introduce new breakage in its Nix unstable CLI
|
|
||||||
# usage.
|
|
||||||
# https://github.com/nixos/nixpkgs/blob/6afb255d976f85f3359e4929abd6f5149c323a02/nixos/modules/config/nix.nix#L121
|
|
||||||
lixPackageFromSource = final.callPackage (lix + "/package.nix") ({
|
lixPackageFromSource = final.callPackage (lix + "/package.nix") ({
|
||||||
inherit versionSuffix;
|
inherit versionSuffix;
|
||||||
|
stdenv = final.clangStdenv;
|
||||||
});
|
});
|
||||||
|
|
||||||
# These packages depend on Nix features that Lix does not support
|
# These packages should receive CppNix since they may link to it or otherwise
|
||||||
overridelist_2_18 = [
|
# cause problems (or even just silly mass-rebuilds) if we give them Lix
|
||||||
|
overridelist_upstream = [
|
||||||
"attic-client"
|
"attic-client"
|
||||||
"devenv"
|
"devenv"
|
||||||
"nix-du"
|
"nix-du"
|
||||||
|
@ -20,11 +18,6 @@ let
|
||||||
"nurl"
|
"nurl"
|
||||||
"prefetch-yarn-deps" # force these onto upstream so we are not regularly rebuilding electron
|
"prefetch-yarn-deps" # force these onto upstream so we are not regularly rebuilding electron
|
||||||
];
|
];
|
||||||
override_2_18 = prev.lib.genAttrs overridelist_2_18 (
|
|
||||||
name: prev.${name}.override {
|
|
||||||
nix = final.nixVersions.nix_2_18_upstream;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
inherit (prev) lib;
|
inherit (prev) lib;
|
||||||
|
|
||||||
|
@ -64,7 +57,37 @@ let
|
||||||
# errors. This is a simple safeguard to put in at least something that might be seen.
|
# errors. This is a simple safeguard to put in at least something that might be seen.
|
||||||
maybeWarnWrongMajor = x: if !(lib.hasPrefix supportedLixMajor lixPackageToUse.version) then builtins.trace wrongMajorWarning x else x;
|
maybeWarnWrongMajor = x: if !(lib.hasPrefix supportedLixMajor lixPackageToUse.version) then builtins.trace wrongMajorWarning x else x;
|
||||||
|
|
||||||
overlay = override_2_18 // {
|
# It is not enough to *just* throw whatever the default nix version is at
|
||||||
|
# anything in the "don't give lix" list, we have to *also* ensure that we
|
||||||
|
# give whatever upstream version as specified in the callPackage invocation.
|
||||||
|
#
|
||||||
|
# Unfortunately I don't think there is any actual way to directly query that,
|
||||||
|
# so we instead do something extremely evil and guess which version it
|
||||||
|
# probably was. This code is not generalizable to arbitrary derivations, so
|
||||||
|
# it will hopefully not make us cry, at least.
|
||||||
|
useCppNixOverlay =
|
||||||
|
lib.genAttrs overridelist_upstream (
|
||||||
|
name:
|
||||||
|
if (lib.functionArgs prev.${name}.override ? "nix") then
|
||||||
|
let
|
||||||
|
# Get the two common inputs of a derivation/package.
|
||||||
|
inputs = prev.${name}.buildInputs ++ prev.${name}.nativeBuildInputs;
|
||||||
|
nixDependency = lib.findFirst
|
||||||
|
(drv: (drv.pname or "") == "nix")
|
||||||
|
final.nixVersions.stable_upstream # default to stable nix if nix is not an input
|
||||||
|
inputs;
|
||||||
|
nixMajor = lib.versions.major (nixDependency.version or "");
|
||||||
|
nixMinor = lib.versions.minor (nixDependency.version or "");
|
||||||
|
nixAttr = "nix_${nixMajor}_${nixMinor}";
|
||||||
|
finalNix = final.nixVersions.${nixAttr};
|
||||||
|
in
|
||||||
|
prev.${name}.override {
|
||||||
|
nix = finalNix;
|
||||||
|
}
|
||||||
|
else prev.${name}
|
||||||
|
);
|
||||||
|
|
||||||
|
overlay = useCppNixOverlay // {
|
||||||
lix-overlay-present = 1;
|
lix-overlay-present = 1;
|
||||||
# used for things that one wouldn't necessarily want to update, but we
|
# used for things that one wouldn't necessarily want to update, but we
|
||||||
# nevertheless shove it in the overlay and fixed-point it in case one *does*
|
# nevertheless shove it in the overlay and fixed-point it in case one *does*
|
||||||
|
@ -73,19 +96,18 @@ let
|
||||||
|
|
||||||
lix = maybeWarnWrongMajor (maybeWarnDuplicate lixPackageToUse);
|
lix = maybeWarnWrongMajor (maybeWarnDuplicate lixPackageToUse);
|
||||||
|
|
||||||
nixVersions = prev.nixVersions // rec {
|
nixVersions = prev.nixVersions // {
|
||||||
nix_2_18 = final.lix;
|
stable = final.lix;
|
||||||
stable = nix_2_18;
|
stable_upstream = prev.nixVersions.stable;
|
||||||
nix_2_18_upstream = prev.nixVersions.nix_2_18;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nix-eval-jobs = (prev.nix-eval-jobs.override {
|
nix-eval-jobs = (prev.nix-eval-jobs.override {
|
||||||
# lix
|
# lix
|
||||||
nix = final.nixVersions.nix_2_18;
|
nix = final.lix;
|
||||||
}).overrideAttrs (old:
|
}).overrideAttrs (old:
|
||||||
let src = final.lix-sources.nix-eval-jobs;
|
let src = final.lix-sources.nix-eval-jobs;
|
||||||
in {
|
in {
|
||||||
version = "2.91.0-lix-${builtins.substring 0 7 src.rev}";
|
version = "2.92.0-lix-${builtins.substring 0 7 src.rev}";
|
||||||
|
|
||||||
# FIXME: should this be patches instead?
|
# FIXME: should this be patches instead?
|
||||||
inherit src;
|
inherit src;
|
||||||
|
@ -96,7 +118,7 @@ let
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
nix-doc = prev.callPackage ./nix-doc/package.nix { withPlugin = false; };
|
nix-doc = prev.nix-doc.override { withPlugin = false; };
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
# Make the overlay idempotent, since flakes passing nixos modules around by
|
# Make the overlay idempotent, since flakes passing nixos modules around by
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"nix-eval-jobs": {"kind": "tarball", "rev": "f8869bdcca7c1d5aaf37de3da3a4176811279a57", "nar_hash": "sha256-F/RvI9chHywnckEqHO1ggjzCayknhDnnl2kNnnVXpWg=", "locked_url": "https://git.lix.systems/api/v1/repos/lix-project/nix-eval-jobs/archive/f8869bdcca7c1d5aaf37de3da3a4176811279a57.tar.gz?rev=f8869bdcca7c1d5aaf37de3da3a4176811279a57", "url": "https://git.lix.systems/lix-project/nix-eval-jobs/archive/main.tar.gz"}}
|
{"nix-eval-jobs": {"kind": "tarball", "rev": "912a9d63319e71ca131e16eea3348145a255db2e", "nar_hash": "sha256-6xMxT2duVMO6fo1AXfTjqh7LW3ZmNiHw6kBaAhweLGo=", "locked_url": "https://git.lix.systems/api/v1/repos/lix-project/nix-eval-jobs/archive/912a9d63319e71ca131e16eea3348145a255db2e.tar.gz?rev=912a9d63319e71ca131e16eea3348145a255db2e", "url": "https://git.lix.systems/lix-project/nix-eval-jobs/archive/main.tar.gz"}}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"version": "2.91.0"
|
"version": "2.92.0-dev"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue