refactor into modules
This commit is contained in:
7
nixos/modules/boot/bootloader.nix
Normal file
7
nixos/modules/boot/bootloader.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.resumeDevice = "/dev/mapper/luksroot";
|
||||
}
|
||||
26
nixos/modules/boot/kernel.nix
Normal file
26
nixos/modules/boot/kernel.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
boot.extraModprobeConfig = ''
|
||||
options mt7921_common disable_clc=1
|
||||
options atkbd reset=1 softrepeat=1
|
||||
options i8042 nomux=1 reset=1 nopnp=1 kbdreset=1 direct=1 dumbkbd=1
|
||||
'';
|
||||
|
||||
boot.kernelParams = [
|
||||
# CRITICAL FIX: Disable ACPI for i8042 (ASUS BIOS bug workaround)
|
||||
"i8042.noacpi"
|
||||
"i8042.reset=1"
|
||||
"i8042.nomux=1"
|
||||
"i8042.nopnp=1"
|
||||
"atkbd.softrepeat=1"
|
||||
# AMD P-State driver for better power management
|
||||
"amd_pstate=active"
|
||||
"amd_pstate.shared_mem=1"
|
||||
# GPU
|
||||
"amdgpu.gpu_recovery=1"
|
||||
"amdgpu.runpm=0"
|
||||
];
|
||||
|
||||
boot.kernelModules = [ "usbmon" ];
|
||||
}
|
||||
6
nixos/modules/boot/tpm.nix
Normal file
6
nixos/modules/boot/tpm.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
systemd.tpm2.enable = false;
|
||||
boot.initrd.systemd.tpm2.enable = false;
|
||||
}
|
||||
10
nixos/modules/desktop/fonts.nix
Normal file
10
nixos/modules/desktop/fonts.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-color-emoji
|
||||
nerd-fonts.fira-code
|
||||
];
|
||||
}
|
||||
13
nixos/modules/desktop/greetd.nix
Normal file
13
nixos/modules/desktop/greetd.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
default_session = {
|
||||
command = "${pkgs.tuigreet}/bin/tuigreet --time --cmd niri-session";
|
||||
user = "greeter";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
22
nixos/modules/desktop/xdg.nix
Normal file
22
nixos/modules/desktop/xdg.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
security.polkit.enable = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
programs.dconf.enable = true;
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
pkgs.xdg-desktop-portal-gnome
|
||||
];
|
||||
config = {
|
||||
common = {
|
||||
default = [ "gtk" ];
|
||||
"org.freedesktop.impl.portal.ScreenCast" = [ "gnome" ];
|
||||
"org.freedesktop.impl.portal.Screenshot" = [ "gnome" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
9
nixos/modules/desktop/xwayland.nix
Normal file
9
nixos/modules/desktop/xwayland.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
programs.xwayland.enable = true;
|
||||
|
||||
environment.sessionVariables = {
|
||||
QT_QPA_PLATFORMTHEME = "qt5ct";
|
||||
};
|
||||
}
|
||||
27
nixos/modules/filesystems.nix
Normal file
27
nixos/modules/filesystems.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
fileSystems."/" = {
|
||||
options = [ "subvol=@" "compress=zstd" "space_cache=v2" "noatime" "lazytime" "ssd" "discard=async" ];
|
||||
};
|
||||
|
||||
fileSystems."/home" = {
|
||||
options = [ "subvol=@home" "compress=zstd" "space_cache=v2" "noatime" "lazytime" "ssd" "discard=async" ];
|
||||
};
|
||||
|
||||
fileSystems."/var/log" = {
|
||||
options = [ "subvol=@log" "compress=zstd" "space_cache=v2" "noatime" "lazytime" "ssd" "discard=async" ];
|
||||
};
|
||||
|
||||
fileSystems."/swap" = {
|
||||
options = [ "subvol=@swap" "noatime" "ssd" "discard=async" ];
|
||||
};
|
||||
|
||||
swapDevices = [{ device = "/swap/swapfile"; }];
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
"vm.dirty_ratio" = 10;
|
||||
"vm.dirty_background_ratio" = 5;
|
||||
"vm.swappiness" = 10;
|
||||
};
|
||||
}
|
||||
6
nixos/modules/hardware/bluetooth.nix
Normal file
6
nixos/modules/hardware/bluetooth.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.bluetooth.powerOnBoot = false;
|
||||
}
|
||||
8
nixos/modules/hardware/gpu.nix
Normal file
8
nixos/modules/hardware/gpu.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
}
|
||||
6
nixos/modules/hardware/power.nix
Normal file
6
nixos/modules/hardware/power.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.upower.enable = true;
|
||||
services.power-profiles-daemon.enable = true;
|
||||
}
|
||||
11
nixos/modules/hardware/rtl-sdr.nix
Normal file
11
nixos/modules/hardware/rtl-sdr.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
hardware.rtl-sdr.enable = true;
|
||||
|
||||
boot.blacklistedKernelModules = [
|
||||
"dvb_usb_rtl28xxu"
|
||||
"rtl2832"
|
||||
"rtl2830"
|
||||
];
|
||||
}
|
||||
9
nixos/modules/hardware/scanner.nix
Normal file
9
nixos/modules/hardware/scanner.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
hardware.sane.enable = true;
|
||||
|
||||
environment.etc."sane.d/epsonds.conf".text = ''
|
||||
net EPSOND80395.local
|
||||
'';
|
||||
}
|
||||
7
nixos/modules/hardware/tablet.nix
Normal file
7
nixos/modules/hardware/tablet.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
hardware.opentabletdriver.enable = true;
|
||||
hardware.uinput.enable = true;
|
||||
boot.kernelModules = [ "uinput" ];
|
||||
}
|
||||
11
nixos/modules/hardware/udev.nix
Normal file
11
nixos/modules/hardware/udev.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
services.udev.packages = [
|
||||
(pkgs.writeTextFile {
|
||||
name = "probe-rs-udev-rules";
|
||||
destination = "/etc/udev/rules.d/69-probe-rs.rules";
|
||||
text = builtins.readFile ../../udev-rules/69-probe-rs.rules;
|
||||
})
|
||||
];
|
||||
}
|
||||
11
nixos/modules/networking/general.nix
Normal file
11
nixos/modules/networking/general.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "lusia-laptop";
|
||||
networking.networkmanager.enable = true;
|
||||
networking.networkmanager.wifi.powersave = true;
|
||||
|
||||
networking.nameservers = [ "9.9.9.9" ];
|
||||
|
||||
services.resolved.enable = true;
|
||||
}
|
||||
11
nixos/modules/networking/tailscale.nix
Normal file
11
nixos/modules/networking/tailscale.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.tailscale.enable = true;
|
||||
|
||||
networking.firewall.trustedInterfaces = [ "tailscale0" ];
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
"net.ipv4.conf.tailscale0.rp_filter" = 0;
|
||||
};
|
||||
}
|
||||
55
nixos/modules/networking/vpn.nix
Normal file
55
nixos/modules/networking/vpn.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
# VSTech VPN (with DNS for bgs.local domain)
|
||||
services.openvpn.servers.vstech = {
|
||||
config = ''
|
||||
client
|
||||
remote 51.83.143.81
|
||||
proto udp
|
||||
port 649
|
||||
dev tun
|
||||
topology subnet
|
||||
ca /home/lusia/VSTech-vpn/ca.crt
|
||||
cert /home/lusia/VSTech-vpn/Klient251.crt
|
||||
key /home/lusia/VSTech-vpn/Klient251.inline
|
||||
tls-crypt /home/lusia/VSTech-vpn/ta.key
|
||||
|
||||
auth sha512
|
||||
data-ciphers aes-256-cbc
|
||||
data-ciphers-fallback aes-256-cbc
|
||||
key-direction 1
|
||||
keepalive 10 120
|
||||
'';
|
||||
updateResolvConf = false;
|
||||
|
||||
up = ''
|
||||
${pkgs.systemd}/bin/resolvectl dns $dev 10.10.10.1
|
||||
${pkgs.systemd}/bin/resolvectl domain $dev bgs.local
|
||||
'';
|
||||
|
||||
down = ''
|
||||
${pkgs.systemd}/bin/resolvectl revert $dev
|
||||
'';
|
||||
};
|
||||
|
||||
# CAT VPN
|
||||
services.openvpn.servers.cat = {
|
||||
config = ''
|
||||
client
|
||||
remote 79.133.193.211
|
||||
proto tcp
|
||||
port 1194
|
||||
dev tun
|
||||
topology subnet
|
||||
ca /home/lusia/vpn/ca.crt
|
||||
cert /home/lusia/vpn/client18.crt
|
||||
key /home/lusia/vpn/client18.key
|
||||
|
||||
auth sha256
|
||||
data-ciphers AES-256-CBC
|
||||
key-direction 1
|
||||
'';
|
||||
updateResolvConf = true;
|
||||
};
|
||||
}
|
||||
25
nixos/modules/packages.nix
Normal file
25
nixos/modules/packages.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
curl
|
||||
wget
|
||||
vim
|
||||
fish
|
||||
kitty
|
||||
powertop
|
||||
openvpn
|
||||
nodejs
|
||||
gnumake
|
||||
gcc
|
||||
cmake
|
||||
xwayland-satellite
|
||||
busybox
|
||||
libdecor
|
||||
file
|
||||
cifs-utils
|
||||
samba
|
||||
gvfs
|
||||
];
|
||||
}
|
||||
5
nixos/modules/services/flatpak.nix
Normal file
5
nixos/modules/services/flatpak.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.flatpak.enable = true;
|
||||
}
|
||||
17
nixos/modules/services/printing.nix
Normal file
17
nixos/modules/services/printing.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
services.printing = {
|
||||
enable = true;
|
||||
drivers = with pkgs; [
|
||||
cups-filters
|
||||
cups-browsed
|
||||
];
|
||||
};
|
||||
}
|
||||
5
nixos/modules/services/smb.nix
Normal file
5
nixos/modules/services/smb.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.gvfs.enable = true;
|
||||
}
|
||||
5
nixos/modules/services/ssh.nix
Normal file
5
nixos/modules/services/ssh.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
16
nixos/modules/users.nix
Normal file
16
nixos/modules/users.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
users.groups.plugdev = {};
|
||||
|
||||
users.users.lusia = {
|
||||
isNormalUser = true;
|
||||
description = "Lukrecja";
|
||||
extraGroups = [ "wheel" "networkmanager" "docker" "plugdev" "scanner" "lp" "wireshark" "libvirtd" "kvm" "vboxusers" "dialout" ];
|
||||
initialPassword = "pass";
|
||||
shell = pkgs.fish;
|
||||
};
|
||||
|
||||
programs.fish.enable = true;
|
||||
security.sudo.enable = true;
|
||||
}
|
||||
12
nixos/modules/virtualization.nix
Normal file
12
nixos/modules/virtualization.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
virtualisation.libvirtd.enable = true;
|
||||
|
||||
virtualisation.virtualbox.host.enable = true;
|
||||
virtualisation.virtualbox.host.enableExtensionPack = true;
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
}
|
||||
6
nixos/modules/wireshark.nix
Normal file
6
nixos/modules/wireshark.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.wireshark.enable = true;
|
||||
programs.wireshark.package = pkgs.wireshark;
|
||||
}
|
||||
Reference in New Issue
Block a user