host mac
This commit is contained in:
9
modules/shell/exercism/common.nix
Normal file
9
modules/shell/exercism/common.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ pkgs }:
|
||||
{
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
exercism
|
||||
bats
|
||||
;
|
||||
};
|
||||
}
|
||||
34
modules/shell/exercism/home.nix
Normal file
34
modules/shell/exercism/home.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
osConfig ? null,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hm = inputs.self.lib.hmModule {
|
||||
inherit
|
||||
config
|
||||
inputs
|
||||
osConfig
|
||||
;
|
||||
optionPath = [
|
||||
"shell"
|
||||
"exercism"
|
||||
];
|
||||
};
|
||||
cfg = config.my.shell.exercism;
|
||||
exercism = import ./common.nix { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
options.my.shell.exercism.enable = lib.mkEnableOption "Exercism coding practice platform";
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
my.shell.exercism.enable = lib.mkDefault hm.enabledByDefault;
|
||||
}
|
||||
(lib.mkIf cfg.enable {
|
||||
home.packages = exercism.packages;
|
||||
})
|
||||
];
|
||||
}
|
||||
16
modules/shell/exercism/nixos.nix
Normal file
16
modules/shell/exercism/nixos.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.my.shell.exercism = {
|
||||
enable = lib.mkEnableOption "Exercism coding practice platform";
|
||||
users = lib.mkOption {
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.shell;
|
||||
description = "Users to install Exercism for";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user