massive rearchitecture

This commit is contained in:
2025-01-10 16:11:36 +00:00
parent 95257c8816
commit 618bb4a596
15 changed files with 207 additions and 145 deletions

View File

@@ -5,34 +5,20 @@
{ config, lib, pkgs, inputs, ... }:
{
imports =
[
./nix-settings.nix
./fonts.nix
./kde.nix
./virtualisation.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_zen;
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.auto-optimise-store = true;
nix.gc.automatic = true;
nix.gc.options = "--delete-older-than 30d";
services.fstrim.enable = true;
hardware.graphics.enable32Bit = true; # For 32 bit applications
hardware.bluetooth.enable = true;
hardware.steam-hardware.enable = true;
# Enable common container config files in /etc/containers
virtualisation.containers.enable = true;
virtualisation = {
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
};
};
# networking.hostName = "nixos"; # Define your hostname.
# Pick only one of the below networking options.
@@ -43,12 +29,6 @@
wifi.powersave = false;
};
# services.resolved.enable = true;
services.mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
# Set your time zone.
time.timeZone = "Europe/London";
@@ -56,45 +36,6 @@
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
fonts.enableDefaultPackages = true;
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
];
# Select internationalisation properties.
i18n = {
defaultLocale = "en_GB.UTF-8";
supportedLocales = [
"en_GB.UTF-8/UTF-8"
"en_US.UTF-8/UTF-8"
"ja_JP.UTF-8/UTF-8"
];
inputMethod = {
enable = true;
type = "fcitx5";
fcitx5 = {
waylandFrontend = true;
addons = with pkgs; [ fcitx5-mozc ];
};
};
};
console = {
# font = "Lat2-Terminus16";
keyMap = "uk";
# useXkbConfig = true; # use xkb.options in tty.
};
# Enable the X11 windowing system.
# services.xserver.enable = true;
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
@@ -106,68 +47,38 @@
pulse.enable = true;
};
services.power-profiles-daemon.enable = false;
services.tlp = {
services.fstrim.enable = true;
# services.resolved.enable = true;
services.mullvad-vpn = {
enable = true;
settings = {
RESTORE_DEVICE_STATE_ON_STARTUP = 1;
USB_AUTOSUSPEND = 0;
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
};
package = pkgs.mullvad-vpn;
};
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
services.xserver.enable = true; # optional
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
services.fwupd.enable = true;
services.geoclue2.enable = true;
services.flatpak.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
#gamescopeSession.enable = true;
};
programs.gamemode.enable = true;
programs.cdemu.enable = true;
programs.nix-ld.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs;
[
nixpkgs-fmt
gcc
vim
curl
wget
inetutils
rar
nuspell
hunspellDicts.en-gb-ise
gcc
libva-utils
kdePackages.sddm-kcm
smartmontools
kdePackages.plasma-disks
kdePackages.partitionmanager
kdePackages.filelight
kdePackages.ffmpegthumbs
kdePackages.kcalc
rar
nixpkgs-fmt
distrobox
];
# Some programs need SUID wrappers, can be configured further or are

35
configuration/fonts.nix Normal file
View File

@@ -0,0 +1,35 @@
{ config, lib, pkgs, inputs, ... }:
{
fonts.enableDefaultPackages = true;
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
];
# Select internationalisation properties.
i18n = {
defaultLocale = "en_GB.UTF-8";
supportedLocales = [
"en_GB.UTF-8/UTF-8"
"en_US.UTF-8/UTF-8"
"ja_JP.UTF-8/UTF-8"
];
inputMethod = {
enable = true;
type = "fcitx5";
fcitx5 = {
waylandFrontend = true;
addons = with pkgs; [ fcitx5-mozc ];
};
};
};
console = {
# font = "Lat2-Terminus16";
keyMap = "uk";
# useXkbConfig = true; # use xkb.options in tty.
};
}

23
configuration/kde.nix Normal file
View File

@@ -0,0 +1,23 @@
{ config, lib, pkgs, inputs, ... }:
{
services.xserver.enable = true; # optional
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
environment.systemPackages = with pkgs;
[ ] ++ (with kdePackages; [
sddm-kcm
plasma-disks
partitionmanager
filelight
ffmpegthumbs
kcalc
]);
}

View File

@@ -0,0 +1,10 @@
{ config, lib, pkgs, inputs, ... }:
{
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.auto-optimise-store = true;
nix.gc.automatic = true;
nix.gc.options = "--delete-older-than 30d";
}

View File

@@ -0,0 +1,22 @@
{ config, lib, pkgs, inputs, ... }:
{
virtualisation = {
containers = {
# Enable common container config files in /etc/containers
enable = true;
};
libvirtd = {
enable = true;
};
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
};
};
programs.virt-manager.enable = true;
}

