WIP: Laptop config

This commit is contained in:
2026-02-17 20:02:25 +01:00
parent 1d00288f34
commit bfe2094a5f
27 changed files with 467 additions and 190 deletions

161
common/default.nix Normal file
View File

@@ -0,0 +1,161 @@
{
config,
pkgs,
lib,
...
}:
{
imports = [
./modules
./hardware-configuration.nix
];
boot = {
loader = {
efi.canTouchEfiVariables = true;
systemd-boot = {
enable = true;
};
};
consoleLogLevel = 3;
plymouth.enable = true;
};
networking = {
networkmanager.enable = true;
firewall.enable = false;
};
time.timeZone = "Europe/Prague";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "cs_CZ.UTF-8";
LC_IDENTIFICATION = "cs_CZ.UTF-8";
LC_MEASUREMENT = "cs_CZ.UTF-8";
LC_MONETARY = "cs_CZ.UTF-8";
LC_NAME = "cs_CZ.UTF-8";
LC_NUMERIC = "cs_CZ.UTF-8";
LC_PAPER = "cs_CZ.UTF-8";
LC_TELEPHONE = "cs_CZ.UTF-8";
LC_TIME = "cs_CZ.UTF-8";
};
};
console.keyMap = "cz-lat2";
xdg.portal.enable = true;
security = {
rtkit.enable = true;
sudo.extraConfig = ''
Defaults insults
'';
polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (action.id == "org.libvirt.unix.manage" &&
subject.isInGroup("qemu-libvirtd")) {
return polkit.Result.YES;
}
});
'';
};
virtualisation = {
docker = {
enable = true;
autoPrune.enable = false;
storageDriver = "btrfs";
enableOnBoot = true;
};
libvirtd = {
enable = true;
extraConfig = ''
unix_sock_group = "qemu-libvirtd"
'';
onBoot = "ignore";
};
spiceUSBRedirection.enable = true;
};
users.users.jax = {
isNormalUser = true;
description = "Roman Lubij";
extraGroups = [
"networkmanager"
"wheel"
"docker"
"qemu-libvirtd"
"camera"
"video"
"render"
"input"
];
shell = pkgs.zsh;
#packages = with pkgs; [ ];
};
environment = {
sessionVariables = {
NIXOS_OZONE_WL = "1";
LIBVIRT_DEFAULT_URI = "qemu:///system";
};
systemPackages = [
pkgs.libheif
pkgs.libheif.out
];
pathsToLink = [ "share/thumbnailers" ];
};
hardware = {
bluetooth = {
enable = true;
package = pkgs.bluez.overrideAttrs (old: {
configureFlags = old.configureFlags ++ [
"--enable-sixaxis"
];
});
powerOnBoot = true;
input.General.ClassicBondedOnly = false;
settings = {
General = {
Experimental = true;
};
};
};
i2c.enable = true;
graphics = {
enable = true;
enable32Bit = true;
package = pkgs.mesa;
};
logitech.wireless = {
enable = true;
enableGraphical = true;
};
};
qt = {
platformTheme = "qt5ct";
style = "adwaita-dark";
enable = true;
};
nix.settings = {
auto-optimise-store = true;
experimental-features = [
"flakes"
"nix-command"
];
warn-dirty = false;
};
system.stateVersion = "25.05";
}

View File

@@ -0,0 +1,85 @@
{
description = "Krokiet (Czkawka Slint GUI)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
czkawka-src = {
url = "github:qarmin/czkawka";
flake = false;
};
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
czkawka-src,
naersk,
}:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
nativeBuildInputs = with pkgs; [
pkg-config
cmake
makeWrapper
cargo
rustc
];
runtimeLibs = with pkgs; [
wayland
libxkbcommon
libglvnd
fontconfig
libX11
libXcursor
libXi
libXrandr
];
in
{
packages.${system}.default = naersk-lib.buildPackage {
pname = "krokiet";
version = "master";
src = czkawka-src;
nativeBuildInputs = nativeBuildInputs;
buildInputs = runtimeLibs;
cargoBuildOptions =
x:
x
++ [
"-p"
"krokiet"
];
buildAndCheckFeatures = [
"winit_wayland"
"winit_x11"
];
RUSTFLAGS = "-C target-cpu=native";
NIX_CFLAGS_COMPILE = "-march=native -mtune=native";
postInstall = ''
wrapProgram $out/bin/krokiet \
--prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath runtimeLibs}
install -Dm444 -t $out/share/applications data/io.github.qarmin.krokiet.desktop
install -Dm444 -t $out/share/icons/hicolor/scalable/apps data/icons/io.github.qarmin.krokiet.svg \
install -Dm444 -t $out/share/metainfo data/io.github.qarmin.krokiet.metainfo.xml
'';
};
};
}

View File

