new nixos dotfile layout

Signed-off-by: Michał Czyż <mike@c2yz.com>
This commit is contained in:
2024-11-04 13:21:48 +01:00
parent cbfbe20592
commit 720c05f9b0
119 changed files with 3895 additions and 4549 deletions

View File

@@ -1,89 +0,0 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [
./locale.nix
./packages.nix
./services.nix
./users.nix
./docker.nix
./x.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# I'm sorry Richard Stallman
allowUnfree = true;
};
};
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nix.nixPath = ["/etc/nix/path"];
environment.etc =
lib.mapAttrs'
(name: value: {
name = "nix/path/${name}";
value.source = value.flake;
})
config.nix.registry;
nix.settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
# Use cache servers for packages
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Enables wireless support via wpa_supplicant
# networking.wireless.enable = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone
time.timeZone = "Europe/Warsaw";
}

View File

@@ -1,5 +0,0 @@
{
virtualisation.docker = {
enable = true;
};
}

View File

@@ -1,23 +0,0 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# Select internationalisation properties
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "pl_PL.UTF-8";
LC_IDENTIFICATION = "pl_PL.UTF-8";
LC_MEASUREMENT = "pl_PL.UTF-8";
LC_MONETARY = "pl_PL.UTF-8";
LC_NAME = "pl_PL.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "pl_PL.UTF-8";
LC_TELEPHONE = "pl_PL.UTF-8";
LC_TIME = "en_US.UTF-8";
};
}

View File

@@ -1,56 +0,0 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# Auto-upgrade in the background
system.autoUpgrade = {
enable = true;
flake = inputs.self.outPath;
flags = [
"--update-input"
"nixpkgs"
"-L"
];
dates = "12:00";
randomizedDelaySec = "45min";
};
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
ntfs3g
dosfstools
unstable.nh
nix-output-monitor
nvd
];
fonts.packages = with pkgs; [
nerdfonts
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
font-awesome
source-han-sans
source-han-sans-japanese
source-han-serif-japanese
];
environment.sessionVariables = {
FLAKE = "/home/mike/.dots";
};
programs.nix-ld = {
enable = true;
libraries = with pkgs; [
# Add any missing dynamic libraries for unpackaged
# programs here, NOT in environment.systemPackages
];
};
programs.dconf.enable = true;
}

View File

@@ -1,87 +0,0 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# I use zsh btw
environment.shells = with pkgs; [bash zsh];
users.defaultUserShell = pkgs.zsh;
programs.zsh.enable = true;
# Configure console keymap
console.keyMap = "pl2";
services.gnome.gnome-keyring.enable = true;
# Enable CUPS to print documents.
services.printing.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;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.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;
pinentryFlavor = "curses";
settings = {
max-cache-ttl = 60480000;
default-cache-ttl = 60480000;
# default-cache-ttl-ssh = 60480000;
# max-cache-ttl-ssl = 60480000;
};
};
# This setups a SSH server. Very important if you're setting up a headless system.
# Feel free to remove if you don't need it.
services.openssh = {
enable = true;
settings = {
# Forbid root login through SSH.
PermitRootLogin = "no";
# Use keys only. Remove if you want to SSH using password (not recommended)
PasswordAuthentication = true;
X11Forwarding = true;
};
};
# security.pam.services.kwallet = {
# name = "kwallet";
# enableKwallet = true;
# };
programs.ssh = {
# startAgent = true;
# forwardX11 = true;
# enableAskPassword = true;
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
}

View File

@@ -1,20 +0,0 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# Define a user account. Don't forget to set a password with passwd.
users.users = {
mike = {
isNormalUser = true;
description = "Mike";
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDfqPj+a2gmoUl3TuGSZxf0zRBabVWvXRrjLF7sFlqjMbfkx428F3L7C8OC3Z9XDT4ysbpgWcPuVKNtK5kkKGjSLHAgB2CgvD15K11Q+ag1+uyePaiOypZYJewvv1hhqU5IrVcxUbTsbREH/IsdQSlNSuyNFIr3oFnrff5iKEKEwEvSDeiqpqRh56pAkF6Kb15aYqZO7X9rbfoa8Sgj3VJXN0181lXMjXkNsYVa3gDmKv89C6qutg+KOpHlXgn4AfIRcCw8ik6OGBEfi/gUeb3SYpD+7undNLyloxCbGwHQ40IdoqPatyhTNS4jm9kb+Tno4hj0pbLHZSUdXgGaSfGx1W0MVVY0mm0Hu7EmYDBHUTfmPmPxnolWh8UH+XdkNPnwZfyZlyBcVVkVzog1ZCs1i9Y6oS1ZIbzuz+WxBPPDIHMRdmxv6+PMc5kZyrpuX1PgFb7Xt5cRNAL5/wywoi9Z45SS7qP9zNSb443UaaXzUatqnlawZ0GS0qXJh3ljwJ8= mike@odin"
];
extraGroups = ["networkmanager" "wheel" "docker" "libvirtd"];
};
};
}

View File

@@ -1,29 +0,0 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
services.udisks2.enable = true;
security.polkit.enable = true;
services.upower.enable = config.powerManagement.enable;
services.gvfs.enable = true;
services.autorandr = {
enable = true;
};
environment.systemPackages = with pkgs; [
autorandr
xorg.xrandr
xorg.libX11
xorg.libX11.dev
xorg.libXft
xorg.libXinerama
xorg.xbacklight
pulseaudioFull
brightnessctl
];
}

56
hosts/default.nix Normal file
View File

@@ -0,0 +1,56 @@
{ hostname, ... }:
{
imports =
if hostname == "zion" then [
./zion.nix
./modules/nh.nix
./modules/boot.nix
./modules/users.nix
./modules/greetd.nix
./modules/fstrim.nix
./modules/nvidia.nix
./modules/network.nix
./modules/security.nix
./modules/pipewire.nix
./modules/gsettings.nix
./modules/bluetooth.nix
./modules/packages.nix
# ./modules/lanzaboot.nix
./modules/configuration.nix
]
else if hostname == "thor" then [
./thor.nix
./modules/nh.nix
./modules/tlp.nix
./modules/boot.nix
./modules/users.nix
./modules/greetd.nix
./modules/fstrim.nix
./modules/network.nix
./modules/security.nix
./modules/pipewire.nix
./modules/gsettings.nix
./modules/bluetooth.nix
./modules/lanzaboot.nix
./modules/configuration.nix
]
else if hostname == "server" then [
./server.nix
./modules/nh.nix
./modules/tlp.nix
./modules/ssh.nix
./modules/boot.nix
./modules/users.nix
./modules/nvidia.nix
./modules/ollama.nix
./modules/fstrim.nix
./modules/system.nix
./modules/network.nix
./modules/configuration.nix
#./modules/lanzaboot.nix
]
else [ ];
}

8
hosts/modules/adb.nix Normal file
View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
programs.adb.enable = true;
environment.systemPackages = [
pkgs.android-tools
pkgs.universal-android-debloater
];
}

View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
services.ananicy = {
enable = true;
package = pkgs.ananicy-cpp;
rulesProvider = pkgs.ananicy-rules-cachyos;
};
}

View File

@@ -0,0 +1,8 @@
{
services.blueman.enable = false;
hardware.bluetooth = {
enable = true;
powerOnBoot = false;
};
}

24
hosts/modules/boot.nix Normal file
View File

@@ -0,0 +1,24 @@
{ pkgs, hostname, inputs, ... }:
{
imports = if hostname == "zion" then [ inputs.chaotic.nixosModules.default ] else [ ];
boot = {
tmp.cleanOnBoot = true;
loader = {
timeout = 1;
efi.canTouchEfiVariables = true;
systemd-boot = {
enable = true;
configurationLimit = 10;
};
};
kernelPackages =
if hostname == "zion" then pkgs.linuxPackages #linuxPackages_zen #linuxPackages #linuxPackages_latest #linuxPackages_xanmod_latest
else if hostname == "thor" then pkgs.linuxPackages
else if hostname == "server" then pkgs.linuxPackages
else pkgs.linuxPackages_zen;
};
}

View File

