Migrated from import based to config based
This commit is contained in:
37
modules/system/services/docker.nix
Normal file
37
modules/system/services/docker.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.services.docker;
|
||||
in {
|
||||
options = {
|
||||
settings.services.docker.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable docker configuration
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
rootless = {
|
||||
enable = true;
|
||||
setSocketVariable = true;
|
||||
};
|
||||
};
|
||||
|
||||
users.users.xeovalyte.extraGroups = [ "docker" ];
|
||||
|
||||
security.wrappers = {
|
||||
docker-rootlesskit = {
|
||||
owner = "root";
|
||||
group = "root";
|
||||
capabilities = "cap_net_bind_service+ep";
|
||||
source = "${pkgs.rootlesskit}/bin/rootlesskit";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
26
modules/system/services/garbage-collection.nix
Normal file
26
modules/system/services/garbage-collection.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.services.garbage-collection;
|
||||
in {
|
||||
options = {
|
||||
settings.services.garbage-collection.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable garbage collection of nix store
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 1w";
|
||||
};
|
||||
|
||||
nix.settings.auto-optimise-store = true;
|
||||
};
|
||||
}
|
27
modules/system/services/quickemu.nix
Normal file
27
modules/system/services/quickemu.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.services.quickemu;
|
||||
in {
|
||||
options = {
|
||||
settings.services.quickemu.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable quickemu virtualisation
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
|
||||
users.users.xeovalyte.extraGroups = [ "libvirtd" ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
quickemu
|
||||
];
|
||||
};
|
||||
}
|
26
modules/system/services/sunshine.nix
Normal file
26
modules/system/services/sunshine.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.services.sunshine;
|
||||
in {
|
||||
options = {
|
||||
settings.services.sunshine.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable sunshine service
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.sunshine = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.sunshine.override { cudaSupport = true; };
|
||||
autoStart = true;
|
||||
capSysAdmin = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user