@@ -0,0 +1,82 @@
{
description = "FET - Free Timetabling Software";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.default = pkgs.stdenv.mkDerivation rec {
pname = "fet";
version = "7.7.6";
src = pkgs.fetchurl {
url = "https://lalescu.ro/liviu/fet/download/fet-${version}.tar.xz";
sha256 = "06vvxxl5kza3a2v0fkw6bylavpickk8a5ybgabbhylmi59c1q1ns";
};
enableParallelBuilding = true;
nativeBuildInputs = [
pkgs.qt6.qmake
pkgs.qt6.wrapQtAppsHook
pkgs.copyDesktopItems
];
buildInputs = [
pkgs.qt6.qtbase
];
configurePhase = ''
qmake fet.pro
'';
desktopItems = [
(pkgs.makeDesktopItem {
name = "fet";
exec = "fet";
icon = "fet";
comment = "Free Timetabling Software";
desktopName = "FET";
categories = [
"Education"
"Qt"
];
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp fet $out/bin/
mkdir -p $out/share/icons/hicolor/128x128/apps
cp icons/fet.png $out/share/icons/hicolor/128x128/apps/fet.png
runHook postInstall
'';
meta = with pkgs.lib; {
description = "Free software for automatically scheduling timetables";
homepage = "https://lalescu.ro/liviu/fet/";
license = licenses.agpl3Plus;
platforms = platforms.linux;
mainProgram = "fet";
};
};
}
);
}

View File

@@ -0,0 +1,70 @@
{
description = "Solaar built from GitHub master branch";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
solaar-src = {
url = "github:pwr-Solaar/Solaar/master";
flake = false;
};
};
outputs =
{
self,
nixpkgs,
flake-utils,
solaar-src,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
pythonPackages = pkgs.python3Packages;
in
{
packages.default = pythonPackages.buildPythonApplication rec {
pname = "solaar";
version = "master-${solaar-src.shortRev or "dirty"}";
src = solaar-src;
pyproject = true;
nativeBuildInputs =
with pkgs;
[
gobject-introspection
wrapGAppsHook3
pkg-config
]
++ (with pythonPackages; [
setuptools
wheel
]);
propagatedBuildInputs = with pythonPackages; [
pyudev
psutil
xlib
pyyaml
evdev
dbus-python
pygobject3
typing-extensions
pkgs.gtk3
pkgs.libnotify
pkgs.libayatana-appindicator
];
postInstall = ''
install -Dm644 rules.d/42-logitech-unify-permissions.rules \
$out/lib/udev/rules.d/42-logitech-unify-permissions.rules
'';
doCheck = false;
};
}
);
}

View File

@@ -0,0 +1 @@
{ ... }: { }

View File

@@ -0,0 +1,11 @@
{ ... }:
{
imports = [
./flatpak.nix
./gnome.nix
./packages.nix
./programs.nix
./services.nix
];
}

View File

@@ -0,0 +1,49 @@
{
config,
pkgs,
lib,
...
}:
{
services.flatpak = {
enable = true;
update.auto.enable = true;
remotes = [
{
name = "flathub";
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
}
];
packages = [
{
appId = "com.mattjakeman.ExtensionManager";
origin = "flathub";
}
{
appId = "com.prusa3d.PrusaSlicer";
origin = "flathub";
}
{
appId = "com.github.tchx84.Flatseal";
origin = "flathub";
}
{
appId = "org.gtk.Gtk3theme.Adwaita-dark";
origin = "flathub";
}
{
appId = "org.gtk.Gtk3theme.Flat-Remix-GTK-Red-Darkest";
origin = "flathub";
}
{
appId = "com.github.iwalton3.jellyfin-media-player";
origin = "flathub";
}
{
appId = "org.freecad.FreeCAD";
origin = "flathub";
}
];
};
}

42
common/modules/gnome.nix Normal file
View File

@@ -0,0 +1,42 @@
{
config,
pkgs,
lib,
...
}:
{
environment = {
gnome.excludePackages = with pkgs; [
decibels
epiphany
geary
gnome-connections
gnome-contacts
gnome-logs
gnome-maps
gnome-music
gnome-software
gnome-system-monitor
snapshot
totem
yelp
];
systemPackages = with pkgs.gnomeExtensions; [
alphabetical-app-grid
appindicator
blur-my-shell
control-monitor-brightness-and-volume-with-ddcutil
bubblemail
color-picker
dash-to-dock
# favorites-to-applications-grid
middle-click-to-close-in-overview
undecorate
user-themes
window-is-ready-remover
solaar-extension
];
};
}

194
common/modules/packages.nix Normal file
View File

@@ -0,0 +1,194 @@
{
config,
pkgs,
lib,
czkawka-master,
solaar-master,
fet,
...
}:
{
nixpkgs = {
config = {
allowUnfree = true;
permittedInsecurePackages = [
"ventoy-gtk3-1.1.10"
];
};
overlays = [
(final: prev: {
nautilus = prev.nautilus.overrideAttrs (nprev: {
buildInputs =
nprev.buildInputs
++ (with pkgs.gst_all_1; [
gst-plugins-good
gst-plugins-bad
gst-plugins-ugly
gst-plugins-base
]);
});
})
(final: prev: {
zenmonitor = prev.zenmonitor.overrideAttrs (oldAttrs: {
env = (oldAttrs.env or { }) // {
NIX_CFLAGS_COMPILE = "-std=gnu17";
};
});
})
];
};
environment.systemPackages = with pkgs; [
abootimg
android-tools
anki
appstream
aspell
aspellDicts.cs
aspellDicts.en
aspellDicts.es
attic-client
bibata-cursors
binwalk
brscan4
brscan5
btrfs-progs
bubblemail
bzip2
curl
fet.packages.${pkgs.stdenv.hostPlatform.system}.default
ddcutil
discord
distrobox
docker-buildx
docker-compose
dog
element-desktop
eza
ffmpeg-full
ffmpegthumbnailer
file
file-roller
firmware-manager
flat-remix-gnome
flat-remix-gtk
flatpak-xdg-utils
freerdp
fuse
fuse3
fwupd
gimp
gnome-tweaks
gnome.gvfs
gotop
gparted
gphoto2
gst_all_1.gst-libav
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-ugly
gst_all_1.gst-vaapi
gst_all_1.gstreamer
gvfs
gzip
htop
i2c-tools
iftop
inkscape
iotop
jq
killall
kooha
krita
libgsf
libnotify
libreoffice
libsForQt5.qtstyleplugins
linux-firmware
lm_sensors
lrzip
lsof
lz4
lzip
lzop
mangohud
mesa-demos
mission-center
ncdu
nil
nixfmt
ntfs3g
nufraw-thumbnailer
obsidian
openrgb-with-all-plugins
papirus-icon-theme
pbzip2
pciutils
pigz
plymouth
poppler-utils
prismlauncher-unwrapped
protonup-qt
rquickshare
saber
solaar-master.packages.${pkgs.stdenv.hostPlatform.system}.default
logitech-udev-rules
scrcpy
screen
seafile-client
smartmontools
starship
sushi
telegram-desktop
testdisk
thunderbird
tidal-hifi
tldr
trash-cli
tree
unrar
unzip
usbutils
ventoy-full-gtk
vesktop
vkbasalt
vlc
vscode-fhs
webp-pixbuf-loader
wev
wget
which
wine
wireshark
tumbler
xz
yt-dlp
zip
zram-generator
zsh-autosuggestions
zsh-completions
zsh-history-substring-search
zsh-syntax-highlighting
zstd
zulu
zulu8
zulu17
];
fonts = {
packages = with pkgs; [
fira-code
font-awesome
nerd-fonts.fira-code
nerd-fonts.fira-mono
nerd-fonts.symbols-only
nerd-fonts.ubuntu-mono
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
ubuntu-classic
];
};
}

View File

@@ -0,0 +1,53 @@
{
config,
pkgs,
lib,
...
}:
{
programs = {
bat.enable = true;
zsh.enable = true;
gamemode.enable = true;
firefox = {
enable = true;
languagePacks = [
"cs"
"en-GB"
"en-US"
];
};
weylus.enable = true;
gamescope.enable = true;
git = {
enable = true;
lfs.enable = true;
};
nh = {
clean = {
enable = true;
extraArgs = "--keep-since 7d --keep 10";
};
enable = true;
flake = "/etc/nixos";
};
nix-ld = {
enable = true;
libraries = with pkgs; [ ];
};
steam = {
dedicatedServer.openFirewall = true;
enable = true;
extest.enable = true;
gamescopeSession.enable = true;
protontricks.enable = true;
remotePlay.openFirewall = true;
};
};
}

View File

@@ -0,0 +1,82 @@
{
config,
pkgs,
lib,
...
}:
{
services = {
sshd.enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
xserver = {
enable = true;
excludePackages = with pkgs; [
xterm
];
xkb = {
layout = "cz";
variant = "";
};
};
pulseaudio.enable = false;
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;
};
printing = {
enable = true;
drivers = [
pkgs.brlaser
];
};
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
journald.extraConfig = ''
SystemMaxUse=2G
RuntimeMaxUse=1G
SystemMaxFiles=100
'';
zram-generator = {
enable = true;
settings = {
"zram0" = {
"zram-size" = "ram*1.5";
"compression-algorithm" = "zstd";
};
};
};
btrfs = {
autoScrub = {
enable = true;
interval = "monthly";
};
};
fstrim = {
enable = true;
interval = "weekly";
};
fwupd.enable = true;
};
}