@@ -0,0 +1,66 @@
{ hostname, inputs, ... }:
{
time.timeZone = "Europe/Warsaw";
i18n.defaultLocale = "en_US.UTF-8";
hardware.graphics = {
enable = true;
enable32Bit = true;
};
services = {
logind = {
lidSwitch = "ignore";
lidSwitchExternalPower = if hostname == "server" then "ignore" else "suspend-then-hibernate";
};
};
system = {
stateVersion = "24.05";
switch = {
enable = false;
enableNg = true;
};
};
nixpkgs = { config = { allowUnfree = true; }; };
documentation = {
enable = false;
doc.enable = false;
man.enable = false;
dev.enable = false;
info.enable = false;
nixos.enable = false;
};
nix = {
daemonCPUSchedPolicy = "batch";
channel.enable = false;
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
optimise = {
automatic = true;
dates = [ "daily" ];
};
settings = {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
substituters = [
"https://cache.nixos.org"
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
"https://cuda-maintainers.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
};
};
}

6
hosts/modules/fstrim.nix Normal file
View File

@@ -0,0 +1,6 @@
{
services.fstrim = {
enable = true;
interval = "daily";
};
}

28
hosts/modules/gaming.nix Executable file
View File

@@ -0,0 +1,28 @@
{ pkgs, username, ... }:
{
users.users.${username}.packages = with pkgs; [ heroic ];
hardware.steam-hardware.enable = true;
programs = {
steam = {
enable = true;
gamescopeSession.enable = true;
extraCompatPackages = with pkgs; [ proton-ge-bin ];
};
gamemode = {
enable = false;
enableRenice = false;
settings = { };
};
gamescope = {
enable = false;
args = [
"-w 1920 -h 1080"
"-F nis"
"f"
];
};
};
}

32
hosts/modules/greetd.nix Normal file
View File

@@ -0,0 +1,32 @@
{ pkgs, ... }:
{
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --asterisks --container-padding 2 --time --time-format '%I:%M %p | %a %h | %F' --cmd Hyprland";
user = "greeter";
};
};
};
# this is a life saver.
# literally no documentation about this anywhere.
# might be good to write about this...
# https://www.reddit.com/r/NixOS/comments/u0cdpi/tuigreet_with_xmonad_how/
systemd = {
# To prevent getting stuck at shutdown
extraConfig = "DefaultTimeoutStopSec=10s";
services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal"; # Without this errors will spam on screen
# Without these bootlogs will spam on screen
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
};
};
}

View File

@@ -0,0 +1,4 @@
{
programs.dconf.enable = true;
services.gvfs.enable = true;
}

6
hosts/modules/kde.nix Normal file
View File

@@ -0,0 +1,6 @@
{
services.desktopManager = {
plasma6.enable = true;
enableQt5Integration = false;
};
}

View File

@@ -0,0 +1,14 @@
{ lib, pkgs, inputs, ... }:
{
imports = [ inputs.lanzaboote.nixosModules.lanzaboote ];
environment.systemPackages = [ pkgs.sbctl ];
boot = {
loader.systemd-boot.enable = lib.mkForce false;
lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
};
}

20
hosts/modules/network.nix Normal file
View File

@@ -0,0 +1,20 @@
{ hostname, ... }:
{
boot.initrd.systemd.network.wait-online.enable = false;
systemd.services.NetworkManager-wait-online.enable = false;
networking = {
hostName = "${hostname}";
firewall.enable = true;
wireless = {
enable = false;
iwd.enable = false;
};
networkmanager = {
enable = true;
wifi.backend = "wpa_supplicant";
};
};
}

12
hosts/modules/nh.nix Normal file
View File

@@ -0,0 +1,12 @@
{ username, ... }:
{
programs.nh = {
enable = true;
flake = "/home/${username}/.files";
clean = {
enable = true;
dates = "weekly";
extraArgs = "--keep-since 3d --keep 3";
};
};
}

56
hosts/modules/nvidia.nix Executable file
View File

@@ -0,0 +1,56 @@
{ config, ... }:
{
nixpkgs.config.nvidia.acceptLicense = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
graphics = {
enable = true;
enable32Bit = true;
};
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.beta;
open = false;
nvidiaSettings = true;
modesetting.enable = true;
# dynamicBoost.enable = true;
powerManagement = {
enable = false;
finegrained = false;
};
# prime = {
# amdgpuBusId = "PCI:05:00:0";
# nvidiaBusId = "PCI:01:00:0";
# #sync.enable = true;
# offload = {
# enable = true;
# enableOffloadCmd = true;
# };
# };
};
};
# specialisation = {
# Battery.configuration = {
# system.nixos.tags = [ "Battery" ];
# boot.extraModprobeConfig = ''blacklist nouveau options nouveau modeset=0'';
# boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ];
# services.udev.extraRules = ''
# # Remove NVIDIA USB xHCI Host Controller devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA USB Type-C UCSI devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA Audio devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA VGA/3D controller devices
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
# '';
# };
# };
}

14
hosts/modules/ollama.nix Normal file
View File

@@ -0,0 +1,14 @@
{
nixpkgs.config.cudaSupport = true;
services.ollama = {
enable = true;
acceleration = "cuda";
};
services.open-webui = {
enable = false;
host = "0.0.0.0";
openFirewall = true;
};
}

View File

@@ -0,0 +1,30 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
vim
ntfs3g
dosfstools
nix-output-monitor
nvd
];
fonts.packages = with pkgs; [
nerdfonts
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
font-awesome
source-han-sans
source-han-sans-japanese
source-han-serif-japanese
];
# 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;
};
}

View File

@@ -0,0 +1,23 @@
{
services.pipewire = {
enable = true;
jack.enable = true;
pulse.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
wireplumber.extraConfig = {
"10-disable-camera" = {
"wireplumber.profiles" = {
main = {
"monitor.libcamera" = "disabled";
};
};
};
};
};
}

28
hosts/modules/qtile.nix Executable file
View File

@@ -0,0 +1,28 @@
# Enable Qtile
{ pkgs, ... }:
{
# --------------------------------------
# Enable QTILE
# --------------------------------------
services.xserver.windowManager.qtile = {
enable = true;
configFile = /home/nel/dotfiles/qtile/config.py;
extraPackages = python3Packages: with python3Packages; [ qtile-extras ];
};
# --------------------------------------
# Necessary things
# --------------------------------------
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
};
xdg.portal = {
enable = true;
config.common.default = "*";
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
};
}

View File

@@ -0,0 +1,7 @@
{
security = {
sudo.enable = true;
rtkit.enable = true;
polkit.enable = true;
};
}

13
hosts/modules/ssh.nix Normal file
View File

@@ -0,0 +1,13 @@
{
networking.firewall.allowedTCPPorts = [ 22 ];
services.openssh = {
enable = true;
ports = [ 22 ];
settings = {
PasswordAuthentication = true;
UseDns = true;
};
};
}

10
hosts/modules/thunar.nix Normal file
View File

@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
}

50
hosts/modules/tlp.nix Normal file
View File

@@ -0,0 +1,50 @@
{ config, hostname, ... }:
{
boot = {
kernelModules = [ "acpi_call" ];
extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
};
services.tlp = {
enable = true;
settings = {
TLP_DEFAULT_MODE =
if hostname == "laptop"
then "BAT"
else "AC";
TLP_PERSISTENT_DEFAULT =
if hostname == "laptop"
then 0
else 1;
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
CPU_HWP_DYN_BOOST_ON_AC = 1;
CPU_HWP_DYN_BOOST_ON_BAT = 0;
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power";
RADEON_DPM_PERF_LEVEL_ON_AC = "auto";
RADEON_DPM_PERF_LEVEL_ON_BAT = "low";
RADEON_DPM_STATE_ON_AC = "performance";
RADEON_DPM_STATE_ON_BAT = "battery";
RADEON_POWER_PROFILE_ON_AC = "default";
RADEON_POWER_PROFILE_ON_BAT = "low";
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
START_CHARGE_THRESH_BAT0 = 40;
STOP_CHARGE_THRESH_BAT0 = 60;
WOL_DISABLE = "Y";
USB_AUTOSUSPEND = 1;
};
};
}

26
hosts/modules/users.nix Normal file
View File

@@ -0,0 +1,26 @@
{ inputs, username, hostname, ... }:
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
users.users.${username} = {
isNormalUser = true;
description = "${username}";
extraGroups = [ "networkmanager" "wheel" ];
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs username hostname; };
users.${username} = {
imports = [ ../../home/home.nix ];
programs.home-manager.enable = true;
home = {
stateVersion = "24.05";
username = "${username}";
homeDirectory = "/home/${username}";
};
};
};
}

31
hosts/modules/vm.nix Normal file
View File

@@ -0,0 +1,31 @@
{ pkgs, username, ... }:
{
users.users.${username}.extraGroups = [ "libvirtd" ];
boot.kernel.sysctl = { "vm.max_map_count" = 2147483642; };
# Install necessary packages
environment.systemPackages = with pkgs; [
virt-manager
virt-viewer
spice
spice-gtk
spice-protocol
win-virtio
win-spice
adwaita-icon-theme
];
services.spice-vdagentd.enable = true;
virtualisation = {
spiceUSBRedirection.enable = true;
libvirtd = {
enable = true;
qemu = {
swtpm.enable = true;
ovmf.enable = true;
ovmf.packages = [ pkgs.OVMFFull.fd ];
};
};
};
}

View File

@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
services.xserver = {
enable = true;
xkb.layout = "fr";
xkb.variant = "";
excludePackages = [ pkgs.xterm ];
};
}

View File

@@ -1,22 +0,0 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Experimental = true;
};
};
};
services.blueman.enable = true;
environment.systemPackages = with pkgs; [bluez];
}

View File

@@ -1,42 +0,0 @@
# 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).
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# You can import other NixOS modules here
imports = [
# If you want to use modules your own flake exports (from modules/nixos):
# outputs.nixosModules.example
# Or modules from other flakes (such as nixos-hardware):
# inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-ssd
# You can also split up your configuration and import pieces of it here:
# ./users.nix
../common
./gui.nix
./bluetooth.nix
./networking.nix
# Import your generated (nixos-generate-config) hardware configuration
./hardware-configuration.nix
];
# Hostname
networking.hostName = "thor";
# 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
# this value at the release version of the first install of this system.
# 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.11"; # Did you read the comment?
}

View File

@@ -1,42 +0,0 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# X Server settings
services.xserver = {
enable = true;
layout = "pl";
xkbVariant = "";
libinput.enable = true;
displayManager = {
lightdm = {
enable = false;
};
startx = {
enable = true;
};
};
windowManager = {
dwm = {
enable = true;
package = pkgs.dwm-customized;
};
};
desktopManager = {
xfce = {
enable = false;
};
};
};
services.autorandr = {
enable = true;
};
}

View File

@@ -1,49 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot.kernelParams = ["resume=/var/swapfile" "resume_offset=16230400"];
boot.resumeDevice = "/dev/disk/by-uuid/9bf8fe18-8b72-4e43-a472-546260574b1e";
fileSystems."/" = {
device = "/dev/disk/by-uuid/9bf8fe18-8b72-4e43-a472-546260574b1e";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/09BA-3F6F";
fsType = "vfat";
};
swapDevices = [
{
device = "/var/swapfile";
size = 32 * 1024;
}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -1,32 +0,0 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
networking.networkmanager.wifi.backend = "iwd";
networking.wireless.iwd = {
enable = true;
settings = {
General = {
EnableNetworkConfiguration = true;
UseDefaultInterface = true;
};
Settings = {
AutoConnect = true;
};
};
};
# system.activationScripts = {
# rfkillUnblockWlan = {
# text = ''
# rfkill unblock wlan
# '';
# deps = [];
# };
# };
}

View File

