Compare commits

...
Author SHA1 Message Date
nixos-install.sh 4c8ae96253 Replace gnome with xfce 2025-12-29 17:11:56 +00:00
nixos-install.sh 2e6c44dad6 Give qitech user serial permissions 2025-12-29 17:11:56 +00:00
nixos-install.sh 4de5df45d6 Enable 6GB swap 2025-12-29 17:11:56 +00:00
nixos-install.sh 8c8c5c664c Have development specific settings 2025-12-29 17:11:56 +00:00
3 changed files with 138 additions and 157 deletions

No files matched your search

+72 -56
View File
@@ -18,8 +18,6 @@ in
boot.kernelPackages = pkgs.linuxPackages_6_13;
boot.kernelModules = [ "i915" ];
boot.kernelParams = [
# Realtime Preemption
"preempt=full"
@@ -70,10 +68,56 @@ in
boot.kernel.sysctl = {
"kernel.panic_on_oops" = 1; # Reboot on kernel oops
"kernel.panic" = 10; # Reboot after 10 seconds on panic
"vm.swappiness" = 10; # Reduce swap usage
# "vm.swappiness" = 10; # Reduce swap usage
"kernel.sysrq" = 1; # Enable SysRq for emergency control
};
# Create a 6 GiB swapfile at /swapfile
systemd.tmpfiles.rules = [
# Ensure parent directory exists with proper perms (root dir already exists)
# Create the swapfile with exact size: 6G
"f /swapfile - - - - -"
];
# Custom service to allocate and format the swapfile early in boot
systemd.services.create-swapfile = {
description = "Create and enable /swapfile swap";
wants = [ "local-fs.target" ];
before = [ "swap.target" ];
path = [ pkgs.coreutils pkgs.util-linux pkgs.systemd ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = "yes";
};
script = ''
set -e
# If swapfile already exists and is a swap, enable it
if swapon --show=NAME | grep -q '^/swapfile$'; then
exit 0
fi
# If file exists but not swap, remove it to recreate
if [ -f /swapfile ]; then
swapuuid=$(/sbin/blkid -o value -s UUID /swapfile 2>/dev/null || true)
if [ -n "$swapuuid" ]; then
swapoff /swapfile || true
fi
rm -f /swapfile
fi
# Allocate 6 GiB (sparse then fallocate to ensure space)
fallocate -l 6G /swapfile || dd if=/dev/zero of=/swapfile bs=1M count=6144
# Set strict permissions
chown 0:0 /swapfile
chmod 600 /swapfile
# Setup swap space and enable it
mkswap /swapfile
swapon /swapfile
'';
};
nix = {
package = pkgs.nixVersions.stable;
extraOptions = ''
@@ -139,15 +183,14 @@ in
};
# Enable the X11 windowing system.
services.xserver.enable = true;
#services.xserver.videoDrivers = [ "intel" ];
services.xserver.displayManager.gdm = {
services.xserver = {
enable = true;
autoSuspend = false;
wayland = true;
desktopManager = {
xterm.enable = false;
xfce.enable = true;
};
};
services.xserver.desktopManager.gnome.enable = true;
services.displayManager.defaultSession = "xfce";
# Disable sleep/suspend
systemd.targets.sleep.enable = false;
@@ -226,19 +269,15 @@ in
users.users.qitech = {
isNormalUser = true;
description = "QiTech HMI";
extraGroups = [ "networkmanager" "wheel" "realtime" "wireshark" ];
extraGroups = [ "networkmanager" "wheel" "realtime" "wireshark" "dailout" ];
packages = with pkgs; [ ];
};
security.sudo.wheelNeedsPassword = false;
# Enable automatic login for the user.
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "qitech";
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
# Enable automatic login for the user. (Disabled for rdp to work)
# services.displayManager.autoLogin.enable = true;
# services.displayManager.autoLogin.user = "qitech";
# Install firefox.
programs.firefox.enable = true;
@@ -247,53 +286,19 @@ in
programs.wireshark.enable = true;
programs.wireshark.package = pkgs.wireshark;
# List packages installed in system profile. To search, run:
# $ nix search wget
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
gnome-tweaks
gnome-extension-manager
gnomeExtensions.dash-to-dock
# Extension to disable activities overview on login
gnomeExtensions.no-overview
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
git
pkgs.qitechPackages.electron
htop
wireshark
pciutils
neofetch
];
xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
environment.gnome.excludePackages = (with pkgs; [
atomix # puzzle game
baobab # disk usage analyzer
cheese # webcam tool
eog # image viewer
epiphany # web browser
evince # document viewer
geary # email reader
simple-scan # document scanner
gnome-characters
gnome-music
gnome-photos
gnome-terminal
gnome-tour
gnome-calculator
gnome-calendar
gnome-contacts
gnome-maps
gnome-weather
hitori # sudoku game
iagno # go game
tali # poker game
totem # video player
seahorse # password manager
]);
# Set system wide env variables
environment.variables = {
QITECH_OS = "true";
@@ -317,7 +322,7 @@ in
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
@@ -325,12 +330,23 @@ in
# Or disable the firewall altogether.
# networking.firewall.enable = false;
services.xrdp.enable = true;
# Use the GNOME Wayland session
services.xrdp.defaultWindowManager = "${pkgs.gnome-session}/bin/gnome-session";
# XRDP needs the GNOME remote desktop backend to function
services.gnome.gnome-remote-desktop.enable = true;
# Open the default RDP port (3389)
services.xrdp.openFirewall = true;
# 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. It‘s 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 = "24.11"; # Did you read the comment?
system.stateVersion = "25.11"; # Did you read the comment?
}
+66 -100
View File
@@ -1,121 +1,87 @@
{ config, pkgs, lib, ... }: {
home.stateVersion = "24.11";
home.stateVersion = "25.11";
home.packages = with pkgs; [
pkgs.qitechPackages.electron
];
# Add autostart entry for the QiTech electron app
xdg.configFile."autostart/de.qitech.control-electron.desktop".text = ''
[Desktop Entry]
Type=Application
Name=QiTech Control
Comment=QiTech Control
Exec=qitech-control-electron
Icon=de.qitech.control-electron
Terminal=false
StartupWMClass=QiTech Control
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-Phase=Applications
'';
dconf.settings = {
# Set GNOME wallpaper
"org/gnome/desktop/background" = {
picture-uri = "https://i.postimg.cc/Z5XJtNMW/qitech-industries-wallpaper.jpg";
picture-uri-dark = "https://i.postimg.cc/Z5XJtNMW/qitech-industries-wallpaper.jpg";
picture-options = "zoom";
# xdg.configFile."autostart/de.qitech.control-electron.desktop".text = ''
# [Desktop Entry]
# Type=Application
# Name=QiTech Control
# Comment=QiTech Control
# Exec=qitech-control-electron
# Icon=de.qitech.control-electron
# Terminal=false
# StartupWMClass=QiTech Control
# X-GNOME-Autostart-enabled=true
# X-GNOME-Autostart-Phase=Applications
# '';
# XFCE desktop environment settings
xfconf.settings = {
"xfce4-desktop" = {
# Set wallpaper for the primary display
"backdrop/screen0/monitor0/image-path" = "https://i.postimg.cc/Z5XJtNMW/qitech-industries-wallpaper.jpg";
"backdrop/screen0/monitor0/image-show" = true;
"backdrop/screen0/monitor0/image-style" = 5; # 5 = Zoomed (fit to screen)
};
# Enable on-screen keyboard
"org/gnome/desktop/a11y/applications" = {
screen-keyboard-enabled = true;
};
# Configure on-screen keyboard (optional)
"org/gnome/desktop/a11y" = {
always-show-universal-access-status = true;
"xfce4-power-manager" = {
# Disable automatic suspend, dimming, and screen blank
"inactivity-on-ac" = 14; # 14 = Do nothing
"inactivity-on-battery" = 14;
"blank-on-ac" = 0;
"blank-on-battery" = 0;
"dpms-enabled" = false;
"brightness-on-ac" = 100;
"brightness-on-battery" = 100;
};
# Disable screen blanking/timeout
"org/gnome/desktop/session" = {
idle-delay = lib.gvariant.mkUint32 0; # Use uint32 format to ensure proper type
};
# Disable automatic suspend and screen dimming
"org/gnome/settings-daemon/plugins/power" = {
sleep-inactive-ac-type = "nothing";
sleep-inactive-battery-type = "nothing";
power-button-action = "nothing";
idle-dim = false;
sleep-inactive-ac-timeout = lib.gvariant.mkUint32 0;
sleep-inactive-battery-timeout = lib.gvariant.mkUint32 0;
ambient-enabled = false;
};
# Disable screen lock
"org/gnome/desktop/screensaver" = {
lock-enabled = false;
idle-activation-enabled = false;
lock-delay = lib.gvariant.mkUint32 0;
};
# Interface settings with hot-corners disabled
"org/gnome/desktop/interface" = {
enable-animations = true;
show-battery-percentage = true;
enable-hot-corners = false; # Prevent activities from opening with hot corners
"xfce4-session" = {
# Disable session auto lock
"lock-screen-suspend-hibernate" = false;
"logout-prompt" = true;
};
# Show dock on all monitors and always visible
"org/gnome/shell/extensions/dash-to-dock" = {
dock-position = "BOTTOM";
extend-height = false;
dock-fixed = true;
autohide = false;
intellihide = false;
multi-monitor = true; # Show dock on all monitors
isolate-monitors = false; # Don't isolate workspaces per monitor
isolate-workspaces = false; # Don't isolate dock content per workspace
};
# Configure display settings
"org/gnome/mutter" = {
workspaces-only-on-primary = false; # Show workspaces on all monitors
dynamic-workspaces = false; # Disable dynamic workspaces
};
"org/gnome/desktop/wm/preferences" = {
num-workspaces = 1; # Set a fixed number of workspaces (default: 4)
"xfce4-screensaver" = {
"lock-enabled" = false;
"mode" = 0; # 0 = Blank, 1 = Random, 2 = Single image
};
"org/gnome/desktop/lockdown" = {
disable-lock-screen = true; # Disable lock screen
disable-log-out = false; # Enable logout option (To be able to reboot manually)
disable-user-switching = true; # Disable user switching
disable-screensaver = true; # Disable screensaver
user-adminstration-disabled = true; # Disable user administration
"xfce4-panel" = {
# Always show panel, don’t autohide
"autohide-behavior" = 0; # 0 = Never autohide
"show-window-list" = true;
"show-desktop-button" = true;
};
"org/gnome/shell" = {
always-show-log-out = true;
enabled-extensions = [
"dash-to-dock@micxgx.gmail.com"
"no-overview@fthx"
"xfwm4" = {
# Window manager preferences
"workspace_count" = 1;
"wrap_workspaces" = false;
"wrap_layout" = false;
"cycle_workspaces" = false;
"workspace_names" = [ "Main" ];
};
"xfce4-keyboard-shortcuts" = {
# Disable hot corners or any special shortcuts
"/commands/custom/<Super>p" = ""; # Example of unbinding an unwanted shortcut
};
"xfce4-panel/launcher" = {
# Optional: Pin favorite apps (replace with your .desktop entries)
"items" = [
"de.qitech.control-electron.desktop"
];
favorite-apps = [
"de.qitech.control-electron.desktop" # The desktop entry from the QiTech app
"org.gnome.Settings.desktop"
];
disable-user-extensions = false;
disable-extension-version-validation = true;
welcome-dialog-last-shown-version = "999.999.999"; # Prevents welcome screen
looking-glass-history = [];
};
# Disable automatic Activities overview on startup
"org/gnome/shell/extensions/ding" = {
start-corner = "top-left"; # This can help with preventing Activities from opening
"xfce4-notifyd" = {
# Enable notifications, animations
"do-slideout" = true;
};
};
}
-1
View File
@@ -121,7 +121,6 @@ installPhase = ''
Terminal=false
StartupWMClass=QiTech Control
Categories=Development;Engineering;
X-GNOME-UsesNotifications=true
EOF
'';