Skip to content

Instantly share code, notes, and snippets.

@AlisterH
Last active September 11, 2024 22:24
Show Gist options
  • Save AlisterH/500b2c13707a442ffeddc00fc237cf07 to your computer and use it in GitHub Desktop.
Save AlisterH/500b2c13707a442ffeddc00fc237cf07 to your computer and use it in GitHub Desktop.
Sane defaults and examples for nixos configuration
## Things to keep in mind:
##
## Choose the name of your user account wisely to avoid the hassle of renaming it.
## I suggest something generic like "nixos"
##
## If you don't run a desktop environment it will probably be hard to do stuff like mount internal disks
## unless you start a policykit authentication agent - see https://wiki.archlinux.org/title/Polkit
## Todo: confirm Nixos doesn't start one by default
##
## Nix language reference https://nixos.wiki/wiki/Nix_by_example
##
## https://jorel.dev/NixOS4Noobs/packageoptions.html
# Would be nice to set username in a variable so we can just change it in one place if reusing this configuration
# user = "nixos"
# See https://www.reddit.com/r/NixOS/comments/v1rav3/username_variable_in_configurationnix/
# How would you use it when you want to do something like this?:
# users.users.usernamevariable = { do some stuff }
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page,
# in the NixOS manual (accessible by running ‘nixos-help’). and at
# https://search.nixos.org/options
/*
Block comment like this
*/
{ config, lib, pkgs, ... }:
/*
# this project provides a gui software center, but it still needs work.
let
nix-software-center = import (pkgs.fetchFromGitHub {
owner = "snowfallorg";
repo = "nix-software-center";
rev = "0.1.2";
sha256 = "xiqF1mP8wFubdsAQ1BmfjzCgOD3YZf7EGWl9i69FTls=";
}) {};
in
*/
{
imports =
[ # Include the results of the hardware scan.
#./hardware-configuration.nix
/etc/nixos/hardware-configuration.nix
/etc/nixos/nix-alien.nix # easily run unpackaged binaries intended for generic linux (using either nix-ld or an FHS env; I don't know if one way is better than the other)
# can we bring it into this file instead of including?
];
nix.settings.experimental-features = [
"nix-command"
#"flakes" # there's probably no harm in enabling flakes, but do we need to complicate our lives with understanding them?
];
nix.settings.trusted-users = [ "alister" ];
nix.settings.auto-optimise-store = true;
# Bootloader.
boot.loader.systemd-boot.enable = true;
# I think these are only needed if we want to use them at boot via /etc/fstab
# boot.supportedFilesystems = [ "cifs" ];
# boot.supportedFilesystems = [ "ntfs" ];
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
networking.hostName = "nixos"; # Define your hostname.
# probably need this for a laptop
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# 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;
# Avoid confusing a Windows dual boot
time.hardwareClockInLocalTime = true;
# Set your time zone.
time.timeZone = "Pacific/Auckland";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_NZ.UTF-8";
LC_IDENTIFICATION = "en_NZ.UTF-8";
LC_MEASUREMENT = "en_NZ.UTF-8";
LC_MONETARY = "en_NZ.UTF-8";
LC_NAME = "en_NZ.UTF-8";
LC_NUMERIC = "en_NZ.UTF-8";
LC_PAPER = "en_NZ.UTF-8";
LC_TELEPHONE = "en_NZ.UTF-8";
LC_TIME = "en_NZ.UTF-8";
};
# Enable the X11 windowing system.
# we do need to specifically enable this unless we use wayland instead (it isn't automatically enabled by the options below)
# note that it is possible to have both wayland and x11 enabled.
# TODO: how easy is it to keep X11 and remove Wayland?
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true; # note plasma bigscreen is not yet ported for plasma6
# Seems we would include one or the other of these settings, not both:
# services.xserver.desktopManager.plasma5.enable = true;
# services.xserver.desktopManager.plasma5.bigscreen.enable = true;
#
# Seems plasma-bigscreen enables an automatic launch screen (including limited settings ui)
# and on-screen keyboard and disables the desktop and taskbar and clipboard monitor,
# but does not affect Kwin behaviour (e.g. apps aren't forced to fullscreen)
# seems there is no accessible way to disable onscreen keyboard, access other settings (e.g.
# bluetooth pairing), or launch dolphin!
# desktopManager options you can use instead of plasma6 for other desktop environments:
# budgie cde cinnamon deepin enlightenment gnome lomiri (unity8) lumina lxqt mate pantheon (elementaryos) plasma5 xfce
# more than one desktopManager can be enabled, and you could use something like xterm or kodi
# some desktops like COSMIC (POP!os) may recommend installing via flake
#
# gdm displayManager is suggested for gnome, and lightdm for most other DEs except plasma. You can also use xpra, sx, or startx
#
# You can also use e.g. services.xserver.windowManager.jwm.enable
# See https://github.com/NixOS/nixpkgs/tree/nixos-24.05/nixos/modules/services/x11/window-managers for options
#
# This might also be helpful https://wiki.nixos.org/wiki/Using_X_without_a_Display_Manager
# It makes sense to me to ensure that both your display manager itself and your default session use either X11 or Wayland
# and I found it confusing as they are on different VTs.
# Default KDE session is "plasma" (wayland) in plasma6
# but sddm still launches in X11 by default!
# https://nixos.wiki/wiki/KDE
services.displayManager.defaultSession = "plasmax11";
# services.displayManager.sddm.wayland.enable = "true"; # currently said to be experimental
# doesn't do what I want
# services.xserver.desktopManager.plasma5.notoPackage = "";
# doesn't do what I want
# environment.plasma6.excludePackages = [
# pkgs.noto-fonts # doesn't seem to help remove it
# ];
#this causes failure, but I don't think the error tells you the reverse dependency
#system.forbiddenDependenciesRegexes = [ "noto-fonts" ];
# Configure keymap in X11
services.xserver = {
xkb.layout = "us";
xkb.variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Allow users in wheel group to mount all sorts of stuff without being prompted for authentication
# I think filesystem-mount-system-internal is the only one really necessry.
# If I don't do this it is impossible for my user to mount internal drives if they have an empty password
# (Is it a bug? Can we instead create a pam rule or something to allow null passwords)
# For some comments on why mounting should instead be restricted, see https://unix.stackexchange.com/a/96643
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
var YES = polkit.Result.YES;
var permission = {
// required for udisks1:
"org.freedesktop.udisks.filesystem-mount": YES,
"org.freedesktop.udisks.filesystem-mount-system-internal": YES,
"org.freedesktop.udisks.luks-unlock": YES,
"org.freedesktop.udisks.drive-eject": YES,
"org.freedesktop.udisks.drive-detach": YES,
// required for udisks2:
"org.freedesktop.udisks2.filesystem-mount": YES,
"org.freedesktop.udisks2.filesystem-mount-system": YES,
"org.freedesktop.udisks2.encrypted-unlock": YES,
"org.freedesktop.udisks2.eject-media": YES,
"org.freedesktop.udisks2.power-off-drive": YES,
// required for udisks2 if using udiskie from another seat (e.g. systemd):
"org.freedesktop.udisks2.filesystem-mount-other-seat": YES,
"org.freedesktop.udisks2.filesystem-unmount-others": YES,
"org.freedesktop.udisks2.encrypted-unlock-other-seat": YES,
"org.freedesktop.udisks2.encrypted-unlock-system": YES,
"org.freedesktop.udisks2.eject-media-other-seat": YES,
"org.freedesktop.udisks2.power-off-drive-other-seat": YES
};
if (subject.isInGroup("wheel")) {
return permission[action.id];
}
});
'';
# Although solutions like this are commonly found online, they don't work for me - I have to use the code above
/* security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
# another version uses this
# if (subject.local) return "yes";
if subject.isInGroup("wheel") return polkit.Result.YES;
});
'';*/
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
hardware.bluetooth.enable = true; # I think this conflicts with kdePackages.bluedevil
security.rtkit.enable = true;
security.sudo.extraRules= [
{
users = [ "alister" ];
commands = [
{ command = "ALL" ;
options= [ "NOPASSWD" ];
}
];
}
];
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;
};
# TODO: can we test for a laptop install? e.g. parsing the output of `inxi -v7` if the standard
# generated hardware-configuration.nix doesn't already provide a way.
# Also, see https://nixos.wiki/wiki/Laptop and search for laptop options at https://search.nixos.org
#
# turn on number lock at startup; you likely won't want this for a laptop
# note that this is for manual login on a VT.
# You will need to set it elsewhere for an automatically logged in desktop environment or window manager e.g.:
# KDE system settings under "Keyboard"
# services.displayManager.sddm.autoNumlock = true;
# or running numlockx:
# services.xserver.displayManager.setupCommands = ''
# ${pkgs.numlockx}/bin/numlockx on
# '';
systemd.services.numLockOnTty = {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
# /run/current-system/sw/bin/setleds -D +num < "$tty";
ExecStart = lib.mkForce (pkgs.writeShellScript "numLockOnTty" ''
for tty in /dev/tty{1..6}; do
${pkgs.kbd}/bin/setleds -D +num < "$tty";
done
'');
};
};
# TODO: try this again - surely it is simplest (mounting to /media, without ACL)
services.udisks2.mountOnMedia = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.nixos = {
isNormalUser = true;
description = "Default User";
extraGroups = [ "networkmanager" "wheel"]; #adding "root" doesn't help us mount drives without password; I guess because there is no "root" group.
packages = with pkgs; [
# if we install this way they won't be usable by other users including root
# firefox
# kate # kde editor
# thunderbird
];
};
# Enable automatic login for the user.
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "nixos";
# Allow "insecure packages" e.g. openSSL 1.1
nixpkgs.config.permittedInsecurePackages = [
# "openssl-1.1.1w"
# "qtwebkit-5.212.0-alpha4" #openlp brings this in
];
# Build with openlp bringing in broken python3.11-sqlalchemy-migrate-0.13.0 still failed with this
#nixpkgs.config.allowBroken = true;
# simple/default syntax to do the same as what we do below
# nixpkgs.config.allowUnfree = true;
nixpkgs.config = {
allowUnfree = true; # Does not apply to flakes
# Overlays just cause a new pkgs object to be returned and used instead which contains whichever things the overlay adds to it.
# (self: super: { jq = super.jq; })
# This overlay, for example, would replace jq with itself
# The two arguments for overlays are either called self: super: or final: prev: by convention and are the new and old pkgs sets before and after the overlay is called.
# Not sure why packageOverrides isn't documented at https://search.nixos.org
# packageOverrides acts as an overlay with only the prev (super) argument https://wiki.nixos.org/wiki/Overlays
# Does it not count as an "Option"?
packageOverrides = prev: let final = prev.pkgs; in {
# prevent installing vast numbers of noto-fonts etc (override them with null or another package e.g. pkgs.corefonts)
# we could override with anything
# N.B. some fonts load from the package store even if they aren't installed -
# the fontconfig package sets Dejavu Sans as a fallback default and loads it from there!
# so this doesn't work
/* dejavu-fonts-minimal = null;
# the underscore in these causes an error. It seems you escape it like this; quoting didn't help.
dejavu''_fontsEnv = null;
dejavu''_fonts = null;
dejavu''_fonts-minimal = null; */
hack-font = prev.corefonts; # this works; setting to null does not
noto-fonts = prev.corefonts; # this works, but note that softmaker/freeoffice also provides some of the noto fonts
#hspell = null; # hebrew spellcheck; disabling this causes enchant to build from source and fail
# examples of changing the options used for a package
# mumble = prev.mumble.override { pulseSupport = true; };
# linuxPackages = prev.linuxPackages // {
# e1000e = prev.linuxPackages.e1000e.overrideDerivation (old: {
# name = "e1000e-3.3.3-${config.boot.kernelPackages.kernel.version}";
# src = fetchurl {
# url = "https://www.dropbox.com/s/pxx883hx9763ygn/e1000e-3.3.3.tar.gz?dl=0";
# sha256 = "1s2w54927fsxg0f037h31g3qkajgn5jd0x3yi1chxsyckrcr0x80";
# };
# });
# };
# enable the nix user repository is small, which is small and builds from source.
# search at https://nur.nix-community.org/ or https://github.com/nix-community/nur-combined
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
inherit pkgs;
};
};
};
/*
# trying to override a package
# hard to get my head around override (which almost works) vs overrideAttrs
# the problem is the new version has new library dependencies, and I can't figure out how to add them,
# as buildInputs is in generic.nix, not freeoffice.nix
# I give up and manually build from a locally edited copy instead (see environment.packages)
nixpkgs.overlays = [
(final: prev: {
freeoffice = prev.freeoffice.overrideAttrs (old: {
officeVersion = {
version = "1216";
edition = "2024";
hash = "sha256-IvPdj+syI4oJbImH+QS+3owWAHHyBEBKfrrw1sjkQUU="; # when you need to update just use a blank hash first and it will tell you what it should be
};
buildInputs = prev.buildInputs ++ [ pkgs.glib pkgs.gstreamer ];
});
})
];
*/
# 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;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = false; #TODO: see if this helps Plasma Connect to connect
#PROBABLY NOT WISE ON A LAPTOP USED ON PUBLIC NETWORKS
# 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 = "22.11"; # Did you read the comment?
# Copy this file to /run/current-system/configuration.nix
# Useful as it gives us a backup in each generation, and allows us to compare generations.
system.copySystemConfiguration = true;
# Also save a list of all packages (TODO: no, this is only a selection!):
environment.etc."current-system-packages".text =
let
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages);
formatted = builtins.concatStringsSep "\n" sortedUnique;
in
formatted;
# TODO: check sections 4.6 at https://wiki.archlinux.org/title/Font_configuration if using GTK4 programs
# We want nice crisp aliased fonts
# It might be clean to rearrange fonts settings to format the code like this:
# https://codeberg.org/Dimitris98/NixOS-dotfiles/src/branch/main/nixos/configuration.nix
# note that if you will run a desktop environment you can probably just change font rendering in its settings gui
fonts.fontconfig.useEmbeddedBitmaps = true;
fonts.fontconfig.hinting.style = "full";
fonts.fontconfig.defaultFonts.serif = ["Times New Roman"];
fonts.fontconfig.defaultFonts.sansSerif = ["Arial"];
fonts.fontconfig.defaultFonts.monospace = ["Courier New"];
# fonts.fontconfig.includeUserConf = true; # This doesn't seem to do anything, but user config at ~/.fonts.conf works regardless
# Disable the annoying Dejavu fonts; note we can't have an empty line at the beginning of the file
# See section 2.8 at https://wiki.archlinux.org/title/Font_configuration
fonts.fontconfig.localConf =
"<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<selectfont>
<rejectfont>
<pattern>
<patelt name='family' >
<string>DejaVu Sans</string>
</patelt>
</pattern>
</rejectfont>
</selectfont>
</fontconfig>";
fonts.fontconfig.antialias = false;
fonts.fontconfig.allowType1 = true; # probably not needed these days
#Do we need this?:
#fonts.fontDir.enable = true; #create a directory with links to all fonts in:file:/run/current-system/sw/share/X11-fonts
fonts.enableGhostscriptFonts = false; # I presume ghostscript itself doesn't need this option
fonts.enableDefaultPackages = false;
# interestingly it seems some font packages like corefonts can be added to environment.systempackages rather than here
# TODO: we should work out the proper way of utilising a Windows fonts folder if available
# but if Windows isn't shut down properly we might not be able to access its drive, so we should have some good fonts anyway
fonts.packages = with pkgs; [
freeoffice # packages like this also include fonts; unfortunately it also supplies some of the noto fonts, which we are trying to get rid of
# also needs to be in environment.systempackages
corefonts # standard Microsoft fonts like Arial & Times New Roman
vistafonts # newer Microsoft fonts
nur.repos.rewine.ttf-ms-win10 # even newer Microsoft fonts
# we could probably get even more fonts by installing MS Powerpoint viewer or something
];
# It is also possible to obtain Mac fonts; here is a nix file: https://gist.github.com/robbins/dccf1238e971973a6a963b04c486c099
# If we want to run apps in a container we can use podman, docker or lilipod
# virtualisation.docker.enable = true;
# virtualisation.podman.enable = true;
/*
# allow running unpackaged binaries intended for generic linux
# testing this for running linux version of numi
# this requires specifying the libraries needed as done below; likely not worth the effort! Is there a quick way to identify what is needed?
#
# https://nix.dev/guides/faq#how-to-run-non-nix-executables
# also notes alternative (perhaps configuration free?) using steam-run
# also see https://blog.thalheim.io/2022/12/31/nix-ld-a-clean-solution-for-issues-with-pre-compiled-executables-on-nixos/
#
# other alternatives apart from steam-run:
# https://nixos.org/manual/nixpkgs/stable/#sec-fhs-environments
# https://github.com/balsoft/nixos-fhs-compat
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
# Add any missing dynamic libraries for unpackaged programs
# here, NOT in environment.systemPackages
alsa-lib
at-spi2-atk
at-spi2-core
atk
cairo
cups
curl
dbus
e2fsprogs # libcom_err.so.2
expat
fontconfig
freetype
fribidi # libfribidi.so.0
fuse # required to run any AppImage
fuse3
gdk-pixbuf
glib
gtk3
gmp # libgmp.so.10
harfbuzz # libharfbuzz.so.0
icu
libgpg-error # libgpg-error.so.0
libGL
libappindicator-gtk3
libdrm
libglvnd
libnotify
libpulseaudio
libthai # libthai.so.0
libunwind
libusb1
libuuid
libxkbcommon
libxml2
mesa
nspr
nss
openssl
openssl_1_1 # libssl.so.1.1
pango
p11-kit # libp11-kit.so.0
pipewire
stdenv.cc.cc
systemd
vulkan-loader
xorg.libX11
xorg.libXScrnSaver
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libxcb
xorg.libxkbfile
xorg.libxshmfence
zlib
];
*/
/*
# note I found virtualbox services failed to start at boot (timeout after a long time) - how to fix?
# Said to be better performance with Libvirt/Qemu anyway: https://nixos.wiki/wiki/Virt-manager
# gnome.gnome-boxes or quickgui provide simple UIs
#
# create a disk image from .img with a command like this: `VBoxManage convertfromraw *.img easy-6.1.1-amd64.vdi`
virtualisation.virtualbox.host.enable = true;
users.extraGroups.vboxusers.members = [ "nixos" ];
virtualisation.virtualbox.guest.enable = true;
virtualisation.virtualbox.guest.draganddrop = true;
*/
# enable executing AppImage packages
# simplest method to use them requires fuse
# the only AppImage I tried still had a whole lot of shared library dependencies, so I had to use nix-ld to run it
programs.appimage.enable = true;
# like WINE but for Mac apps, and nowhere near as mature
# need to install this way to avoid having to run with sudo
programs.darling.enable = true; # for usage see see https://docs.darlinghq.org/installing-software.html
# new browser being written from scratch by serenityos founder
# programs.ladybird.enable = true; # needs a menu entry! font rendering is rubbish (antialiased)
# binary starts with a capital L; no menu entry
programs.java.enable = true; # packages like pdfsam install java but don't set JAVA_HOME; this does
# these settings may be necessary for some GTK programs (maybe just in a GTK desktop environment?)
# maybe gtk-decoration-layout in settings.ini doesn't work in wayland because it should be set with gsettings/dconf
#programs.dconf.enable = true; # gnome technology for saving settings
#services.dbus.packages = with pkgs; [ gnome3.dconf ];
programs = {
bash = {
shellInit = ''
export HISTCONTROL=ignoreboth:erasedups''; # we might want more settings e.g. see https://gist.github.com/domenko/9071879
# create some useful aliases for awkward or common commands
shellAliases = {
".." = "cd ..";
cf = "nano /etc/nixos/configuration.nix";
gwc = "gtk-wave-cleaner";
ladybird = "Ladybird";
l3 = "l3afpad";
nasc = "com.github.parnold_x.nasc";
paper-clip = "pdf-metadata-editor";
reb = "nixos-rebuild switch";
};
};
};
# can set themes like this
# environment.sessionVariables.GTK_THEME = "Generated";
#
# should we put this stuff inside the packages list ala https://github.com/chaorace/extest-nix/issues/1#issuecomment-1873424344
environment.sessionVariables.GDK_BACKEND = "x11"; #don't use wayland for GTK apps so that we can have normal window decorations
environment.sessionVariables.GTK_CSD = "0"; #disable client side window decorations
# environment.sessionVariables.LD_PRELOAD = "${pkgs.nur.repos.dukzcry.gtk3-nocsd}/lib/libgtk3-nocsd.so.0:$LD_PRELOAD";
environment.sessionVariables.LD_PRELOAD = "${pkgs.nur.repos.dukzcry.gtk3-nocsd}/lib/libgtk3-nocsd.so.0";
environment.sessionVariables.PAPERSIZE = "a4"; # libpaper setting; affects ghostscript; not controlled by `locale LC_PAPER`
#
# do we need this? shouldn't it be environment.sessionVariables ?
environment.extraInit = ''
export XDG_CONFIG_DIRS="/etc/xdg:$XDG_CONFIG_DIRS"
'';
# could use .source rather than .text to source from a file
environment.etc."xdg/gtk-3.0/settings.ini".text = ''
[Settings]
# gtk-can-change-accels = 1 # would be valid for gtk2
# sometimes works for nasc in x11 but not in wayland; can't reliably reproduce getting minimize and close
# looks like menu rather than icon doesn't work
# doesn't work for l3afpad
# let's just use X11 and disable client side decorations instead
#gtk-decoration-layout="icon:minimize,close"
# doesn't work in wayland
gtk-overlay-scrolling = false
# not sure if this is needed
gtk-primary-button-warps-slider = false
# gtk-application-prefer-dark-theme = true
'';
#TODO: create settings file for gtk2 (and gtk4?)
environment.systemPackages = with pkgs; [
# Do not forget to add an editor to edit configuration.nix! The Nano editor is installed by default via programs.nano.enable
# Console
atomicparsley # for youtube-dl to add a thumbnail
bat # cat with syntax highlighting etc
broot # A better way to navigate directories
# can preview image files in certain shells
# use with git: https://dystroy.org/blog/gg/
btop # system monitor
clifm # command line file manager; not a TUI
# I guess plugins like fzfnav would need to be configured: https://github.com/leo-arch/clifm/wiki/Advanced
fd # user-friendly alternative to find
ffmpeg-headless # for youtube-dl to splice video and audio
htop # process monitor
imagemagick
mc # midnight commander console file manager
# testing from paperde
#CuboCore.corepaint
#CuboCore.corepad
CuboCore.corerenamer # this one could be helpful; should compare with alternatives
#CuboCore.coreinfo
# Calculators
#lumina.lumina-calculator # lightweight gui calculator; I assume not arbitrary precision
nasc # advanced but buggy calculator for elementaryOS
speedcrunch # arbitrary precision calculator (QT)
#eva # cl calculator with syntax hilighting
#mini-calc # cl calculator that can give fraction answers (written in rust)
#rink # cl arbitrary precision calculator with unit conversion and unit definitions (written in rust)
# Web
#aura-browser # kde browser for bigscreen
firefox
google-chrome
yt-dlp # youtube-dl; command line video downloader
# Office
# install a modified local copy of this package
abiword # gtk word processor
#calligra # KDE office suite (formerly KOffice)
# a modified (updated) copy of freeoffice:
# https://github.com/NixOS/nixpkgs/pull/335639
(callPackage /home/nixos/devel/nixpkgs/pkgs/applications/office/softmaker/freeoffice.nix {}) # can I call this from my github instead?
#freeoffice # free version of softmaker-office; we temporarily override above for a newer package
#gnumeric # gtk spreadsheet
#libreoffice # TODO: there are multiple variants to choose from
#onlyoffice-bin_latest
# a modified (updated) copy of softmaker-office:
#(callPackage /home/nixos/devel/nixpkgs/pkgs/applications/office/softmaker/softmaker_office.nix {}) # can I call this from online instead?
#softmaker-office
#wpsoffice # formerly Kingsoft Office
#wpsoffice-cn # Chinese version?
treesheets # something different than spreadsheets
mate.mate-utils # mate-dictionary mate-disk-image-mounter mate-disk-usage-analyzer mate-panel-screenshot mate-screenshot mate-search-tool mate-system-log
#wordbook # dictionary from Gnome; doesn't play well with gtk3-nocsd
xfce.xfce4-dict # dictionary from XFCE
l3afpad # gtk3 version of leafpad
leafpad # very lightweight text editor
xfce.mousepad # lightweight text editor; does it bring in libxfce4ui automatically?
# TODO: create an overlay to build it with gtk2
# PDF
## at least three diff options; you may get better results online e.g. https://www.draftable.com/compare
# diffpdf
# diff-pdf # my old notes say "not as robust as diffpdf"
# pdfdiff # don't think I've tried this one
#
# k2pdfopt # reflow pdfs
# krop # automatically break pdfs into subpages to fit small screens (pyqt pypdf2)
# masterpdfeditor # sounds like version 5 adds a watermark unless you have a license
masterpdfeditor4
naps2 # Scan documents to PDF and more, as simply as possible; dotNET based
noteshrink # make optimised pdfs of scanned notes
# paper-clip # edit pdf metadata (vala/gtk4/poppler)
# pdf-quench # visual tool for cropping pdf files (uses pypdf and gtk)
# pdfannots # extract annotations to markdown
pdf4qt # the leading FOSS pdf viewer/editor
pdfmixtool # mix or reformat pdfs; see screenshot at https://github.com/bebenlebricolo/pdfmixtool (uses qt and qpdf)
# pdfmm # optimise file size; uses gs and zenity?
pdfsam-basic # pdf split and merge (excellent, but uses jave)
# pdfsandwich # ocr tool; how does it compare with naps2? I presume it is lighter.
pdfslicer # gtkmm & qpdf
pdftag # edit pdf metadata (vala/gtk3/poppler)
percollate # nodejs tool to turn web pages into pdf, html, etc
# tabula # extract tables from text pdfs; I think pdf4qt is better for this
# qpdf # command line / library
zathura # pdf viewer
# ebook readers (there are others and I didn't look at them all carefully)
# bookworm # elementary-os
# calibre
# foliate
# koreader # targets e-ink devices
# Multimedia
audacity # audio editor
#brasero # GNOME cd/dvd burner TODO: what is brasero-original?
#dvdstyler # DVD authoring (create menus)
freetube
gwc # gtk-wave-cleaner
kdePackages.k3b # KDE cd/dvd burner (KDE6)
kodi # TODO: review all the packages to find out what to install
#libsForQt5.k3b # KDE cd/dvd burner (KDE5)
#mhwavedit # lightweight audio editor
vlc # powerful media player (QT)
#xfce.xfburn # XFCD cd/dvd burner
# TODO: tag editors; see what the best options are now e.g. https://wiki.archlinux.org/title/List_of_applications/Multimedia#Audio_tag_editors
# TODO: what are the best / most mainstream video editors?
# Programming
firebase-tools
gdbHostCpuOnly # I presume this is smaller than regular gdb
(git.override { guiSupport = true; }) # git with gitk enabled
# kate # kde automatically comes with plasma, and this package likely conflicts
kompare # kde diff gui
xxdiff # qt diff gui
# System
# override darling package (see programs.darling.enable), adding these to CMAKEFLAGS
# "-DCOMPONENT=jsc_webkit_common"
# "-DCOMPONENT=jsc"
# but it didn't seem to work!
(callPackage /home/nixos/devel/nixpkgs/pkgs/applications/emulators/darling/default.nix {})
darling-dmg #not sure how this package actually makes things easier, except it gives you another way to access a dmg if hdiutil is broken and says "input/output error" when you try to access files in it.
distrobox # frontend for docker/podman/lilipod; can use any OCI images from docker-hub, quay.io, or any registry of your choice
#dvdplusrwtools # growisofs # only needed to specify this when I had the wrong version of k3b
file # (could alternatively get from toybox)
fuse # required to run programs packaged as appimage in the most simple way (or is it fuse3?)
#gnome.dconf-editor # see note above about programs.dconf.enable
gvfs # enables things like trash in file managers like pcmanfm
#hardinfo # Display information about your hardware and operating system (gtk2)
#kdePackages.bluedevil # maybe we don't need to enable this manually?
kdePackages.kdeconnect-kde
kdePackages.libksysguard # should be able to launch with Ctrl-Esc? Not working?
killall
libpaper # paper sizes
#libsForQt5.plasma-bigscreen
#lilipod # lightweight alternative to docker or podman
netcat-gnu # (could alternatively get netcat from toybox)
nix-index # find which package provides a file
nix-search-cli # search for packages; alternatively use `nix repl` or `nix search` (experimental)
# see https://nixos.wiki/wiki/Searching_packages
#nix-software-center # gui from snowflake project; need to enable separate repository to install it; see above
nur.repos.dukzcry.gtk3-nocsd
pciutils # needed for a feature in KDE info centre
#treesize # disk usage viewer # TODO: make a package for this
wget
#wine # run windows programs
#
## if we want to create the old gtk lxde; but can we bring them all in with an old option from somewhere?
#openbox
#lxpanel
#lxtask
#pcmanfm # file manager; TODO: build with gtk2
#xarchiver
#
## clipboard managers
## note KDE has one built-in; unfortunately it doesn't handle the primary selection
#clapboard # wayland clipboard manager
#cliphist # wayland clipboard manager with support for multimedia
#clipit # lightweight gtk clipboard manager
# an unavailable option we could look at packaging is diodon
#clipman # wayland clipboard manager
#lxqt.qlipper # clipboard manager does it come by default with lxqt?
#parcellite # lightweight gtk clipboard manager
#
## partition tools
gparted # disk partition manager
kdePackages.partitionmanager # disk partition manager; note this does not use libparted and is traditional considered less stable than gparted
#libsForQt5.partitionmanager # disk partition manager
#
## password managers - should we look for some non-KDE options?
#libsForQt5.kwalletmanager #password manager
#kdePackages.kwalletmanager #password manager
# Painting and image editing
#aseprite # Animated sprite editor & pixel art tool
#azpainter # xlib
#deepin.deepin-draw # from deepin desktop environment
#drawing # simple app intended for Gnome or Pantheon (ElementaryOS)
#drawpile # A collaborative drawing program that allows multiple users to sketch on the same canvas simultaneously
#flameshot # another kde screenshot and markup tool
#gimp-with-plugins
#grafx2 # specialist 256-colour painting program
krita # kde image editor
krita-plugin-gmic
#ksnip # screenshot tool; not needed as kde comes with spectacle
#lazpaint # written in Free Pascal
#mypaint
#mypaint-brushes # might not need to specify this
#mypaint-brushes1 # might not need to specify this
#opentoonz # note this package is marked as insecure
#pinta # modelled after Paint.NET; uses GTK#
# Vector Drawing
#ipe # creating pdf drawings
# infinite canvas notetaking apps
#lorien
#rnote
#pizarra
# Bible software
bibletime
##currently broken
#openlp # Is openlpFULL any different?
xiphos
# spellcheck (otherwise only Hebrew is available)
#(aspellWithDicts (dicts: with dicts; [ en en-computers en-science ]))
# I presume the above is the same as doing this:
#aspell
#aspellDicts.en
#aspellDicts.en-computers
#aspellDicts.en-science
# we'll use hunspell since aspell dictionaries don't seem to work in apps like l3afpad using enchant
# gspell-WARNING **: 12:33:54.802: Impossible to create an Enchant dictionary for the language code 'en_AU'
hunspellDicts.en_GB-ise # not sure how to get spellcheck in abiword
kdePackages.sonnet # spellchecking in KDE apps (KDE6)
# consider trying services.languagetool.enable
];
}
# TODO: find out what is bringing in all this junk: nix-store -q --graph /run/current-system|grep gtk4
# why does this give freeoffice 2021 stuff: nix-store -q --graph /run/current-system|grep freeoffice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment