started refactoring desktop setup
This commit is contained in:
parent
3dd06c0bfb
commit
1d42925a43
9 changed files with 112 additions and 243 deletions
1
nixos/common/desktop/README.md
Normal file
1
nixos/common/desktop/README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# Common NixOS Config shared between desktop and laptop
|
85
nixos/common/desktop/default.nix
Normal file
85
nixos/common/desktop/default.nix
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
{ pkgs, config, lib, ... }: {
|
||||||
|
imports = [
|
||||||
|
./desktop-env.nix
|
||||||
|
];
|
||||||
|
# Bootloader.
|
||||||
|
boot = {
|
||||||
|
kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
efi.efiSysMountPoint = "/boot/efi";
|
||||||
|
};
|
||||||
|
kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
|
||||||
|
initrd = {
|
||||||
|
systemd.enable = true;
|
||||||
|
verbose = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "Europe/Amsterdam";
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
i18n.defaultLocale = "en_GB.UTF-8";
|
||||||
|
i18n.extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "nl_NL.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "nl_NL.UTF-8";
|
||||||
|
LC_MEASUREMENT = "nl_NL.UTF-8";
|
||||||
|
LC_MONETARY = "nl_NL.UTF-8";
|
||||||
|
LC_NAME = "nl_NL.UTF-8";
|
||||||
|
LC_NUMERIC = "nl_NL.UTF-8";
|
||||||
|
LC_PAPER = "nl_NL.UTF-8";
|
||||||
|
LC_TELEPHONE = "nl_NL.UTF-8";
|
||||||
|
LC_TIME = "nl_NL.UTF-8";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable CUPS to print documents.
|
||||||
|
services.printing.enable = true;
|
||||||
|
|
||||||
|
# Global Packages
|
||||||
|
environment.systemPackages = with pkgs; [ wireguard-tools ];
|
||||||
|
|
||||||
|
# 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;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualisation = {
|
||||||
|
podman.enable = true;
|
||||||
|
libvirtd = {
|
||||||
|
enable = true;
|
||||||
|
qemu.package = pkgs.qemu_kvm;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
fonts.fonts = with pkgs; [
|
||||||
|
material-design-icons
|
||||||
|
noto-fonts
|
||||||
|
noto-fonts-cjk
|
||||||
|
noto-fonts-emoji
|
||||||
|
dejavu_fonts
|
||||||
|
(nerdfonts.override {
|
||||||
|
fonts =
|
||||||
|
[ "DejaVuSansMono" "Ubuntu" "DroidSansMono" "NerdFontsSymbolsOnly" ];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.steam = {
|
||||||
|
enable = true;
|
||||||
|
# Open ports in the firewall for Steam Remote Play
|
||||||
|
remotePlay.openFirewall = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
{ pkgs, ...}: {
|
{ pkgs, ...}: {
|
||||||
# Enable the X11 windowing system.
|
# TODO: Create Module
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
|
||||||
services.xserver.excludePackages = [ pkgs.xterm ];
|
services.xserver.excludePackages = [ pkgs.xterm ];
|
||||||
|
|
||||||
# Configure keymap in X11
|
# Configure keymap in X11
|
|
@ -2,57 +2,21 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ config, pkgs, inputs, ... }: {
|
{ pkgs, inputs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
|
../../../common/desktop
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-z
|
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-z
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./networking.nix
|
./networking.nix
|
||||||
./desktop-env.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
initrd.kernelModules = [ "amdgpu" ];
|
||||||
# kernelPackages = pkgs.linuxKernel.packages.linux_zen;
|
|
||||||
loader = {
|
|
||||||
systemd-boot.enable = true;
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
efi.efiSysMountPoint = "/boot/efi";
|
|
||||||
};
|
|
||||||
kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
|
|
||||||
initrd = {
|
|
||||||
kernelModules = [ "amdgpu" ];
|
|
||||||
systemd.enable = true;
|
|
||||||
verbose = false;
|
|
||||||
};
|
|
||||||
resumeDevice = "/dev/nvme0n1p2";
|
resumeDevice = "/dev/nvme0n1p2";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/".options = [ "compress=zstd" ];
|
|
||||||
|
|
||||||
# Set your time zone.
|
|
||||||
time.timeZone = "Europe/Amsterdam";
|
|
||||||
|
|
||||||
# Select internationalisation properties.
|
|
||||||
i18n.defaultLocale = "en_GB.UTF-8";
|
|
||||||
i18n.extraLocaleSettings = {
|
|
||||||
LC_ADDRESS = "nl_NL.UTF-8";
|
|
||||||
LC_IDENTIFICATION = "nl_NL.UTF-8";
|
|
||||||
LC_MEASUREMENT = "nl_NL.UTF-8";
|
|
||||||
LC_MONETARY = "nl_NL.UTF-8";
|
|
||||||
LC_NAME = "nl_NL.UTF-8";
|
|
||||||
LC_NUMERIC = "nl_NL.UTF-8";
|
|
||||||
LC_PAPER = "nl_NL.UTF-8";
|
|
||||||
LC_TELEPHONE = "nl_NL.UTF-8";
|
|
||||||
LC_TIME = "nl_NL.UTF-8";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
|
||||||
services.printing.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ wireguard-tools ];
|
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
|
@ -60,48 +24,8 @@
|
||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = { inherit inputs; };
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable sound with pipewire.
|
# Enable Ozone rendering for Chromium and Electron apps.
|
||||||
sound.enable = true;
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualisation = {
|
|
||||||
podman.enable = true;
|
|
||||||
libvirtd = {
|
|
||||||
enable = true;
|
|
||||||
qemu.package = pkgs.qemu_kvm;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
fonts.fonts = with pkgs; [
|
|
||||||
material-design-icons
|
|
||||||
noto-fonts
|
|
||||||
noto-fonts-cjk
|
|
||||||
noto-fonts-emoji
|
|
||||||
dejavu_fonts
|
|
||||||
(nerdfonts.override {
|
|
||||||
fonts =
|
|
||||||
[ "DejaVuSansMono" "Ubuntu" "DroidSansMono" "NerdFontsSymbolsOnly" ];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.steam = {
|
|
||||||
enable = true;
|
|
||||||
# Open ports in the firewall for Steam Remote Play
|
|
||||||
remotePlay.openFirewall = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
|
@ -110,17 +34,4 @@
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
system.stateVersion = "23.05"; # Did you read the comment?
|
||||||
|
|
||||||
# Enable ccache
|
|
||||||
# WARNING: Adding packages here makes them always be built from source, so only do so for once that are usually build like that
|
|
||||||
# This should be fixed when nix switches to content-addresabble paths
|
|
||||||
programs.ccache.enable = true;
|
|
||||||
programs.ccache.packageNames = [
|
|
||||||
"mongodb"
|
|
||||||
];
|
|
||||||
nix.settings.extra-sandbox-paths =
|
|
||||||
[ (toString config.programs.ccache.cacheDir) ];
|
|
||||||
|
|
||||||
# Enable Ozone rendering for Chromium and Electron apps.
|
|
||||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
{ pkgs, ... }: {
|
|
||||||
# Enable the X11 windowing system.
|
|
||||||
services.xserver.enable = true;
|
|
||||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
|
||||||
services.xserver.excludePackages = [ pkgs.xterm ];
|
|
||||||
|
|
||||||
# Configure keymap in X11
|
|
||||||
services.xserver = {
|
|
||||||
# TODO: Is this smart?
|
|
||||||
dpi = 280;
|
|
||||||
layout = "us";
|
|
||||||
xkbVariant = "altgr-intl";
|
|
||||||
xkbOptions = "caps:swapescape";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable the GNOME Desktop Environment.
|
|
||||||
services.xserver.displayManager.gdm.enable = true;
|
|
||||||
services.xserver.desktopManager.gnome.enable = true;
|
|
||||||
services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
|
|
||||||
environment.gnome.excludePackages =
|
|
||||||
(with pkgs; [ gnome-photos gnome-tour gnome-connections ])
|
|
||||||
++ (with pkgs.gnome; [
|
|
||||||
atomix # puzzle game
|
|
||||||
epiphany # web browser
|
|
||||||
geary # email reader
|
|
||||||
gedit # text editor
|
|
||||||
gnome-calendar
|
|
||||||
gnome-clocks
|
|
||||||
gnome-contacts
|
|
||||||
gnome-maps
|
|
||||||
gnome-music
|
|
||||||
gnome-notes
|
|
||||||
gnome-terminal
|
|
||||||
gnome-weather
|
|
||||||
hitori # sudoku game
|
|
||||||
iagno # go game
|
|
||||||
simple-scan # document scanner
|
|
||||||
tali # poker game
|
|
||||||
totem # video player
|
|
||||||
]);
|
|
||||||
|
|
||||||
# Services required for gnome
|
|
||||||
programs.dconf.enable = true;
|
|
||||||
services.dbus.enable = true;
|
|
||||||
services.udisks2.enable = true;
|
|
||||||
|
|
||||||
# Extra gnome packages
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
gnome.gnome-tweaks
|
|
||||||
gnome.gnome-boxes
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
|
@ -5,6 +5,16 @@
|
||||||
|
|
||||||
services.hardware.bolt.enable = true;
|
services.hardware.bolt.enable = true;
|
||||||
|
|
||||||
|
# FS
|
||||||
|
fileSystems."/".options = [ "compress=zstd" ];
|
||||||
|
|
||||||
|
# Video Driver
|
||||||
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||||
|
services.xserver = {
|
||||||
|
dpi = 280;
|
||||||
|
xkbOptions = "caps:swapescape";
|
||||||
|
};
|
||||||
|
|
||||||
# Vulkan
|
# Vulkan
|
||||||
hardware.opengl.driSupport = true;
|
hardware.opengl.driSupport = true;
|
||||||
hardware.opengl.extraPackages = with pkgs; [
|
hardware.opengl.extraPackages = with pkgs; [
|
||||||
|
|
|
@ -4,6 +4,7 @@ let
|
||||||
inherit (pkgs.texlive) scheme-full;
|
inherit (pkgs.texlive) scheme-full;
|
||||||
dnd-5e-latex-template = { pkgs = [ pkgs.v.dnd-5e-latex-template ]; };
|
dnd-5e-latex-template = { pkgs = [ pkgs.v.dnd-5e-latex-template ]; };
|
||||||
};
|
};
|
||||||
|
my-python-packages = ps: with ps; [ pandas requests numpy ];
|
||||||
in {
|
in {
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
|
@ -11,11 +12,7 @@ in {
|
||||||
home.homeDirectory = "/home/victor";
|
home.homeDirectory = "/home/victor";
|
||||||
home.stateVersion = "23.05";
|
home.stateVersion = "23.05";
|
||||||
|
|
||||||
imports = [
|
imports = [ ./dconf.nix ./theme.nix ./neovim.nix ];
|
||||||
./dconf.nix
|
|
||||||
./theme.nix
|
|
||||||
./neovim.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
btop
|
btop
|
||||||
|
@ -32,7 +29,7 @@ in {
|
||||||
neofetch
|
neofetch
|
||||||
nixfmt
|
nixfmt
|
||||||
nixpkgs-review
|
nixpkgs-review
|
||||||
python3
|
(python3.withPackages my-python-packages)
|
||||||
plex-media-player
|
plex-media-player
|
||||||
rustup
|
rustup
|
||||||
solo2-cli
|
solo2-cli
|
||||||
|
|
|
@ -4,102 +4,18 @@
|
||||||
|
|
||||||
{ config, pkgs, inputs, ... }: {
|
{ config, pkgs, inputs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
|
../../../common/desktop
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./desktop-env.nix
|
|
||||||
./networking.nix
|
./networking.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Bootloader.
|
|
||||||
boot = {
|
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
loader = {
|
|
||||||
systemd-boot.enable = true;
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
efi.efiSysMountPoint = "/boot/efi";
|
|
||||||
};
|
|
||||||
kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
|
|
||||||
initrd = {
|
|
||||||
kernelModules = [ "amdgpu" ];
|
|
||||||
systemd.enable = true;
|
|
||||||
verbose = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/".options = [ "compress=zstd" ];
|
|
||||||
|
|
||||||
# Set your time zone.
|
|
||||||
time.timeZone = "Europe/Amsterdam";
|
|
||||||
|
|
||||||
# Select internationalisation properties.
|
|
||||||
i18n.defaultLocale = "en_GB.UTF-8";
|
|
||||||
i18n.extraLocaleSettings = {
|
|
||||||
LC_ADDRESS = "nl_NL.UTF-8";
|
|
||||||
LC_IDENTIFICATION = "nl_NL.UTF-8";
|
|
||||||
LC_MEASUREMENT = "nl_NL.UTF-8";
|
|
||||||
LC_MONETARY = "nl_NL.UTF-8";
|
|
||||||
LC_NAME = "nl_NL.UTF-8";
|
|
||||||
LC_NUMERIC = "nl_NL.UTF-8";
|
|
||||||
LC_PAPER = "nl_NL.UTF-8";
|
|
||||||
LC_TELEPHONE = "nl_NL.UTF-8";
|
|
||||||
LC_TIME = "nl_NL.UTF-8";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
|
||||||
services.printing.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ wireguard-tools ];
|
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
users.victor = import ./home;
|
users.victor = import ./home;
|
||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = { inherit inputs; };
|
||||||
};
|
};
|
||||||
|
|
||||||
# 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;
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualisation = {
|
|
||||||
podman.enable = true;
|
|
||||||
libvirtd = {
|
|
||||||
enable = true;
|
|
||||||
qemu.package = pkgs.qemu_kvm;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
fonts.fonts = with pkgs; [
|
|
||||||
material-design-icons
|
|
||||||
noto-fonts
|
|
||||||
noto-fonts-cjk
|
|
||||||
noto-fonts-emoji
|
|
||||||
dejavu_fonts
|
|
||||||
(nerdfonts.override {
|
|
||||||
fonts =
|
|
||||||
[ "DejaVuSansMono" "Ubuntu" "DroidSansMono" "NerdFontsSymbolsOnly" ];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.steam = {
|
|
||||||
enable = true;
|
|
||||||
# Open ports in the firewall for Steam Remote Play
|
|
||||||
remotePlay.openFirewall = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
{ pkgs, config, ... }: {
|
{ pkgs, config, ... }: {
|
||||||
hardware.enableAllFirmware = true;
|
hardware.enableAllFirmware = true;
|
||||||
|
|
||||||
hardware.bluetooth.enable = true;
|
|
||||||
|
|
||||||
services.hardware.bolt.enable = true;
|
services.hardware.bolt.enable = true;
|
||||||
|
|
||||||
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
hardware.opengl.enable = true;
|
hardware.opengl.enable = true;
|
||||||
hardware.nvidia.modesetting.enable = true;
|
hardware.nvidia.modesetting.enable = true;
|
||||||
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
|
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
|
|
||||||
services.udev.packages = with pkgs; [ wooting-udev-rules ];
|
services.udev.packages = with pkgs; [ wooting-udev-rules ];
|
||||||
|
|
||||||
|
|
||||||
|
# FS
|
||||||
|
fileSystems."/".options = [ "compress=zstd" ];
|
||||||
|
|
||||||
# SSD Trim
|
# SSD Trim
|
||||||
services.fstrim.enable = true;
|
services.fstrim.enable = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue