Compare commits
51 commits
main
...
drop-patch
Author | SHA1 | Date | |
---|---|---|---|
Ilya K | 6e97fd4382 | ||
jade | a2ef313ace | ||
jade | f879988840 | ||
jade | a792d328c4 | ||
jade | ae4a5342c1 | ||
jade | 21907b875d | ||
jade | fac4f00719 | ||
Qyriad | 71f268f215 | ||
Qyriad | 1c91fbff0d | ||
eldritch horrors | a8a1c6a24b | ||
eldritch horrors | 376093813b | ||
Qyriad | a3b8ac2414 | ||
jade | 9babd8172a | ||
jade | 958a5a474b | ||
Qyriad | 6804fe0ec5 | ||
Qyriad | bf047623b5 | ||
Ilya K | f425f32a62 | ||
jade | 93ce1e3f5d | ||
Qyriad | 1b35b90445 | ||
jade | 9515bc250a | ||
Lunaphied | 54cc0918d4 | ||
jade | 2714f7ac02 | ||
jade | 48055468d5 | ||
jade | a428fa24ae | ||
jade | 9c691a4185 | ||
hexa | 600fc154e4 | ||
eldritch horrors | 280c404856 | ||
eldritch horrors | eabed5a04f | ||
jade | 5d64b01d02 | ||
hexa | 7afd8fbb0d | ||
jade | 5d2b325d3a | ||
jade | 1062d3c1ff | ||
jade | f8b5d0bc9c | ||
Qyriad | adbbecb518 | ||
Emily Trau | ebdf6e66ae | ||
jade | 30a7b8f7c8 | ||
jade | 41990c5d80 | ||
jade | f173ccc0aa | ||
jade | 4d09a927b0 | ||
jade | 7278990b5a | ||
jade | 8b7315c5b9 | ||
jade | e61b27f3f6 | ||
ff76ec73c9 | |||
c88abb52dc | |||
raito | 89ccd6e015 | ||
jade | 7083c47d04 | ||
raito | d2b5d0a958 | ||
Jade Lovelace | a312274b08 | ||
Jade Lovelace | 5ca6ed5690 | ||
Jade Lovelace | c4615ccc7f | ||
Jade Lovelace | 9ed607358a |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
result
|
||||
result-*
|
19
LICENSE
Normal file
19
LICENSE
Normal file
|
@ -0,0 +1,19 @@
|
|||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
||||
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
5
README.md
Normal file
5
README.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Lix NixOS module
|
||||
|
||||
See the [beta guide][beta-guide] for details on how to use this:
|
||||
|
||||
[beta-guide]: https://wiki.lix.systems/link/1
|
37
flake.lock
37
flake.lock
|
@ -18,28 +18,44 @@
|
|||
"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": 1714774053,
|
||||
"narHash": "sha256-RaiwQCGFhC1WtieS2N3FotIlKSowq+R6ETyY6nZnPh8=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "8a268359b06471b463a8f3fc46c83a1fced8ab75",
|
||||
"revCount": 15077,
|
||||
"rev": "549d609a7bce2b4ac28808a76a72d7f3743b9c76",
|
||||
"revCount": 15471,
|
||||
"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": {
|
||||
"locked": {
|
||||
"lastModified": 1709703039,
|
||||
"narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=",
|
||||
"lastModified": 1714635257,
|
||||
"narHash": "sha256-4cPymbty65RvF1DWQfc+Bc8B233A1BWxJnNULJKQ1EY=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d",
|
||||
"rev": "63c3a29ca82437c87573e4c6919b09a24ea61b0f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -52,6 +68,7 @@
|
|||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"flakey-profile": "flakey-profile",
|
||||
"lix": "lix",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
|
|
56
flake.nix
56
flake.nix
|
@ -1,25 +1,47 @@
|
|||
{
|
||||
# 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.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 ];
|
||||
};
|
||||
|
||||
linux64BitSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
|
||||
inherit (pkgs) lib;
|
||||
in
|
||||
{
|
||||
inherit pkgs;
|
||||
packages = {
|
||||
default = pkgs.nixVersions.nix_2_18;
|
||||
inherit (pkgs) nix-doc nix-eval-jobs;
|
||||
};
|
||||
|
||||
packages.system-profile = import ./system-profile.nix { inherit pkgs flakey-profile; };
|
||||
|
||||
nixosTests = pkgs.recurseIntoAttrs (pkgs.callPackage ./test-nixos.nix { lix-module = self.nixosModules.default; });
|
||||
|
||||
checks = {
|
||||
inherit (self.packages.${system}) default nix-eval-jobs;
|
||||
} // lib.optionalAttrs (lib.elem system linux64BitSystems) {
|
||||
inherit (self.nixosTests.${system}) it-builds;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
}
|
47
npins/default.nix
Normal file
47
npins/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
# Generated by npins. Do not modify; will be overwritten regularly
|
||||
let
|
||||
data = builtins.fromJSON (builtins.readFile ./sources.json);
|
||||
version = data.version;
|
||||
|
||||
mkSource = spec:
|
||||
assert spec ? type; let
|
||||
path =
|
||||
if spec.type == "Git" then mkGitSource spec
|
||||
else if spec.type == "GitRelease" then mkGitSource spec
|
||||
else if spec.type == "PyPi" then mkPyPiSource spec
|
||||
else if spec.type == "Channel" then mkChannelSource spec
|
||||
else builtins.throw "Unknown source type ${spec.type}";
|
||||
in
|
||||
spec // { outPath = path; };
|
||||
|
||||
mkGitSource = { repository, revision, url ? null, hash, ... }:
|
||||
assert repository ? type;
|
||||
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
|
||||
# In the latter case, there we will always be an url to the tarball
|
||||
if url != null then
|
||||
(builtins.fetchTarball {
|
||||
inherit url;
|
||||
sha256 = hash; # FIXME: check nix version & use SRI hashes
|
||||
})
|
||||
else assert repository.type == "Git"; builtins.fetchGit {
|
||||
url = repository.url;
|
||||
rev = revision;
|
||||
# hash = hash;
|
||||
};
|
||||
|
||||
mkPyPiSource = { url, hash, ... }:
|
||||
builtins.fetchurl {
|
||||
inherit url;
|
||||
sha256 = hash;
|
||||
};
|
||||
|
||||
mkChannelSource = { url, hash, ... }:
|
||||
builtins.fetchTarball {
|
||||
inherit url;
|
||||
sha256 = hash;
|
||||
};
|
||||
in
|
||||
if version == 3 then
|
||||
builtins.mapAttrs (_: mkSource) data.pins
|
||||
else
|
||||
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
|
16
npins/sources.json
Normal file
16
npins/sources.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"pins": {
|
||||
"nix-eval-jobs": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "Git",
|
||||
"url": "git+ssh://git@git.lix.systems/lix-project/nix-eval-jobs"
|
||||
},
|
||||
"branch": "main",
|
||||
"revision": "793841a9b7b689e37c9a7902710aab2bd6a833d5",
|
||||
"url": null,
|
||||
"hash": "1pkb7glscd6dkfjf7x1cj51l21k09wjw5mzm32j37yrln5f20il5"
|
||||
}
|
||||
},
|
||||
"version": 3
|
||||
}
|
72
overlay.nix
72
overlay.nix
|
@ -1,4 +1,4 @@
|
|||
{ lix }:
|
||||
{ lix, versionSuffix ? "" }:
|
||||
final: prev:
|
||||
let
|
||||
boehmgc-patched = ((final.boehmgc.override {
|
||||
|
@ -8,40 +8,78 @@ let
|
|||
# for clown reasons this version is newer than the one in lix, we should
|
||||
# fix this and update our nixpkgs pin
|
||||
(prev.path + "/pkgs/tools/package-management/nix/patches/boehmgc-coroutine-sp-fallback.patch")
|
||||
|
||||
] ++ final.lib.optionals (final.lib.versionOlder o.version "8.2.6") [
|
||||
# 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"; })
|
||||
];
|
||||
})
|
||||
);
|
||||
|
||||
# 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
|
||||
lixPkg = (final.callPackage (lix + "/package.nix") {
|
||||
build-release-notes = false;
|
||||
versionSuffix = "-lix${versionSuffix}";
|
||||
boehmgc-nix = boehmgc-patched;
|
||||
});
|
||||
|
||||
inherit (prev) lib;
|
||||
in
|
||||
{
|
||||
# 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*
|
||||
# want to do that.
|
||||
lix-sources = import ./npins;
|
||||
|
||||
nixVersions = prev.nixVersions // rec {
|
||||
# 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";
|
||||
|
||||
patches = [ ];
|
||||
});
|
||||
nix_2_18 = lixPkg;
|
||||
stable = nix_2_18;
|
||||
nix_2_18_upstream = prev.nixVersions.nix_2_18;
|
||||
};
|
||||
|
||||
nix-eval-jobs = (prev.nix-eval-jobs.override {
|
||||
# lix
|
||||
nix = final.nixVersions.nix_2_18;
|
||||
}).overrideAttrs (old: {
|
||||
# FIXME: should this be patches instead?
|
||||
src = final.lix-sources.nix-eval-jobs;
|
||||
|
||||
mesonBuildType = "debugoptimized";
|
||||
|
||||
ninjaFlags = old.ninjaFlags or [ ] ++ [ "-v" ];
|
||||
});
|
||||
|
||||
# force these onto upstream so we are not regularly rebuilding electron
|
||||
prefetch-yarn-deps = prev.prefetch-yarn-deps.override {
|
||||
nix = final.nixVersions.nix_2_18_upstream;
|
||||
};
|
||||
prefetch-npm-deps = prev.prefetch-npm-deps.override {
|
||||
nix = final.nixVersions.nix_2_18_upstream;
|
||||
};
|
||||
|
||||
# support both having and missing https://github.com/NixOS/nixpkgs/pull/304913
|
||||
prefetch-npm-deps =
|
||||
if (lib.functionArgs prev.prefetch-npm-deps.override) ? nix
|
||||
then prev.prefetch-npm-deps.override {
|
||||
nix = final.nixVersions.nix_2_18_upstream;
|
||||
}
|
||||
else prev.prefetch-npm-deps;
|
||||
|
||||
nix-prefetch-git = prev.nix-prefetch-git.override {
|
||||
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; };
|
||||
|
||||
nix-init = prev.nix-init.override {
|
||||
nix = final.nixVersions.nix_2_18_upstream;
|
||||
};
|
||||
|
||||
nurl = prev.nurl.override {
|
||||
nix = final.nixVersions.nix_2_18_upstream;
|
||||
};
|
||||
}
|
||||
|
|
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" ];
|
||||
}
|
17
test-nixos.nix
Normal file
17
test-nixos.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ nixos, lix-module }:
|
||||
let
|
||||
configs = {
|
||||
it-builds = nixos ({ ... }: {
|
||||
documentation.enable = false;
|
||||
fileSystems."/".device = "ignore-root-device";
|
||||
boot.loader.grub.enable = false;
|
||||
system.stateVersion = "24.05";
|
||||
});
|
||||
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit configs;
|
||||
|
||||
it-builds = configs.it-builds.config.system.build.toplevel;
|
||||
}
|
Loading…
Reference in a new issue