rest of the split migration
This commit is contained in:
22
modules/dev/cc/common.nix
Normal file
22
modules/dev/cc/common.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ pkgs }:
|
||||
let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
clang
|
||||
clang-tools
|
||||
gcc
|
||||
gdb
|
||||
valgrind
|
||||
;
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit packages;
|
||||
devShell = pkgs.mkShell {
|
||||
inherit packages;
|
||||
name = "cc-dev-shell";
|
||||
shellHook = ''
|
||||
echo "🔧 C/C++ dev environment"
|
||||
'';
|
||||
};
|
||||
}
|
||||
34
modules/dev/cc/home.nix
Normal file
34
modules/dev/cc/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 = [
|
||||
"dev"
|
||||
"cc"
|
||||
];
|
||||
};
|
||||
cfg = config.my.dev.cc;
|
||||
feature = import ./common.nix { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
options.my.dev.cc.enable = lib.mkEnableOption "Install C/C++ tooling globally";
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
my.dev.cc.enable = lib.mkDefault hm.enabledByDefault;
|
||||
}
|
||||
(lib.mkIf cfg.enable {
|
||||
home.packages = feature.packages;
|
||||
})
|
||||
];
|
||||
}
|
||||
27
modules/dev/cc/nixos.nix
Normal file
27
modules/dev/cc/nixos.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
feature = import ./common.nix { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
options = {
|
||||
my.dev.cc = {
|
||||
enable = lib.mkEnableOption "Install C/C++ tooling globally";
|
||||
users = lib.mkOption {
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install C/C++ packages for";
|
||||
};
|
||||
};
|
||||
devShells.cc = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = feature.devShell;
|
||||
description = "C/C++ development shell";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user