Compare commits

...

45 commits

Author SHA1 Message Date
Ilya K 4a9e59753a Remove prefetch-npm-deps override
No longer needed on unstable-small
2024-04-23 00:02:47 +03:00
Qyriad 71f268f215 Merge pull request 'callPackage Lix instead of overriding Nixpkgs' Nix' (#17) from qyriad/nixos-module:call-package into main
Reviewed-on: #17
2024-04-22 03:57:44 +00:00
Qyriad 1c91fbff0d callPackage Lix instead of overriding Nixpkgs' Nix 2024-04-18 14:56:07 -06:00
eldritch horrors a8a1c6a24b bump nix-eval-jobs to fix eval with broken attrs 2024-04-18 18:24:40 +02:00
eldritch horrors 376093813b fix nix-eval-jobs repo url
this moved? we might want ci perhaps.
2024-04-17 21:32:57 +02:00
Qyriad a3b8ac2414 Merge pull request 'nix-eval-jobs: use lix' (#15) from jade/nix-eval-jobs-lix into main
Reviewed-on: #15
2024-04-16 09:33:50 +00:00
jade 9babd8172a nix-eval-jobs: use lix 2024-04-15 20:06:52 -07:00
jade 958a5a474b bump lix 2024-04-15 20:06:05 -07:00
Qyriad 6804fe0ec5 flake.lock: update lix 2024-04-10 12:59:27 -06:00
Qyriad bf047623b5 Merge pull request 'Rename nix-doc to lix-doc here too' (#14) from k900/nixos-module:main into main
Reviewed-on: #14
2024-04-08 18:40:50 +00:00
Ilya K f425f32a62 Rename nix-doc to lix-doc here too
Fixes build
2024-04-08 11:15:34 +03:00
jade 93ce1e3f5d Merge pull request 'overlay: fix builds of Lix after c21d11ac0' (#12) from qyriad/nixos-module:fixes/python-dep into main
Reviewed-on: #12
2024-04-06 04:30:25 +00:00
Qyriad 1b35b90445 overlay: fix builds of Lix after c21d11ac0
lix-project/lix/c21d11ac094d4f39215dba6763fcabc62341def4 added a direct
build dependency on Python.
2024-04-05 22:20:24 -06:00
jade 9515bc250a Merge pull request 'overlay: support nix-doc integration into Lix' (#11) from feature/nix-doc into main
Reviewed-on: #11
2024-04-03 22:48:05 +00:00
Lunaphied 54cc0918d4 overlay: support nix-doc integration into Lix 2024-04-03 15:55:27 -06:00
jade 2714f7ac02 Merge pull request 'Add LICENSE' (#10) from jade/license into main
Reviewed-on: #10
2024-04-03 20:08:18 +00:00
jade 48055468d5 Add LICENSE 2024-04-02 13:21:56 -07:00
jade a428fa24ae probably fix cross compilation 2024-04-02 00:41:06 -07:00
jade 9c691a4185 Merge pull request 'fix: pin nurl to upstream nix' (#9) from mweinelt/nixos-module:nurl-pin into main
Reviewed-on: #9
2024-03-29 07:16:53 +00:00
hexa 600fc154e4
fix: pin nurl to upstream nix
nix-init depends on nurl, so they need to use the same nix for nix-init
to not be rebuilt.
2024-03-29 02:27:19 +01:00
eldritch horrors 280c404856 flake.lock: update 2024-03-28 18:32:40 +01:00
eldritch horrors eabed5a04f fix: add cmake and toml11 to inputs
toml11 is needed anyway, cmake is only needed for meson. meson isn't
needed right now but let's not have this cause problems *again* soon
2024-03-28 18:32:00 +01:00
jade 5d64b01d02 Merge pull request 'fix: pin nix-init to upstream nix' (#8) from mweinelt/nixos-module:nix-init-pin into main
Reviewed-on: #8
2024-03-27 08:07:07 +00:00
hexa 7afd8fbb0d
fix: pin nix-init to upstream nix 2024-03-27 05:54:26 +01:00
jade 5d2b325d3a flake.lock: Update
Flake lock file updates:

• Updated input 'lix':
    'git+ssh://git@git.lix.systems/lix-project/lix.git?ref=refs/heads/main&rev=66ccc93eeded1ab77281600bd41d6b0d8d8bf43a' (2024-03-25)
  → 'git+ssh://git@git.lix.systems/lix-project/lix.git?ref=refs/heads/main&rev=0be766c12de6badbbfa4fb9f76b6688b04d81059' (2024-03-25)
2024-03-25 13:45:09 -07:00
jade 1062d3c1ff Add version suffix in nixos module 2024-03-25 13:44:56 -07:00
jade f8b5d0bc9c flake.lock: Update
Flake lock file updates:

• Updated input 'lix':
    'git+ssh://git@git.lix.systems/lix-project/lix.git?ref=refs/heads/main&rev=d26eccebfc1f0d3f5b77e781ffc6455f05f8f90c' (2024-03-24)
  → 'git+ssh://git@git.lix.systems/lix-project/lix.git?ref=refs/heads/main&rev=66ccc93eeded1ab77281600bd41d6b0d8d8bf43a' (2024-03-25)
2024-03-24 21:32:14 -07:00
Qyriad adbbecb518 Merge pull request 'Add gitignore' (#6) from emilytrau/nixos-module:emilytrau/gitignore into main
Reviewed-on: #6
2024-03-25 03:03:56 +00:00
Emily Trau ebdf6e66ae Add gitignore 2024-03-25 13:57:03 +11:00
jade 30a7b8f7c8 Update lix and add system profile 2024-03-24 17:17:53 -07:00
jade 41990c5d80 Add system profile 2024-03-24 17:14:18 -07:00
jade f173ccc0aa put prerelease info in the version 2024-03-18 14:26:45 -07:00
jade 4d09a927b0 bump lix to a non bork version 2024-03-18 13:18:23 -07:00
jade 7278990b5a fix: make the boehm patch content addressed to avoid rebuilds 2024-03-18 13:16:48 -07:00
jade 8b7315c5b9 nix-doc: disable plugin since it is broken by Lix API changes
We don't intend to fix the API changes in nix-doc, because we should be
able to kill nix-doc in like a week?
2024-03-16 16:30:31 -07:00
jade e61b27f3f6 Merge pull request 'Switch to the replicated forgejo, and bump lix to head' (#2) from ktemkin/nixos-module:change_url into main
Reviewed-on: #2
2024-03-09 00:30:16 -07:00
Kate Temkin ff76ec73c9 flake.lock: Update
Flake lock file updates:

• Updated input 'lix':
    'git+ssh://gerrit.lix.systems:2022/lix?ref=refs/heads/main&rev=eac76dbe90ad1ceade863744739246e9b6abaa90' (2024-03-08)
  → 'git+ssh://git@git.lix.systems/lix-project/lix.git?ref=refs/heads/main&rev=896e525681bbf696c330af4e51c5e161d3818350' (2024-03-09)
2024-03-09 00:24:17 -07:00
Kate Temkin c88abb52dc lix: switch to forgejo (replicated) clone addr 2024-03-09 00:23:44 -07:00
raito 89ccd6e015 fix: pin nixos-option to upstream
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-03-09 02:27:21 +01:00
jade 7083c47d04 Merge pull request 'feat: introduce our own flake-compat' (#1) from flake-compat into main
Reviewed-on: #1
2024-03-08 18:11:31 -07:00
raito d2b5d0a958 feat: introduce our own flake-compat
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-03-09 01:48:11 +01:00
Jade Lovelace a312274b08 fake version 2024-03-08 00:10:56 -08:00
Jade Lovelace 5ca6ed5690 fix git-requiring tests 2024-03-08 00:05:25 -08:00
Jade Lovelace c4615ccc7f fix version 2024-03-07 23:49:29 -08:00
Jade Lovelace 9ed607358a update lix 2024-03-07 23:43:21 -08:00
11 changed files with 278 additions and 42 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
result
result-*

19
LICENSE Normal file
View 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.

10
default.nix Normal file
View 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

View file

@ -1,5 +1,20 @@
{ {
"nodes": { "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": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -18,19 +33,35 @@
"type": "github" "type": "github"
} }
}, },
"lix": { "flakey-profile": {
"locked": { "locked": {
"lastModified": 1709811453, "lastModified": 1711325813,
"narHash": "sha256-UOyTAdUAJv80w3s6rrgYB5tQjp43u5Zp2dlM94uud04=", "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": 1713222580,
"narHash": "sha256-wWUZtNf1mSaO8B9mYWSR0AoYVQhryTZIW+b1yIYkAcs=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "8a268359b06471b463a8f3fc46c83a1fced8ab75", "rev": "866c76c7f93442993eb84b4268811bc101b4d447",
"revCount": 15077, "revCount": 15403,
"type": "git", "type": "git",
"url": "ssh://gerrit.lix.systems:2022/lix" "url": "ssh://git@git.lix.systems/lix-project/lix.git"
}, },
"original": { "original": {
"type": "git", "type": "git",
"url": "ssh://gerrit.lix.systems:2022/lix" "url": "ssh://git@git.lix.systems/lix-project/lix.git"
} }
}, },
"nixpkgs": { "nixpkgs": {
@ -51,7 +82,9 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"flakey-profile": "flakey-profile",
"lix": "lix", "lix": "lix",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }

View file

@ -1,25 +1,33 @@
{ {
# fixme: use the forgejo address
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.lix = { inputs.lix = {
url = "git+ssh://gerrit.lix.systems:2022/lix"; url = "git+ssh://git@git.lix.systems/lix-project/lix.git";
flake = false; flake = false;
}; };
inputs.flake-utils.url = "github:numtide/flake-utils"; 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 }: { outputs = inputs@{ self, nixpkgs, lix, flake-utils, flakey-profile, ... }:
nixosModules.default = import ./module.nix { inherit lix; }; let versionSuffix = "pre${builtins.substring 0 8 lix.lastModifiedDate}-${lix.shortRev}";
overlays.default = import ./overlay.nix { inherit lix; }; in {
} // flake-utils.lib.eachDefaultSystem (system: inherit inputs;
let nixosModules.default = import ./module.nix { inherit lix versionSuffix; };
pkgs = import nixpkgs { overlays.default = import ./overlay.nix { inherit lix versionSuffix; };
inherit system; } // flake-utils.lib.eachDefaultSystem (system:
overlays = [ self.overlays.default ]; let
}; pkgs = import nixpkgs {
in inherit system;
{ overlays = [ self.overlays.default ];
inherit pkgs; };
packages.default = pkgs.nixVersions.nix_2_18; in
packages.nix-doc = pkgs.nix-doc; {
}); 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; };
});
} }

View file

@ -1,5 +1,5 @@
{ lix }: { lix, versionSuffix ? "" }:
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
nixpkgs.overlays = [ (import ./overlay.nix { inherit lix; }) ]; nixpkgs.overlays = [ (import ./overlay.nix { inherit lix versionSuffix; }) ];
} }

64
nix-doc/package.nix Normal file
View 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
View 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
View 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
}

View file

@ -1,4 +1,4 @@
{ lix }: { lix, versionSuffix ? "" }:
final: prev: final: prev:
let let
boehmgc-patched = ((final.boehmgc.override { boehmgc-patched = ((final.boehmgc.override {
@ -10,38 +10,65 @@ let
(prev.path + "/pkgs/tools/package-management/nix/patches/boehmgc-coroutine-sp-fallback.patch") (prev.path + "/pkgs/tools/package-management/nix/patches/boehmgc-coroutine-sp-fallback.patch")
# https://github.com/ivmai/bdwgc/pull/586 # 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"; })
]; ];
}) })
); );
lixPkg = (final.callPackage (lix + "/package.nix") {
build-release-notes = false;
versionSuffix = "-lix${versionSuffix}";
boehmgc-nix = boehmgc-patched;
}).overrideAttrs {
# Note: load-bearing version override. Nixpkgs does version detection to determine
# what commands and whatnot we support, so tell Nixpkgs that we're 2.18 (ish).
version = "2.18.3-lix${versionSuffix}";
};
in 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 { nixVersions = prev.nixVersions // rec {
# FIXME: do something less scuffed # FIXME: do something less scuffed
nix_2_18 = (prev.nixVersions.nix_2_18.override { boehmgc = boehmgc-patched; }).overrideAttrs (old: { nix_2_18 = lixPkg;
src = lix;
version = "2.18.3-lix";
VERSION_SUFFIX = "-lix";
patches = [ ];
});
stable = nix_2_18; stable = nix_2_18;
nix_2_18_upstream = prev.nixVersions.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 # force these onto upstream so we are not regularly rebuilding electron
prefetch-yarn-deps = prev.prefetch-yarn-deps.override { prefetch-yarn-deps = prev.prefetch-yarn-deps.override {
nix = final.nixVersions.nix_2_18_upstream; nix = final.nixVersions.nix_2_18_upstream;
}; };
prefetch-npm-deps = prev.prefetch-npm-deps.override {
nix = final.nixVersions.nix_2_18_upstream;
};
nix-prefetch-git = prev.nix-prefetch-git.override { nix-prefetch-git = prev.nix-prefetch-git.override {
nix = final.nixVersions.nix_2_18_upstream; nix = final.nixVersions.nix_2_18_upstream;
}; };
nix-doc = prev.nix-doc.overrideAttrs (old: { nixos-option = prev.nixos-option.override {
# for the purposes of nix C++ API for nix-doc, lix is Nix 2.20 nix = final.nixVersions.nix_2_18_upstream;
NIX_CFLAGS_COMPILE = [ "-DNIX_2_20_0" ]; };
});
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
View 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" ];
}