Add conditionals and assertions
This commit is contained in:
parent
3754cbb0c0
commit
6b04b535c1
7 changed files with 30 additions and 3 deletions
|
@ -451,6 +451,13 @@ let
|
||||||
''}";
|
''}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = config.users.users ? "vili";
|
||||||
|
message = "User 'vili' needed for desktop!";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
i3status
|
i3status
|
||||||
rofi
|
rofi
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
xserver = {
|
xserver = pkgs.lib.mkIf config.services.xserver.enable {
|
||||||
videoDrivers = [
|
videoDrivers = [
|
||||||
"amdgpu"
|
"amdgpu"
|
||||||
"modesetting"
|
"modesetting"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Config for Keychron Q11 keyboard
|
# Config for Keychron Q11 keyboard
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [ via ];
|
environment.systemPackages = with pkgs; if config.services.xserver.enable then [ via ] else [ ];
|
||||||
|
|
||||||
# Keychron Q11
|
# Keychron Q11
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
# Config for my Logitech trackball
|
# Config for my Logitech trackball
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = config.services.xserver.enable;
|
||||||
|
message = "Trackball does not work without a desktop!";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
disabledModules = [ "services/hardware/libinput.nix" ];
|
disabledModules = [ "services/hardware/libinput.nix" ];
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
# Game streaming software (and possibly services in future)
|
# Game streaming software (and possibly services in future)
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = config.services.xserver.enable;
|
||||||
|
message = "Game streaming does not work without a desktop!";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
moonlight-qt
|
moonlight-qt
|
||||||
parsec-bin
|
parsec-bin
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
# Redshift bluelight reducer
|
# Redshift bluelight reducer
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = config.services.xserver.enable;
|
||||||
|
message = "Redshift does not work without a desktop!";
|
||||||
|
}
|
||||||
|
];
|
||||||
services = {
|
services = {
|
||||||
redshift = {
|
redshift = {
|
||||||
executable = "/bin/redshift-gtk";
|
executable = "/bin/redshift-gtk";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Nextcloud instance
|
# Vaultwarden instance
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue