diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..fb5a3ba --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1 @@ +ce54be9aac846c7798307d6d6fcee3346c01f601 diff --git a/common/default.nix b/common/default.nix index a600ff3..1fef46d 100644 --- a/common/default.nix +++ b/common/default.nix @@ -28,7 +28,6 @@ in # configure console console = { - font = "Lat2-Terminus16"; keyMap = "de"; }; @@ -181,7 +180,7 @@ in # 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 = { @@ -269,4 +268,5 @@ in networking.networkmanager.unmanaged = [ "interface-name:ve-*" ]; services.dbus.implementation = "broker"; + system.rebuild.enableNg = true; } diff --git a/common/packages.nix b/common/packages.nix index 9634e2a..ec4f22b 100644 --- a/common/packages.nix +++ b/common/packages.nix @@ -40,7 +40,7 @@ exfat iotop cifs-utils - dstat + dool lsof macchanger borgbackup diff --git a/common/pulseaudio.nix b/common/pulseaudio.nix index ed94170..7323b57 100644 --- a/common/pulseaudio.nix +++ b/common/pulseaudio.nix @@ -1,7 +1,7 @@ { pkgs, ... }: { # Enable sound. - hardware.pulseaudio = { + services.pulseaudio = { enable = true; package = pkgs.pulseaudioFull; # decouple pulseaudio application and sink volumes diff --git a/darwin/configuration.nix b/darwin/configuration.nix index fc577ec..307836f 100644 --- a/darwin/configuration.nix +++ b/darwin/configuration.nix @@ -4,7 +4,6 @@ imports = [ ../common/nix-settings.nix ]; nix = { enable = true; - package = pkgs.nixVersions.nix_2_25; settings = { trusted-users = [ "os" @@ -21,9 +20,6 @@ }; }; - # Auto upgrade nix package and the daemon service. - services.nix-daemon.enable = true; - # List packages installed in system profile. To search by name, run: # $ nix-env -qaP | grep wget environment.systemPackages = [ pkgs.vim ]; @@ -38,6 +34,7 @@ # 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. diff --git a/flake.lock b/flake.lock index 8ee8ebd..6ceab5d 100644 --- a/flake.lock +++ b/flake.lock @@ -102,16 +102,16 @@ ] }, "locked": { - "lastModified": 1747020534, - "narHash": "sha256-D/6rkiC6w2p+4SwRiVKrWIeYzun8FBg7NlMKMwQMxO0=", + "lastModified": 1753592768, + "narHash": "sha256-oV695RvbAE4+R9pcsT9shmp6zE/+IZe6evHWX63f2Qg=", "owner": "nix-community", "repo": "home-manager", - "rev": "b4bbdc6fde16fc2051fcde232f6e288cd22007ca", + "rev": "fc3add429f21450359369af74c2375cb34a2d204", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.11", + "ref": "release-25.05", "repo": "home-manager", "type": "github" } @@ -163,27 +163,27 @@ ] }, "locked": { - "lastModified": 1743127615, - "narHash": "sha256-+sMGqywrSr50BGMLMeY789mSrzjkoxZiu61eWjYS/8o=", + "lastModified": 1749744770, + "narHash": "sha256-MEM9XXHgBF/Cyv1RES1t6gqAX7/tvayBC1r/KPyK1ls=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "fc843893cecc1838a59713ee3e50e9e7edc6207c", + "rev": "536f951efb1ccda9b968e3c9dee39fbeb6d3fdeb", "type": "github" }, "original": { "owner": "LnL7", - "ref": "nix-darwin-24.11", + "ref": "nix-darwin-25.05", "repo": "nix-darwin", "type": "github" } }, "nixos-hardware": { "locked": { - "lastModified": 1747129300, - "narHash": "sha256-L3clA5YGeYCF47ghsI7Tcex+DnaaN/BbQ4dR2wzoiKg=", + "lastModified": 1754564048, + "narHash": "sha256-dz303vGuzWjzOPOaYkS9xSW+B93PSAJxvBd6CambXVA=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "e81fd167b33121269149c57806599045fd33eeed", + "rev": "26ed7a0d4b8741fe1ef1ee6fa64453ca056ce113", "type": "github" }, "original": { @@ -195,11 +195,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1746904237, - "narHash": "sha256-3e+AVBczosP5dCLQmMoMEogM57gmZ2qrVSrmq9aResQ=", + "lastModified": 1754725699, + "narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d89fc19e405cb2d55ce7cc114356846a0ee5e956", + "rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054", "type": "github" }, "original": { @@ -243,27 +243,27 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1746957726, - "narHash": "sha256-k9ut1LSfHCr0AW82ttEQzXVCqmyWVA5+SHJkS5ID/Jo=", + "lastModified": 1754937576, + "narHash": "sha256-3sWA5WJybUE16kIMZ3+uxcxKZY/JRR4DFBqLdSLBo7w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a39ed32a651fdee6842ec930761e31d1f242cb94", + "rev": "ddae11e58c0c345bf66efbddbf2192ed0e58f896", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.11", + "ref": "nixos-25.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_3": { "locked": { - "lastModified": 1746904237, - "narHash": "sha256-3e+AVBczosP5dCLQmMoMEogM57gmZ2qrVSrmq9aResQ=", + "lastModified": 1754725699, + "narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d89fc19e405cb2d55ce7cc114356846a0ee5e956", + "rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054", "type": "github" }, "original": { @@ -276,15 +276,14 @@ "nur": { "inputs": { "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_3", - "treefmt-nix": "treefmt-nix" + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1747261242, - "narHash": "sha256-6p8kO62jbk+LUrDrLT23XbClNRyosnlfh/KCbE5fwnQ=", + "lastModified": 1755080806, + "narHash": "sha256-P94SMIPWhpSX5tvX4ccFDEC1pm0SsddKNouM49Dz5Oo=", "owner": "nix-community", "repo": "NUR", - "rev": "e29c558fa4174da179e2e7f9a41c34466a200fda", + "rev": "3a675e8f6015cb8ea14138b0c69722b2a0e09dee", "type": "github" }, "original": { @@ -330,7 +329,7 @@ "nixos-unstable": "nixos-unstable", "nixpkgs": "nixpkgs_2", "nur": "nur", - "treefmt-nix": "treefmt-nix_2", + "treefmt-nix": "treefmt-nix", "utils": "utils" } }, @@ -373,36 +372,15 @@ "treefmt-nix": { "inputs": { "nixpkgs": [ - "nur", "nixpkgs" ] }, "locked": { - "lastModified": 1733222881, - "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "lastModified": 1748243702, + "narHash": "sha256-9YzfeN8CB6SzNPyPm2XjRRqSixDopTapaRsnTpXUEY8=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "49717b5af6f80172275d47a418c9719a31a78b53", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - }, - "treefmt-nix_2": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1746216483, - "narHash": "sha256-4h3s1L/kKqt3gMDcVfN8/4v2jqHrgLIe4qok4ApH5x4=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "29ec5026372e0dec56f890e50dbe4f45930320fd", + "rev": "1f3f7b784643d488ba4bf315638b2b0a4c5fb007", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 470ae9b..cb177ff 100644 --- a/flake.nix +++ b/flake.nix @@ -2,11 +2,11 @@ description = "NixOS system flake"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + 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-24.11"; + url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; lanzaboote = { @@ -19,7 +19,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; nix-darwin = { - url = "github:LnL7/nix-darwin/nix-darwin-24.11"; + url = "github:LnL7/nix-darwin/nix-darwin-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -53,7 +53,7 @@ (import nixpkgs { inherit system; }).applyPatches { name = "nixpkgs-patched"; src = nixpkgs; - patches = [ ./patches/nixos-nixpkgs-362c2bc76d359b908ad1389ee28c23ee0e862324.patch ]; + patches = [ ]; }; # necessary to make the top-level inputs available to system configuration @@ -166,6 +166,7 @@ # inspired by https://github.com/Mic92/dotfiles/blob/main/home-manager/flake-module.nix # run like: `nix run .#hm -- ` apps.hm = { + meta.description = "Wrapper around home-manager with automatic profile selection"; type = "app"; program = "${pkgs.writeShellScriptBin "hm" '' set -x diff --git a/home/common.nix b/home/common.nix index 9cb8df9..b8dc67f 100644 --- a/home/common.nix +++ b/home/common.nix @@ -11,6 +11,7 @@ ./modules/packages.nix ./modules/vscodium.nix ./modules/fonts.nix + ./modules/captive-browser.nix ]; home.homeDirectory = if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}"; @@ -51,9 +52,7 @@ merge.tool = "vimdiff"; # provide `git mergetool -t nixfmt` mergetool.nixfmt = { - cmd = "${ - lib.getExe inputs.nixos-unstable.legacyPackages.${system}.nixfmt-rfc-style - } --mergetool \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\""; + cmd = "${lib.getExe pkgs.nixfmt-rfc-style} --mergetool \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\""; trustExitCode = true; }; core.excludesfile = toString ( @@ -105,7 +104,7 @@ enable = true; syntaxHighlighting.enable = true; history.ignoreSpace = true; - initExtra = '' + 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 diff --git a/home/desktop.nix b/home/desktop.nix index 212debf..7fa7840 100644 --- a/home/desktop.nix +++ b/home/desktop.nix @@ -33,46 +33,45 @@ contacts = import "${inputs.mysecrets}/contacts.nix" { inherit lib; }; in { - includes = - [ - { - condition = "gitdir:~/Seafile/Studium/"; + 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.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; - }; + user = { + inherit (contacts.schmittlauch) email name; }; - }) - [ - "~/src/" - "~/bin/" - "~/tmp/" - "~/nixconfigs/" - ]; + }; + }) + [ + "~/src/" + "~/bin/" + "~/tmp/" + "~/nixconfigs/" + ]; }; services.gpg-agent = { enable = true; #enableSshSupport = true; - pinentryPackage = pkgs.pinentry-qt; + pinentry.package = pkgs.pinentry-qt; }; programs.ssh = { diff --git a/home/modules/captive-browser.nix b/home/modules/captive-browser.nix new file mode 100644 index 0000000..f3c8453 --- /dev/null +++ b/home/modules/captive-browser.nix @@ -0,0 +1,81 @@ +{ + pkgs, + lib, + inputs, + config, + system, + ... +}: + +let + tomlFormat = pkgs.formats.toml { }; + cfg = config.programs.captive-browser; + inherit (pkgs.stdenv.hostPlatform) isDarwin; +in +{ + options.programs.captive-browser = { + enable = lib.mkEnableOption "Enable custom captive-browser in user PATH"; + package = lib.mkPackageOption pkgs "captive-browser" { nullable = true; }; + settings = lib.mkOption { + type = lib.types.submodule { + freeformType = tomlFormat.type; + + options = { + browser = lib.mkOption { + type = lib.types.str; + description = "command to invoke the browser with"; + + # browser is the shell (/bin/sh) command executed once the proxy starts. + # When browser exits, the proxy exits. An extra env var PROXY is available. + # + # Here, we use a separate Chrome instance in Incognito mode, so that + # it can run (and be waited for) alongside the default one, and that + # it maintains no state across runs. To configure this browser open a + # normal window in it, settings will be preserved. + default = '' + ${cfg.browserCommand} \ + --user-data-dir="$HOME/Library/Application Support/Google/Captive" \ + --proxy-server="socks5://$PROXY" \ + --host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \ + --no-first-run --new-window --incognito \ + http://example.com + ''; + }; + }; + }; + }; + interface = lib.mkOption { + type = lib.types.str; + description = "WLAN interface to use"; + }; + browserCommand = lib.mkOption { + type = lib.types.str; + default = if isDarwin then "open -n -W -a \"Google Chrome\" --args" else (lib.getExe pkgs.chromium); + }; + }; + config = lib.mkIf cfg.enable { + home.packages = [ cfg.package ]; + + programs.captive-browser.settings = builtins.mapAttrs (_: lib.mkOptionDefault) { + # dhcp-dns is the shell (/bin/sh) command executed to obtain the DHCP + # DNS server address. The first match of an IPv4 regex is used. + # IPv4 only, because let's be real, it's a captive portal. + dhcp-dns = + if isDarwin then + "ipconfig getoption ${cfg.interface} domain_name_server" + else + "${lib.getExe pkgs.dhcpcd} -U ${cfg.interface} | grep domain_name_servers"; + + # socks5-addr is the listen address for the SOCKS5 proxy server. + socks5-addr = "localhost:1666"; + }; + home.file.".config/captive-browser.toml" = lib.mkIf (isDarwin && !config.xdg.enable) { + source = tomlFormat.generate "captive-browser-config" cfg.settings; + }; + + xdg.configFile."captive-browser.toml" = lib.mkIf (!(isDarwin && !config.xdg.enable)) { + source = tomlFormat.generate "captive-browser-config" cfg.settings; + }; + + }; +} diff --git a/home/modules/latex.nix b/home/modules/latex.nix index 3f79930..a9b853c 100644 --- a/home/modules/latex.nix +++ b/home/modules/latex.nix @@ -43,5 +43,6 @@ in koma-script ; }) - ] ++ lib.optionals config.schmittlauch.latex.guiTools latexGuiTools; + ] + ++ lib.optionals config.schmittlauch.latex.guiTools latexGuiTools; } diff --git a/home/modules/packages.nix b/home/modules/packages.nix index 79052c5..d9f1a31 100644 --- a/home/modules/packages.nix +++ b/home/modules/packages.nix @@ -12,83 +12,85 @@ let unstable = inputs.nixos-unstable.legacyPackages.${system}; nur = inputs.nur.legacyPackages.${system}; - graphicsApps = - [ - inkscape - darktable - exiftool - gimp - ] - ++ (with gimpPlugins; [ - fourier - lqrPlugin - ]) - ++ lib.optionals pkgs.stdenv.isLinux [ - hugin - luminanceHDR - xournal - ]; + 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.isLinux [ - vlc - amarok - clementine - elisa - musescore - tenacity - soundkonverter - #nur.repos.fooker.studio-link - ]; + 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 + cliApps = [ + coreutils + myVim + htop + tmux + httpie + rsync + 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 - ]; + 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 @@ -96,33 +98,32 @@ let nix-top statix ]; - devTools = - [ - curl - httpie - gcc - shellcheck - mtr - ripgrep - fd - gitui - pre-commit - scriv + 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 - ]; + # Haskell + ghc + cabal2nix + ] + ++ lib.optionals pkgs.stdenv.isLinux [ + gdb + strace + ltrace + valgrind + zeal + ]; pythonTools = with python3Packages; [ - python3 # to shadow old macOS python + python # to shadow old macOS python ipython uv pip @@ -142,13 +143,12 @@ let desktopCommon = [ keepassxc - tigervnc ]; desktopLinux = [ firefox chromium - falkon + kdePackages.falkon thunderbird calibre dino @@ -164,15 +164,15 @@ let seafile-client alacritty libreoffice-qt6 # still with KDE integration - backintime-common anki signal-desktop (tor-browser-bundle-bin.override { mediaSupport = true; pulseaudioSupport = pkgs.stdenv.isLinux; }) + tigervnc + rustdesk-flutter pdfpc - quaternion nheko gpxsee subsurface @@ -183,7 +183,7 @@ let #(pkgs.pidgin-with-plugins.override { # plugins = [ pkgs.pidginotr ];}) - unstable.logseq + logseq # for Hibiscus banking software jameica @@ -192,33 +192,32 @@ let 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 - ]); + 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 = { diff --git a/home/modules/vscodium.nix b/home/modules/vscodium.nix index 76b4c8d..a42b7ec 100644 --- a/home/modules/vscodium.nix +++ b/home/modules/vscodium.nix @@ -11,112 +11,110 @@ enable = true; package = pkgs.vscodium; mutableExtensionsDir = true; - extensions = - with pkgs.vscode-extensions; - [ - ms-python.python - vscodevim.vim - yzhang.markdown-all-in-one - bungcip.better-toml - eamodio.gitlens - jnoortheen.nix-ide - mkhl.direnv - editorconfig.editorconfig - ] - ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + 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 { - 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 = "black-formatter"; - publisher = "ms-python"; - version = "2023.5.12771008"; - sha256 = "sha256-lJG0RRUUMhQGs2a6oBtoqt+uY1kSJ0+cbmaP07hNh2o="; - } - { - 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; + "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; }; - "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" = "ms-python.black-formatter"; - "editor.formatOnSave" = true; - }; - "python.languageServer" = "Jedi"; # don't use proprietary pylance server - "python.defaultInterpreterPath" = "${defaultPython}/bin/python"; - "black-formatter.path" = [ "${pkgs.python3Packages.black}/bin/black" ]; - "black-formatter.importStrategy" = "fromEnvironment"; - "mypy-type-checker.path" = [ "${pkgs.python3Packages.mypy}/bin/mypy" ]; - "mypy-type-checker.importStrategy" = "fromEnvironment"; - "mypy-type-checker.args" = [ "--ignore-missing-imports" ]; - "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/workmac.nix b/home/workmac.nix index f2b7969..0f8fd43 100644 --- a/home/workmac.nix +++ b/home/workmac.nix @@ -35,9 +35,11 @@ in # defaults in bottom match block "*" # TODO: common config for desktop as well # multiplexer, e.g. to avoid rate limiting on jumphost usage - serverAliveInterval = 60; + serverAliveInterval = 10; + serverAliveCountMax = 2; # 2 strikes and you're out controlMaster = "auto"; - controlPersist = "4h"; + # not too long, due to the frequent keepalives + controlPersist = "1h"; # ssh host config matchBlocks = { @@ -45,7 +47,6 @@ in "*" = { extraOptions = { IdentityAgent = "\"~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock\""; - #ControlPath = "/tmp/ssh_mux_%h_%p_%r"; }; }; @@ -66,34 +67,38 @@ in 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}"; + includes = [ + { + condition = "gitdir:~/src/schmittlauch/"; contents = { user = { - inherit (contacts.work) name email; + 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.initExtra = lib.mkAfter ( + programs.zsh.initContent = lib.mkAfter ( import ./scripts/reporsync.nix { inherit pkgs lib; } + import ./scripts/ssh-loop-fc.nix { inherit pkgs lib; } ); + # separate proxied browser using the DHCP-supplied DNS for accessing captive portals + programs.captive-browser = { + enable = true; + interface = "en0"; + }; launchd.agents.hydra_proxy = { enable = true; config = { @@ -103,7 +108,7 @@ in "0" "-D" "1080" - "-oServerAliveInterval=60" + "-oServerAliveInterval=30" "-oControlMaster=no" "-N" "vpn-whq.services.fcio.net" diff --git a/hosts/framenix/storage.nix b/hosts/framenix/storage.nix index 7fb2801..8acb7fd 100644 --- a/hosts/framenix/storage.nix +++ b/hosts/framenix/storage.nix @@ -39,6 +39,17 @@ in fsType = "vfat"; options = [ "discard" ]; }; + # nix/ lix build directory + # lix: + # > If you plan to use a tmpfs, we **strongly recommend** to set `mode=0755` as a mount option for that `tmpfs`, otherwise you are effectively reverting this mitigation. + "/nix/var/nix/builds" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = [ + "mode=0755" + "size=75%" + ]; + }; }; services.fstrim.enable = true; diff --git a/hosts/thinknix/hardware-configuration.nix b/hosts/thinknix/hardware-configuration.nix index e60ac46..74708b5 100644 --- a/hosts/thinknix/hardware-configuration.nix +++ b/hosts/thinknix/hardware-configuration.nix @@ -21,7 +21,6 @@ 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/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/patches/nixos-nixpkgs-362c2bc76d359b908ad1389ee28c23ee0e862324.patch b/patches/nixos-nixpkgs-362c2bc76d359b908ad1389ee28c23ee0e862324.patch deleted file mode 100644 index dbaf9ee..0000000 --- a/patches/nixos-nixpkgs-362c2bc76d359b908ad1389ee28c23ee0e862324.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 362c2bc76d359b908ad1389ee28c23ee0e862324 Mon Sep 17 00:00:00 2001 -From: Ihar Hrachyshka -Date: Mon, 7 Apr 2025 21:03:09 -0400 -Subject: [PATCH] nodejs_20: fix test failure on darwin on latest MacOS 15.4 - -Signed-off-by: Ihar Hrachyshka -(cherry picked from commit 9674c1f688d12b99fbde26e6068ab62609fef3b1) ---- - pkgs/development/web/nodejs/v20.nix | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/pkgs/development/web/nodejs/v20.nix b/pkgs/development/web/nodejs/v20.nix -index b9c9345c441afa..20cceb5b5d1cda 100644 ---- a/pkgs/development/web/nodejs/v20.nix -+++ b/pkgs/development/web/nodejs/v20.nix -@@ -50,5 +50,10 @@ buildNodejs { - stripLen = 1; - hash = "sha256-6y3aEqxNC4iTQEv1oewodJrhOHxjp5xZMq1P1QL94Rg="; - }) -+ # fix test failure on macos 15.4 -+ (fetchpatch2 { -+ url = "https://github.com/nodejs/node/commit/33f6e1ea296cd20366ab94e666b03899a081af94.patch?full_index=1"; -+ hash = "sha256-aVBMcQlhQeviUQpMIfC988jjDB2BgYzlMYsq+w16mzU="; -+ }) - ] ++ gypPatches; - }