mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
Minor module refactors
This commit is contained in:
parent
89144e5b7a
commit
1a8333829e
4 changed files with 28 additions and 26 deletions
|
|
@ -1,8 +1,19 @@
|
|||
{ config, lib, ... }:
|
||||
{ config, lib, ... }@moduleArgs:
|
||||
{
|
||||
options.myConfig.deUtils.gammastep.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.deUtils.gammastep.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion =
|
||||
let
|
||||
inherit (moduleArgs.osConfig.services) geoclue2;
|
||||
in
|
||||
geoclue2.enable or true && geoclue2.appConfig.gammastep.isAllowed or true;
|
||||
message = "gammastep requires geoclue";
|
||||
}
|
||||
];
|
||||
|
||||
services.gammastep = {
|
||||
enable = true;
|
||||
provider = "geoclue2";
|
||||
|
|
|
|||
13
modules/home/virt-manager.nix
Normal file
13
modules/home/virt-manager.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }@moduleArgs:
|
||||
{
|
||||
options.myConfig.virt-manager.enable = lib.mkEnableOption "" // {
|
||||
default = moduleArgs.osConfig.programs.virt-manager.enable or false;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.myConfig.virt-manager.enable {
|
||||
dconf.settings."org/virt-manager/virt-manager/connections" = {
|
||||
autoconnect = [ "qemu:///system" ];
|
||||
uris = [ "qemu:///system" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
{ config, lib, ... }@moduleArgs:
|
||||
{
|
||||
options.myConfig.virtualisation.enable = lib.mkEnableOption "" // {
|
||||
default = moduleArgs.osConfig.myConfig.virtualisation.enable or false;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.myConfig.virtualisation.enable {
|
||||
dconf.settings."org/virt-manager/virt-manager/connections" = {
|
||||
autoconnect = [ "qemu:///system" ];
|
||||
uris = [ "qemu:///system" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -5,24 +5,15 @@
|
|||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.myConfig.sops;
|
||||
in
|
||||
{
|
||||
imports = [ inputs.sops-nix.nixosModules.sops ];
|
||||
|
||||
options.myConfig.sops = {
|
||||
enable = lib.mkEnableOption "";
|
||||
defaultSopsFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
|
||||
};
|
||||
};
|
||||
options.myConfig.sops.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
config = lib.mkIf config.myConfig.sops.enable {
|
||||
sops = {
|
||||
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
inherit (cfg) defaultSopsFile;
|
||||
defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue