Skip to content

Commit

Permalink
Export nix module as moe, change package export to packages.default
Browse files Browse the repository at this point in the history
  • Loading branch information
gepbird committed Feb 10, 2024
1 parent 8efaf93 commit 0c5c4ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
};

outputs = { self, nixpkgs, flake-utils }:
{
nixosModule = import ./nix/module.nix self.outputs.packages;
} //
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
let
pkgs = import nixpkgs { inherit system; };
version = builtins.substring 0 8 self.lastModifiedDate or "dirty";
in
{
packages.moe = pkgs.callPackage ./nix/package.nix { inherit version; };
defaultPackage = self.packages.${system}.moe;
}
);
packages.default = pkgs.callPackage ./nix/package.nix { inherit version; };
});
}
9 changes: 5 additions & 4 deletions nix/module.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{ config, pkgs, lib, ... }:
packages:
{ config, pkgs, lib, specialArgs, ... }:

with lib;
with types;
let
cfg = config.services.moe;
cfg = config.moe;
in
{
options.services.moe = {
options.moe = {
enable = mkEnableOption "Enable the moe service";
package = mkOption {
type = package;
default = (pkgs.callPackage ./package.nix { });
default = packages.${pkgs.system}.default;
};
group = mkOption {
type = str;
Expand Down

0 comments on commit 0c5c4ae

Please sign in to comment.