Skip to content

Commit

Permalink
docs,tests: fetch nmd and nmt using fetchTarball
Browse files Browse the repository at this point in the history
This simplifies the code a bit and avoids using experimental Flake
functionality. If Flakes become stable before NixOS 22.11 then we can
consider having nmd and nmt as Flake inputs. Maybe could then also
avoid the need for flake-compat.
  • Loading branch information
rycee committed Jun 26, 2022
1 parent 0434f8e commit 9550595
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 79 deletions.
14 changes: 1 addition & 13 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
{ pkgs ? import <nixpkgs> { } }:

let

flake = (import
(let lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in fetchTarball {
url =
"https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) { src = ./.; }).defaultNix;

in rec {
rec {
docs = with import ./docs { inherit pkgs; }; {
html = manual.html;
manPages = manPages;
Expand All @@ -26,6 +16,4 @@ in rec {
nixos = import ./nixos;

path = ./.;

inherit (flake) inputs;
}
10 changes: 8 additions & 2 deletions docs/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{ pkgs, nmdSrc ? (import ./.. { }).inputs.nmd
{ pkgs

# Note, this should be "the standard library" + HM extensions.
# Note, this should be "the standard library" + HM extensions.
, lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib }:

let

nmdSrc = fetchTarball {
url =
"https://gitlab.com/api/v4/projects/rycee%2Fnmd/repository/archive.tar.gz?sha=91dee681dd1c478d6040a00835d73c0f4a4c5c29";
sha256 = "07szg39wmna287hv5w9hl45wvm04zbh0k54br59nv3yzvg9ymlj4";
};

nmd = import nmdSrc { inherit lib pkgs; };

# Make sure the used package is scrubbed to avoid actually
Expand Down
51 changes: 0 additions & 51 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
description = "Home Manager for Nix";

inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.nmd.url = "gitlab:rycee/nmd";
inputs.nmd.flake = false;
inputs.nmt.url = "gitlab:rycee/nmt";
inputs.nmt.flake = false;

inputs.utils.url = "github:numtide/flake-utils";
inputs.flake-compat.url = "github:edolstra/flake-compat";
inputs.flake-compat.flake = false;

outputs = { self, nixpkgs, nmd, utils, ... }:
outputs = { self, nixpkgs, utils, ... }:
{
nixosModules = rec {
home-manager = import ./nixos;
Expand Down Expand Up @@ -67,10 +60,7 @@
} // utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
docs = import ./docs {
inherit pkgs;
nmdSrc = nmd;
};
docs = import ./docs { inherit pkgs; };
in {
packages = rec {
home-manager = pkgs.callPackage ./home-manager { };
Expand Down
6 changes: 5 additions & 1 deletion tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ let

lib = import ../modules/lib/stdlib-extended.nix pkgs.lib;

inherit ((import ./.. { }).inputs) nmt;
nmt = fetchTarball {
url =
"https://gitlab.com/api/v4/projects/rycee%2Fnmt/repository/archive.tar.gz?sha=d83601002c99b78c89ea80e5e6ba21addcfe12ae";
sha256 = "1xzwwxygzs1cmysg97hzd285r7n1g1lwx5y1ar68gwq07a1rczmv";
};

modules = import ../modules/modules.nix {
inherit lib pkgs;
Expand Down

0 comments on commit 9550595

Please sign in to comment.