Compare commits

..

No commits in common. "601e8948d89082fa0d36ea058803a96891f5e71e" and "ffaac68fa63f6b2719ecd80ebb2618d8d8509444" have entirely different histories.

16 changed files with 76 additions and 219 deletions

View File

@ -1,10 +1,8 @@
{ lib, ... }:
let
settings = import ./../settings.nix;
in
{ {
imports = lib.optionals settings.printing.enable [ ./printing.nix ] imports = [
++ lib.optionals settings.xdg.enable [ ./xdg.nix ] ./java.nix
++ lib.optionals settings.java [ ./java.nix ] ./dotnet.nix
++ lib.optionals settings.dotnet [ ./dotnet.nix ]; ./printing.nix
./xdg.nix
];
} }

View File

@ -1,24 +1,13 @@
{ pkgs, lib, config, ... }: { pkgs, config, ... }: {
let services.printing.enable = true;
settings = import ./../settings.nix; services.avahi.enable = true;
in # for a WiFi printer
{ services.avahi.openFirewall = true;
config = lib.mkMerge [ services.avahi.nssmdns = false; # Use the settings from below
{ # settings from avahi-daemon.nix where mdns is replaced with mdns4
services.printing.enable = true; system.nssModules = pkgs.lib.optional (!config.services.avahi.nssmdns) pkgs.nssmdns;
} system.nssDatabases.hosts = with pkgs.lib; optionals (!config.services.avahi.nssmdns) (mkMerge [
# Avahi daemon (mkBefore [ "mdns4_minimal [NOTFOUND=return]" ]) # before resolve
(lib.mkIf settings.printing.avahi { (mkAfter [ "mdns4" ]) # after dns
services.avahi.enable = true; ]);
# for a WiFi printer
services.avahi.openFirewall = true;
services.avahi.nssmdns = false; # Use the settings from below
# settings from avahi-daemon.nix where mdns is replaced with mdns4
system.nssModules = pkgs.lib.optional (!config.services.avahi.nssmdns) pkgs.nssmdns;
system.nssDatabases.hosts = with pkgs.lib; optionals (!config.services.avahi.nssmdns) (mkMerge [
(mkBefore [ "mdns4_minimal [NOTFOUND=return]" ]) # before resolve
(mkAfter [ "mdns4" ]) # after dns
]);
})
];
} }

View File

@ -1,12 +1,15 @@
{ pkgs, ... }: { pkgs, config, ... }: {
let
settings = import ./../settings.nix;
in
{
xdg.portal = { xdg.portal = {
enable = true; enable = true;
extraPortals = settings.xdg.extraPortals; extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-kde
];
}; };
environment.systemPackages = settings.xdg.extraPortals; environment.systemPackages = with pkgs; [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-kde
];
} }

View File

@ -1,12 +1,10 @@
{ pkgs, lib, config, ... }:
let
settings = import ./../settings.nix;
in
{ {
imports = lib.optionals settings.dev.lsp.enable [ ./lsp.nix ] imports = [
++ lib.optionals settings.virtualisation.docker-rootless.enable [ ./docker-rootless.nix ] ./language-server.nix
++ lib.optionals settings.virtualisation.qemu.enable [ ./qemu.nix ] ./dotnet.nix
++ lib.optionals settings.dev.platformio [ ./platformio.nix ] ./docker-rootless.nix
++ lib.optionals settings.dev.latex [ ./latex.nix ] ./platformio.nix
++ lib.optionals settings.dev.dotnet [ ./dotnet.nix ]; ./qemu.nix
./latex.nix
];
} }

View File

@ -1,13 +1,9 @@
{ pkgs, config, ... }: { pkgs, config, ... }: {
let
settings = import ./../settings.nix;
in
{
# enable rootless docker for more security # enable rootless docker for more security
virtualisation.docker.rootless = { virtualisation.docker.rootless = {
enable = true; enable = true;
setSocketVariable = true; setSocketVariable = true;
}; };
# regulary clean unused docker images # regulary clean unused docker images
virtualisation.docker.autoPrune.enable = settings.virtualisation.docker-rootless.autoPrune; virtualisation.docker.autoPrune.enable = true;
} }

10
dev/language-server.nix Normal file
View File

@ -0,0 +1,10 @@
{ pkgs, config, ... }: {
# various language server used by IDEs and by my Neovim config
environment.systemPackages = with pkgs; [
shellcheck
lua-language-server
pyright
arduino-language-server
clang
];
}

View File

@ -1,13 +0,0 @@
{ pkgs, lib, ... }:
let
settings = import ./../settings.nix;
in
{
# various language server used by IDEs and by Neovim lsp-config
environment.systemPackages = with pkgs;
lib.optionals settings.dev.lsp.shellcheck [ shellcheck ]
++ lib.optionals settings.dev.lsp.luals [ lua-language-server ]
++ lib.optionals settings.dev.lsp.pyright[ pyright ]
++ lib.optionals settings.dev.lsp.arduino [ arduino-language-server ]
++ lib.optionals settings.dev.lsp.clangd [ clang ];
}

View File

