Skip to content

Commit

Permalink
+ flake parts os-module pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
oluceps committed Nov 8, 2024
1 parent aef81aa commit 50a35c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 8 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,14 @@
overlays.default = final: prev: {
vaultix = inputs.self.packages.${prev.system}.default;
};
nixosModules.default = import ./module self;

nixosModules.default =
{ pkgs, ... }:
{
imports = [ ./module ];
vaultix.package = withSystem pkgs.stdenv.hostPlatform.system (
{ config, ... }: config.packages.vaultix
);
};
};
}
);
Expand Down
7 changes: 2 additions & 5 deletions module/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
vaultixSelf:
{
config,
options,
Expand All @@ -14,6 +13,7 @@ let
isAttrs
isPath
readFile
literalMD
literalExpression
mkEnableOption
mkIf
Expand Down Expand Up @@ -237,10 +237,7 @@ in
{
options.vaultix = {

package = mkOption {
type = types.package;
default = vaultixSelf.packages.${pkgs.system}.vaultix;
};
package = mkOption { defaultText = literalMD "`packages.vaultix` from this flake"; };

settings = mkOption {
type = settingsType;
Expand Down

0 comments on commit 50a35c0

Please sign in to comment.