@@ -1,35 +1,32 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/8af14034-1aec-4b6f-b8c4-de13e6987ac5";
fsType = "ext4";
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/9b9ed0c3-1236-499b-b9c3-51e6c4d02483";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/CEC7-B082";
fsType = "vfat";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/17B9-AFFF";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [
{device = "/dev/disk/by-uuid/00a782e1-71c2-4121-8608-9ed1104d6aa5";}
];
swapDevices =
[ { device = "/dev/disk/by-uuid/d6820248-2865-4b52-9893-174309c9e684"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -1,43 +0,0 @@
# 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).
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# You can import other NixOS modules here
imports = [
# If you want to use modules your own flake exports (from modules/nixos):
# outputs.nixosModules.example
# Or modules from other flakes (such as nixos-hardware):
# inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-ssd
# You can also split up your configuration and import pieces of it here:
# ./users.nix
../common
./gui.nix
# nvidia drivers
./nvidia.nix
# Import your generated (nixos-generate-config) hardware configuration
./hardware-configuration.nix
];
# Hostname
networking.hostName = "zion";
# 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
# this value at the release version of the first install of this system.
# 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.11"; # Did you read the comment?
}

View File

@@ -1,95 +0,0 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# X Server settings
services.xserver = {
enable = true;
layout = "pl";
xkbVariant = "";
dpi = 100;
displayManager = {
lightdm = {
enable = false;
};
startx = {
enable = true;
};
setupCommands = ''
LEFT='HDMI-0'
CENTER='DP-2'
RIGHT='DP-0'
${pkgs.xorg.xrandr}/bin/xrandr \
--output $LEFT --mode 1920x1080 --rate 60.00 --pos 0x360 \
--output $CENTER --primary --mode 2560x1440 --rate 74.92 --pos 1920x0 \
--output $RIGHT --mode 2560x1440 --rate 74.92 --pos 4480x0
'';
};
windowManager = {
dwm = {
enable = true;
package = pkgs.dwm-customized;
};
};
desktopManager = {
xfce = {
enable = false;
};
};
xrandrHeads = [
{
output = "HDMI-0";
}
{
output = "DP-2";
primary = true;
}
{
output = "DP-0";
}
];
};
services.autorandr = {
enable = true;
defaultTarget = "zion";
profiles = {
"zion" = {
fingerprint = {
HDMI-0 = "00ffffffffffff004c2db30a000000003416010380301b780a2621a65555a0280d5054bdef80714f81c0810081809500a9c0b3000101023a801871382d40582c4500dd0c1100001e662156aa51001e30468f3300dd0c1100001e000000fd00184b0f5117000a202020202020000000fc00543232433330300a202020202001dc020325f14d901f04130514031220212207162309070783010000e2000f67030c001000b82d011d007251d01e206e285500dd0c1100001e011d00bc52d01e20b8285540dd0c1100001e011d8018711c1620582c2500dd0c1100009e011d80d0721c1620102c2580dd0c1100009e000000000000000000000000000000000000ec";
DP-2 = "00ffffffffffff000472c90672bb9004311e0104b53c22783f0c95ab554ca0240d5054bfef80714f8140818081c081009500b300d1c0565e00a0a0a029503020350055502100001a000000fd00304b70701e010a202020202020000000fc005647323730550a202020202020000000ff005445484545303034383532430a0146020318f14b010203040590111213141f23090707830100009774006ea0a034501720680855502100001a2a4480a0703827403020350055502100001a023a801871382d40582c450055502100001e011d8018711c1620582c250055502100009e011d007251d01e206e28550055502100001e0000000000000000000000000040";
DP-0 = "00ffffffffffff000472c9064bbc9004311e0104b53c22783f0c95ab554ca0240d5054bfef80714f8140818081c081009500b300d1c0565e00a0a0a029503020350055502100001a000000fd00304b70701e010a202020202020000000fc005647323730550a202020202020000000ff005445484545303034383532430a016c020318f14b010203040590111213141f23090707830100009774006ea0a034501720680855502100001a2a4480a0703827403020350055502100001a023a801871382d40582c450055502100001e011d8018711c1620582c250055502100009e011d007251d01e206e28550055502100001e0000000000000000000000000040";
};
config = {
HDMI-0 = {
enable = true;
position = "0x360";
mode = "1920x1080";
rate = "60.00";
};
DP-2 = {
enable = true;
primary = true;
position = "1920x0";
mode = "2560x1440";
rate = "74.92";
};
DP-0 = {
enable = true;
position = "4480x0";
mode = "2560x1440";
rate = "74.92";
};
};
};
};
};
}

View File

@@ -1,49 +0,0 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# Enable OpenGL
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
}