Migrated from import based to config based
This commit is contained in:
parent
c1b12746f5
commit
5edd8b1e01
@ -2,31 +2,39 @@
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Import hardware configuration
|
||||
./hardware-configuration.nix
|
||||
|
||||
# GUI
|
||||
../../modules/system/gui/hyprland.nix
|
||||
../../modules/system/gui/cosmic.nix
|
||||
../../modules/system/gui/cosmic-greeter.nix
|
||||
../../modules/system/gui/steam.nix
|
||||
../../modules/system/gui/thunar.nix
|
||||
|
||||
# CLI
|
||||
../../modules/system/cli/common.nix
|
||||
../../modules/system/cli/docker.nix
|
||||
|
||||
# Hardware
|
||||
# ../../modules/system/hardware/amd.nix
|
||||
../../modules/system/hardware/bluetooth.nix
|
||||
../../modules/system/hardware/firewall.nix
|
||||
../../modules/system/hardware/garbage-collection.nix
|
||||
../../modules/system/hardware/laptop.nix
|
||||
../../modules/system/hardware/locale.nix
|
||||
../../modules/system/hardware/printing.nix
|
||||
../../modules/system/hardware/fprint.nix
|
||||
../../modules/system/hardware/virt.nix
|
||||
# Import modules
|
||||
../../modules/system/default.nix
|
||||
];
|
||||
|
||||
settings = {
|
||||
display-manager = "cosmic-greeter";
|
||||
desktop-environments = {
|
||||
cosmic.enable = true;
|
||||
hyprland.enable = true;
|
||||
};
|
||||
applications = {
|
||||
common.enable = true;
|
||||
steam.enable = true;
|
||||
thunar.enable = true;
|
||||
};
|
||||
services = {
|
||||
docker.enable = true;
|
||||
quickemu.enable = true;
|
||||
sunshine.enable = false;
|
||||
garbage-collection.enable = true;
|
||||
};
|
||||
hardware = {
|
||||
fprint.enable = true;
|
||||
printing.enable = true;
|
||||
bluetooth.enable = true;
|
||||
firewall.enable = true;
|
||||
locale.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
|
34
modules/system/applications/common.nix
Normal file
34
modules/system/applications/common.nix
Normal file
@ -0,0 +1,34 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.applications.common;
|
||||
in {
|
||||
options = {
|
||||
settings.applications.common.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable common applications
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
usbutils
|
||||
tree
|
||||
fastfetch
|
||||
btop
|
||||
git
|
||||
yazi
|
||||
|
||||
just
|
||||
];
|
||||
|
||||
environment.pathsToLink = [ "/share/zsh" ];
|
||||
|
||||
programs.zsh.enable = true;
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
};
|
||||
}
|
31
modules/system/applications/steam.nix
Normal file
31
modules/system/applications/steam.nix
Normal file
@ -0,0 +1,31 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.applications.steam;
|
||||
in {
|
||||
options = {
|
||||
settings.applications.steam.enable = lib.mkOption {
|
||||
type = with lib.types; bool;
|
||||
description = ''
|
||||
Enable steam
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"steam"
|
||||
"steam-original"
|
||||
"steam-run"
|
||||
];
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
};
|
||||
};
|
||||
}
|
30
modules/system/applications/thunar.nix
Normal file
30
modules/system/applications/thunar.nix
Normal file
@ -0,0 +1,30 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.applications.thunar;
|
||||
in {
|
||||
options = {
|
||||
settings.applications.thunar.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable thunar file manager
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.thunar = {
|
||||
enable = true;
|
||||
plugins = with pkgs.xfce; [
|
||||
thunar-archive-plugin
|
||||
thunar-volman
|
||||
];
|
||||
};
|
||||
|
||||
services.gvfs.enable = true;
|
||||
services.tumbler.enable = true;
|
||||
programs.file-roller.enable = true;
|
||||
};
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
usbutils
|
||||
tree
|
||||
fastfetch
|
||||
btop
|
||||
git
|
||||
yazi
|
||||
|
||||
just
|
||||
];
|
||||
|
||||
environment.pathsToLink = [ "/share/zsh" ];
|
||||
|
||||
programs.zsh.enable = true;
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
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";
|
||||
};
|
||||
};
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
virtualisation.containers.enable = true;
|
||||
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.backend = "podman";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
dive
|
||||
podman-tui
|
||||
podman-compose
|
||||
];
|
||||
}
|
26
modules/system/default.nix
Normal file
26
modules/system/default.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./applications/common.nix
|
||||
./applications/steam.nix
|
||||
./applications/thunar.nix
|
||||
|
||||
./services/docker.nix
|
||||
./services/quickemu.nix
|
||||
./services/sunshine.nix
|
||||
./services/garbage-collection.nix
|
||||
|
||||
./hardware/bluetooth.nix
|
||||
./hardware/fprint.nix
|
||||
./hardware/locale.nix
|
||||
# ./hardware/nvidia.nix
|
||||
./hardware/firewall.nix
|
||||
./hardware/printing.nix
|
||||
|
||||
./desktop-environments/cosmic.nix
|
||||
./desktop-environments/hyprland.nix
|
||||
|
||||
./display-managers/default.nix
|
||||
];
|
||||
}
|
24
modules/system/desktop-environments/cosmic.nix
Normal file
24
modules/system/desktop-environments/cosmic.nix
Normal file
@ -0,0 +1,24 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.desktop-environments.cosmic;
|
||||
in {
|
||||
options = {
|
||||
settings.desktop-environments.cosmic.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable cosmic desktop environment
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.desktopManager.cosmic.enable = true;
|
||||
|
||||
environment.sessionVariables = {
|
||||
COSMIC_DISABLE_DIRECT_SCANOUT = "true";
|
||||
};
|
||||
};
|
||||
}
|
44
modules/system/desktop-environments/hyprland.nix
Normal file
44
modules/system/desktop-environments/hyprland.nix
Normal file
@ -0,0 +1,44 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.desktop-environments.hyprland;
|
||||
in {
|
||||
options = {
|
||||
settings.desktop-environments.hyprland.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable hyprland window manager
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.hyprland;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
|
||||
# Sound configuration
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# Keyring configuration
|
||||
security.polkit.enable = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
security.pam.services.greetd.enableGnomeKeyring = true;
|
||||
programs.ssh.startAgent = true;
|
||||
|
||||
# Configure networking
|
||||
networking.networkmanager.enable = true;
|
||||
networking.wireless.iwd.enable = true;
|
||||
};
|
||||
}
|
11
modules/system/display-managers/cosmic-greeter.nix
Normal file
11
modules/system/display-managers/cosmic-greeter.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.display-manager;
|
||||
in {
|
||||
config = mkIf (cfg == "cosmic-greeter") {
|
||||
services.displayManager.cosmic-greeter.enable = true;
|
||||
};
|
||||
}
|
21
modules/system/display-managers/default.nix
Normal file
21
modules/system/display-managers/default.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{ lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.display-manager;
|
||||
in {
|
||||
options = {
|
||||
settings.display-manager = lib.mkOption {
|
||||
type = lib.types.enum ["sddm" "cosmic-greeter"];
|
||||
description = ''
|
||||
Specify which display manager to use
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./sddm.nix
|
||||
./cosmic-greeter.nix
|
||||
];
|
||||
}
|
20
modules/system/display-managers/sddm.nix
Normal file
20
modules/system/display-managers/sddm.nix
Normal file
@ -0,0 +1,20 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.display-manager;
|
||||
in {
|
||||
config = mkIf (cfg == "sddm") {
|
||||
environment.systemPackages = with pkgs; [
|
||||
libsForQt5.qt5.qtquickcontrols2
|
||||
libsForQt5.qt5.qtgraphicaleffects
|
||||
];
|
||||
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
theme = "${import ./sddm-theme.nix { inherit pkgs; }}";
|
||||
};
|
||||
};
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.displayManager.cosmic-greeter.enable = true;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.desktopManager.cosmic.enable = true;
|
||||
|
||||
environment.sessionVariables = {
|
||||
COSMIC_DISABLE_DIRECT_SCANOUT = "true";
|
||||
};
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.hyprland;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
|
||||
# Sound configuration
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# Keyring configuration
|
||||
security.polkit.enable = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
security.pam.services.greetd.enableGnomeKeyring = true;
|
||||
programs.ssh.startAgent = true;
|
||||
|
||||
# Configure networking
|
||||
networking.networkmanager.enable = true;
|
||||
networking.wireless.iwd.enable = true;
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
programs.noisetorch.enable = true;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
services.displayManager.sddm.enable = true;
|
||||
services.displayManager.sddm.wayland.enable = true;
|
||||
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
libsForQt5.qt5.qtquickcontrols2
|
||||
libsForQt5.qt5.qtgraphicaleffects
|
||||
];
|
||||
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
theme = "${import ./sddm-theme.nix { inherit pkgs; }}";
|
||||
};
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
{ config, lib, nixpkgs, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"steam"
|
||||
"steam-original"
|
||||
"steam-run"
|
||||
];
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
};
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
services.sunshine = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.sunshine.override { cudaSupport = true; };
|
||||
autoStart = true;
|
||||
capSysAdmin = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.thunar = {
|
||||
enable = true;
|
||||
plugins = with pkgs.xfce; [
|
||||
thunar-archive-plugin
|
||||
thunar-volman
|
||||
];
|
||||
};
|
||||
|
||||
services.gvfs.enable = true;
|
||||
services.tumbler.enable = true;
|
||||
programs.file-roller.enable = true;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
hardware.graphics.extraPackages = with pkgs; [
|
||||
amdvlk
|
||||
];
|
||||
|
||||
hardware.graphics.extraPackages32 = with pkgs; [
|
||||
driversi686Linux.amdvlk
|
||||
];
|
||||
}
|
@ -1,6 +1,20 @@
|
||||
{ pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.hardware.bluetooth;
|
||||
in {
|
||||
options = {
|
||||
settings.hardware.bluetooth.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable bluetooth
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
@ -12,4 +26,5 @@
|
||||
};
|
||||
|
||||
services.blueman.enable = true;
|
||||
};
|
||||
}
|
||||
|
@ -1,9 +1,24 @@
|
||||
{ ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.hardware.firewall;
|
||||
in {
|
||||
options = {
|
||||
settings.hardware.firewall.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable firewall
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ ];
|
||||
allowedUDPPorts = [ ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -1,8 +1,23 @@
|
||||
{ lib, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.hardware.fprint;
|
||||
in {
|
||||
options = {
|
||||
settings.hardware.fprint.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable fingerprint
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.fprintd.enable = true;
|
||||
|
||||
security.pam.services.login.fprintAuth = false;
|
||||
security.pam.services.cosmic-greeter.fprintAuth = false;
|
||||
};
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 1w";
|
||||
};
|
||||
|
||||
nix.settings.auto-optimise-store = true;
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
# services.auto-cpufreq.enable = true;
|
||||
# services.auto-cpufreq.settings = {
|
||||
# battery = {
|
||||
# governor = "powersave";
|
||||
# turbo = "never";
|
||||
# };
|
||||
# charger = {
|
||||
# governor = "performance";
|
||||
# turbo = "auto";
|
||||
# };
|
||||
# };
|
||||
|
||||
services.power-profiles-daemon.enable = true;
|
||||
|
||||
boot.extraModprobeConfig = ''
|
||||
options snd_hda_intel power_save=0
|
||||
'';
|
||||
|
||||
# powerManagement.powertop.enable = true;
|
||||
}
|
||||
|
@ -1,6 +1,20 @@
|
||||
{ ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.hardware.locale;
|
||||
in {
|
||||
options = {
|
||||
settings.hardware.locale.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable locale configuration
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Amsterdam";
|
||||
|
||||
@ -18,4 +32,5 @@
|
||||
LC_TELEPHONE = "nl_NL.UTF-8";
|
||||
LC_TIME = "nl_NL.UTF-8";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -1,8 +1,23 @@
|
||||
{ pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.settings.hardware.printing;
|
||||
in {
|
||||
options = {
|
||||
settings.hardware.printing.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enable printer configuration
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.printing = {
|
||||
enable = true;
|
||||
drivers = [ pkgs.hplip ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
|
||||
users.users.xeovalyte.extraGroups = [ "libvirtd" ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
quickemu
|
||||
];
|
||||
}
|
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;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user