started refactoring desktop setup

This commit is contained in:
Vivian 2023-04-25 09:01:06 +02:00
parent 3dd06c0bfb
commit 1d42925a43
9 changed files with 112 additions and 243 deletions

View file

@ -0,0 +1 @@
# Common NixOS Config shared between desktop and laptop

View 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;
};
}

View file

@ -1,7 +1,6 @@
{ pkgs, ... }: {
# Enable the X11 windowing system.
{ pkgs, ...}: {
# TODO: Create Module
services.xserver.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.excludePackages = [ pkgs.xterm ];
# Configure keymap in X11

View file

@ -2,57 +2,21 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, inputs, ... }: {
{ pkgs, inputs, ... }: {
imports = [
../../../common/desktop
./hardware-configuration.nix
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-z
./hardware.nix
./networking.nix
./desktop-env.nix
];
# Bootloader.
boot = {
kernelPackages = pkgs.linuxPackages_latest;
# 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;
};
initrd.kernelModules = [ "amdgpu" ];
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 = {
useGlobalPkgs = true;
useUserPackages = true;
@ -60,48 +24,8 @@
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;
};
# Enable Ozone rendering for Chromium and Electron apps.
environment.sessionVariables.NIXOS_OZONE_WL = "1";
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
@ -110,17 +34,4 @@
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
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";
}

View file

@ -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
];
}

View file

@ -5,6 +5,16 @@
services.hardware.bolt.enable = true;
# FS
fileSystems."/".options = [ "compress=zstd" ];
# Video Driver
services.xserver.videoDrivers = [ "amdgpu" ];
services.xserver = {
dpi = 280;
xkbOptions = "caps:swapescape";
};
# Vulkan
hardware.opengl.driSupport = true;
hardware.opengl.extraPackages = with pkgs; [

View file

@ -4,6 +4,7 @@ let
inherit (pkgs.texlive) scheme-full;
dnd-5e-latex-template = { pkgs = [ pkgs.v.dnd-5e-latex-template ]; };
};
my-python-packages = ps: with ps; [ pandas requests numpy ];
in {
programs.home-manager.enable = true;
@ -11,11 +12,7 @@ in {
home.homeDirectory = "/home/victor";
home.stateVersion = "23.05";
imports = [
./dconf.nix
./theme.nix
./neovim.nix
];
imports = [ ./dconf.nix ./theme.nix ./neovim.nix ];
home.packages = with pkgs; [
btop
@ -32,7 +29,7 @@ in {
neofetch
nixfmt
nixpkgs-review
python3
(python3.withPackages my-python-packages)
plex-media-player
rustup
solo2-cli

View file

@ -4,102 +4,18 @@
{ config, pkgs, inputs, ... }: {
imports = [
../../../common/desktop
./hardware-configuration.nix
./hardware.nix
./desktop-env.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 = {
useGlobalPkgs = true;
useUserPackages = true;
users.victor = import ./home;
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
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave

View file

@ -1,16 +1,19 @@
{ pkgs, config, ... }: {
hardware.enableAllFirmware = true;
hardware.bluetooth.enable = true;
services.hardware.bolt.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.enable = true;
hardware.nvidia.modesetting.enable = true;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
services.udev.packages = with pkgs; [ wooting-udev-rules ];
# FS
fileSystems."/".options = [ "compress=zstd" ];
# SSD Trim
services.fstrim.enable = true;
}