mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-12 19:46:20 +00:00
refactor: make the whole thing more generic
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
{ config, pkgs, username, ... }: {
|
||||
imports = [ ./nvidia.nix ./hardware-configuration.nix ];
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
|
||||
nix = {
|
||||
settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
@@ -15,118 +12,47 @@
|
||||
|
||||
# Bootloader.
|
||||
boot = {
|
||||
quiet.enable = true;
|
||||
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
loader = {
|
||||
timeout = 0;
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
editor = false;
|
||||
configurationLimit = 10;
|
||||
consoleMode = "max";
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
supportedFilesystems = [ "ntfs" ];
|
||||
|
||||
# Silent Boot
|
||||
kernelParams = [
|
||||
# Redirect all kernel messages to a console off screen
|
||||
#"fbcon=vc:2-6"
|
||||
#"console=tty1"
|
||||
|
||||
"video=3840x2160@144"
|
||||
# "splash"
|
||||
# "quiet"
|
||||
|
||||
#"rd.udev.log_level=3"
|
||||
#"rd.systemd.show_status=false"
|
||||
#"udev.log_priority=3"
|
||||
#"boot.shell_on_fail"
|
||||
#"vt.global_cursor_default=0" # no cursor blinking
|
||||
];
|
||||
consoleLogLevel = 0;
|
||||
initrd.verbose = false;
|
||||
|
||||
# Virtual Camera/Mic
|
||||
kernelModules = [ "v4l2loopback" "snd-aloop" "sg" ];
|
||||
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback.out ];
|
||||
extraModprobeConfig = ''
|
||||
options v4l2loopback exclusive_caps=1 card_label="Virtual Camera"
|
||||
'';
|
||||
};
|
||||
|
||||
# Audio
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
desktops.hyprland.enable = true;
|
||||
locale.preset.theaninova.enable = true;
|
||||
|
||||
hardware = {
|
||||
nvidia.preset.proprietary.enable = true;
|
||||
audio.preset.pipewire.enable = true;
|
||||
cc1.enable = true;
|
||||
fv43u.enable = true;
|
||||
virtual-camera.enable = true;
|
||||
# https://github.com/NixOS/nixpkgs/pull/300682
|
||||
# hid-fanatecff.enable = true;
|
||||
};
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/pull/300682
|
||||
# hardware.hid-fanatecff.enable = true;
|
||||
hardware.gbmonctl.enable = true;
|
||||
|
||||
hardware.sane = {
|
||||
enable = true;
|
||||
extraBackends = [ pkgs.sane-airscan ];
|
||||
};
|
||||
services.printing.enable = true;
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
services.dbus.enable = true;
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-kde ];
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/Berlin";
|
||||
i18n = {
|
||||
inputMethod = {
|
||||
enabled = "ibus";
|
||||
ibus.engines = with pkgs.ibus-engines; [ anthy ];
|
||||
fonts = {
|
||||
fira-code = {
|
||||
enable = true;
|
||||
default = true;
|
||||
};
|
||||
defaultLocale = "en_GB.UTF-8";
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "de_DE.UTF-8";
|
||||
LC_IDENTIFICATION = "de_DE.UTF-8";
|
||||
LC_MEASUREMENT = "de_DE.UTF-8";
|
||||
LC_MONETARY = "de_DE.UTF-8";
|
||||
LC_NAME = "de_DE.UTF-8";
|
||||
LC_NUMERIC = "de_DE.UTF-8";
|
||||
LC_PAPER = "de_DE.UTF-8";
|
||||
LC_TELEPHONE = "de_DE.UTF-8";
|
||||
LC_TIME = "de_DE.UTF-8";
|
||||
noto-sans = {
|
||||
enable = true;
|
||||
default = true;
|
||||
};
|
||||
nerdfonts.enable = true;
|
||||
};
|
||||
|
||||
# Configure keymap in X11
|
||||
console.useXkbConfig = true;
|
||||
services.xserver.xkb = {
|
||||
layout = "cc1-thea";
|
||||
extraLayouts.cc1-thea = {
|
||||
description = "A CC1 optimized layout";
|
||||
languages = [ "eng" "ger" ];
|
||||
symbolsFile = ../../modules/cc1-thea;
|
||||
};
|
||||
};
|
||||
|
||||
services.pcscd.enable = true;
|
||||
|
||||
# nautilus on non-gnome
|
||||
services.gvfs.enable = true;
|
||||
# fix pinentry on non-gnome
|
||||
services.dbus.packages = with pkgs; [ gcr ];
|
||||
services.gnome.gnome-online-accounts.enable = true;
|
||||
services.gnome.evolution-data-server.enable = true;
|
||||
services.airprint.enable = true;
|
||||
|
||||
services.udev.packages = with pkgs; [ oversteer android-udev-rules ];
|
||||
|
||||
@@ -135,14 +61,7 @@
|
||||
setSocketVariable = true;
|
||||
};
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
services.getty.autologinUser = "${username}";
|
||||
services.getty.extraArgs = [ "--noclear" "--noissue" "--nonewline" ];
|
||||
services.getty.loginOptions = "-p -f -- \\u"; # preserve environment
|
||||
|
||||
programs.hyprland.enable = true;
|
||||
programs.fish.enable = true;
|
||||
programs.kdeconnect.enable = true;
|
||||
security.sudo.configFile = ''
|
||||
Defaults env_reset,pwfeedback,passprompt=" "
|
||||
'';
|
||||
@@ -154,7 +73,6 @@
|
||||
"wheel"
|
||||
"audio"
|
||||
"video"
|
||||
"dialout"
|
||||
"plugdev"
|
||||
"scanner"
|
||||
"lp"
|
||||
@@ -165,7 +83,6 @@
|
||||
};
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
environment.systemPackages = with pkgs; [
|
||||
gamemode
|
||||
# Essential utils
|
||||
@@ -194,26 +111,6 @@
|
||||
docker-compose
|
||||
];
|
||||
|
||||
fonts = {
|
||||
packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
noto-fonts-emoji
|
||||
fira-code
|
||||
(nerdfonts.override {
|
||||
fonts = [ "FiraCode" "JetBrainsMono" "Noto" "NerdFontsSymbolsOnly" ];
|
||||
})
|
||||
];
|
||||
fontconfig = {
|
||||
defaultFonts = {
|
||||
monospace = [ "FiraCode Nerd Font" ];
|
||||
sansSerif = [ "Noto Sans Nerd Font" ];
|
||||
};
|
||||
localConf = builtins.readFile ./fontconfig.xml;
|
||||
subpixel.rgba = "bgr";
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
firewall = {
|
||||
allowedTCPPorts = [ 8100 5037 5173 ];
|
||||
@@ -246,4 +143,6 @@
|
||||
device = "/dev/sda2";
|
||||
fsType = "ntfs";
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<match target="font">
|
||||
<test name="family" compare="contains">
|
||||
<string>Fira</string>
|
||||
</test>
|
||||
<!-- https://github.com/tonsky/FiraCode/wiki/How-to-enable-stylistic-sets -->
|
||||
<edit name="fontfeatures" mode="append">
|
||||
<string>zero</string>
|
||||
<string>onum</string>
|
||||
<string>ss04</string>
|
||||
<string>cv19</string>
|
||||
<string>cv23</string>
|
||||
<string>ss09</string>
|
||||
<string>ss06</string>
|
||||
<string>ss07</string>
|
||||
<string>ss10</string>
|
||||
</edit>
|
||||
</match>
|
||||
1
hosts/MONSTER/home.nix
Normal file
1
hosts/MONSTER/home.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ ... }: { }
|
||||
@@ -1,38 +0,0 @@
|
||||
{ config, lib, pkgs, ... }: {
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
extraPackages = with pkgs; [ libvdpau-va-gl nvidia-vaapi-driver ];
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
boot.kernelParams = [ "nvidia_drm.fbdev=1" ];
|
||||
boot.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
|
||||
boot.initrd.kernelModules =
|
||||
[ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
# seems to cause crashes on sleep
|
||||
powerManagement.enable = false;
|
||||
open = true;
|
||||
nvidiaSettings = false;
|
||||
# no idea if this actually does anything...
|
||||
nvidiaPersistenced = false;
|
||||
};
|
||||
|
||||
environment = {
|
||||
variables = {
|
||||
VDPAU_DRIVER = "va_gl";
|
||||
LIBVA_DRIVER_NAME = "nvidia";
|
||||
};
|
||||
systemPackages = with pkgs; [
|
||||
glxinfo
|
||||
nvtopPackages.nvidia
|
||||
libva-utils
|
||||
vulkan-tools
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user