View File

@@ -17,7 +17,7 @@
nixosConfigurations.tuxedo = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
./configuration/base.nix
./tuxedo/configuration.nix
];
};

View File

@@ -0,0 +1,15 @@
{ inputs, config, pkgs, ... }:
{
home.packages = with pkgs;[
git-credential-manager
(with dotnetCorePackages; combinePackages [
sdk_8_0
sdk_9_0
])
jetbrains.rider
azure-cli
azuredatastudio
rustup
];
}

19
home-manager/fonts.nix Normal file
View File

@@ -0,0 +1,19 @@
{ inputs, config, pkgs, ... }:
{
home.packages = with pkgs;[
liberation_ttf
ubuntu-sans
ubuntu-sans-mono
(nerdfonts.override { fonts = [ "SpaceMono" ]; })
];
fonts.fontconfig = {
enable = true;
defaultFonts = {
monospace = [ "Ubuntu Sans Mono" ];
sansSerif = [ "Ubuntu Sans" ];
serif = [ "Liberation Serif" ];
};
};
}

11
home-manager/gaming.nix Normal file
View File

@@ -0,0 +1,11 @@
{ inputs, config, pkgs, ... }:
{
home.packages = with pkgs;[
steamguard-cli
bottles
protontricks
gamescope
inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}".ryujinx-greemdev
];
}

17
modules/gaming.nix Normal file
View File

@@ -0,0 +1,17 @@
{ config, lib, pkgs, inputs, ... }:
{
hardware.graphics.enable32Bit = true; # For 32 bit applications
hardware.steam-hardware.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
#gamescopeSession.enable = true;
};
programs.gamemode.enable = true;
# ensure users who need access to this have `cdrom` as `extraGroups`
programs.cdemu.enable = true;
}

21
modules/laptop.nix Normal file
View File

@@ -0,0 +1,21 @@
{ config, lib, pkgs, inputs, ... }:
{
services.power-profiles-daemon.enable = false;
services.tlp = {
enable = true;
settings = {
RESTORE_DEVICE_STATE_ON_STARTUP = 1;
USB_AUTOSUSPEND = 0;
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
};
};
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
}

View File

@@ -12,6 +12,8 @@
inputs.disko.nixosModules.default
./disk-config.nix
inputs.home-manager.nixosModules.default
../modules/laptop.nix
../modules/gaming.nix
];
fileSystems."/mnt/HDD1" = {
@@ -29,8 +31,8 @@
hardware.tuxedo-drivers.enable = true;
programs.gpu-screen-recorder.enable = true;
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
# ......omit many configurations
# Define a user account. Don't forget to set a password with passwd.
users.users.worble = {

View File

@@ -2,9 +2,12 @@
{
imports = [
../../home-manager/fonts.nix
../../home-manager/terminal.nix
../../home-manager/firefox/firefox.nix
../../home-manager/vscode.nix
../../home-manager/development/tools.nix
../../home-manager/development/vscode.nix
../../home-manager/gaming.nix
];
terminal.nixUpdateLocation = "/home/worble/Projects/nixos#tuxedo";
@@ -43,55 +46,28 @@
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
thunderbird
nextcloud-client
ubuntu-sans
ubuntu-sans-mono
(nerdfonts.override { fonts = [ "SpaceMono" ]; })
keepassxc
bottles
rustup
strawberry-qt6
rclone
qbittorrent
teamspeak_client
thunderbird
git-credential-manager
(with dotnetCorePackages; combinePackages [
sdk_8_0
sdk_9_0
])
gimp-with-plugins
ffmpeg-full
protonup-qt
protontricks
gamescope
yt-dlp
joplin-desktop
obsidian
teamspeak_client
webcord
libreoffice-qt
azure-cli
jetbrains.rider
steamguard-cli
jellyfin-media-player
haruna
azuredatastudio
inotify-tools
libnotify
electrum
gpu-screen-recorder-gtk
inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}".ryujinx-greemdev
];
fonts.fontconfig = {
enable = true;
defaultFonts = {
monospace = [ "Ubuntu Sans Mono" ];
sansSerif = [ "Ubuntu Sans" ];
serif = [ "Liberation Serif" ];
};
};
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
@@ -127,9 +103,9 @@
NIXOS_OZONE_WL = "1";
};
home.sessionPath = [
"$HOME/.local/bin"
];
# home.sessionPath = [
# "$HOME/.local/bin"
# ];
# Let Home Manager install and manage itself.
programs = {

View File

@@ -1,2 +1,2 @@
#!/bin/sh
#!/usr/bin/env bash
sudo nixos-rebuild switch --flake '/home/worble/Projects/nixos#tuxedo'