mirror of
https://github.com/szymon-jozef/checkers.git
synced 2026-10-27 19:20:44 +01:00
init
This commit is contained in:
37
nix/module.nix
Normal file
37
nix/module.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{ self, metadata, ... }:
|
||||
{
|
||||
flake.nixosModules.default =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.example;
|
||||
|
||||
inherit (lib)
|
||||
mkEnableOption
|
||||
mkOption
|
||||
mkIf
|
||||
;
|
||||
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
|
||||
in
|
||||
{
|
||||
options.programs.example = {
|
||||
enable = mkEnableOption metadata.package.name;
|
||||
|
||||
package = mkOption {
|
||||
default = self.packages.${system}.default;
|
||||
description = "Package to use";
|
||||
type = lib.types.package;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user