Update NixDesk
This commit is contained in:
parent
adbb497f80
commit
05850a53ae
12 changed files with 182 additions and 103 deletions
|
@ -35,9 +35,10 @@
|
|||
inherit self inputs;
|
||||
|
||||
channelsConfig.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
|
||||
"nvidia-x11"
|
||||
"nvidia-settings"
|
||||
"corefonts"
|
||||
"nvidia-settings"
|
||||
"nvidia-x11"
|
||||
"Oracle_VM_VirtualBox_Extension_Pack"
|
||||
"vista-fonts"
|
||||
];
|
||||
|
||||
|
|
|
@ -1,64 +1,86 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
../../modules/hardware/nvidia.nix
|
||||
../../modules/hardware/corsair
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
../../modules/apps/virtualbox
|
||||
../../modules/des/gnome
|
||||
];
|
||||
sisyphus = {
|
||||
hardware.nvidia = {
|
||||
enable = true;
|
||||
model = "RTX 2060";
|
||||
};
|
||||
|
||||
# Bootloader.
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot/efi";
|
||||
};
|
||||
programs = {
|
||||
home-manager.enable = true;
|
||||
sops.enable = true;
|
||||
ssh.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
pipewire.enable = true;
|
||||
printing.enable = true;
|
||||
openrgb.enable = true;
|
||||
};
|
||||
|
||||
users.tdpeuter.enable = true;
|
||||
|
||||
virtualisation.virtualbox.enable = true;
|
||||
};
|
||||
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot/efi";
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
vim
|
||||
w3m
|
||||
wget
|
||||
zenith-nvidia
|
||||
];
|
||||
|
||||
programs.zsh.enable = true;
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
|
||||
networking = {
|
||||
hostName = "Tibo-NixDesk";
|
||||
networkmanager.enable = true;
|
||||
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
hostName = "Tibo-NixDesk";
|
||||
networkmanager.enable = true;
|
||||
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Brussels";
|
||||
|
||||
# Enable sound with pipewire.
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
};
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
# programs.gnupg.agent = {
|
||||
# enable = true;
|
||||
# enableSSHSupport = true;
|
||||
# };
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
|
||||
time.timeZone = "Europe/Brussels";
|
||||
|
||||
nix = {
|
||||
# Allow Nix Flakes
|
||||
# Keep derivations so shells don't break (direnv)
|
||||
# If the disk has less than 100MiB, free up to 2GiB by garbage-collecting.
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
min-free = ${toString (100 * 1024 * 1024)}
|
||||
max-free = ${toString (2048 * 1024 * 1024)}
|
||||
'';
|
||||
# Scheduled garbage-collect
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
package = pkgs.nixFlakes;
|
||||
};
|
||||
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
console = {
|
||||
# font = "Lat2-Terminus16";
|
||||
useXkbConfig = true; # use xkbOptions in tty.
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,24 +3,25 @@
|
|||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../modules-old
|
||||
];
|
||||
|
||||
sisyphus = {
|
||||
users.tdpeuter.enable = true;
|
||||
|
||||
hardware.nvidia.enable = true;
|
||||
hardware.nvidia.model = "Quadro T2000";
|
||||
hardware.nvidia = {
|
||||
enable = true;
|
||||
model = "Quadro T2000";
|
||||
};
|
||||
|
||||
programs = {
|
||||
home-manager.enable = true;
|
||||
sops.enable = true;
|
||||
ssh.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
desktop.gnome.enable = true;
|
||||
printing.enable = true;
|
||||
pipewire.enable = true;
|
||||
};
|
||||
|
||||
users.tdpeuter.enable = true;
|
||||
};
|
||||
|
||||
boot = {
|
||||
|
@ -83,21 +84,30 @@
|
|||
networking = {
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
|
||||
# Enable sound with pipewire.
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
|
||||
nix = {
|
||||
# Allow Nix Flakes
|
||||
# Keep derivations so shells don't break (direnv)
|
||||
# If the disk has less than 100MiB, free up to 2GiB by garbage-collecting.
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
min-free = ${toString (100 * 1024 * 1024)}
|
||||
max-free = ${toString (2048 * 1024 * 1024)}
|
||||
'';
|
||||
# Scheduled garbage-collect
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
package = pkgs.nixFlakes;
|
||||
};
|
||||
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
console = {
|
||||
# font = "Lat2-Terminus16";
|
||||
useXkbConfig = true; # use xkbOptions in tty.
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.hardware.openrgb = {
|
||||
enable = true;
|
||||
package = pkgs.openrgb-with-all-plugins;
|
||||
motherboard = "intel";
|
||||
};
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./desktop
|
||||
./hardware
|
||||
./programs
|
||||
./services
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.sisyphus.services.desktop.gnome;
|
||||
cfg = config.sisyphus.desktop.gnome;
|
||||
in {
|
||||
options.sisyphus.services.desktop.gnome.enable = lib.mkEnableOption "GNOME";
|
||||
options.sisyphus.desktop.gnome.enable = lib.mkEnableOption "GNOME";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.xserver = {
|
|
@ -3,6 +3,7 @@
|
|||
let
|
||||
cfg = config.sisyphus.hardware.nvidia;
|
||||
|
||||
do-offloading = builtins.elem cfg.model [ "Quadro T2000" ];
|
||||
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
|
||||
export __NV_PRIME_RENDER_OFFLOAD=1
|
||||
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
|
||||
|
@ -35,24 +36,33 @@ in {
|
|||
open = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
modesetting.enable = true;
|
||||
nvidiaSettings = config.sisyphus.hardware.nvidia.gui-settings;
|
||||
nvidiaSettings = cfg.gui-settings;
|
||||
powerManagement = {
|
||||
enable = true;
|
||||
finegrained = true;
|
||||
enable = do-offloading;
|
||||
finegrained = do-offloading;
|
||||
};
|
||||
|
||||
prime = lib.mkIf (cfg.model == "Quadro T2000") {
|
||||
offload = {
|
||||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
};
|
||||
intelBusId = "PCI::00:02:0";
|
||||
nvidiaBusId = "PCI:01:00:0";
|
||||
};
|
||||
prime = lib.mkMerge [
|
||||
(lib.mkIf do-offloading {
|
||||
offload = {
|
||||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
};
|
||||
})
|
||||
(lib.mkIf (cfg.model == "Quadro T2000") {
|
||||
intelBusId = "PCI::00:02:0";
|
||||
nvidiaBusId = "PCI:01:00:0";
|
||||
})
|
||||
(lib.mkIf (cfg.model == "RTX 2060") {
|
||||
sync.enable = true;
|
||||
intelBusId = "PCI::00:02:0";
|
||||
nvidiaBusId = "PCI:01:00:0";
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = lib.mkIf (cfg.model != "") [
|
||||
environment.systemPackages = lib.mkIf do-offloading [
|
||||
nvidia-offload
|
||||
];
|
||||
};
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
imports = [
|
||||
./desktop
|
||||
./openrgb
|
||||
./openssh
|
||||
./pipewire
|
||||
./printing
|
||||
];
|
||||
}
|
||||
|
|
15
nixos/modules/services/openrgb/default.nix
Normal file
15
nixos/modules/services/openrgb/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.sisyphus.services.openrgb;
|
||||
in {
|
||||
options.sisyphus.services.openrgb.enable = lib.mkEnableOption "OpenRGB";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.hardware.openrgb = {
|
||||
enable = true;
|
||||
package = pkgs.openrgb-with-all-plugins;
|
||||
motherboard = "intel";
|
||||
};
|
||||
};
|
||||
}
|
25
nixos/modules/services/pipewire/default.nix
Normal file
25
nixos/modules/services/pipewire/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.sisyphus.services.pipewire;
|
||||
in {
|
||||
options.sisyphus.services.pipewire.enable = lib.mkEnableOption "Pipewire";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -38,7 +38,10 @@ in {
|
|||
vistafonts # Microsoft fonts
|
||||
];
|
||||
|
||||
sisyphus.programs.spotify-adblock.enable = true;
|
||||
sisyphus = {
|
||||
desktop.gnome.enable = true;
|
||||
programs.spotify-adblock.enable = true;
|
||||
};
|
||||
|
||||
home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable {
|
||||
programs.home-manager.enable = true;
|
||||
|
@ -85,7 +88,7 @@ in {
|
|||
# GNOME ricing
|
||||
# Browse available settings by running:
|
||||
# gsettings list-schemas | xargs -I % sh -c 'echo %; gsettings list-keys %' | less
|
||||
dconf.settings = lib.mkIf config.sisyphus.services.desktop.gnome.enable {
|
||||
dconf.settings = lib.mkIf config.sisyphus.desktop.gnome.enable {
|
||||
"org/gnome/desktop/background" = {
|
||||
picture-uri = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg";
|
||||
picture-uri-dark = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg-dark";
|
||||
|
|
Loading…
Reference in a new issue