@ -1,14 +1,10 @@
{ pkgs, config, ... }: { pkgs, config, ... }: {
let
settings = import ./../settings.nix;
in
{
# KVM # KVM
virtualisation.libvirtd.enable = true; virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = settings.virtualisation.qemu.virt-manager; # after 23.11 # programs.virt-manager.enable = true; # after 23.11
# only before 23.11 # only before 23.11
# environment.systemPackages = (with pkgs; [ environment.systemPackages = (with pkgs; [
# virt-manager virt-manager
# ]); ]);
} }

View File

@ -1,12 +1,8 @@
{ lib, ... }:
let
settings = import ./../settings.nix;
in
{ {
# Optionally import modules for non-essential extras imports = [
imports = ./bluray.nix
lib.optionals settings.hardware.yubikey.enable [ ./yubikey.nix ] ./dvd.nix
++ lib.optionals settings.dvd [ ./dvd.nix ] ./yubikey.nix
++ lib.optionals settings.bluray [ ./bluray.nix ] ./wireguard.nix
++ lib.optionals settings.networking.wireguard [ ./wireguard.nix ]; ];
} }

View File

@ -1,16 +1,12 @@
{ pkgs, lib, ... }: { pkgs, config, ... }: {
let
settings = import ./../settings.nix;
in
{
services.pcscd.enable = true; # enable support for smart cards services.pcscd.enable = true; # enable support for smart cards
environment.systemPackages = with pkgs; [ pcsclite ] environment.systemPackages = with pkgs; [
# Yubico authentictor app for managing accounts # Yubikey stuff
++ (lib.optionals settings.hardware.yubikey.authenticator [ yubioath-flutter ]) yubioath-flutter # Yubico authentictor app for managing accounts
# ykman CLI and Qt-GUI yubikey-manager # CLI tool for ykman
++ (lib.optionals settings.hardware.yubikey.ykman [ yubikey-manager-qt # GUI tool for ykman
yubikey-manager # CLI tool for ykman pcsclite
yubikey-manager-qt # GUI tool for ykman ];
]);
} }

View File

@ -1,10 +1,6 @@
{ lib, ... }:
let
settings = import ./../settings.nix;
in
{ {
# Optionally import modules for game launchers, games or compatability layers imports = [
imports = ./steam.nix
lib.optionals settings.games.prismlauncher [ ./prismlauncher.nix ] ./prismlauncher.nix
++ lib.optionals settings.games.steam [ ./steam.nix ]; ];
} }

View File

@ -1,14 +1,8 @@
{ pkgs, lib, ... }: { pkgs, config, ... }: {
{
# Adapted from: https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/amd/default.nix
# Make the kernel use the correct driver early # Make the kernel use the correct driver early
boot.initrd.kernelModules = [ "amdgpu" ]; boot.initrd.kernelModules = [ "amdgpu" ];
# Make sure Xserver uses the `amdgpu` driver
services.xserver.enable = true;
services.xserver.videoDrivers = [ "amdgpu" ];
# For 32 bit applications # For 32 bit applications
hardware.opengl.driSupport32Bit = true; hardware.opengl.driSupport32Bit = true;
@ -18,11 +12,6 @@
rocmPackages.clr.icd rocmPackages.clr.icd
]; ];
# For 32 bit applications
hardware.opengl.extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
nvtop-amd nvtop-amd
clinfo clinfo

View File

@ -1,11 +1,5 @@
{ lib, ... }:
let
settings = import ./../settings.nix;
in
{ {
# Optionally import modules for specific hardware imports = [
imports = ./amdgpu.nix
lib.optionals settings.hardware.amdgpu [ ./amdgpu.nix ] ];
++ lib.optionals settings.hardware.intelgpu [ ./intelgpu.nix ]
++ lib.optionals settings.hardware.nvidiagpu [ ./nvidiagpu.nix ];
} }

View File

@ -1,16 +0,0 @@
{ pkgs, lib, ... }:
{
# Excerpt: https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/intel/default.nix
boot.initrd.kernelModules = [ "i915" ];
environment.variables = {
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl");
};
hardware.opengl.extraPackages = with pkgs; [
(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver)
libvdpau-va-gl
intel-media-driver
];
}

View File

@ -1,8 +0,0 @@
{ pkgs, lib, ... }:
{
# Excerpt from: https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/nvidia/default.nix
services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ];
hardware.opengl.extraPackages = with pkgs; [
vaapiVdpau
];
}

View File

@ -1,67 +0,0 @@
with import <nixpkgs> {}; {
hardware = {
# support for GPUs
amdgpu = true;
intelgpu = false;
nvidiagpu = false;
# support for yubikey and additional software
yubikey = {
enable = true;
# additional software
ykman = false;
authenticator = true; # flutter yubico authenticator
};
};
virtualisation = {
docker-rootless = {
enable = true;
autoPrune = true;
};
qemu = {
enable = true;
virt-manager = true;
};
};
dev = {
platformio = true;
latex = true;
dotnet = false;
lsp = {
enable = true;
# various language server
shellcheck = true;
luals = true;
pyright = true;
arduino = true;
clangd = true;
};
};
dvd = true; # enable DVD decryption + ripping via Handbrake
bluray = true; # enable Bluray decryption (requires additional setup)
printing = {
enable = true;
avahi = true;
};
xdg = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
xdg-desktop-portal-kde
];
};
java = true;
dotnet = true;
networking = {
wireguard = true; # enable wireguard protocol
};
games = {
prismlauncher = true;
steam = true;
};
}