Compare commits
7 Commits
ffaac68fa6
...
d037c58394
Author | SHA1 | Date |
---|---|---|
Sven Vogel | d037c58394 | |
Sven Vogel | 4d39e01214 | |
Sven Vogel | ea5ee00760 | |
Sven Vogel | aced2f565a | |
Sven Vogel | a566322eee | |
Sven Vogel | eca53b8eb5 | |
Sven Vogel | 88b1681dcb |
|
@ -1,8 +1,10 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
settings = import ./../settings.nix;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = lib.optionals settings.printing.enable [ ./printing.nix ]
|
||||||
./java.nix
|
++ lib.optionals settings.xdg.enable [ ./xdg.nix ]
|
||||||
./dotnet.nix
|
++ lib.optionals settings.java [ ./java.nix ]
|
||||||
./printing.nix
|
++ lib.optionals settings.dotnet [ ./dotnet.nix ];
|
||||||
./xdg.nix
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
{ pkgs, config, ... }: {
|
{ pkgs, lib, config, ... }:
|
||||||
|
let
|
||||||
|
settings = import ./../settings.nix;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
}
|
||||||
|
# Avahi daemon
|
||||||
|
(lib.mkIf settings.printing.avahi {
|
||||||
services.avahi.enable = true;
|
services.avahi.enable = true;
|
||||||
# for a WiFi printer
|
# for a WiFi printer
|
||||||
services.avahi.openFirewall = true;
|
services.avahi.openFirewall = true;
|
||||||
|
@ -10,4 +19,6 @@
|
||||||
(mkBefore [ "mdns4_minimal [NOTFOUND=return]" ]) # before resolve
|
(mkBefore [ "mdns4_minimal [NOTFOUND=return]" ]) # before resolve
|
||||||
(mkAfter [ "mdns4" ]) # after dns
|
(mkAfter [ "mdns4" ]) # after dns
|
||||||
]);
|
]);
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
17
core/xdg.nix
17
core/xdg.nix
|
@ -1,15 +1,12 @@
|
||||||
{ pkgs, config, ... }: {
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
|
settings = import ./../settings.nix;
|
||||||
|
in
|
||||||
|
{
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPortals = [
|
extraPortals = settings.xdg.extraPortals;
|
||||||
pkgs.xdg-desktop-portal-gtk
|
|
||||||
pkgs.xdg-desktop-portal-kde
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = settings.xdg.extraPortals;
|
||||||
pkgs.xdg-desktop-portal-gtk
|
|
||||||
pkgs.xdg-desktop-portal-kde
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
let
|
||||||
|
settings = import ./../settings.nix;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = lib.optionals settings.dev.lsp.enable [ ./lsp.nix ]
|
||||||
./language-server.nix
|
++ lib.optionals settings.virtualisation.docker-rootless.enable [ ./docker-rootless.nix ]
|
||||||
./dotnet.nix
|
++ lib.optionals settings.virtualisation.qemu.enable [ ./qemu.nix ]
|
||||||
./docker-rootless.nix
|
++ lib.optionals settings.dev.platformio [ ./platformio.nix ]
|
||||||
./platformio.nix
|
++ lib.optionals settings.dev.latex [ ./latex.nix ]
|
||||||
./qemu.nix
|
++ lib.optionals settings.dev.dotnet [ ./dotnet.nix ];
|
||||||
./latex.nix
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
{ 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 = true;
|
virtualisation.docker.autoPrune.enable = settings.virtualisation.docker-rootless.autoPrune;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
{ 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
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
{ 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 ];
|
||||||
|
}
|
14
dev/qemu.nix
14
dev/qemu.nix
|
@ -1,10 +1,14 @@
|
||||||
{ pkgs, config, ... }: {
|
{ pkgs, config, ... }:
|
||||||
|
let
|
||||||
|
settings = import ./../settings.nix;
|
||||||
|
in
|
||||||
|
{
|
||||||
# KVM
|
# KVM
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
# programs.virt-manager.enable = true; # after 23.11
|
programs.virt-manager.enable = settings.virtualisation.qemu.virt-manager; # after 23.11
|
||||||
|
|
||||||
# only before 23.11
|
# only before 23.11
|
||||||
environment.systemPackages = (with pkgs; [
|
# environment.systemPackages = (with pkgs; [
|
||||||
virt-manager
|
# virt-manager
|
||||||
]);
|
# ]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
settings = import ./../settings.nix;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
# Optionally import modules for non-essential extras
|
||||||
./bluray.nix
|
imports =
|
||||||
./dvd.nix
|
lib.optionals settings.hardware.yubikey.enable [ ./yubikey.nix ]
|
||||||
./yubikey.nix
|
++ lib.optionals settings.dvd [ ./dvd.nix ]
|
||||||
./wireguard.nix
|
++ lib.optionals settings.bluray [ ./bluray.nix ]
|
||||||
];
|
++ lib.optionals settings.networking.wireguard [ ./wireguard.nix ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
{ pkgs, config, ... }: {
|
{ pkgs, lib, ... }:
|
||||||
|
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; [
|
environment.systemPackages = with pkgs; [ pcsclite ]
|
||||||
# Yubikey stuff
|
# Yubico authentictor app for managing accounts
|
||||||
yubioath-flutter # Yubico authentictor app for managing accounts
|
++ (lib.optionals settings.hardware.yubikey.authenticator [ yubioath-flutter ])
|
||||||
|
# ykman CLI and Qt-GUI
|
||||||
|
++ (lib.optionals settings.hardware.yubikey.ykman [
|
||||||
yubikey-manager # CLI tool for ykman
|
yubikey-manager # CLI tool for ykman
|
||||||
yubikey-manager-qt # GUI tool for ykman
|
yubikey-manager-qt # GUI tool for ykman
|
||||||
pcsclite
|
]);
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
settings = import ./../settings.nix;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
# Optionally import modules for game launchers, games or compatability layers
|
||||||
./steam.nix
|
imports =
|
||||||
./prismlauncher.nix
|
lib.optionals settings.games.prismlauncher [ ./prismlauncher.nix ]
|
||||||
];
|
++ lib.optionals settings.games.steam [ ./steam.nix ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
{ pkgs, config, ... }: {
|
{ pkgs, lib, ... }:
|
||||||
|
{
|
||||||
|
# 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;
|
||||||
|
|
||||||
|
@ -12,6 +18,11 @@
|
||||||
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
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
settings = import ./../settings.nix;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
# Optionally import modules for specific hardware
|
||||||
./amdgpu.nix
|
imports =
|
||||||
];
|
lib.optionals settings.hardware.amdgpu [ ./amdgpu.nix ]
|
||||||
|
++ lib.optionals settings.hardware.intelgpu [ ./intelgpu.nix ]
|
||||||
|
++ lib.optionals settings.hardware.nvidiagpu [ ./nvidiagpu.nix ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
{ 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
|
||||||
|
];
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
{ 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
|
||||||
|
];
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue