refactor: automatic options for overlays, fix build
This commit is contained in:
parent
850d673035
commit
281d763c62
7 changed files with 72 additions and 46 deletions
|
|
@ -18,6 +18,7 @@
|
|||
./modern-desktop.nix
|
||||
./muede-desktop-settings.nix
|
||||
./nix-ld.nix
|
||||
./nixpkgs-overlays.nix
|
||||
./openssh.nix
|
||||
./podman.nix
|
||||
./printing.nix
|
||||
|
|
|
|||
33
nixosModules/nixpkgs-overlays.nix
Normal file
33
nixosModules/nixpkgs-overlays.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.my.overlays = {
|
||||
enableAll = lib.mkEnableOption "all nixpkgs overlays";
|
||||
}
|
||||
// lib.mapAttrs (_: _: {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
}) self.overlays;
|
||||
|
||||
config = lib.mkMerge (
|
||||
[
|
||||
{
|
||||
my.overlays = lib.mapAttrs (_: _: {
|
||||
enable = lib.mkDefault config.my.overlays.enableAll;
|
||||
}) self.overlays;
|
||||
}
|
||||
]
|
||||
++ lib.mapAttrsToList (
|
||||
name: overlay:
|
||||
lib.mkIf config.my.overlays.${name}.enable {
|
||||
nixpkgs.overlays = [ overlay ];
|
||||
}
|
||||
) self.overlays
|
||||
);
|
||||
}
|
||||
|
|
@ -1,24 +1,12 @@
|
|||
{
|
||||
modulesPath,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# Import unconditionally — the module only defines options, activating nothing by default.
|
||||
imports = [ (modulesPath + "/virtualisation/proxmox-lxc.nix") ];
|
||||
|
||||
options.my.pxvirtGuest.enable = lib.mkEnableOption "Proxmox LXC guest configuration";
|
||||
|
||||
config = lib.mkIf config.my.pxvirtGuest.enable {
|
||||
# TODO is this needed?
|
||||
# nix.settings.sandbox = false;
|
||||
|
||||
proxmoxLXC = {
|
||||
manageNetwork = false;
|
||||
privileged = false;
|
||||
};
|
||||
|
||||
# Let Proxmox host handle fstrim
|
||||
services.fstrim.enable = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue