Migrate packages module to clanServices
This commit is contained in:
41
clanServices/packages/default.nix
Normal file
41
clanServices/packages/default.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{ ... }:
|
||||
{
|
||||
_class = "clan.service";
|
||||
manifest.name = "clan-core/packages";
|
||||
manifest.description = "Define package sets from nixpkgs and install them on one or more machines";
|
||||
manifest.categories = [
|
||||
"System"
|
||||
];
|
||||
|
||||
roles.default = {
|
||||
interface =
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.packages = lib.mkOption {
|
||||
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
example = [ "cowsay" ];
|
||||
description = "The packages to install on the machine";
|
||||
};
|
||||
};
|
||||
|
||||
perInstance =
|
||||
{ settings, ... }:
|
||||
{
|
||||
nixosModule =
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
environment.systemPackages = map (
|
||||
pName: lib.getAttrFromPath (lib.splitString "." pName) pkgs
|
||||
) settings.packages;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user