add overlay

This commit is contained in:
Daniel Phan 2021-11-01 08:18:12 +07:00
parent d938ad0118
commit da5dffa056
No known key found for this signature in database
GPG key ID: A3556DCE587353FB
3 changed files with 13 additions and 3 deletions

View file

@ -13,6 +13,7 @@
outputs = { self, nixpkgs, flake-utils, mach-nix, ... }: { outputs = { self, nixpkgs, flake-utils, mach-nix, ... }: {
nixosModules.peerix = import ./module.nix; nixosModules.peerix = import ./module.nix;
overlay = import ./overlay.nix { inherit self; };
} // flake-utils.lib.eachDefaultSystem (system: } // flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in { let pkgs = nixpkgs.legacyPackages.${system}; in {
packages.peerix = mach-nix.lib.${system}.buildPythonApplication { packages.peerix = mach-nix.lib.${system}.buildPythonApplication {

View file

@ -1,8 +1,6 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
let let
cfg = config.services.peerix; cfg = config.services.peerix;
peerix = (import ./default.nix).default;
in in
{ {
options = with lib; { options = with lib; {
@ -70,6 +68,13 @@ in
By default not given, as it affects the UX of the nix installation. By default not given, as it affects the UX of the nix installation.
''; '';
}; };
package = mkOption {
type = types.package;
default = (import ./default.nix).default or pkgs.peerix;
defaultText = literalExpression "pkgs.peerix";
description = "The package to use for peerix";
};
}; };
}; };
@ -132,7 +137,7 @@ in
]; ];
}; };
script = '' script = ''
exec ${peerix}/bin/peerix exec ${cfg.package}/bin/peerix
''; '';
}; };

4
overlay.nix Normal file
View file

@ -0,0 +1,4 @@
{ self }:
final: prev: {
peerix = self.packages.${prev.system}.peerix;
}