diff --git a/common/default.nix b/common/default.nix index fc54ad9..5fbf46a 100644 --- a/common/default.nix +++ b/common/default.nix @@ -1,20 +1,25 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let inputs = config.inputInjection.flake-inputs; unstable = inputs.nixos-unstable; - in { - imports = - [ - ./packages.nix - ./nitrokey.nix - ]; + imports = [ + ./packages.nix + ./nitrokey.nix + ./nix-settings.nix + ./upgrade-diff.nix + ./guest.nix + ]; services.davfs2.enable = true; - # exfat support #boot.extraModulePackages = [ config.boot.kernelPackages.exfat-nofuse ]; @@ -37,18 +42,22 @@ in # Some programs need SUID wrappers, can be configured further or are # started in user sessions. - programs.bash.enableCompletion = true; - programs.wireshark = - { - enable = true; - package = pkgs.wireshark; - }; + programs.bash.completion.enable = true; + programs.wireshark = { + enable = true; + package = pkgs.wireshark; + }; programs.adb.enable = true; programs.mtr.enable = true; # programs.gnupg.agent = { enable = true; enableSSHSupport = true; }; + programs.ausweisapp = { + enable = true; + openFirewall = true; + }; + # List services that you want to enable: # Enable the OpenSSH daemon. @@ -59,119 +68,137 @@ in # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ]; - networking.firewall.allowedTCPPortRanges = [{ from = 1714; to = 1764; }]; - networking.firewall.allowedUDPPortRanges = [{ from = 1714; to = 1764; }]; # for KDE connect + networking.firewall.allowedTCPPortRanges = [ + { + from = 1714; + to = 1764; + } + ]; + networking.firewall.allowedUDPPortRanges = [ + { + from = 1714; + to = 1764; + } + ]; # for KDE connect # FIXME: kdeconnect module # Or disable the firewall altogether. # networking.firewall.enable = false; - networking.networkmanager = { + networking.networkmanager = { enable = true; # FIXME: move into own file, use SOPS for secrets ensureProfiles.profiles = { - "37C3" = { - connection = { - id = "37C3"; - type = "wifi"; - interface-name = "wlan0"; - }; - wifi = { - mode = "infrastructure"; - ssid = "37C3"; - }; - wifi-security = { - auth-alg = "open"; - key-mgmt = "wpa-eap"; - }; - "802-1x" = { - anonymous-identity = "37C3"; - eap = "ttls;"; - identity = "37C3"; - password = "37C3"; - phase2-auth = "pap"; - altsubject-matches = "DNS:radius.c3noc.net"; - ca-cert = "${builtins.fetchurl { - url = "https://letsencrypt.org/certs/isrgrootx1.pem"; - sha256 = "sha256:1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92"; - }}"; - }; - ipv4 = { - method = "auto"; - }; - ipv6 = { - addr-gen-mode = "default"; - method = "auto"; + "37C3" = { + connection = { + id = "37C3"; + type = "wifi"; + interface-name = "wlan0"; + }; + wifi = { + mode = "infrastructure"; + ssid = "37C3"; + }; + wifi-security = { + auth-alg = "open"; + key-mgmt = "wpa-eap"; + }; + "802-1x" = { + anonymous-identity = "37C3"; + eap = "ttls;"; + identity = "37C3"; + password = "37C3"; + phase2-auth = "pap"; + altsubject-matches = "DNS:radius.c3noc.net"; + ca-cert = "${builtins.fetchurl { + url = "https://letsencrypt.org/certs/isrgrootx1.pem"; + sha256 = "sha256:1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92"; + }}"; + }; + ipv4 = { + method = "auto"; + }; + ipv6 = { + addr-gen-mode = "default"; + method = "auto"; + }; }; }; }; -}; services.avahi.enable = true; # Enable CUPS to print documents. - services.printing = - { - enable = true; - drivers = [ pkgs.hplip ]; - }; - # scanners - hardware.sane = - { - enable = true; - extraBackends = [ pkgs.hplip ]; - }; - - # Enable sound. - hardware.pulseaudio = { + services.printing = { enable = true; - # decouple pulseaudio application and sink volumes - daemon.config = { flat-volumes = "no"; }; - # C3D2 hq music - zeroconf.discovery.enable = true; - zeroconf.publish.enable = true; + drivers = [ pkgs.hplip ]; + }; + # scanners + hardware.sane = { + enable = true; + extraBackends = [ pkgs.hplip ]; }; - # Bluetooth hardware.bluetooth = { enable = true; settings.General.Disable = "Headset"; # disable headset profile }; - hardware.pulseaudio = { - package = pkgs.pulseaudioFull; - }; - # FIXME: at some point, hide GUI and sound (desktop vs. server) behind an option # Enable the X11 windowing system. - services.xserver.enable = true; - services.xserver.layout = "de"; - services.xserver.xkbOptions = "eurosign:e"; + services.xserver = { + enable = true; + xkb.layout = "de"; + xkb.options = "eurosign:e"; + }; # Enable touchpad support. - services.xserver.libinput.enable = true; + services.libinput.enable = true; # while libinput also supports graphic tablets, enable more-specific wacom driver services.xserver.wacom.enable = true; # Enable the KDE Desktop Environment. - services.xserver.displayManager.sddm.enable = true; - services.xserver.desktopManager.plasma5.enable = true; + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + services.desktopManager.plasma6.enable = true; + # TODO: move out into a plasma.nix module + programs.kde-pim = { + enable = true; + kmail = true; + kontact = true; + merkuro = true; + }; + # enable wayland for Chromium and Electron + environment.sessionVariables.NIXOS_OZONE_WL = "1"; # dconf required for several Gnome applications programs.dconf.enable = true; - - programs.firefox.enable = true; # enables support for automatically setting additionsl nativeMessagingHosts + + programs.firefox.enable = true; # enables support for automatically setting additionsl nativeMessagingHosts # Flatpak support services.flatpak.enable = true; - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ]; + xdg.portal.extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde ]; # Define a user account. Don't forget to set a password with `passwd`. users.users.spiollinux = { isNormalUser = true; uid = 1000; - extraGroups = [ "vboxusers" "wheel" "networkmanager" "scanner" "lp" "wireshark" "dialout" "cdrom" "input" "adbusers" ]; + extraGroups = [ + "vboxusers" + "wheel" + "networkmanager" + "scanner" + "lp" + "wireshark" + "dialout" + "cdrom" + "input" + "adbusers" + ]; shell = pkgs.zsh; }; @@ -184,11 +211,10 @@ in nixpkgs.config.whitelistedLicenses = [ pkgs.lib.licenses.virtualbox-puel ]; users.extraGroups.vboxusers.members = [ "spiollinux" ]; - programs.zsh = - { - enable = true; - autosuggestions.enable = true; - }; + programs.zsh = { + enable = true; + autosuggestions.enable = true; + }; # profile sync daemon services.psd.enable = true; @@ -202,23 +228,9 @@ in # Enable all sysrq functions (useful to recover from some issues): boot.kernel.sysctl."kernel.sysrq" = 1; # NixOS default: 16 (only the sync command) - nix = { - # expose all flake inputs through nix Path and registry - registry = (lib.mapAttrs (_: value: { flake = value; }) inputs) // { - nixpkgs.flake = inputs.nixpkgs; - }; - nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; - # keep build-time deps around for offline-rebuilding - settings = { - # keep around all inputs necessary for offline-rebuilding the system - keep-outputs = true; - keep-derivations = true; - trusted-users = [ "spiollinux" ]; - experimental-features = [ "nix-command" "flakes" "repl-flake" ]; - # use all cores for building - cores = 0; - }; - }; + nix.package = pkgs.lix; + + nix.settings.trusted-users = [ "spiollinux" ]; # override tmpdir for daemon #systemd.services.nix-daemon.environment.TMPDIR = "/var/tmp"; @@ -237,7 +249,8 @@ in # ]; # } #]; - programs.ssh.knownHosts."build01.nix-community.org".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIElIQ54qAy7Dh63rBudYKdbzJHrrbrrMXLYl7Pkmk88H"; + programs.ssh.knownHosts."build01.nix-community.org".publicKey = + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIElIQ54qAy7Dh63rBudYKdbzJHrrbrrMXLYl7Pkmk88H"; # package debugging # programs.sysdig.enable = true; @@ -255,5 +268,5 @@ in # stop NetworkManager from managing virtual interfaces networking.networkmanager.unmanaged = [ "interface-name:ve-*" ]; - + services.dbus.implementation = "broker"; } diff --git a/common/guest.nix b/common/guest.nix new file mode 100644 index 0000000..2084b97 --- /dev/null +++ b/common/guest.nix @@ -0,0 +1,65 @@ +{ + config, + lib, + system, + ... +}: +let + inputs = config.inputInjection.flake-inputs; +in +{ + # interesting: this causes an infinite recursion + #imports = [ config.inputInjection.flake-inputs.home-manager.nixosModules.home-manager ]; + + options.schmittlauch.guestUser.enable = lib.options.mkEnableOption "Provide a guest user account"; + + config = lib.mkIf config.schmittlauch.guestUser.enable { + users.extraUsers.gast = { + isNormalUser = true; + group = "gast"; + hashedPassword = "$y$j9T$pPCjU8ZvVYo0aY4jtrHPj1$NxUWOP/YTcqJ1PYaP1Hy5MwTeDcNjg0k369R5rE5M48"; + }; + users.groups.gast = { }; + # a basic home-manager configuration to share installed packages of other accounts + # reason: keeping a separate config checkout for guests and requiring them to run + # their own `home-manager` instance does not make sense. + home-manager = + let + gast = config.users.extraUsers.gast; + in + { + useGlobalPkgs = false; # to allow usage of home-level overlays + # FIXME: possibly expose home modules through flake outputs instead of brittle path traversals + users.gast = { + imports = [ + ../home/modules/packages.nix + ]; + home = { + username = gast.name; + homeDirectory = gast.home; + stateVersion = "24.05"; + }; + schmittlauch = { + packages = { + graphics = true; + multimedia = true; + nixHelpers = true; + devTools = true; + pythonTools = true; + games = true; + desktopLinux = true; + kde = true; + }; + }; + + }; + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + extraSpecialArgs = { + inherit inputs system; + }; + + }; + + }; +} diff --git a/common/nitrokey.nix b/common/nitrokey.nix index dc6ed75..40457d1 100644 --- a/common/nitrokey.nix +++ b/common/nitrokey.nix @@ -1,11 +1,13 @@ -{ pkgs, lib, ...}: +{ pkgs, lib, ... }: { -hardware.nitrokey.enable = true; -environment.systemPackages = [ pkgs.pynitrokey ]; -nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "nrfutil" - "pc-ble-driver-py" - "pc-ble-driver" - "pypemicro" -]; + hardware.nitrokey.enable = true; + environment.systemPackages = [ pkgs.pynitrokey ]; + nixpkgs.config.allowUnfreePredicate = + pkg: + builtins.elem (lib.getName pkg) [ + "nrfutil" + "pc-ble-driver-py" + "pc-ble-driver" + "pypemicro" + ]; } diff --git a/common/nix-settings.nix b/common/nix-settings.nix new file mode 100644 index 0000000..caa16f9 --- /dev/null +++ b/common/nix-settings.nix @@ -0,0 +1,38 @@ +# needs to be kept compatible to both NixOS and nix-darwin +{ + config, + pkgs, + lib, + ... +}: + +let + inputs = config.inputInjection.flake-inputs; + unstable = inputs.nixos-unstable; +in +{ + nix = { + # expose all flake inputs through nix Path and registry + registry = (lib.mapAttrs (_: value: { flake = value; }) inputs) // { + nixpkgs.flake = inputs.nixpkgs; + }; + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; + }; + nix.settings = builtins.mapAttrs (_: lib.mkDefault) { + # keep around all inputs necessary for offline-rebuilding the system + keep-outputs = true; + keep-derivations = true; + trusted-users = [ "spiollinux" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; + # use all cores for building + cores = 0; + }; + # TODO: manage access token with sops instead of manual deployment + # permissions: needs to be readable by the user invoking nix and root (for nix daemon) + nix.extraOptions = '' + !include /etc/nix/secrets.conf + ''; +} diff --git a/common/packages.nix b/common/packages.nix index d507b42..ec4f22b 100644 --- a/common/packages.nix +++ b/common/packages.nix @@ -1,8 +1,18 @@ -{ lib, pkgs, config, ... }: +{ + lib, + pkgs, + config, + ... +}: -{ +{ # take overlays from flake nixpkgs.overlays = lib.attrValues config.inputInjection.flake-inputs.self.overlays; + nixpkgs.config.permittedInsecurePackages = [ + # (temporarily) permit the usage of libolm + "olm-3.2.16" + ]; + # List packages installed in system profile. environment.systemPackages = with pkgs; [ wget @@ -30,7 +40,7 @@ exfat iotop cifs-utils - dstat + dool lsof macchanger borgbackup @@ -38,52 +48,12 @@ # for debugging WLAN failures: ethtool trace-cmd - + # NetworkManager stuff networkmanager-openconnect networkmanager-vpnc networkmanager-openvpn - plasma5Packages.kdeGear.akonadi-mime # for KOrganizer - ] - ++ (with plasma5Packages; with kdeGear; [ - #akonadi - #akonadi-calendar - #akonadi-contacts - #akonadi-import-wizard - #akonadi-mime - #akonadi-notes - #akonadi-search - #akonadiconsole - #akregator - #kaddressbook - #kalarm - #kalarmcal - #kcalutils - #kcontacts - #kdav - #kdepim-addons - - #kdepim-runtime - #kidentitymanagement - #kldap - #kmail - #kmailtransport - #kmbox - #kmime - #kontact - #kontactinterface - #korganizer - #kpimtextedit - #libkdepim - #libksieve - #mailcommon - #messagelib - #pimcommon - #pim-sieve-editor - # for some Flatpak packkages accountsservice - ]); + ]; } - - diff --git a/common/pipewire.nix b/common/pipewire.nix new file mode 100644 index 0000000..1fb3c0e --- /dev/null +++ b/common/pipewire.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: +{ + # rtkit is optional but recommended + 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; + + wireplumber.configPackages = [ + (pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" '' + bluez_monitor.properties = { + ["bluez5.enable-sbc-xq"] = true, + ["bluez5.enable-msbc"] = true, + ["bluez5.enable-hw-volume"] = true, + ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" + } + '') + ]; + }; + environment.systemPackages = [ pkgs.easyeffects ]; +} diff --git a/common/pulseaudio.nix b/common/pulseaudio.nix new file mode 100644 index 0000000..7323b57 --- /dev/null +++ b/common/pulseaudio.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +{ + # Enable sound. + services.pulseaudio = { + enable = true; + package = pkgs.pulseaudioFull; + # decouple pulseaudio application and sink volumes + daemon.config = { + flat-volumes = "no"; + }; + # C3D2 hq music + zeroconf.discovery.enable = true; + zeroconf.publish.enable = true; + }; + services.pipewire.enable = false; # conflicts otherwise +} diff --git a/common/upgrade-diff.nix b/common/upgrade-diff.nix new file mode 100644 index 0000000..a66725f --- /dev/null +++ b/common/upgrade-diff.nix @@ -0,0 +1,9 @@ +# MIT Jörg Thalheim - https://github.com/Mic92/dotfiles/blob/c6cad4e57016945c4816c8ec6f0a94daaa0c3203/nixos/modules/upgrade-diff.nix +{ pkgs, ... }: +{ + system.activationScripts.diff = '' + if [[ -e /run/current-system ]]; then + ${pkgs.nix}/bin/nix store diff-closures /run/current-system "$systemConfig" + fi + ''; +} diff --git a/darwin/configuration.nix b/darwin/configuration.nix new file mode 100644 index 0000000..307836f --- /dev/null +++ b/darwin/configuration.nix @@ -0,0 +1,52 @@ +{ config, pkgs, ... }: + +{ + imports = [ ../common/nix-settings.nix ]; + nix = { + enable = true; + settings = { + trusted-users = [ + "os" + "@admin" + ]; # @admin for linux-builder + substituters = [ + "https://s3.whq.fcio.net/hydra" + "https://hydra.flyingcircus.io" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "flyingcircus.io-1:Rr9CwiPv8cdVf3EQu633IOTb6iJKnWbVfCC8x8gVz2o=" + ]; + }; + }; + + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = [ pkgs.vim ]; + + # Use a custom configuration.nix location. + # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix + # environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix"; + + # Create /etc/bashrc that loads the nix-darwin environment. + programs.zsh.enable = true; # default shell on catalina + + # system-wide SSH configuration, used by nix-daemon for remote builders + + # show hidden files + system.primaryUser = "os"; + system.defaults.NSGlobalDomain.AppleShowAllFiles = true; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 4; + nixpkgs.hostPlatform = "aarch64-darwin"; + + # local vm-backed linux builder as background service + nix.linux-builder = { + enable = true; + ephemeral = true; + maxJobs = 3; + }; + +} diff --git a/flake.lock b/flake.lock index 7aff31c..57216c2 100644 --- a/flake.lock +++ b/flake.lock @@ -1,30 +1,12 @@ { "nodes": { "crane": { - "inputs": { - "flake-compat": [ - "lanzaboote", - "flake-compat" - ], - "flake-utils": [ - "lanzaboote", - "flake-utils" - ], - "nixpkgs": [ - "lanzaboote", - "nixpkgs" - ], - "rust-overlay": [ - "lanzaboote", - "rust-overlay" - ] - }, "locked": { - "lastModified": 1681177078, - "narHash": "sha256-ZNIjBDou2GOabcpctiQykEQVkI8BDwk7TyvlWlI4myE=", + "lastModified": 1731098351, + "narHash": "sha256-HQkYvKvaLQqNa10KEFGgWHfMAbWBfFp+4cAgkut+NNE=", "owner": "ipetkov", "repo": "crane", - "rev": "0c9f468ff00576577d83f5019a66c557ede5acf6", + "rev": "ef80ead953c1b28316cc3f8613904edc2eb90c28", "type": "github" }, "original": { @@ -36,11 +18,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -57,11 +39,11 @@ ] }, "locked": { - "lastModified": 1680392223, - "narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=", + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", "type": "github" }, "original": { @@ -70,21 +52,24 @@ "type": "github" } }, - "flake-utils": { + "flake-parts_2": { "inputs": { - "systems": "systems" + "nixpkgs-lib": [ + "nur", + "nixpkgs" + ] }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "hercules-ci", + "repo": "flake-parts", "type": "github" } }, @@ -97,11 +82,11 @@ ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -117,16 +102,16 @@ ] }, "locked": { - "lastModified": 1706981411, - "narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=", + "lastModified": 1748665073, + "narHash": "sha256-RMhjnPKWtCoIIHiuR9QKD7xfsKb3agxzMfJY8V9MOew=", "owner": "nix-community", "repo": "home-manager", - "rev": "652fda4ca6dafeb090943422c34ae9145787af37", + "rev": "282e1e029cb6ab4811114fc85110613d72771dea", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-23.11", + "ref": "release-25.05", "repo": "home-manager", "type": "github" } @@ -136,50 +121,33 @@ "crane": "crane", "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1682802423, - "narHash": "sha256-Fb5TeRTdvUlo/5Yi2d+FC8a6KoRLk2h1VE0/peMhWPs=", + "lastModified": 1737639419, + "narHash": "sha256-AEEDktApTEZ5PZXNDkry2YV2k6t0dTgLPEmAZbnigXU=", "owner": "nix-community", "repo": "lanzaboote", - "rev": "64b903ca87d18cef2752c19c098af275c6e51d63", + "rev": "a65905a09e2c43ff63be8c0e86a93712361f871e", "type": "github" }, "original": { "owner": "nix-community", - "ref": "v0.3.0", + "ref": "v0.4.2", "repo": "lanzaboote", "type": "github" } }, - "logseq-fix-nixpkgs": { - "locked": { - "lastModified": 1707316439, - "narHash": "sha256-3dVL8Wk7ECMiQrHVO1ys7FawMLo7iyQJyKG+aie1eaE=", - "owner": "schmittlauch", - "repo": "nixpkgs", - "rev": "6f1431c8e2dfdfdfe25837c2cc94857900153cab", - "type": "github" - }, - "original": { - "owner": "schmittlauch", - "ref": "backport2311-logseq-0.10.5", - "repo": "nixpkgs", - "type": "github" - } - }, "mysecrets": { "flake": false, "locked": { - "lastModified": 1618507998, - "narHash": "sha256-i5ph7JlFh8eFEnQehQaKj2SGG7WLE0DPO8R81ERGCZ0=", + "lastModified": 1722419972, + "narHash": "sha256-7gKcSKTu7Z6sswIK4QuMHtDbpKMs09b6w7uFjJJyAIA=", "ref": "refs/heads/master", - "rev": "068a4759e72948284c3de85d20a780723278f8b8", - "revCount": 2, + "rev": "c725f810bb9a43c213fcf964f036dd0c64b6ba04", + "revCount": 5, "type": "git", "url": "ssh://gitea@git.orlives.de:2342/schmittlauch/home-manager_secrets.git" }, @@ -188,13 +156,34 @@ "url": "ssh://gitea@git.orlives.de:2342/schmittlauch/home-manager_secrets.git" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748373722, + "narHash": "sha256-qi6aDGP2W6GyAUNEhg+slQWEpUiJ8LNIrQkmxHpzadI=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "75b99daa12b1fffd646d6c3cf13b06f1fa5cef63", + "type": "github" + }, + "original": { + "owner": "LnL7", + "ref": "nix-darwin-25.05", + "repo": "nix-darwin", + "type": "github" + } + }, "nixos-hardware": { "locked": { - "lastModified": 1707211557, - "narHash": "sha256-LTKTzZ6fM5j8XWXf51IMBzDaOaJg9kYWLUZxoIhzRN8=", + "lastModified": 1748942041, + "narHash": "sha256-HEu2gTct7nY0tAPRgBtqYepallryBKR1U8B4v2zEEqA=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "6e5cc385fc8cf5ca6495d70243074ccdea9f64c7", + "rev": "fc7c4714125cfaa19b048e8aaf86b9c53e04d853", "type": "github" }, "original": { @@ -206,11 +195,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1707956935, - "narHash": "sha256-ZL2TrjVsiFNKOYwYQozpbvQSwvtV/3Me7Zwhmdsfyu4=", + "lastModified": 1748693115, + "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a4d4fe8c5002202493e87ec8dbc91335ff55552c", + "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc", "type": "github" }, "original": { @@ -222,11 +211,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1682741954, - "narHash": "sha256-RPZxzRu8XU0YD2WeYUFYzJy5yAvWUsxkuK+zWw+6WVk=", + "lastModified": 1731919951, + "narHash": "sha256-vOM6ETpl1yu9KLi/icTmLJIPbbdJCdAVYUXZceO/Ce4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "373e9eb4c42b2fc0611d794de5ea715a35d72393", + "rev": "04386ac325a813047fc314d4b4d838a5b1e3c7fe", "type": "github" }, "original": { @@ -238,43 +227,64 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1678872516, - "narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=", + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-22.11", + "ref": "nixos-24.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1707978831, - "narHash": "sha256-UblFdWQ2MMZNzD9C/w8+7RjAJ2QIbebbzHUniQ/a44o=", + "lastModified": 1748889542, + "narHash": "sha256-Hb4iMhIbjX45GcrgOp3b8xnyli+ysRPqAgZ/LZgyT5k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c68a9fc85c2cb3a313be6ff40511635544dde8da", + "rev": "10d7f8d34e5eb9c0f9a0485186c1ca691d2c5922", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.11", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1748693115, + "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, "nur": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs_3", + "treefmt-nix": "treefmt-nix" + }, "locked": { - "lastModified": 1707071465, - "narHash": "sha256-sp+lgTl440Ex3v8rB6hspMJhg5uuGVfO1LRba/a8kSY=", + "lastModified": 1748973087, + "narHash": "sha256-ZN0XKKdCBC9eLeog7qYhfGPbajkPtQPdlxp/dhwONw4=", "owner": "nix-community", "repo": "NUR", - "rev": "abe9eb6d605d624e121d4f84749b47f7816f1686", + "rev": "90add46380908ba4395f5f1dfec84224a3b0d4b9", "type": "github" }, "original": { @@ -289,10 +299,6 @@ "lanzaboote", "flake-compat" ], - "flake-utils": [ - "lanzaboote", - "flake-utils" - ], "gitignore": "gitignore", "nixpkgs": [ "lanzaboote", @@ -301,11 +307,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1681413034, - "narHash": "sha256-/t7OjNQcNkeWeSq/CFLYVBfm+IEnkjoSm9iKvArnUUI=", + "lastModified": 1731363552, + "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "d3de8f69ca88fb6f8b09e5b598be5ac98d28ede5", + "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", "type": "github" }, "original": { @@ -318,32 +324,29 @@ "inputs": { "home-manager": "home-manager", "lanzaboote": "lanzaboote", - "logseq-fix-nixpkgs": "logseq-fix-nixpkgs", "mysecrets": "mysecrets", + "nix-darwin": "nix-darwin", "nixos-hardware": "nixos-hardware", "nixos-unstable": "nixos-unstable", "nixpkgs": "nixpkgs_2", "nur": "nur", + "treefmt-nix": "treefmt-nix_2", "utils": "utils" } }, "rust-overlay": { "inputs": { - "flake-utils": [ - "lanzaboote", - "flake-utils" - ], "nixpkgs": [ "lanzaboote", "nixpkgs" ] }, "locked": { - "lastModified": 1682129965, - "narHash": "sha256-1KRPIorEL6pLpJR04FwAqqnt4Tzcm4MqD84yhlD+XSk=", + "lastModified": 1731897198, + "narHash": "sha256-Ou7vLETSKwmE/HRQz4cImXXJBr/k9gp4J4z/PF8LzTE=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "2c417c0460b788328220120c698630947547ee83", + "rev": "0be641045af6d8666c11c2c40e45ffc9667839b5", "type": "github" }, "original": { @@ -367,31 +370,57 @@ "type": "github" } }, - "systems_2": { + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nur", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "lastModified": 1733222881, + "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "49717b5af6f80172275d47a418c9719a31a78b53", "type": "github" }, "original": { - "owner": "nix-systems", - "repo": "default", + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748243702, + "narHash": "sha256-9YzfeN8CB6SzNPyPm2XjRRqSixDopTapaRsnTpXUEY8=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "1f3f7b784643d488ba4bf315638b2b0a4c5fb007", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", "type": "github" } }, "utils": { "inputs": { - "systems": "systems_2" + "systems": "systems" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bcfb9b6..20809d2 100644 --- a/flake.nix +++ b/flake.nix @@ -2,96 +2,207 @@ description = "NixOS system flake"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - logseq-fix-nixpkgs.url = "github:schmittlauch/nixpkgs/backport2311-logseq-0.10.5"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; home-manager = { - url = "github:nix-community/home-manager/release-23.11"; + url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; lanzaboote = { - url = "github:nix-community/lanzaboote/v0.3.0"; + url = "github:nix-community/lanzaboote/v0.4.2"; # deliberately do _not_ follow the nixpkgs input here, because paranoia and test coverage }; utils.url = "github:numtide/flake-utils"; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-darwin = { + url = "github:LnL7/nix-darwin/nix-darwin-25.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - nur.url = "github:nix-community/NUR"; + nur.url = "github:nix-community/NUR"; # TODO: possible make this a flake as well mysecrets = { flake = false; url = "git+ssh://gitea@git.orlives.de:2342/schmittlauch/home-manager_secrets.git"; }; - }; - outputs = - { self, nixpkgs, nur, lanzaboote, utils, home-manager, ... }@inputs: - let - # FIXME: allow different systems - systems = utils.lib.system; - # necessary to make the top-level inputs available to system configuration - # inspired by https://jade.fyi/blog/flakes-arent-real/ - inputInjection = {pkgs, lib, ...}: { - options.inputInjection = lib.mkOption { - type = with lib.types; attrsOf unspecified; - default = {}; - }; - config.inputInjection = { - flake-inputs = inputs; - }; - }; - defaultModules = system: [ - inputInjection - ]; - mkSystem = system: extraModules: - nixpkgs.lib.nixosSystem rec { - modules = (defaultModules system) ++ extraModules; - inherit system; - specialArgs = {inherit system;}; - }; - mkHomeManager = confName: user: system: # unfortunately, home-manager configs are still system-specific - # FIXME: this is thus still linux-x86_64 specific - home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.${system}; - modules = [ - { - imports = [ - nur.hmModules.nur - # TODO: $name can be utilised to conditionally load other config files - ./home/home.nix - ]; - # extends the home config - home.username = user; - home.homeDirectory = "/home/${user}"; - } - ]; - # Optionally use extraSpecialArgs - # to pass through arguments to home.nix - extraSpecialArgs = { - inherit inputs system; - }; - }; - in - { - overlays.default = import ./packages; - nixosConfigurations = { - thinknix = mkSystem systems.x86_64-linux [ ./hosts/thinknix inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t440s lanzaboote.nixosModules.lanzaboote ]; - framenix = mkSystem systems.x86_64-linux [ ./hosts/framenix inputs.nixos-hardware.nixosModules.framework-13-7040-amd lanzaboote.nixosModules.lanzaboote ]; - }; - homeConfigurations.spiollinux = mkHomeManager "spiollinux" "spiollinux" systems.x86_64-linux; - } // utils.lib.eachDefaultSystem(system: + outputs = + { + self, + nixpkgs, + nur, + lanzaboote, + utils, + home-manager, + treefmt-nix, + nix-darwin, + ... + }@inputs: let - nixpkgs = import inputs.nixpkgs { - inherit system; - overlays = nixpkgs.lib.attrValues self.overlays; + # FIXME: allow different systems + systems = utils.lib.system; + + # ability to extend nixpkgs with patches, e.g. from PRs or staging. See https://ertt.ca/nix/patch-nixpkgs/ + mkNixpkgs-patched = + system: + (import nixpkgs { inherit system; }).applyPatches { + name = "nixpkgs-patched"; + src = nixpkgs; + patches = [ ./patches/keepassxc-fix-darwin-build.patch ]; + }; + + # necessary to make the top-level inputs available to system configuration + # inspired by https://jade.fyi/blog/flakes-arent-real/ + inputInjection = + { pkgs, lib, ... }: + { + options.inputInjection = lib.mkOption { + type = with lib.types; attrsOf unspecified; + default = { }; + }; + config.inputInjection = { + flake-inputs = inputs; + }; + }; + defaultModules = system: [ + inputInjection + + # for some reason, `imports`-ing the home-manager module via inputInjection + # from a sub-module causes infinite recursion, so importing it here instead + home-manager.nixosModules.home-manager + ]; + mkSystem = + system: extraModules: + nixpkgs.lib.nixosSystem rec { + modules = (defaultModules system) ++ extraModules; + inherit system; + specialArgs = { + inherit system; + }; + }; + mkHomeManager = + confName: user: system: # unfortunately, home-manager configs are still system-specific + home-manager.lib.homeManagerConfiguration { + pkgs = import (mkNixpkgs-patched system) { inherit system; }; + modules = [ + { + imports = [ + ./home/common.nix + ./home/${confName}.nix + ]; + # extends the home config + home.username = user; + } + ]; + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + extraSpecialArgs = { + inherit inputs system; + }; + }; + treefmtConf = + { pkgs, ... }: + { + projectRootFile = "flake.nix"; + programs.nixfmt.enable = true; + }; + in + { + overlays.default = import ./packages; + nixosConfigurations = { + thinknix = mkSystem systems.x86_64-linux [ + ./hosts/thinknix + inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t440s + lanzaboote.nixosModules.lanzaboote + ]; + framenix = mkSystem systems.x86_64-linux [ + ./hosts/framenix + inputs.nixos-hardware.nixosModules.framework-13-7040-amd + lanzaboote.nixosModules.lanzaboote + ]; }; - pkgs = inputs.nixpkgs.legacyPackages.${system}; - in { - devShells.default = pkgs.mkShell { - buildInputs = []; + darwinConfigurations."OS-MacBook-Pro" = nix-darwin.lib.darwinSystem { + modules = [ + ./darwin/configuration.nix + inputInjection + + ]; }; - # expose nixpkgs with overlay; TODO: figure out role of config - #legacyPackages = nixpkgs; - }); + homeConfigurations = { + spiollinux-desktop = mkHomeManager "desktop" "spiollinux" systems.x86_64-linux; + os-workmac = mkHomeManager "workmac" "os" systems.aarch64-darwin; + }; + lib = { + inherit mkHomeManager; + }; + } + // utils.lib.eachDefaultSystem ( + system: + let + nixpkgs = import inputs.nixpkgs { + inherit system; + overlays = nixpkgs.lib.attrValues self.overlays; + }; + nixpkgs_unstable = import inputs.nixos-unstable { + inherit system; + overlays = nixpkgs.lib.attrValues self.overlays; + }; + pkgs = inputs.nixpkgs.legacyPackages.${system}; + pkgs_unstable = inputs.nixos-unstable.legacyPackages.${system}; + treefmtEval = treefmt-nix.lib.evalModule pkgs_unstable treefmtConf; + in + { + devShells.default = pkgs.mkShell { buildInputs = [ ]; }; + formatter = treefmtEval.config.build.wrapper; + checks.formatting = treefmtEval.config.build.check self; + # expose nixpkgs with overlay; TODO: figure out role of config + #legacyPackages = nixpkgs; + + # inspired by https://github.com/Mic92/dotfiles/blob/main/home-manager/flake-module.nix + # run like: `nix run .#hm -- ` + apps.hm = { + type = "app"; + program = "${pkgs.writeShellScriptBin "hm" '' + set -x + export PATH=${ + pkgs.lib.makeBinPath [ + pkgs.git + pkgs.coreutils + pkgs.findutils + pkgs.lix + pkgs.jq + pkgs.unixtools.hostname + ] + } + declare -A profiles=( + ["framenix"]="spiollinux-desktop" + ["thinknix"]="spiollinux-desktop" + ["OS MacBook Pro"]="os-workmac" + ) + user=$(id -un) + host=$(hostname) + if [[ -n ''${profiles["$host-$user"]} ]]; then + profile=''${profiles["$host-$user"]}; + elif [[ -n ''${profiles[$host]:-} ]]; then + profile=''${profiles[$host]} + else + echo "No suitable profile found." >2 + exit 2 + fi + if [[ "''${1:-}" == profile ]]; then + echo $profile + exit 0 + fi + ${ + inputs.home-manager.packages.${pkgs.system}.home-manager + }/bin/home-manager --flake "${self}#$profile" "$@" + ''}/bin/hm"; + }; + } + ); } diff --git a/home/common.nix b/home/common.nix new file mode 100644 index 0000000..c2c5264 --- /dev/null +++ b/home/common.nix @@ -0,0 +1,177 @@ +{ + pkgs, + inputs, + config, + system, + lib, + ... +}: +{ + imports = [ + ./modules/packages.nix + ./modules/vscodium.nix + ./modules/fonts.nix + ]; + home.homeDirectory = + if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}"; + programs.home-manager.enable = true; + + programs.bat.enable = true; + programs.direnv = { + enable = true; + nix-direnv.enable = true; + enableZshIntegration = true; + }; + + programs.tmux = { + enable = true; + keyMode = "vi"; + extraConfig = + # for direnv not messing up the environment + '' + set-option -g update-environment "DIRENV_DIFF DIRENV_DIR DIRENV_WATCHES" + set-environment -gu DIRENV_DIFF + set-environment -gu DIRENV_DIR + set-environment -gu DIRENV_WATCHES + set-environment -gu DIRENV_LAYOUT + + bind-key -T copy-mode-vi 'v' send -X begin-selection + bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel''; + terminal = "screen-256color"; + }; + + programs.git = { + enable = true; + extraConfig = { + credential.helper = "cache"; + push.default = "simple"; + push.forceIfIncludes = true; # avoid accidental force overrides when remote is autofetched in background + init.defaultBranch = "mainline"; + diff.tool = "vimdiff"; + merge.tool = "vimdiff"; + # provide `git mergetool -t nixfmt` + mergetool.nixfmt = { + cmd = "${lib.getExe pkgs.nixfmt-rfc-style} --mergetool \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\""; + trustExitCode = true; + }; + core.excludesfile = toString ( + pkgs.writeText ".gitignore_global" '' + # Direnv stuff # + ################ + .direnv + .envrc + # Editor files # + ################ + *~ + *.swp + *.swo + # macOS foo # + ############# + .DS_Store + '' + ); + core.whitespace = "-blank-at-eol,blank-at-eof,space-before-tab"; + rerere.enabled = true; + }; + lfs.enable = true; + delta = { + enable = true; + options = { + line-numbers = true; + side-by-side = true; + #dark = true; + }; + }; + }; + programs.lazygit = { + enable = true; + settings = { + git = { + autoFetch = false; + mainBranches = [ + "main" + "master" + "mainline" + ]; + }; + update.method = "never"; + }; + }; + + # shell config + programs.zsh = { + enable = true; + syntaxHighlighting.enable = true; + history.ignoreSpace = true; + initContent = '' + # Uncomment following line if you want red dots to be displayed while waiting for completion + COMPLETION_WAITING_DOTS="true" + ### Fix slowness of pastes with zsh-syntax-highlighting.zsh + pasteinit() { + OLD_SELF_INSERT=''${''${(s.:.)widgets[self-insert]}[2,3]} + zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`? + } + + pastefinish() { + zle -N self-insert $OLD_SELF_INSERT + } + zstyle :bracketed-paste-magic paste-init pasteinit + zstyle :bracketed-paste-magic paste-finish pastefinish + + # automatic rehash of path completion + zstyle ':completion:*' rehash true + + eval "$(${pkgs.thefuck}/bin/thefuck --alias)" + + ## helper functions + nixify() { + if [ ! -e ./.envrc ]; then + echo "eval \"$(lorri direnv)\"" > .envrc + direnv allow + fi + if [ ! -e shell.nix ]; then + cat > shell.nix <<'EOF' + with import {}; + mkShell { + buildInputs = [ + bashInteractive + ]; + } + EOF + ${"EDITOR:-vim"} default.nix + fi + } + + binpath() { + realpath $(${pkgs.which}/bin/which $1) + } + ''; + + oh-my-zsh = { + enable = true; + theme = "bira"; + plugins = [ + "git" + "python" + "systemd" + "gpg-agent" + ]; + }; + }; + home.shellAliases = { + ip = "ip --color"; + ipb = "ip --color --brief"; + ll = "ls -l"; + wavesynth = "nix-shell -p sox --run 'play -n synth brownnoise synth pinknoise mix synth 0 0 0 15 40 80 trapezium amod 0.2 20'"; + vim = "nvim"; + }; + home.sessionVariables = { + EDITOR = "nvim"; + }; + + home.activation.reportChanges = config.lib.dag.entryAnywhere '' + if [[ -v oldGenPath ]]; then + run nix store diff-closures $oldGenPath $newGenPath + fi + ''; +} diff --git a/home/desktop.nix b/home/desktop.nix new file mode 100644 index 0000000..1e089e7 --- /dev/null +++ b/home/desktop.nix @@ -0,0 +1,86 @@ +{ + pkgs, + inputs, + config, + system, + lib, + ... +}: +{ + imports = [ ./modules/latex.nix ]; + home.stateVersion = "23.11"; + + schmittlauch = { + packages = { + graphics = true; + multimedia = true; + nixHelpers = true; + devTools = true; + pythonTools = true; + games = true; + desktopLinux = true; + kde = true; + }; + latex.guiTools = true; + }; + + # for backwards compatibility + services.lorri.enable = true; + + programs.git = + let + # TODO profile specific + contacts = import "${inputs.mysecrets}/contacts.nix" { inherit lib; }; + in + { + includes = + [ + { + condition = "gitdir:~/Seafile/Studium/"; + contents = { + user.name = contacts.personal.name; + user.email = contacts.uni.email; + }; + } + { + condition = "gitdir:~/src/nixpkgs/"; + contents = { + user.name = "Trolli Schmittlauch"; + user.email = contacts.nixOs.email; + }; + } + ] + # set default name for several other common locations + ++ + map + (dir: { + condition = "gitdir:${dir}"; + contents = { + user = { + inherit (contacts.schmittlauch) email name; + }; + }; + }) + [ + "~/src/" + "~/bin/" + "~/tmp/" + "~/nixconfigs/" + ]; + }; + + services.gpg-agent = { + enable = true; + #enableSshSupport = true; + pinentry.package = pkgs.pinentry-qt; + }; + + programs.ssh = { + enable = true; + # ssh host config + matchBlocks = (import "${inputs.mysecrets}/ssh_hosts.nix").privateHosts; + }; + + # media button control support from Bluetooth devices + services.mpris-proxy.enable = true; +} diff --git a/home/home.nix b/home/home.nix deleted file mode 100644 index 1f42843..0000000 --- a/home/home.nix +++ /dev/null @@ -1,453 +0,0 @@ -{ pkgs, inputs, config, system, ... }: - -with pkgs; -let - unstable = inputs.nixos-unstable.legacyPackages.${system}; - - desktopApps = [ - firefox - chromium - falkon - thunderbird - calibre - dino - #zotero has open CVEs, wait for patch in Zotero7 - keepassxc - ding - aspell - aspellDicts.de - aspellDicts.en - # for kate/KDE applications - hunspellDicts.de-de - hunspellDicts.en-us - hunspellDicts.en-gb-ise - seafile-client - alacritty - libreoffice-qt # fresh with KDE integration - backintime-common - anki - signal-desktop - (tor-browser-bundle-bin.override { - mediaSupport = true; - pulseaudioSupport = true; - }) - pdfpc - quaternion - nheko - gpxsee - subsurface - yate - # split and merge PDFs in a GUI - pdfarranger - qbittorrent - #(pkgs.pidgin-with-plugins.override { - # plugins = [ pkgs.pidginotr ];}) - - inputs.logseq-fix-nixpkgs.legacyPackages.${system}.logseq - - - # for Hibiscus banking software - jameica - #ToDo: which of these drivers is actually used? - geckodriver - chromedriver - ]; - - graphicsApps = [ - inkscape - darktable - hugin - luminanceHDR - exiftool - gimp - xournal - ] - ++ ( - with gimpPlugins; [ - fourier - lqrPlugin - ] - ); - - multimediaApps = [ - mpv - vlc - #amarok - clementine - elisa - yt-dlp - #sonic-pi - musescore - tenacity - #linphone - soundkonverter - config.nur.repos.fooker.studio-link - ]; - - cliApps = [ - myVim - htop - tmux - httpie - ponysay - gti - tree - lsof - mosh - openssh - sshfs-fuse - cryfs - smbnetfs # for FUSE smb mounting - sshuttle - thefuck - gnupg - unar - lzop - p7zip - pwgen - pandoc - agrep - pdfgrep - torsocks - ncdu - psmisc # for killall - dos2unix - reptyr # re-bind running program to other tty - xclip - unzip - lnav - config.nur.repos.schmittlauch.lolcommits # from NUR - ]; - - nixHelpers = [ - nixpkgs-review - nixpkgs-fmt - nix-top - statix - nix-output-monitor - ]; - - kdeTools = with plasma5Packages; with kdeGear; [ - okular - gwenview - yakuake - kmail - kontact - korganizer - akonadi-mime #for KOrganizer - kaddressbook - kdeconnect - dolphin - spectacle - kate - kleopatra - qdirstat - ark - kwalletmanager - ktouch - kcharselect - konversation - okteta - krdc - skanlite - akonadiconsole - tokodon # mastodon client - ] - ++ ( - with kdeFrameworks; [ - networkmanager-qt - kcrash - breeze-gtk - ] - ); - - devTools = [ - curl - httpie - gdb - strace - ltrace - valgrind - zeal - gcc - shellcheck - mtr - ripgrep - gitui - lazygit - pre-commit - - # Haskell - ghc - cabal2nix - ]; - - - latexApps = [ - texmaker - kile - biber - # customize texlive installation - ( - texlive.combine { - inherit (texlive) - scheme-medium - - xetex - luatex - unicode-math - fontspec - collection-binextra - collection-fontsrecommended - collection-latex - collection-latexextra - collection-latexrecommended - collection-langgerman - moderncv - fontawesome5 - academicons - acronym - ccicons - fontawesome - biblatex - logreq - koma-script - ; - } - ) - ]; - - pythonApps = with python3Packages; [ - notebook - ipython - pip - numpy - matplotlib - jedi - flake8 - mypy - ]; - - - fonts = [ - comic-neue - source-sans-pro - source-serif-pro - fira-code - ubuntu_font_family - twemoji-color-font - open-sans - (iosevka-bin.override { - variant = "curly-slab"; - }) - config.nur.repos.schmittlauch.vollkorn - # TODO: humor-sans - ]; - - games = [ - superTuxKart - #hedgewars - ]; - -in -{ - - nixpkgs.overlays = (import ./overlays.nix); - nixpkgs.config = { - clementine.spotify = false; - vim = - { gui = "gtk3"; - python = true; - multibyteSupport = true; - }; - }; - - home.packages = - desktopApps - ++ latexApps - ++ pythonApps - ++ graphicsApps - ++ cliApps - ++ multimediaApps - ++ devTools - ++ kdeTools - ++ fonts - ++ nixHelpers - ++ games - ; - - programs.home-manager.enable = true; - home.stateVersion = "22.11"; - - programs.direnv = - { - enable = true; - nix-direnv.enable = true; - enableZshIntegration = true; - }; - - # programs.vim = - # { enable = true; - # }; - - programs.bat.enable = true; - - services.gpg-agent = - { - enable = true; - #enableSshSupport = true; - pinentryFlavor = "qt"; - }; - - programs.ssh = - { - enable = true; - # ssh host config - matchBlocks = - import "${inputs.mysecrets}/ssh_hosts.nix"; - }; - - programs.tmux = { - enable = true; - keyMode = "vi"; - extraConfig = - # for direnv not messing up the environment - ''set-option -g update-environment "DIRENV_DIFF DIRENV_DIR DIRENV_WATCHES" - set-environment -gu DIRENV_DIFF - set-environment -gu DIRENV_DIR - set-environment -gu DIRENV_WATCHES - set-environment -gu DIRENV_LAYOUT - - bind-key -T copy-mode-vi 'v' send -X begin-selection - bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel''; - terminal = "screen-256color"; - }; - - systemd.user.startServices = true; - - # for backwards compatibility - services.lorri.enable = true; - - # media button control support from Bluetooth devices - services.mpris-proxy.enable = true; - - fonts.fontconfig.enable = true; - - programs.git = - let contacts = import "${inputs.mysecrets}/contacts.nix"; - in - { - enable = true; - includes = [ - { - condition = "gitdir:~/Seafile/Studium/"; - contents = { - user.name = contacts.realName; - user.email = contacts.uniMail; - }; - } - { - condition = "gitdir:~/src/nixpkgs/"; - contents = { - user.name = "Trolli Schmittlauch"; - user.email = contacts.nixosMail; - }; - } - ] - # set default name for several other common locations - ++ map - (dir: { - condition = "gitdir:${dir}"; - contents = { - user.name = "Trolli Schmittlauch"; - user.email = contacts.mainMail; - }; - }) [ "~/src/" "~/bin/" "~/tmp/" "~/nixconfigs/" ]; - extraConfig = { - credential.helper = "cache"; - push.default = "simple"; - init.defaultBranch = "mainline"; - diff.tool = "vimdiff"; - merge.tool = "vimdiff"; - core.excludesfile = toString (pkgs.writeText ".gitignore_global" '' - # Direnv stuff - .direnv - .envrc - # Editor files # - ################ - *~ - *.swp - *.swo - ''); - core.whitespace = "-blank-at-eol,blank-at-eof,space-before-tab"; - }; - lfs.enable = true; - }; - - # shell config - programs.zsh = { - enable = true; - syntaxHighlighting.enable = true; - history.ignoreSpace = true; - initExtra = '' - # Uncomment following line if you want red dots to be displayed while waiting for completion - COMPLETION_WAITING_DOTS="true" - ### Fix slowness of pastes with zsh-syntax-highlighting.zsh - pasteinit() { - OLD_SELF_INSERT=''${''${(s.:.)widgets[self-insert]}[2,3]} - zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`? - } - - pastefinish() { - zle -N self-insert $OLD_SELF_INSERT - } - zstyle :bracketed-paste-magic paste-init pasteinit - zstyle :bracketed-paste-magic paste-finish pastefinish - - # automatic rehash of path completion - zstyle ':completion:*' rehash true - - eval "$(${pkgs.thefuck}/bin/thefuck --alias)" - - ## helper functions - nixify() { - if [ ! -e ./.envrc ]; then - echo "eval \"$(lorri direnv)\"" > .envrc - direnv allow - fi - if [ ! -e shell.nix ]; then - cat > shell.nix <<'EOF' - with import {}; - mkShell { - buildInputs = [ - bashInteractive - ]; - } - EOF - ${EDITOR:-vim} default.nix - fi - } - - binpath() { - realpath $(${pkgs.which}/bin/which $1) - } - ''; - - - oh-my-zsh = { - enable = true; - theme = "bira"; - plugins = [ "git" "python" "systemd" "gpg-agent"]; - }; - }; - home.shellAliases = { - ip = "ip --color"; - ipb = "ip --color --brief"; - ll = "ls -l"; - wavesynth = "nix-shell -p sox --run 'play -n synth brownnoise synth pinknoise mix synth 0 0 0 15 40 80 trapezium amod 0.2 20'"; - vim = "nvim"; - }; - home.sessionVariables = { - EDITOR = "nvim"; - }; -} diff --git a/home/modules/fonts.nix b/home/modules/fonts.nix new file mode 100644 index 0000000..6ce1185 --- /dev/null +++ b/home/modules/fonts.nix @@ -0,0 +1,29 @@ +{ + pkgs, + inputs, + config, + system, + ... +}: +{ + home.packages = with pkgs; [ + comic-neue + source-sans-pro + source-code-pro + source-serif-pro + ubuntu_font_family + twemoji-color-font + open-sans + (iosevka-bin.override { variant = "CurlySlab"; }) + inputs.nur.legacyPackages.${system}.repos.schmittlauch.vollkorn + # TODO: humor-sans + + # fcio corporate design, TODO module + fira-code + fira-mono + # TODO fira-sans + condensed + # TODO museo 500 + ]; + + fonts.fontconfig.enable = true; +} diff --git a/home/modules/latex.nix b/home/modules/latex.nix new file mode 100644 index 0000000..3f79930 --- /dev/null +++ b/home/modules/latex.nix @@ -0,0 +1,47 @@ +{ + pkgs, + inputs, + config, + system, + lib, + ... +}: +with pkgs; +let + latexGuiTools = [ + texmaker + kile + biber + ]; +in +{ + options.schmittlauch.latex.guiTools = lib.mkEnableOption "Install GUI LaTeX tools like editors"; + + config.home.packages = [ + (texlive.combine { + inherit (texlive) + scheme-medium + + xetex + luatex + unicode-math + fontspec + collection-binextra + collection-fontsrecommended + collection-latex + collection-latexextra + collection-latexrecommended + collection-langgerman + moderncv + fontawesome5 + academicons + acronym + ccicons + fontawesome + biblatex + logreq + koma-script + ; + }) + ] ++ lib.optionals config.schmittlauch.latex.guiTools latexGuiTools; +} diff --git a/home/modules/packages.nix b/home/modules/packages.nix new file mode 100644 index 0000000..0b3f0ab --- /dev/null +++ b/home/modules/packages.nix @@ -0,0 +1,275 @@ +{ + pkgs, + inputs, + config, + system, + ... +}: + +with pkgs; +let + cfg = config.schmittlauch.packages; + unstable = inputs.nixos-unstable.legacyPackages.${system}; + nur = inputs.nur.legacyPackages.${system}; + + graphicsApps = + [ + inkscape + darktable + exiftool + ] + ++ (with gimp3Plugins; [ + #fourier # broken + #lqrPlugin # broken + ]) + ++ lib.optionals pkgs.stdenv.isLinux [ + gimp3 + hugin + #luminanceHDR # FIXME, build failure + xournalpp + ] + ++ lib.optionals pkgs.stdenv.isDarwin [ + gimp + ]; + + multimediaApps = + [ + mpv + yt-dlp + ] + ++ lib.optionals pkgs.stdenv.isDarwin [ vlc-bin ] + ++ lib.optionals pkgs.stdenv.isLinux [ + vlc + amarok + clementine + kdePackages.elisa + musescore + tenacity + soundkonverter + #nur.repos.fooker.studio-link + ]; + + cliApps = + [ + coreutils + myVim + htop + tmux + httpie + ponysay + gti + tree + lsof + mosh + openssh + sshfs-fuse + sshuttle + cryfs + thefuck + gnupg + unar + lzop + p7zip + pwgen + pandoc + pdfgrep + # zig dependency breaks occasionally, stay on C version for now + ncdu_1 + dos2unix + unzip + fswatch + jq + age + lnav + spacer + + nix-output-monitor # putting this here as a plain `nix` alternative + ] + ++ lib.optionals pkgs.stdenv.isLinux [ + xclip + smbnetfs # for FUSE smb mounting + psmisc # for killall + torsocks + agrep + reptyr # re-bind running program to other tty + ]; + + nixHelpers = [ + nixpkgs-review + nixfmt-rfc-style + nix-top + statix + ]; + devTools = + [ + curl + httpie + gcc + shellcheck + mtr + ripgrep + fd + gitui + pre-commit + scriv + + # Haskell + ghc + cabal2nix + ] + ++ lib.optionals pkgs.stdenv.isLinux [ + gdb + strace + ltrace + valgrind + zeal + ]; + + pythonTools = with python3Packages; [ + python # to shadow old macOS python + ipython + uv + pip + numpy + matplotlib + jedi + jedi-language-server + black + flake8 + mypy + ]; + + games = [ + superTuxKart + #hedgewars + ]; + + desktopCommon = [ + keepassxc + ]; + + desktopLinux = [ + firefox + chromium + kdePackages.falkon + thunderbird + calibre + dino + zotero + ding + aspell + aspellDicts.de + aspellDicts.en + # for kate/KDE applications + hunspellDicts.de-de + hunspellDicts.en-us + hunspellDicts.en-gb-ise + seafile-client + alacritty + libreoffice-qt6 # still with KDE integration + anki + signal-desktop + (tor-browser-bundle-bin.override { + mediaSupport = true; + pulseaudioSupport = pkgs.stdenv.isLinux; + }) + tigervnc + pdfpc + nheko + gpxsee + subsurface + yate + # split and merge PDFs in a GUI + pdfarranger + qbittorrent + #(pkgs.pidgin-with-plugins.override { + # plugins = [ pkgs.pidginotr ];}) + + logseq + + # for Hibiscus banking software + jameica + #ToDo: which of these drivers is actually used? + geckodriver + chromedriver + ]; + + kdeTools = + [ + okteta + plasma5Packages.kdeconnect-kde + ] + ++ (with kdePackages; [ + okular + gwenview + yakuake + dolphin + spectacle + kate + kleopatra + qdirstat + ark + kwalletmanager + #ktouch # TODO: unbreak + kcharselect + konversation + krdc + skanlite + akonadiconsole + tokodon # mastodon client + networkmanager-qt + kcrash + breeze-gtk + ]); +in +{ + options.schmittlauch.packages = { + graphics = lib.mkEnableOption "Enable a common set of graphics apps"; + multimedia = lib.mkEnableOption "Enable a common set of multimedia apps"; + cli = lib.mkOption { + description = "Enable a common set of CLI tools"; + type = lib.types.bool; + default = true; + }; + nixHelpers = lib.mkEnableOption "Enable a common set of Nix helper tools"; + devTools = lib.mkEnableOption "Enable a common set of dev tools"; + pythonTools = lib.mkEnableOption "Enable a common set of python tools"; + games = lib.mkEnableOption "Enable some games"; + desktopCommon = lib.mkOption { + description = "GUI desktop applications that work cross-platform and cross-desktop"; + type = lib.types.bool; + default = true; + }; + desktopLinux = lib.mkEnableOption "Enable a common set of desktop applications"; + kde = lib.mkEnableOption "Enable a common set of KDE applications"; + }; + config = { + home.packages = lib.flatten ( + (lib.optional cfg.graphics graphicsApps) + ++ (lib.optional cfg.multimedia multimediaApps) + ++ (lib.optional cfg.cli cliApps) + ++ (lib.optional cfg.nixHelpers nixHelpers) + ++ (lib.optional cfg.devTools devTools) + ++ (lib.optional cfg.pythonTools pythonTools) + ++ (lib.optional cfg.games games) + ++ (lib.optional cfg.desktopCommon desktopCommon) + ++ (lib.optional cfg.desktopLinux desktopLinux) + ++ (lib.optional cfg.kde kdeTools) + ); + + nixpkgs.overlays = import ../overlays.nix; + nixpkgs.config = { + + permittedInsecurePackages = [ + # (temporarily) permit the usage of libolm + "olm-3.2.16" + ]; + clementine.spotify = false; + vim = { + gui = "gtk3"; + python = true; + multibyteSupport = true; + }; + }; + }; +} diff --git a/home/modules/vscodium.nix b/home/modules/vscodium.nix new file mode 100644 index 0000000..a42b7ec --- /dev/null +++ b/home/modules/vscodium.nix @@ -0,0 +1,120 @@ +{ + pkgs, + lib, + inputs, + config, + system, + ... +}: +{ + programs.vscode = { + enable = true; + package = pkgs.vscodium; + mutableExtensionsDir = true; + profiles.default = { + extensions = + with pkgs.vscode-extensions; + [ + ms-python.python + charliermarsh.ruff + vscodevim.vim + yzhang.markdown-all-in-one + bungcip.better-toml + eamodio.gitlens + jnoortheen.nix-ide + mkhl.direnv + editorconfig.editorconfig + ] + ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "Sync-Rsync"; + publisher = "vscode-ext"; + version = "0.36.0"; + sha256 = "sha256-0b/OHLZfXo0NAVAVkzZSqMGDzF0uvPRoiqsZtW1iOdA"; + } + # TODO: probably available in nixpkgs soonish? + { + name = "mypy-type-checker"; + publisher = "ms-python"; + version = "2023.3.12681020"; + sha256 = "sha256-rhed7CQlvxksVCGc9nPU2oYQWtXcAV5TzuG63e8Y3zM="; + } + { + name = "vscode-pets"; + publisher = "tonybaloney"; + version = "1.25.1"; + sha256 = "sha256-as3e2LzKBSsiGs/UGIZ06XqbLh37irDUaCzslqITEJQ="; + } + ]; + userSettings = + let + defaultPython = pkgs.python3.withPackages (ps: [ + ps.jedi + ps.jedi-language-server + ps.pip + ps.setuptools # for pkg_resources + ps.black + ps.mypy + ]); + in + { + "editor.fontLigatures" = true; + "editor.accessibilitySupport" = false; # prevent asking + "editor.cursorBlinking" = "phase"; + "editor.stickyScroll.enabled" = true; + "workbench.editor.highlightModifiedTabs" = true; + "window.autoDetectColorScheme" = true; + "workbench.preferredDarkColorTheme" = "Default Dark Modern"; + "workbench.preferredLightColorTheme" = "Default Light Modern"; + "[nix]" = { + "editor.insertSpaces" = true; + "editor.tabSize" = 2; + # for now, disable automatic formatting to prevent disruption of existing code bases + "editor.formatOnPaste" = false; + "editor.formatOnSave" = false; + "editor.formatOnType" = false; + }; + "nix.formatterPath" = lib.getExe pkgs.nixfmt-rfc-style; + "nix.enableLanguageServer" = true; + "nix.serverPath" = lib.getExe pkgs.nixd; + "nix.serverSettings" = { }; + "editor.fontSize" = 13; + "editor.fontWeight" = "normal"; + "git.detectSubmodulesLimit" = 30; + "[python]" = { + "breadcrumbs.showClasses" = true; + "breadcrumbs.showFunctions" = true; + "gitlens.codeLens.symbolScopes" = [ "!Module" ]; + "editor.defaultFormatter" = "charliermarsh.ruff"; + "editor.formatOnSave" = true; + }; + "python.experiments.enabled" = false; + "python.languageServer" = "Jedi"; # don't use proprietary pylance server + "python.defaultInterpreterPath" = "${defaultPython}/bin/python"; + "mypy-type-checker.path" = [ "${pkgs.python3Packages.mypy}/bin/mypy" ]; + "mypy-type-checker.importStrategy" = "fromEnvironment"; + "mypy-type-checker.args" = [ "--ignore-missing-imports" ]; + "ruff.path" = [ (lib.getExe pkgs.ruff) ]; + "ruff.importStrategy" = "fromEnvironment"; + "gitlens.telemetry.enabled" = false; + "vim.highlightedyank.enable" = true; + "vim.history" = 500; + "vim.neovimUseConfigFile" = true; + "vim.enableNeovim" = true; + "git.suggestSmartCommit" = false; + "editor.rulers" = [ 79 ]; + "vim.useSystemClipboard" = true; + "vim.smartRelativeLine" = true; + "diffEditor.ignoreTrimWhitespace" = false; + "files.associations" = { + "*.py" = "python"; + }; + "editor.renderWhitespace" = "all"; + "editor.fontFamily" = "Iosevka Curly Slab, Menlo, Monaco, 'Courier New', monospace"; + "vim.neovimPath" = lib.getExe pkgs.myVim; + "sync-rsync.options" = [ ]; + "direnv.path.executable" = lib.getExe pkgs.direnv; + }; + }; + }; +} diff --git a/home/overlays.nix b/home/overlays.nix index f2ae044..5a9b213 100644 --- a/home/overlays.nix +++ b/home/overlays.nix @@ -1,9 +1,9 @@ - [ - ( - self: super: - rec { - myVim = with super; neovim.override { configure = { + (self: super: rec { + myVim = + with super; + neovim.override { + configure = { packages.myVimPackage = with pkgs.vimPlugins; { # loaded on start start = [ @@ -25,8 +25,7 @@ ]; }; customRC = builtins.readFile ./vimrc; - };}; - } - ) - + }; + }; + }) ] diff --git a/home/scripts/reporsync.nix b/home/scripts/reporsync.nix new file mode 100644 index 0000000..8412c8c --- /dev/null +++ b/home/scripts/reporsync.nix @@ -0,0 +1,85 @@ +{ pkgs, lib, ... }: +'' + # rsync -rlptzv --progress --delete --exclude=.git --exclude=.vscode --exclude=result --exclude=channels/ /Users/os/src/fc.qemu os@hydra01: + # rsync -rlptzv --progress --rsh="ssh -J fcio-whq-jump" --delete --exclude=.git --exclude=.vscode --exclude=result --exclude=channels/ /Users/os/src/fc-nixos/ os@patty:fc-nixos/ + + + DEFAULT_JUMPHOST="fcio-whq-jump" + + _parse_rsync_args() { + # reset pre-defined variables that are read and manipulated throughout this function + unset JUMPHOST + # arrays are bash or zsh specific + RSYNC_OPTS=("-rlptzv" "--progress" "--delete" "--exclude=.git" "--exclude=.vscode" "--exclude=result" "--exclude=channels/" "--exclude=.mypy_cache") + + while getopts ':Jj:' OPT; do + case $OPT in + j) + if [ -n "$JUMPHOST" ]; then + echo "-j and -J are conflicting arguments" >&2 + return 1 + fi + JUMPHOST="$OPTARG" + ;; + J) + if [ -n "$JUMPHOST" ]; then + echo "-j and -J are conflicting arguments" >&2 + return 1 + fi + JUMPHOST="$DEFAULT_JUMPHOST" + ;; + ?) + echo "rsyncrepo [-J] [-j ] [target dir name]" + return 1 + ;; + esac + done + + # trim CLI parameters + shift "$(($OPTIND -1))" + + RR_FROM="$1" + RR_TO="$2" + RR_TARGET="$3" + } + + _do_rsync() { + # parameter check + if [ -z "$1" ] || [ -z "$2" ]; then + echo "Missing arguments, required: " >&2 + return 1 + fi + + if [ -n "$JUMPHOST" ]; then + RSYNC_OPTS+=("--rsh=${lib.getExe pkgs.openssh} -J ''${JUMPHOST}") + fi + + for OPTI in "''${RSYNC_OPTS[@]}"; do + echo "$OPTI" + done + + # If no $3 is specified, we sync /path/to/dir/ to hostname:dir + if [ -z "$3" ]; then + RR_DEST="''${2}:$(basename $(realpath "''${1}"))" + else + RR_DEST="''${2}:''${3}" + fi + + echo "Syncing ''${1} to ''${RR_DEST}…" + + # ensure trailing slash for src to avoid recreating directory + ${lib.getExe pkgs.rsync} "''${RSYNC_OPTS[@]}" "''${1}/" "''${RR_DEST}" + } + + rsyncrepo() { + _parse_rsync_args "$@" + # inherits parsed arguments through variables + _do_rsync "$RR_FROM" "$RR_TO" "$RR_TARGET" + } + + rsynchydra() { + _parse_rsync_args "$@" + # the name of RR_TO is a bit misleading, it just describes the 2nd positional arg here + _do_rsync "$RR_FROM" "hydra01" "$RR_TO" + } +'' diff --git a/home/scripts/ssh-loop-fc.nix b/home/scripts/ssh-loop-fc.nix new file mode 100644 index 0000000..a632477 --- /dev/null +++ b/home/scripts/ssh-loop-fc.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: +'' + ssh-loop () { + setopt shwordsplit + local hosts=$1 + local cmd=$2 + + for x in $1; do echo $x; ${pkgs.openssh}/bin/ssh $x.fcio.net -o StrictHostKeyChecking=no -C "$2"; done + } + + ssh-loop-parallel () { + setopt shwordsplit + local hosts=$1 + local cmd=$2 + + for x in $1; do echo $x; ${pkgs.openssh}/bin/ssh $x.fcio.net -o StrictHostKeyChecking=no -C "$2" 2>&1 | sed -e "s/^/$x: /;" & done + wait + } +'' diff --git a/home/secrets b/home/secrets index 068a475..c725f81 160000 --- a/home/secrets +++ b/home/secrets @@ -1 +1 @@ -Subproject commit 068a4759e72948284c3de85d20a780723278f8b8 +Subproject commit c725f810bb9a43c213fcf964f036dd0c64b6ba04 diff --git a/home/vimrc b/home/vimrc index 847940e..05ea804 100644 --- a/home/vimrc +++ b/home/vimrc @@ -24,7 +24,11 @@ filetype plugin indent on syntax on +" use relative numbering… +set relativenumber +" except for current line set number + set mouse=a set mousehide @@ -42,7 +46,7 @@ set history=1000 " representing system clipboard (not X11 clipboard) set clipboard=unnamedplus -" set expandtab +set expandtab set shiftwidth=4 set tabstop=4 set softtabstop=4 @@ -52,7 +56,7 @@ let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" set termguicolors -"let base16colorspace=256 +let base16colorspace=256 colorscheme base16-tomorrow-night "colorscheme Tomorrow-Night @@ -102,6 +106,7 @@ let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static` let g:haskell_backpack = 1 " to enable highlighting of backpack keywords au FileType markdown setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4 +au FileType pandoc setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4 au FileType nix setlocal tabstop=2 expandtab shiftwidth=2 softtabstop=2 set ofu=syntaxcomplete#Complete " nmap "+gP diff --git a/home/workmac.nix b/home/workmac.nix new file mode 100644 index 0000000..5227db0 --- /dev/null +++ b/home/workmac.nix @@ -0,0 +1,119 @@ +{ + pkgs, + inputs, + config, + system, + lib, + ... +}: + +with pkgs; +let + unstable = inputs.nixos-unstable.legacyPackages.${system}; +in +{ + + schmittlauch.packages = { + graphics = true; + multimedia = true; + nixHelpers = true; + devTools = true; + pythonTools = true; + }; + + home.packages = [ + wireshark # on NixOS systems enabled via system config + _1password-cli + # also TODO: color schemes nix-darwin + ]; + + # pinning theme is necessary until iTerm 3.5, because despite the dark terminal background, bat detects light mode and adapts theme + programs.bat.config.theme = "Visual Studio Dark+"; + + programs.ssh = { + enable = true; + # defaults in bottom match block "*" + # TODO: common config for desktop as well + # multiplexer, e.g. to avoid rate limiting on jumphost usage + serverAliveInterval = 60; + controlMaster = "auto"; + controlPersist = "4h"; + # ssh host config + matchBlocks = { + + # early catchall to enforce agent socket usage. **NOT** the place for fallback defaults. + "*" = { + extraOptions = { + IdentityAgent = "\"~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock\""; + #ControlPath = "/tmp/ssh_mux_%h_%p_%r"; + }; + }; + + "hydra01" = lib.hm.dag.entryAfter [ "*" ] { + hostname = "hydra01.access.whq.gocept.net"; + user = "os"; + }; + "fcio-whq-jump" = lib.hm.dag.entryAfter [ "*" ] { + hostname = "vpn-whq.services.fcio.net"; + extraOptions.LogLevel = "Verbose"; + }; + "fcio-rzob-jump" = lib.hm.dag.entryAfter [ "*" ] { hostname = "vpn-rzob.services.fcio.net"; }; + }; + }; + + programs.git = + let + contacts = import "${inputs.mysecrets}/contacts.nix" { inherit lib; }; + in + { + includes = + [ + { + condition = "gitdir:~/src/schmittlauch/"; + contents = { + user = { + inherit (contacts.schmittlauch) name email; + }; + }; + } + ] + # set default name for several other common locations + ++ map (dir: { + condition = "gitdir:${dir}"; + contents = { + user = { + inherit (contacts.work) name email; + }; + }; + }) [ "~/" ]; + }; + + # some extra shell scripts + programs.zsh.initContent = lib.mkAfter ( + import ./scripts/reporsync.nix { inherit pkgs lib; } + + import ./scripts/ssh-loop-fc.nix { inherit pkgs lib; } + ); + + launchd.agents.hydra_proxy = { + enable = true; + config = { + ProgramArguments = [ + "${lib.getExe pkgs.autossh}" + "-M" + "0" + "-D" + "1080" + "-oServerAliveInterval=60" + "-oControlMaster=no" + "-N" + "vpn-whq.services.fcio.net" + ]; + # TODO: consider socket activation instead + KeepAlive = true; + ThrottleInterval = 60; + }; + }; + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "1password-cli" ]; + + home.stateVersion = "22.05"; +} diff --git a/hosts/framenix/default.nix b/hosts/framenix/default.nix index 81295a2..f1e62cd 100644 --- a/hosts/framenix/default.nix +++ b/hosts/framenix/default.nix @@ -1,10 +1,17 @@ -{ config, lib, pkgs, system, ...}: +{ + config, + lib, + pkgs, + system, + ... +}: let unstable = config.inputInjection.flake-inputs.nixos-unstable.legacyPackages.${system}; in { imports = [ ../../common + ../../common/pipewire.nix ./hardware-configuration.nix ./storage.nix @@ -13,44 +20,28 @@ in networking.hostName = "framenix"; # Define your hostname. - # use newer linux-firmware from unstable - hardware.firmware = lib.mkBefore [ unstable.linux-firmware ]; - # override tmpdir for daemon systemd.services.nix-daemon.environment.TMPDIR = "/var/tmp"; - # try newer kernels - boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linux_latest.override { - argsOverride = rec { - src = pkgs.fetchurl { - url = "https://git.kernel.org/torvalds/t/linux-${version}.tar.gz"; - hash = "sha256-sLypPyMhFhamhQOWDIkzZ5cVrWfoZDb3prJaESD6UU0="; - }; - version = "6.8-rc4"; - modDirVersion = "6.8.0-rc4"; - }; - }); - # revert some commits that introduced the clourful graphics artefacts flickering, - # at least that's the current working hypothesis in https://gitlab.freedesktop.org/drm/amd/-/issues/3097 - boot.kernelPatches = [ - {name = "drm/buddy: Fix alloc_range() error handling code"; - patch = pkgs.fetchpatch { - url = "https://cgit.freedesktop.org/drm/drm-misc/patch/?id=8746c6c9dfa31d269c65dd52ab42fde0720b7d91"; - hash = "sha256-Ir7TDLspbYilTJr6aVVb8urIYI2N2vZwI5ayp7laaGw="; - }; - } - ]; - # fix freezes after s2idle suspend-resume - boot.blacklistedKernelModules = [ "amd-pmf" ]; - - boot.kernelParams = [ - # temporary workaround for white flickering graphics artefacts - "amdgpu.sg_display=0" + boot.kernelParams = [ # powersave "amd_pstate=active" "amdgpu.abmlevel=1" # adaptive backlight management ]; + boot.initrd.systemd.enable = true; + + # at boot by default, limit charging capacity to protect battery. + # Hopefully there's gonna be a standard interface to control this from the desktop at some point. + systemd.services.battery-charge-limit = { + wantedBy = [ "basic.target" ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${lib.getExe pkgs.framework-tool} --driver portio --charge-limit 85"; + RemainAfterExit = true; + }; + }; + boot.loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; @@ -86,4 +77,3 @@ in pkgs.framework-tool ]; } - diff --git a/hosts/framenix/hardware-configuration.nix b/hosts/framenix/hardware-configuration.nix index a731402..b9295b2 100644 --- a/hosts/framenix/hardware-configuration.nix +++ b/hosts/framenix/hardware-configuration.nix @@ -1,18 +1,27 @@ # 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") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "thunderbolt" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - # 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 diff --git a/hosts/framenix/internal_display_profile_xrite-i1pro2.icm b/hosts/framenix/internal_display_profile_xrite-i1pro2.icm new file mode 100644 index 0000000..e067230 Binary files /dev/null and b/hosts/framenix/internal_display_profile_xrite-i1pro2.icm differ diff --git a/hosts/framenix/storage.nix b/hosts/framenix/storage.nix index 3efa655..7fb2801 100644 --- a/hosts/framenix/storage.nix +++ b/hosts/framenix/storage.nix @@ -1,17 +1,24 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let - fsOptions = [ "noatime" "ssd" "compress=zstd" ]; + fsOptions = [ + "noatime" + "ssd" + "compress=zstd" + ]; in { boot.initrd.luks = { devices = # allow discards on all devices - builtins.mapAttrs (name: val: val // {allowDiscards = true;}) - { + builtins.mapAttrs (name: val: val // { allowDiscards = true; }) { "system".device = "/dev/disk/by-uuid/1838cdc5-9b0b-4c46-9f23-9465549eeb92"; - "cryptswap".device = "/dev/disk/by-uuid/ded7d649-ab3a-42ee-ae4a-f8c4ba029e9c"; + "cryptswap".device = "/dev/disk/by-uuid/ded7d649-ab3a-42ee-ae4a-f8c4ba029e9c"; }; - reusePassphrases = true; }; fileSystems = { @@ -37,7 +44,10 @@ in services.fstrim.enable = true; services.btrfs.autoScrub = { enable = true; - fileSystems = [ "/" "/home" ]; + fileSystems = [ + "/" + "/home" + ]; }; boot.tmp.useTmpfs = true; diff --git a/hosts/framenix/swap.nix b/hosts/framenix/swap.nix index 262809c..ce2347e 100644 --- a/hosts/framenix/swap.nix +++ b/hosts/framenix/swap.nix @@ -1,7 +1,5 @@ { - swapDevices = - [ { device = "/dev/disk/by-uuid/24c47f3d-0d3e-4575-92a2-174b5a6b6086"; } - ]; + swapDevices = [ { device = "/dev/disk/by-uuid/24c47f3d-0d3e-4575-92a2-174b5a6b6086"; } ]; zramSwap = { enable = true; diff --git a/hosts/thinknix/default.nix b/hosts/thinknix/default.nix index ff1a2ff..431f3ba 100644 --- a/hosts/thinknix/default.nix +++ b/hosts/thinknix/default.nix @@ -1,7 +1,13 @@ -{ config, lib, pkgs, ...}: +{ + config, + lib, + pkgs, + ... +}: { imports = [ ../../common + ../../common/pulseaudio.nix ./hardware-configuration.nix ./storage.nix @@ -10,15 +16,17 @@ ./secureboot.nix ]; - hardware.trackpoint = { enable = true; sensitivity = 180; speed = 180; }; - networking.hostName = "thinknix"; + boot.extraModprobeConfig = "options thinkpad_acpi fan_control=1"; # enable fan control via echo to /proc/acpi/ibm/fan + schmittlauch.guestUser.enable = true; + + networking.hostName = "thinknix"; # This value determines the NixOS release with which your system is to be # compatible, in order to avoid breaking some software such as database diff --git a/hosts/thinknix/hardware-configuration.nix b/hosts/thinknix/hardware-configuration.nix index 18c7846..74708b5 100644 --- a/hosts/thinknix/hardware-configuration.nix +++ b/hosts/thinknix/hardware-configuration.nix @@ -1,20 +1,27 @@ -{ 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 = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ehci_pci" + "ahci" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = []; + boot.extraModulePackages = [ ]; nix.settings.max-jobs = lib.mkDefault 4; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; # modesetting is always better than intel (legacy) services.xserver.videoDrivers = [ "modesetting" ]; - } diff --git a/hosts/thinknix/secureboot.nix b/hosts/thinknix/secureboot.nix index 41eb516..657838e 100644 --- a/hosts/thinknix/secureboot.nix +++ b/hosts/thinknix/secureboot.nix @@ -1,11 +1,14 @@ -{ config, lib, pkgs, ...}: -{ +{ + config, + lib, + pkgs, + ... +}: +{ boot.loader.efi.canTouchEfiVariables = true; # UEFI secure boot - environment.systemPackages = [ - pkgs.sbctl - ]; + environment.systemPackages = [ pkgs.sbctl ]; # Lanzaboote currently replaces the systemd-boot module. # This setting is usually set to true in configuration.nix # generated at installation time. So we force it to false @@ -16,5 +19,4 @@ enable = true; pkiBundle = "/etc/secureboot"; }; - } diff --git a/hosts/thinknix/storage.nix b/hosts/thinknix/storage.nix index 55b9a0a..169cca6 100644 --- a/hosts/thinknix/storage.nix +++ b/hosts/thinknix/storage.nix @@ -1,19 +1,28 @@ -{ config, lib, pkgs, ...}: +{ + config, + lib, + pkgs, + ... +}: let - fsOptions = [ "noatime" "ssd" "space_cache" "compress=zstd" ]; + fsOptions = [ + "noatime" + "ssd" + "space_cache" + "compress=zstd" + ]; in { # encrypted partitions boot.initrd.luks = { devices = # allow discards on all devices - builtins.mapAttrs (name: val: val // {allowDiscards = true;}) - { + builtins.mapAttrs (name: val: val // { allowDiscards = true; }) { "system".device = "/dev/disk/by-uuid/85154131-b2a8-4ef5-9d74-47429cb267ef"; "cryptswap".device = "/dev/disk/by-uuid/ac586df6-6332-4809-beb1-f51906a2adaa"; "ssd2".device = "/dev/disk/by-uuid/cadd4e1f-3642-4faa-8d4e-37dd85465df1"; }; - reusePassphrases = true; + reusePassphrases = true; }; fileSystems = { @@ -57,16 +66,20 @@ in services.fstrim.enable = true; services.btrfs.autoScrub = { enable = true; - fileSystems = [ "/" "/home" ]; + fileSystems = [ + "/" + "/home" + ]; }; - boot.tmp.useTmpfs = true; fileSystems."/tmp".fsType = "tmpfs"; - services.smartd = - { - enable = true; - devices = [{ device = "/dev/sda"; } { device = "/dev/sdb"; }]; - }; + services.smartd = { + enable = true; + devices = [ + { device = "/dev/sda"; } + { device = "/dev/sdb"; } + ]; + }; } diff --git a/hosts/thinknix/swap.nix b/hosts/thinknix/swap.nix index 5aeb2bc..d600057 100644 --- a/hosts/thinknix/swap.nix +++ b/hosts/thinknix/swap.nix @@ -1,7 +1,5 @@ { - swapDevices = [ - { device = "/dev/disk/by-uuid/bf928178-4e92-4e7e-8df2-18fbd658eecf"; } - ]; + swapDevices = [ { device = "/dev/disk/by-uuid/bf928178-4e92-4e7e-8df2-18fbd658eecf"; } ]; zramSwap = { enable = true; diff --git a/nixos/Hash2PubTestbed.nix b/nixos/Hash2PubTestbed.nix index 1efbfe6..99c4cac 100644 --- a/nixos/Hash2PubTestbed.nix +++ b/nixos/Hash2PubTestbed.nix @@ -1,10 +1,15 @@ -{ config, pkgs, experimentUid ? 1000, ... }: +{ + config, + pkgs, + experimentUid ? 1000, + ... +}: let projectDir = "/home/spiollinux/Seafile/Studium/Semester11/INF-PM-FP-ANW"; projectPath = builtins.toPath projectDir; projectMount = "/mnt/project"; - shell = (import (projectDir + "/Hash2Pub/default.nix") {}).shell; + shell = (import (projectDir + "/Hash2Pub/default.nix") { }).shell; simulationSetupScript = pkgs.writeShellScriptBin "simulationSetup" '' # make cabal-install work offline mkdir $HOME/.cabal @@ -12,25 +17,30 @@ let # run simulation script within the shell ${pkgs.nix}/bin/nix-shell ${shell.drvPath} --command "cd ${projectMount} && bash ./build/simulationrunner.sh 2>&1" - ''; - instanceData = builtins.fromJSON (builtins.readFile "${projectDir}/simulationData/inputs/generated/instances_sample.json"); - + ''; + instanceData = builtins.fromJSON ( + builtins.readFile "${projectDir}/simulationData/inputs/generated/instances_sample.json" + ); in { privateNetwork = true; ephemeral = true; bindMounts = { - "${projectMount}" = { hostPath = projectDir; isReadOnly = false; }; + "${projectMount}" = { + hostPath = projectDir; + isReadOnly = false; + }; }; config = { networking = { firewall.enable = false; - interfaces.lo.ipv6.addresses = - builtins.map (inst: {address = inst.ip; prefixLength = 0;}) instanceData; - extraHosts = - pkgs.lib.concatMapStringsSep "\n" (inst: "${inst.ip} ${inst.hostname}") instanceData; + interfaces.lo.ipv6.addresses = builtins.map (inst: { + address = inst.ip; + prefixLength = 0; + }) instanceData; + extraHosts = pkgs.lib.concatMapStringsSep "\n" (inst: "${inst.ip} ${inst.hostname}") instanceData; }; # avoid permission problems with project builds users.users.experimentor = { @@ -39,12 +49,14 @@ in }; # adjust open file limits - security.pam.loginLimits = [{ - domain = "*" - ; type = "-" - ; item = "nofile" - ; value = "50000" - ;}]; + security.pam.loginLimits = [ + { + domain = "*"; + type = "-"; + item = "nofile"; + value = "50000"; + } + ]; environment.systemPackages = [ pkgs.netcat @@ -55,7 +67,7 @@ in pkgs.iftop (pkgs.writeShellScriptBin "doSimulation" '' su experimentor -c "${simulationSetupScript}/bin/simulationSetup" - '') + '') pkgs.tcpdump ]; }; diff --git a/nixremotebuildermachines b/nixremotebuildermachines new file mode 100644 index 0000000..82800d1 --- /dev/null +++ b/nixremotebuildermachines @@ -0,0 +1 @@ +ssh-ng://schmittlauch@build01.nix-community.org x86_64-linux /root/.ssh/remote_builder_key 64 1 big-parallel,kvm,nixos-test - diff --git a/packages/default.nix b/packages/default.nix index 557002f..fe84da9 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,12 +1,8 @@ final: prev: { - power-profiles-daemon = prev.power-profiles-daemon.overrideAttrs (old: { - patches = [ - # patch for AMD pstate CPUs - (final.fetchpatch { - url = "https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/merge_requests/127.patch"; - sha256 = "sha256-CneqixlpZx9iZ0PM5MFIutsvnqKrLlM7FHOHUA/MK6g="; - }) - ]; - }); - + python3 = prev.python3.override { + packageOverrides = python-final: python-prev: { + # spsdk tests fail with timeout on old laptop thinknix + spsdk = python-prev.spsdk.overridePythonAttrs { doCheck = false; }; + }; + }; } diff --git a/patches/keepassxc-fix-darwin-build.patch b/patches/keepassxc-fix-darwin-build.patch new file mode 100644 index 0000000..3684a24 --- /dev/null +++ b/patches/keepassxc-fix-darwin-build.patch @@ -0,0 +1,26 @@ +From 49b7ae226cedb0adb403758e0c63d09762297a22 Mon Sep 17 00:00:00 2001 +From: Fernando Rodrigues +Date: Wed, 28 May 2025 14:06:23 -0300 +Subject: [PATCH] keepassxc: remove unecessary dependency + +KIO no longer seems necessary for KeePassXC, so removing it should +decrease the closure size significantly. + +Reported-by: chopper2000uk <> +Signed-off-by: Fernando Rodrigues +--- + pkgs/by-name/ke/keepassxc/package.nix | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/pkgs/by-name/ke/keepassxc/package.nix b/pkgs/by-name/ke/keepassxc/package.nix +index 170cc7bfe8e384..40b6dc15170f5b 100644 +--- a/pkgs/by-name/ke/keepassxc/package.nix ++++ b/pkgs/by-name/ke/keepassxc/package.nix +@@ -142,7 +142,6 @@ stdenv.mkDerivation (finalAttrs: { + libXi + libXtst + libargon2 +- libsForQt5.kio + libsForQt5.qtbase + libsForQt5.qtsvg + minizip