Compare commits
21 commits
Author | SHA1 | Date | |
---|---|---|---|
5d2b325d3a | |||
1062d3c1ff | |||
f8b5d0bc9c | |||
adbbecb518 | |||
ebdf6e66ae | |||
30a7b8f7c8 | |||
41990c5d80 | |||
f173ccc0aa | |||
4d09a927b0 | |||
7278990b5a | |||
8b7315c5b9 | |||
e61b27f3f6 | |||
|
ff76ec73c9 | ||
|
c88abb52dc | ||
89ccd6e015 | |||
7083c47d04 | |||
d2b5d0a958 | |||
a312274b08 | |||
5ca6ed5690 | |||
c4615ccc7f | |||
9ed607358a |
8 changed files with 164 additions and 34 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
result
|
||||
result-*
|
10
default.nix
Normal file
10
default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
(import
|
||||
(
|
||||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
|
||||
fetchTarball {
|
||||
url = lock.nodes.flake-compat.locked.url or "https://git.lix.systems/lix-project/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}
|
||||
)
|
||||
{ src = ./.; }
|
||||
).defaultNix
|
47
flake.lock
47
flake.lock
|
@ -1,5 +1,20 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"revCount": 57,
|
||||
"type": "git",
|
||||
"url": "ssh://git@git.lix.systems/lix-project/flake-compat"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@git.lix.systems/lix-project/flake-compat"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
|
@ -18,19 +33,35 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"lix": {
|
||||
"flakey-profile": {
|
||||
"locked": {
|
||||
"lastModified": 1709811453,
|
||||
"narHash": "sha256-UOyTAdUAJv80w3s6rrgYB5tQjp43u5Zp2dlM94uud04=",
|
||||
"lastModified": 1711325813,
|
||||
"narHash": "sha256-ygJR5VikyCfK0CUJHboOKJVr6s9HQ1RXcvFEFnv+KIk=",
|
||||
"owner": "lf-",
|
||||
"repo": "flakey-profile",
|
||||
"rev": "3b32c4a71f89b874fe0be2dc125eacb9c3473204",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lf-",
|
||||
"repo": "flakey-profile",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"lix": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1711380636,
|
||||
"narHash": "sha256-ZyCTgvZxr6YRt/Lq+XEfqWsbMG6hiGozMwmlRveamA0=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "8a268359b06471b463a8f3fc46c83a1fced8ab75",
|
||||
"revCount": 15077,
|
||||
"rev": "0be766c12de6badbbfa4fb9f76b6688b04d81059",
|
||||
"revCount": 15222,
|
||||
"type": "git",
|
||||
"url": "ssh://gerrit.lix.systems:2022/lix"
|
||||
"url": "ssh://git@git.lix.systems/lix-project/lix.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "ssh://gerrit.lix.systems:2022/lix"
|
||||
"url": "ssh://git@git.lix.systems/lix-project/lix.git"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
|
@ -51,7 +82,9 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"flakey-profile": "flakey-profile",
|
||||
"lix": "lix",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
|
|
40
flake.nix
40
flake.nix
|
@ -1,25 +1,31 @@
|
|||
{
|
||||
# fixme: use the forgejo address
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
inputs.lix = {
|
||||
url = "git+ssh://gerrit.lix.systems:2022/lix";
|
||||
url = "git+ssh://git@git.lix.systems/lix-project/lix.git";
|
||||
flake = false;
|
||||
};
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.flake-compat.url = "git+ssh://git@git.lix.systems/lix-project/flake-compat";
|
||||
inputs.flakey-profile.url = "github:lf-/flakey-profile";
|
||||
|
||||
outputs = { self, nixpkgs, lix, flake-utils }: {
|
||||
nixosModules.default = import ./module.nix { inherit lix; };
|
||||
overlays.default = import ./overlay.nix { inherit lix; };
|
||||
} // flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.default ];
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit pkgs;
|
||||
packages.default = pkgs.nixVersions.nix_2_18;
|
||||
packages.nix-doc = pkgs.nix-doc;
|
||||
});
|
||||
outputs = inputs@{ self, nixpkgs, lix, flake-utils, flakey-profile, ... }:
|
||||
let versionSuffix = "pre${builtins.substring 0 8 lix.lastModifiedDate}-${lix.shortRev}";
|
||||
in {
|
||||
inherit inputs;
|
||||
nixosModules.default = import ./module.nix { inherit lix versionSuffix; };
|
||||
overlays.default = import ./overlay.nix { inherit lix versionSuffix; };
|
||||
} // flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.default ];
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit pkgs;
|
||||
packages.default = pkgs.nixVersions.nix_2_18;
|
||||
packages.nix-doc = pkgs.nix-doc;
|
||||
|
||||
packages.system-profile = import ./system-profile.nix { inherit pkgs flakey-profile; };
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{ lix }:
|
||||
{ lix, versionSuffix ? "" }:
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
nixpkgs.overlays = [ (import ./overlay.nix { inherit lix; }) ];
|
||||
nixpkgs.overlays = [ (import ./overlay.nix { inherit lix versionSuffix; }) ];
|
||||
}
|
||||
|
|
64
nix-doc/package.nix
Normal file
64
nix-doc/package.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
# 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";
|
||||
};
|
||||
}
|
21
overlay.nix
21
overlay.nix
|
@ -1,4 +1,4 @@
|
|||
{ lix }:
|
||||
{ lix, versionSuffix ? "" }:
|
||||
final: prev:
|
||||
let
|
||||
boehmgc-patched = ((final.boehmgc.override {
|
||||
|
@ -10,7 +10,7 @@ let
|
|||
(prev.path + "/pkgs/tools/package-management/nix/patches/boehmgc-coroutine-sp-fallback.patch")
|
||||
|
||||
# https://github.com/ivmai/bdwgc/pull/586
|
||||
(lix + "/boehmgc-traceable_allocator-public.diff")
|
||||
(builtins.path { path = lix + "/boehmgc-traceable_allocator-public.diff"; name = "boehmgc-traceable_allocator-public.patch"; })
|
||||
];
|
||||
})
|
||||
);
|
||||
|
@ -20,10 +20,14 @@ in
|
|||
# FIXME: do something less scuffed
|
||||
nix_2_18 = (prev.nixVersions.nix_2_18.override { boehmgc = boehmgc-patched; }).overrideAttrs (old: {
|
||||
src = lix;
|
||||
version = "2.18.3-lix";
|
||||
VERSION_SUFFIX = "-lix";
|
||||
# FIXME: fake version so that nixpkgs will not try to use nix config >_>
|
||||
version = "2.18.3-lix${versionSuffix}";
|
||||
VERSION_SUFFIX = "-lix${versionSuffix}";
|
||||
|
||||
patches = [ ];
|
||||
# FIXME: we don't know why this was not being picked up properly when
|
||||
# included in nativeCheckInputs.
|
||||
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ final.git ];
|
||||
});
|
||||
stable = nix_2_18;
|
||||
nix_2_18_upstream = prev.nixVersions.nix_2_18;
|
||||
|
@ -40,8 +44,9 @@ in
|
|||
nix = final.nixVersions.nix_2_18_upstream;
|
||||
};
|
||||
|
||||
nix-doc = prev.nix-doc.overrideAttrs (old: {
|
||||
# for the purposes of nix C++ API for nix-doc, lix is Nix 2.20
|
||||
NIX_CFLAGS_COMPILE = [ "-DNIX_2_20_0" ];
|
||||
});
|
||||
nixos-option = prev.nixos-option.override {
|
||||
nix = final.nixVersions.nix_2_18_upstream;
|
||||
};
|
||||
|
||||
nix-doc = prev.callPackage ./nix-doc/package.nix { withPlugin = false; };
|
||||
}
|
||||
|
|
10
system-profile.nix
Normal file
10
system-profile.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ pkgs, flakey-profile }:
|
||||
flakey-profile.lib.mkProfile {
|
||||
inherit pkgs;
|
||||
paths = with pkgs; [
|
||||
cacert
|
||||
nix
|
||||
];
|
||||
name = "system-profile";
|
||||
extraSwitchArgs = [ "--profile" "/nix/var/nix/profiles/default" ];
|
||||
}
|
Loading…
Reference in a new issue