Skip to content

Commit

Permalink
fix(module): expose module and packages through default.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
water-sucks committed Feb 22, 2025
1 parent 82a0361 commit e7a51a9
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
47 changes: 33 additions & 14 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
(
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
{pkgs ? import <nixpkgs> {}}: let
flake-self =
(
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 = ./.;}
)
.outputs;

rev = (builtins.fetchGit ./.).rev;
in {
nixos = pkgs.callPackage ./package.nix {
flake = true;
inherit rev;
};

nixosLegacy = pkgs.callPackage ./package.nix {
flake = false;
inherit rev;
};

inherit flake-self;

module = import ./module.nix flake-self;
}
6 changes: 3 additions & 3 deletions flake.lock

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

4 changes: 2 additions & 2 deletions module.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
self: {
options,
config,
pkgs,
Expand All @@ -17,7 +17,7 @@ in {

package = lib.mkOption {
type = types.package;
default = import ./default.nix;
default = self.packages.${pkgs.system}.nixos;
description = "Package to use for nixos-cli";
};

Expand Down

0 comments on commit e7a51a9

Please sign in to comment.