From 38f35f35681d7b5242e2c4abc7d0f5d519c5827b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 4 Apr 2023 21:13:03 +0200 Subject: [PATCH 0001/1295] initial check-in --- configuration.nix | 303 +++++++++++++++++++++++++++++++++++++ hardware-configuration.nix | 41 +++++ 2 files changed, 344 insertions(+) create mode 100644 configuration.nix create mode 100644 hardware-configuration.nix diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 00000000..4e634e64 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,303 @@ +# Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + config, + pkgs, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + # enable home manager + + ]; + + nixpkgs.config = { + # override insync build version + packageOverrides = pkgs: { + my = import (builtins.fetchTarball https://github.com/kaesaecracker/nixpkgs/archive/db254c650b7f5b6657c6579afba1568f7f997195.tar.gz) { + config = config.nixpkgs.config; + }; + }; + + allowUnfree = true; + }; + + boot = { + # supportedFilesystems = [ "btrfs" ]; + loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; + }; + }; + + networking = { + hostName = "vinzenz-lpt"; + # wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # proxy.default = "http://user:password@proxy:port/"; + # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networkmanager.enable = true; + + firewall = { + enable = true; + allowedTCPPortRanges = [ + { + from = 1714; + to = 1764; + } # KDE Connect + ]; + allowedUDPPortRanges = [ + { + from = 1714; + to = 1764; + } # KDE Connect + ]; + }; + }; + + time.timeZone = "Europe/Berlin"; + + i18n = { + defaultLocale = "en_US.UTF-8"; + + extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + }; + + services = { + xserver = { + # Enable the X11 windowing system / wayland depending on DE + enable = true; + + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + + # Configure keymap in X11 + layout = "de"; + xkbVariant = ""; + + # Enable touchpad support (enabled default in most desktopManager). + # libinput.enable = true; + }; + + # Enable CUPS to print documents. + printing.enable = true; + + # Enable the OpenSSH daemon. + openssh = { + enable = true; + permitRootLogin = "no"; + }; + + gnome = { + tracker-miners.enable = false; + tracker.enable = false; + }; + }; + + # Configure console keymap + console.keyMap = "de"; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + 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; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + system = { + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + stateVersion = "22.11"; # Did you read the comment? + + # enable auto updates + autoUpgrade.enable = true; + }; + + nix.gc = { + automatic = true; + dates = "00:30"; + }; + + programs.git = { + enable = true; + package = pkgs.gitFull; + }; + + environment = { + # List packages installed in system profile. + systemPackages = with pkgs; [ + # The Nano editor is also installed by default + ]; + + # remove gnome default apps + gnome.excludePackages = with pkgs.gnome; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + seahorse # password manager + gnome-clocks + gnome-maps + gnome-weather + gnome-music + pkgs.gnome-connections + ]; + }; + + # Define user account + users.users.vinzenz = { + isNormalUser = true; + description = "Vinzenz Schroeter"; + extraGroups = ["networkmanager" "wheel"]; + shell = pkgs.zsh; + # openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3NzaC1kc3MAAACBAPIkGWVEt4..." ]; + }; + + # home manager + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + home-manager.users.vinzenz = { + config, + pkgs, + ... + }: { + #imports = [ "${builtins.fetchTarball https://github.com/schuelermine/xhmm/archive/1608fa757cbd8fb4f11435a50610e44de3fc2223.tar.gz}/console/nano.nix" ]; + + home = { + username = "vinzenz"; + homeDirectory = "/home/vinzenz"; + stateVersion = "22.11"; + #editor = "nano"; + + sessionVariables = { + EDITOR = "nano"; + }; + + packages = with pkgs; [ + firefox + htop + btop + iotop + radeontop + powerline + powerline-fonts + thefuck + keepassxc + steam + wine-staging + nix-zsh-completions + tldr + my.insync-v3 + jetbrains.rider + alejandra + gnome-secrets + amberol + dotnet-sdk_7 + # gnome workbench + tdesktop + lutris + ]; + + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + + services = { + kdeconnect = { + enable = true; + indicator = true; + }; + }; + + programs = { + home-manager.enable = true; + zsh = { + enable = true; + shellAliases = { + my-update = "sudo nixos-rebuild switch"; + my-config = "sudo nano /etc/nixos/configuration.nix"; + my-fmt = "sudo alejandra /etc/nixos/configuration.nix"; + }; + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + }; + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "docker" "systemadmin" "thefuck" "nix-zsh-completions"]; + }; + }; + + git = { + enable = true; + userName = "Vinzenz Schroeter"; + userEmail = "vinzenz.f.s@gmail.com"; + + #package = pkgs.gitFull; + #config.credential.helper = "libsecret"; + + aliases = { + prettylog = "log --pretty=oneline --graph"; + }; + extraConfig = { + pull = { + ff = "only"; + }; + init = { + defaultBranch = "main"; + }; + }; + }; + + vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = [pkgs.vscode-extensions.bbenoist.nix]; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 00000000..95a5f1b1 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + fileSystems."/boot/efi" = + { device = "/dev/disk/by-uuid/2381-1CD2"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d"; } + ]; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} From 76a7a31ef6917f0b84f745116d095ff72014c8e7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 4 Apr 2023 21:41:44 +0200 Subject: [PATCH 0002/1295] split files --- configuration.nix => common.nix | 125 +----------------- home.nix | 125 ++++++++++++++++++ ... => vinzenz-lpt-hardware-configuration.nix | 1 - vinzenz-lpt.nix | 8 ++ 4 files changed, 136 insertions(+), 123 deletions(-) rename configuration.nix => common.nix (60%) create mode 100644 home.nix rename hardware-configuration.nix => vinzenz-lpt-hardware-configuration.nix (99%) create mode 100644 vinzenz-lpt.nix diff --git a/configuration.nix b/common.nix similarity index 60% rename from configuration.nix rename to common.nix index 4e634e64..0e03e654 100644 --- a/configuration.nix +++ b/common.nix @@ -1,15 +1,12 @@ -# Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, ... }: { imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix # enable home manager + ./home.nix ]; nixpkgs.config = { @@ -34,8 +31,8 @@ }; }; + networking = { - hostName = "vinzenz-lpt"; # wireless.enable = true; # Enables wireless support via wpa_supplicant. # Configure network proxy if necessary @@ -62,6 +59,7 @@ }; }; + time.timeZone = "Europe/Berlin"; i18n = { @@ -183,121 +181,4 @@ pkgs.gnome-connections ]; }; - - # Define user account - users.users.vinzenz = { - isNormalUser = true; - description = "Vinzenz Schroeter"; - extraGroups = ["networkmanager" "wheel"]; - shell = pkgs.zsh; - # openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3NzaC1kc3MAAACBAPIkGWVEt4..." ]; - }; - - # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - #imports = [ "${builtins.fetchTarball https://github.com/schuelermine/xhmm/archive/1608fa757cbd8fb4f11435a50610e44de3fc2223.tar.gz}/console/nano.nix" ]; - - home = { - username = "vinzenz"; - homeDirectory = "/home/vinzenz"; - stateVersion = "22.11"; - #editor = "nano"; - - sessionVariables = { - EDITOR = "nano"; - }; - - packages = with pkgs; [ - firefox - htop - btop - iotop - radeontop - powerline - powerline-fonts - thefuck - keepassxc - steam - wine-staging - nix-zsh-completions - tldr - my.insync-v3 - jetbrains.rider - alejandra - gnome-secrets - amberol - dotnet-sdk_7 - # gnome workbench - tdesktop - lutris - ]; - - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - - services = { - kdeconnect = { - enable = true; - indicator = true; - }; - }; - - programs = { - home-manager.enable = true; - zsh = { - enable = true; - shellAliases = { - my-update = "sudo nixos-rebuild switch"; - my-config = "sudo nano /etc/nixos/configuration.nix"; - my-fmt = "sudo alejandra /etc/nixos/configuration.nix"; - }; - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - }; - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "docker" "systemadmin" "thefuck" "nix-zsh-completions"]; - }; - }; - - git = { - enable = true; - userName = "Vinzenz Schroeter"; - userEmail = "vinzenz.f.s@gmail.com"; - - #package = pkgs.gitFull; - #config.credential.helper = "libsecret"; - - aliases = { - prettylog = "log --pretty=oneline --graph"; - }; - extraConfig = { - pull = { - ff = "only"; - }; - init = { - defaultBranch = "main"; - }; - }; - }; - - vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = [pkgs.vscode-extensions.bbenoist.nix]; - }; - }; - }; } diff --git a/home.nix b/home.nix new file mode 100644 index 00000000..53ca13b7 --- /dev/null +++ b/home.nix @@ -0,0 +1,125 @@ +{ + config, + pkgs, + ... +}: { + # Define user account + users.users.vinzenz = { + isNormalUser = true; + description = "Vinzenz Schroeter"; + extraGroups = ["networkmanager" "wheel"]; + shell = pkgs.zsh; + # openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3NzaC1kc3MAAACBAPIkGWVEt4..." ]; + }; + + # home manager + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + home-manager.users.vinzenz = { + config, + pkgs, + ... + }: { + #imports = [ "${builtins.fetchTarball https://github.com/schuelermine/xhmm/archive/1608fa757cbd8fb4f11435a50610e44de3fc2223.tar.gz}/console/nano.nix" ]; + + home = { + username = "vinzenz"; + homeDirectory = "/home/vinzenz"; + stateVersion = "22.11"; + #editor = "nano"; + + sessionVariables = { + EDITOR = "nano"; + }; + + packages = with pkgs; [ + firefox + htop + btop + iotop + radeontop + powerline + powerline-fonts + thefuck + keepassxc + steam + wine-staging + nix-zsh-completions + tldr + my.insync-v3 + jetbrains.rider + alejandra + gnome-secrets + amberol + dotnet-sdk_7 + # gnome workbench + tdesktop + lutris + ]; + + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + + services = { + kdeconnect = { + enable = true; + indicator = true; + }; + }; + + programs = { + home-manager.enable = true; + zsh = { + enable = true; + shellAliases = { + my-update = "sudo nixos-rebuild switch"; + my-config = "sudo nano /etc/nixos/configuration.nix"; + my-fmt = "sudo alejandra /etc/nixos/configuration.nix"; + }; + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + }; + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "docker" "systemadmin" "thefuck" "nix-zsh-completions"]; + }; + }; + + git = { + enable = true; + userName = "Vinzenz Schroeter"; + userEmail = "vinzenz.f.s@gmail.com"; + + #package = pkgs.gitFull; + #config.credential.helper = "libsecret"; + + aliases = { + prettylog = "log --pretty=oneline --graph"; + }; + extraConfig = { + pull = { + ff = "only"; + }; + init = { + defaultBranch = "main"; + }; + }; + }; + + vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = [pkgs.vscode-extensions.bbenoist.nix]; + userSettings = { + "files.insertFinalNewline" = true; + }; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/vinzenz-lpt-hardware-configuration.nix similarity index 99% rename from hardware-configuration.nix rename to vinzenz-lpt-hardware-configuration.nix index 95a5f1b1..79643cb9 100644 --- a/hardware-configuration.nix +++ b/vinzenz-lpt-hardware-configuration.nix @@ -2,7 +2,6 @@ # 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") diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix new file mode 100644 index 00000000..2ad0e9d1 --- /dev/null +++ b/vinzenz-lpt.nix @@ -0,0 +1,8 @@ +{...}: { + networking.hostName = "vinzenz-lpt"; + + imports = [ + ./common.nix + ./vinzenz-lpt-hardware-configuration.nix + ]; +} From 833f3f79e2daec8fd3f6648ebec2527c8d09b0eb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 4 Apr 2023 21:57:12 +0200 Subject: [PATCH 0003/1295] split out gnome --- README.md | 9 +++++++++ common.nix | 41 +++-------------------------------------- gnome.nix | 32 ++++++++++++++++++++++++++++++++ home.nix | 10 ++++++++++ vinzenz-lpt.nix | 3 ++- 5 files changed, 56 insertions(+), 39 deletions(-) create mode 100644 README.md create mode 100644 gnome.nix diff --git a/README.md b/README.md new file mode 100644 index 00000000..edd602a8 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# nixos-configuration + +When adding a new host: +1. install NixOS via the graphical installer +2. `mv /etc/hardware-configuration ./devicename-hardware-configuration.nix` +3. copy an existing devicename.nix +5. change import to new-devicename-hardware-configuration.nix +4. `ln -s ./new-devicename.nix /etc/nixos/configuration` +5. apply diff --git a/common.nix b/common.nix index 0e03e654..34bb1f96 100644 --- a/common.nix +++ b/common.nix @@ -9,16 +9,7 @@ ./home.nix ]; - nixpkgs.config = { - # override insync build version - packageOverrides = pkgs: { - my = import (builtins.fetchTarball https://github.com/kaesaecracker/nixpkgs/archive/db254c650b7f5b6657c6579afba1568f7f997195.tar.gz) { - config = config.nixpkgs.config; - }; - }; - - allowUnfree = true; - }; + nixpkgs.config.allowUnfree = true; boot = { # supportedFilesystems = [ "btrfs" ]; @@ -83,10 +74,6 @@ # Enable the X11 windowing system / wayland depending on DE enable = true; - # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; - desktopManager.gnome.enable = true; - # Configure keymap in X11 layout = "de"; xkbVariant = ""; @@ -104,10 +91,6 @@ permitRootLogin = "no"; }; - gnome = { - tracker-miners.enable = false; - tracker.enable = false; - }; }; # Configure console keymap @@ -161,24 +144,6 @@ package = pkgs.gitFull; }; - environment = { - # List packages installed in system profile. - systemPackages = with pkgs; [ - # The Nano editor is also installed by default - ]; - - # remove gnome default apps - gnome.excludePackages = with pkgs.gnome; [ - cheese # photo booth - epiphany # web browser - evince # document viewer - geary # email client - seahorse # password manager - gnome-clocks - gnome-maps - gnome-weather - gnome-music - pkgs.gnome-connections - ]; - }; + # List packages installed in system profile. + # environment.systemPackages = []; } diff --git a/gnome.nix b/gnome.nix new file mode 100644 index 00000000..3abbd727 --- /dev/null +++ b/gnome.nix @@ -0,0 +1,32 @@ +{ + config, + pkgs, + ... +}: { + services = { + xserver = { + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + }; + + gnome = { + tracker-miners.enable = false; + tracker.enable = false; + }; + }; + + # remove some gnome default apps + environment.gnome.excludePackages = with pkgs.gnome; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + seahorse # password manager + gnome-clocks + gnome-maps + gnome-weather + gnome-music + pkgs.gnome-connections +]; +} diff --git a/home.nix b/home.nix index 53ca13b7..93b76d25 100644 --- a/home.nix +++ b/home.nix @@ -3,6 +3,13 @@ pkgs, ... }: { + # override insync build version + nixpkgs.config.packageOverrides = pkgs: { + my = import (builtins.fetchTarball https://github.com/kaesaecracker/nixpkgs/archive/db254c650b7f5b6657c6579afba1568f7f997195.tar.gz) { + config = config.nixpkgs.config; + }; + }; + # Define user account users.users.vinzenz = { isNormalUser = true; @@ -118,6 +125,9 @@ extensions = [pkgs.vscode-extensions.bbenoist.nix]; userSettings = { "files.insertFinalNewline" = true; + "[nix]" = { + "editor.tabSize" = 2; + }; }; }; }; diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 2ad0e9d1..fa1218cd 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -2,7 +2,8 @@ networking.hostName = "vinzenz-lpt"; imports = [ - ./common.nix ./vinzenz-lpt-hardware-configuration.nix + ./common.nix + ./gnome.nix ]; } From 970480cb53555fbd4450e8fc9df72e139c071d78 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 4 Apr 2023 22:02:28 +0200 Subject: [PATCH 0004/1295] format with alejandra --- common.nix | 18 +++-------- gnome.nix | 8 ++--- home.nix | 10 +++--- vinzenz-lpt-hardware-configuration.nix | 45 ++++++++++++++------------ 4 files changed, 39 insertions(+), 42 deletions(-) diff --git a/common.nix b/common.nix index 34bb1f96..1ceb7f01 100644 --- a/common.nix +++ b/common.nix @@ -11,18 +11,14 @@ nixpkgs.config.allowUnfree = true; - boot = { - # supportedFilesystems = [ "btrfs" ]; - loader = { - systemd-boot.enable = true; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot/efi"; - }; + boot.loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; }; }; - networking = { # wireless.enable = true; # Enables wireless support via wpa_supplicant. @@ -50,12 +46,9 @@ }; }; - time.timeZone = "Europe/Berlin"; - i18n = { defaultLocale = "en_US.UTF-8"; - extraLocaleSettings = { LC_ADDRESS = "de_DE.UTF-8"; LC_IDENTIFICATION = "de_DE.UTF-8"; @@ -90,7 +83,6 @@ enable = true; permitRootLogin = "no"; }; - }; # Configure console keymap diff --git a/gnome.nix b/gnome.nix index 3abbd727..8726c2c3 100644 --- a/gnome.nix +++ b/gnome.nix @@ -5,9 +5,9 @@ }: { services = { xserver = { - # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; - desktopManager.gnome.enable = true; + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; }; gnome = { @@ -28,5 +28,5 @@ gnome-weather gnome-music pkgs.gnome-connections -]; + ]; } diff --git a/home.nix b/home.nix index 93b76d25..8d2e341f 100644 --- a/home.nix +++ b/home.nix @@ -56,7 +56,7 @@ my.insync-v3 jetbrains.rider alejandra - gnome-secrets + # gnome-secrets amberol dotnet-sdk_7 # gnome workbench @@ -124,10 +124,10 @@ enableUpdateCheck = false; extensions = [pkgs.vscode-extensions.bbenoist.nix]; userSettings = { - "files.insertFinalNewline" = true; - "[nix]" = { - "editor.tabSize" = 2; - }; + "files.insertFinalNewline" = true; + "[nix]" = { + "editor.tabSize" = 2; + }; }; }; }; diff --git a/vinzenz-lpt-hardware-configuration.nix b/vinzenz-lpt-hardware-configuration.nix index 79643cb9..a44d0b14 100644 --- a/vinzenz-lpt-hardware-configuration.nix +++ b/vinzenz-lpt-hardware-configuration.nix @@ -1,31 +1,36 @@ # 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 = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; - fsType = "btrfs"; - options = [ "subvol=@" ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; - fileSystems."/boot/efi" = - { device = "/dev/disk/by-uuid/2381-1CD2"; - fsType = "vfat"; - }; + fileSystems."/boot/efi" = { + device = "/dev/disk/by-uuid/2381-1CD2"; + fsType = "vfat"; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} + ]; # 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 From 06c68732ff5637b69e3726d1c7f230ed7f15ca7a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 4 Apr 2023 22:14:17 +0200 Subject: [PATCH 0005/1295] remove broken zsh completions --- home.nix | 64 +++++++++++++++++++++++++++---------------------- vinzenz-pc2.nix | 9 +++++++ 2 files changed, 45 insertions(+), 28 deletions(-) create mode 100644 vinzenz-pc2.nix diff --git a/home.nix b/home.nix index 8d2e341f..0337bd03 100644 --- a/home.nix +++ b/home.nix @@ -27,42 +27,50 @@ pkgs, ... }: { - #imports = [ "${builtins.fetchTarball https://github.com/schuelermine/xhmm/archive/1608fa757cbd8fb4f11435a50610e44de3fc2223.tar.gz}/console/nano.nix" ]; - home = { username = "vinzenz"; homeDirectory = "/home/vinzenz"; stateVersion = "22.11"; - #editor = "nano"; sessionVariables = { EDITOR = "nano"; }; - packages = with pkgs; [ - firefox - htop - btop - iotop - radeontop - powerline - powerline-fonts - thefuck - keepassxc - steam - wine-staging - nix-zsh-completions - tldr - my.insync-v3 - jetbrains.rider - alejandra - # gnome-secrets - amberol - dotnet-sdk_7 - # gnome workbench - tdesktop - lutris - ]; + packages = with pkgs; + [] + # Apps + ++ [ + firefox + keepassxc + steam + wine-staging + my.insync-v3 + # gnome-secrets + tdesktop + lutris + amberol + ] + # system monitoring + ++ [ + htop + btop + iotop + radeontop + ] + # command line niceness + ++ [ + tldr + powerline + powerline-fonts + thefuck + ] + # development + ++ [ + dotnet-sdk_7 + # gnome workbench + jetbrains.rider + alejandra + ]; file.".nanorc".text = '' set linenumbers @@ -93,7 +101,7 @@ oh-my-zsh = { enable = true; theme = "agnoster"; - plugins = ["git" "sudo" "docker" "systemadmin" "thefuck" "nix-zsh-completions"]; + plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; }; }; diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix new file mode 100644 index 00000000..daa9fec7 --- /dev/null +++ b/vinzenz-pc2.nix @@ -0,0 +1,9 @@ +{...}: { + networking.hostName = "vinzenz-pc2"; + + imports = [ + ./vinzenz-pc2-hardware-configuration.nix + ./common.nix + ./kde.nix + ]; +} From 223a66264a62f7b49d0013d955a31e7740131b68 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 4 Apr 2023 22:19:39 +0200 Subject: [PATCH 0006/1295] Create LICENSE --- LICENSE | 339 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 339 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. From c041ac5f4d8ec5830ccac3822cd9b551bc5b6f49 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 13 Apr 2023 20:33:20 +0200 Subject: [PATCH 0007/1295] add some packages --- README.md | 7 ++++--- home.nix | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index edd602a8..61c5a701 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ When adding a new host: 1. install NixOS via the graphical installer 2. `mv /etc/hardware-configuration ./devicename-hardware-configuration.nix` 3. copy an existing devicename.nix -5. change import to new-devicename-hardware-configuration.nix -4. `ln -s ./new-devicename.nix /etc/nixos/configuration` -5. apply +5. change import to `new-devicename-hardware-configuration.nix` +6. set the hostname and optional imports in `new-devicename.nix` +7. `ln -s ./new-devicename.nix /etc/nixos/configuration` +8. apply diff --git a/home.nix b/home.nix index 0337bd03..3dc8918d 100644 --- a/home.nix +++ b/home.nix @@ -49,6 +49,7 @@ tdesktop lutris amberol + simple-scan ] # system monitoring ++ [ @@ -56,6 +57,8 @@ btop iotop radeontop + lsof + wirelesstools ] # command line niceness ++ [ @@ -70,6 +73,9 @@ # gnome workbench jetbrains.rider alejandra + arduino + uucp + screen ]; file.".nanorc".text = '' From 3c616bac52dba4bdc996079f786ae672b73ac420 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 19 Aug 2023 20:13:11 +0200 Subject: [PATCH 0008/1295] fix wifi, add apps, update insync, some vscode settings --- common.nix | 14 ++++++++++-- home.nix | 31 +++++++++++++++++++------- vinzenz-lpt-hardware-configuration.nix | 1 + 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/common.nix b/common.nix index 1ceb7f01..71578430 100644 --- a/common.nix +++ b/common.nix @@ -21,6 +21,7 @@ networking = { # wireless.enable = true; # Enables wireless support via wpa_supplicant. + # wireless.userControlled.enable = true; # Configure network proxy if necessary # proxy.default = "http://user:password@proxy:port/"; @@ -33,15 +34,17 @@ enable = true; allowedTCPPortRanges = [ { + # KDE Connect from = 1714; to = 1764; - } # KDE Connect + } ]; allowedUDPPortRanges = [ { + # KDE Connect from = 1714; to = 1764; - } # KDE Connect + } ]; }; }; @@ -136,6 +139,13 @@ package = pkgs.gitFull; }; + + programs.steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; + # List packages installed in system profile. # environment.systemPackages = []; } diff --git a/home.nix b/home.nix index 3dc8918d..a1552cec 100644 --- a/home.nix +++ b/home.nix @@ -5,7 +5,7 @@ }: { # override insync build version nixpkgs.config.packageOverrides = pkgs: { - my = import (builtins.fetchTarball https://github.com/kaesaecracker/nixpkgs/archive/db254c650b7f5b6657c6579afba1568f7f997195.tar.gz) { + my = import (builtins.fetchTarball https://github.com/kaesaecracker/nixpkgs/archive/0fa91456d2f6dfb9cd4008e81c89c2fec8512415.tar.gz) { config = config.nixpkgs.config; }; }; @@ -50,6 +50,11 @@ lutris amberol simple-scan + gnome.gpaste + wireguard-tools + # steamlink + chromium + element-desktop ] # system monitoring ++ [ @@ -59,6 +64,7 @@ radeontop lsof wirelesstools + #lm-sensors ] # command line niceness ++ [ @@ -76,6 +82,8 @@ arduino uucp screen + jetbrains.pycharm-professional + kdiff3 ]; file.".nanorc".text = '' @@ -123,12 +131,9 @@ prettylog = "log --pretty=oneline --graph"; }; extraConfig = { - pull = { - ff = "only"; - }; - init = { - defaultBranch = "main"; - }; + pull.ff = "only"; + init.defaultBranch = "main"; + merge.tool = "kdiff3"; }; }; @@ -136,12 +141,22 @@ enable = true; package = pkgs.vscodium; enableUpdateCheck = false; - extensions = [pkgs.vscode-extensions.bbenoist.nix]; + extensions = with pkgs; [ + vscode-extensions.bbenoist.nix + vscode-extensions.ms-python.python + ]; userSettings = { "files.insertFinalNewline" = true; + "git.autofetch" = true; + "update.mode" = "none"; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; "[nix]" = { "editor.tabSize" = 2; }; + "redhat.telemetry.enabled" = false; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; }; }; }; diff --git a/vinzenz-lpt-hardware-configuration.nix b/vinzenz-lpt-hardware-configuration.nix index a44d0b14..0aa84772 100644 --- a/vinzenz-lpt-hardware-configuration.nix +++ b/vinzenz-lpt-hardware-configuration.nix @@ -41,5 +41,6 @@ # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.enableRedistributableFirmware = true; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } From 988155162d477b34ba1bb686b30019e3b097198e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Aug 2023 14:54:08 +0200 Subject: [PATCH 0009/1295] add yt music and docker --- home.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home.nix b/home.nix index a1552cec..da935a02 100644 --- a/home.nix +++ b/home.nix @@ -55,6 +55,7 @@ # steamlink chromium element-desktop + youtube-music ] # system monitoring ++ [ @@ -84,6 +85,7 @@ screen jetbrains.pycharm-professional kdiff3 + docker ]; file.".nanorc".text = '' From 00ba15ab5190cbecafaf9f000baeef2680c699f3 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Aug 2023 17:29:01 +0200 Subject: [PATCH 0010/1295] direnv --- common.nix | 9 ++++++--- gnome.nix | 2 ++ home.nix | 14 ++++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/common.nix b/common.nix index 71578430..d5ec072b 100644 --- a/common.nix +++ b/common.nix @@ -139,13 +139,16 @@ package = pkgs.gitFull; }; - programs.steam = { enable = true; remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server }; - # List packages installed in system profile. - # environment.systemPackages = []; + environment = { + pathsToLink = ["/share/zsh"]; + + # List packages installed in system profile. + # systemPackages = []; + }; } diff --git a/gnome.nix b/gnome.nix index 8726c2c3..8e1a5c32 100644 --- a/gnome.nix +++ b/gnome.nix @@ -16,6 +16,8 @@ }; }; + environment.systemPackages = [pkgs.gnomeExtensions.gsconnect]; + # remove some gnome default apps environment.gnome.excludePackages = with pkgs.gnome; [ cheese # photo booth diff --git a/home.nix b/home.nix index da935a02..5d90f39c 100644 --- a/home.nix +++ b/home.nix @@ -73,6 +73,7 @@ powerline powerline-fonts thefuck + direnv ] # development ++ [ @@ -105,20 +106,29 @@ home-manager.enable = true; zsh = { enable = true; + + # syntaxHighlighting.enable = true; + enableAutosuggestions = true; + enableVteIntegration = true; + shellAliases = { my-update = "sudo nixos-rebuild switch"; - my-config = "sudo nano /etc/nixos/configuration.nix"; - my-fmt = "sudo alejandra /etc/nixos/configuration.nix"; + my-fmt = "alejandra ."; }; + history = { size = 10000; path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; }; + oh-my-zsh = { enable = true; theme = "agnoster"; plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; }; + + initExtra = "eval \"$(direnv hook zsh)\""; }; git = { From c1c59ed9e26cdd621a71e9a3cfecbdda0f52ccf4 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Aug 2023 18:27:34 +0200 Subject: [PATCH 0011/1295] configure a buch of stuff through home manager --- home.nix | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 5 deletions(-) diff --git a/home.nix b/home.nix index 5d90f39c..f789f318 100644 --- a/home.nix +++ b/home.nix @@ -40,7 +40,6 @@ [] # Apps ++ [ - firefox keepassxc steam wine-staging @@ -53,13 +52,11 @@ gnome.gpaste wireguard-tools # steamlink - chromium element-desktop youtube-music ] # system monitoring ++ [ - htop btop iotop radeontop @@ -73,7 +70,6 @@ powerline powerline-fonts thefuck - direnv ] # development ++ [ @@ -104,10 +100,18 @@ programs = { home-manager.enable = true; + + firefox.enable = true; + atuin.enable = true; + command-not-found.enable = true; + dircolors.enable = true; + fzf.enable = true; + htop.enable = true; + zsh = { enable = true; - # syntaxHighlighting.enable = true; + enableSyntaxHighlighting = true; enableAutosuggestions = true; enableVteIntegration = true; @@ -149,6 +153,11 @@ }; }; + gh = { + enable = true; + enableGitCredentialHelper = true; + }; + vscode = { enable = true; package = pkgs.vscodium; @@ -171,6 +180,61 @@ "markdown.extension.toc.orderedList" = false; }; }; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + + bottom = { + enable = true; + settings = { + # https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml + }; + }; + + exa = { + enable = true; + # not availiable at 22.11 + # git = true; + # icons = true; + # enableAliases = true; + # extraOptions = [ + # "--group-directories-first" + # "--header" + # ]; + }; + + # checked https://rycee.gitlab.io/home-manager/options.html until "programs.jq" + }; + + editorconfig = { + enable = true; + settings = { + "*" = { + charset = "utf-8"; + end_of_line = "lf"; + trim_trailing_whitespace = true; + insert_final_newline = true; + max_line_width = 120; + indent_style = "space"; + indent_size = 4; + }; + }; }; }; } From 4585904bdc29241676e437113f31fc1e1457add2 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Aug 2023 22:37:34 +0200 Subject: [PATCH 0012/1295] upgrade to nixos 23.05 --- common.nix | 32 +++++++++------- home.nix | 107 ++++++++++++++++++++++------------------------------- 2 files changed, 64 insertions(+), 75 deletions(-) diff --git a/common.nix b/common.nix index d5ec072b..524f1089 100644 --- a/common.nix +++ b/common.nix @@ -9,7 +9,12 @@ ./home.nix ]; - nixpkgs.config.allowUnfree = true; + nixpkgs.config = { + allowUnfree = true; + permittedInsecurePackages = [ + "electron-12.2.3" + ]; + }; boot.loader = { systemd-boot.enable = true; @@ -73,9 +78,6 @@ # Configure keymap in X11 layout = "de"; xkbVariant = ""; - - # Enable touchpad support (enabled default in most desktopManager). - # libinput.enable = true; }; # Enable CUPS to print documents. @@ -84,7 +86,7 @@ # Enable the OpenSSH daemon. openssh = { enable = true; - permitRootLogin = "no"; + settings.PermitRootLogin = "no"; }; }; @@ -134,15 +136,19 @@ dates = "00:30"; }; - programs.git = { - enable = true; - package = pkgs.gitFull; - }; + programs = { + git = { + enable = true; + package = pkgs.gitFull; + }; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; + + zsh.enable = true; }; environment = { diff --git a/home.nix b/home.nix index f789f318..1fab343d 100644 --- a/home.nix +++ b/home.nix @@ -3,13 +3,6 @@ pkgs, ... }: { - # override insync build version - nixpkgs.config.packageOverrides = pkgs: { - my = import (builtins.fetchTarball https://github.com/kaesaecracker/nixpkgs/archive/0fa91456d2f6dfb9cd4008e81c89c2fec8512415.tar.gz) { - config = config.nixpkgs.config; - }; - }; - # Define user account users.users.vinzenz = { isNormalUser = true; @@ -36,54 +29,46 @@ EDITOR = "nano"; }; - packages = with pkgs; - [] - # Apps - ++ [ - keepassxc - steam - wine-staging - my.insync-v3 - # gnome-secrets - tdesktop - lutris - amberol - simple-scan - gnome.gpaste - wireguard-tools - # steamlink - element-desktop - youtube-music - ] - # system monitoring - ++ [ - btop - iotop - radeontop - lsof - wirelesstools - #lm-sensors - ] - # command line niceness - ++ [ - tldr - powerline - powerline-fonts - thefuck - ] - # development - ++ [ - dotnet-sdk_7 - # gnome workbench - jetbrains.rider - alejandra - arduino - uucp - screen - jetbrains.pycharm-professional - kdiff3 - docker - ]; + packages = with pkgs; [ + ## Apps + keepassxc + steam + wine-staging + insync + # gnome-secrets + tdesktop + lutris + amberol + simple-scan + gnome.gpaste + wireguard-tools + # steamlink + element-desktop + # youtube-music + etcher + ## system monitoring + iotop + radeontop + lsof + wirelesstools + # lm-sensors + ## command line niceness + tldr + powerline + powerline-fonts + thefuck + ## development + dotnet-sdk_7 + # gnome workbench + jetbrains.rider + alejandra + arduino + uucp + screen + jetbrains.pycharm-professional + kdiff3 + docker + ]; file.".nanorc".text = '' set linenumbers @@ -102,7 +87,6 @@ home-manager.enable = true; firefox.enable = true; - atuin.enable = true; command-not-found.enable = true; dircolors.enable = true; fzf.enable = true; @@ -115,6 +99,8 @@ enableAutosuggestions = true; enableVteIntegration = true; + initExtra = "eval \"$(direnv hook zsh)\""; + shellAliases = { my-update = "sudo nixos-rebuild switch"; my-fmt = "alejandra ."; @@ -131,8 +117,6 @@ theme = "agnoster"; plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; }; - - initExtra = "eval \"$(direnv hook zsh)\""; }; git = { @@ -167,14 +151,10 @@ vscode-extensions.ms-python.python ]; userSettings = { - "files.insertFinalNewline" = true; "git.autofetch" = true; "update.mode" = "none"; "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; "editor.fontLigatures" = true; - "[nix]" = { - "editor.tabSize" = 2; - }; "redhat.telemetry.enabled" = false; "markdown.extension.tableFormatter.normalizeIndentation" = true; "markdown.extension.toc.orderedList" = false; @@ -234,6 +214,9 @@ indent_style = "space"; indent_size = 4; }; + "*.nix" = { + indent_size = 2; + }; }; }; }; From be2290371c45706bf340f6a87541ad23e516e5d7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 27 Aug 2023 13:28:13 +0200 Subject: [PATCH 0013/1295] setup desktop with nixos --- README.md | 5 +-- common.nix | 5 +-- gnome.nix | 11 ++++++ home.nix | 2 -- kde.nix | 29 ++++++++++++++++ vinzenz-lpt-hardware-configuration.nix | 14 ++++---- vinzenz-pc2.nix | 9 ----- vinzenz-pc3-hardware-configuration.nix | 46 ++++++++++++++++++++++++++ vinzenz-pc3.nix | 9 +++++ 9 files changed, 106 insertions(+), 24 deletions(-) create mode 100644 kde.nix delete mode 100644 vinzenz-pc2.nix create mode 100644 vinzenz-pc3-hardware-configuration.nix create mode 100644 vinzenz-pc3.nix diff --git a/README.md b/README.md index 61c5a701..3195c038 100644 --- a/README.md +++ b/README.md @@ -6,5 +6,6 @@ When adding a new host: 3. copy an existing devicename.nix 5. change import to `new-devicename-hardware-configuration.nix` 6. set the hostname and optional imports in `new-devicename.nix` -7. `ln -s ./new-devicename.nix /etc/nixos/configuration` -8. apply +7. `ln -s ./new-devicename.nix /etc/nixos/configuration.nix` +8. `sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager` +9. apply diff --git a/common.nix b/common.nix index 524f1089..6f36d020 100644 --- a/common.nix +++ b/common.nix @@ -18,10 +18,7 @@ boot.loader = { systemd-boot.enable = true; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot/efi"; - }; + efi.canTouchEfiVariables = true; }; networking = { diff --git a/gnome.nix b/gnome.nix index 8e1a5c32..f68a1b5d 100644 --- a/gnome.nix +++ b/gnome.nix @@ -31,4 +31,15 @@ gnome-music pkgs.gnome-connections ]; + + home-manager.users.vinzenz = { + config, + pkgs, + ... + }: { + home.packages = with pkgs; [ + gnome.gpaste + amberol + ]; + }; } diff --git a/home.nix b/home.nix index 1fab343d..c8d92c63 100644 --- a/home.nix +++ b/home.nix @@ -38,9 +38,7 @@ # gnome-secrets tdesktop lutris - amberol simple-scan - gnome.gpaste wireguard-tools # steamlink element-desktop diff --git a/kde.nix b/kde.nix new file mode 100644 index 00000000..80949761 --- /dev/null +++ b/kde.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: +{ + + services = { + # Enable the KDE Plasma Desktop Environment. + xserver = { + displayManager.sddm.enable = true; + desktopManager.plasma5.enable = true; + }; + }; + + + + home-manager.users.vinzenz = { + config, + pkgs, + ... + }: { + home = { + packages = with pkgs; [ + ]; + }; + services.kdeconnect = { + enable = true; + indicator = true; + }; + }; + +} diff --git a/vinzenz-lpt-hardware-configuration.nix b/vinzenz-lpt-hardware-configuration.nix index 0aa84772..096c2f24 100644 --- a/vinzenz-lpt-hardware-configuration.nix +++ b/vinzenz-lpt-hardware-configuration.nix @@ -1,6 +1,3 @@ -# 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, @@ -12,10 +9,13 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot = { + initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; + initrd.kernelModules = []; + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + loader.efi.efiSysMountPoint = "/boot/efi"; + }; fileSystems."/" = { device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix deleted file mode 100644 index daa9fec7..00000000 --- a/vinzenz-pc2.nix +++ /dev/null @@ -1,9 +0,0 @@ -{...}: { - networking.hostName = "vinzenz-pc2"; - - imports = [ - ./vinzenz-pc2-hardware-configuration.nix - ./common.nix - ./kde.nix - ]; -} diff --git a/vinzenz-pc3-hardware-configuration.nix b/vinzenz-pc3-hardware-configuration.nix new file mode 100644 index 00000000..5603aa89 --- /dev/null +++ b/vinzenz-pc3-hardware-configuration.nix @@ -0,0 +1,46 @@ +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot = { + initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "sd_mod" ]; # "usb_storage" + initrd.kernelModules = [ ]; + kernelModules = [ "kvm-amd" ]; + extraModulePackages = [ ]; + loader.efi.efiSysMountPoint = "/boot"; + }; + + fileSystems = { + "/" = + { device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + "/boot" = + { device = "/dev/disk/by-uuid/AF67-8F16"; + fsType = "vfat"; + }; + }; + + fileSystems."/sdmanjaro" = + { device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + swapDevices = [ ]; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix new file mode 100644 index 00000000..458a499b --- /dev/null +++ b/vinzenz-pc3.nix @@ -0,0 +1,9 @@ +{...}: { + networking.hostName = "vinzenz-pc3"; + + imports = [ + ./vinzenz-pc3-hardware-configuration.nix + ./common.nix + ./kde.nix + ]; +} From bc73a316f11c79d5c7e76c620440d6278e2b819f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 27 Aug 2023 13:34:38 +0200 Subject: [PATCH 0014/1295] format files --- gnome.nix | 4 +- kde.nix | 29 +++++++-------- vinzenz-pc3-hardware-configuration.nix | 51 ++++++++++++++++---------- 3 files changed, 47 insertions(+), 37 deletions(-) diff --git a/gnome.nix b/gnome.nix index f68a1b5d..c03bc227 100644 --- a/gnome.nix +++ b/gnome.nix @@ -38,8 +38,8 @@ ... }: { home.packages = with pkgs; [ - gnome.gpaste - amberol + gnome.gpaste + amberol ]; }; } diff --git a/kde.nix b/kde.nix index 80949761..6535c597 100644 --- a/kde.nix +++ b/kde.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: { - + config, + pkgs, + ... +}: { services = { # Enable the KDE Plasma Desktop Environment. xserver = { @@ -9,21 +11,18 @@ }; }; - - - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - home = { - packages = with pkgs; [ - ]; - }; - services.kdeconnect = { + home-manager.users.vinzenz = { + config, + pkgs, + ... + }: { + home = { + packages = with pkgs; [ + ]; + }; + services.kdeconnect = { enable = true; indicator = true; }; }; - } diff --git a/vinzenz-pc3-hardware-configuration.nix b/vinzenz-pc3-hardware-configuration.nix index 5603aa89..353c8287 100644 --- a/vinzenz-pc3-hardware-configuration.nix +++ b/vinzenz-pc3-hardware-configuration.nix @@ -1,37 +1,48 @@ -{ 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" "ahci" "usbhid" "sd_mod" ]; # "usb_storage" - initrd.kernelModules = [ ]; - kernelModules = [ "kvm-amd" ]; - extraModulePackages = [ ]; + initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" + initrd.kernelModules = []; + kernelModules = ["kvm-amd"]; + extraModulePackages = []; loader.efi.efiSysMountPoint = "/boot"; }; fileSystems = { - "/" = - { device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + "/" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; fsType = "btrfs"; - options = [ "subvol=@" ]; + options = ["subvol=@"]; }; - "/boot" = - { device = "/dev/disk/by-uuid/AF67-8F16"; + "/boot" = { + device = "/dev/disk/by-uuid/AF67-8F16"; fsType = "vfat"; }; + + "/sdmanjaro" = { + device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/sdmanjaro/home" = { + device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; + fsType = "btrfs"; + options = ["subvol=home"]; + }; }; - fileSystems."/sdmanjaro" = - { device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; - fsType = "btrfs"; - options = [ "subvol=@" ]; - }; - - swapDevices = [ ]; + swapDevices = []; # 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 From 5c7fb068c3d7ede240ca94728ea476e5ab4fe7ef Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 27 Aug 2023 13:43:24 +0200 Subject: [PATCH 0015/1295] failed mount blocked boot - disable secondary partitions --- vinzenz-pc3-hardware-configuration.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/vinzenz-pc3-hardware-configuration.nix b/vinzenz-pc3-hardware-configuration.nix index 353c8287..3f603b11 100644 --- a/vinzenz-pc3-hardware-configuration.nix +++ b/vinzenz-pc3-hardware-configuration.nix @@ -29,17 +29,17 @@ fsType = "vfat"; }; - "/sdmanjaro" = { - device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; +# "/sdmanjaro" = { +# device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; +# fsType = "btrfs"; +# options = ["subvol=@"]; +# }; - "/sdmanjaro/home" = { - device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; - fsType = "btrfs"; - options = ["subvol=home"]; - }; +# "/sdmanjaro/home" = { +# device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; +# fsType = "btrfs"; +# options = ["subvol=home"]; +# }; }; swapDevices = []; From 419be69b9cae78df565e35c2fd6278d655abcd56 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 27 Aug 2023 14:44:41 +0200 Subject: [PATCH 0016/1295] nix formatter in vscode, some more settings --- home.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/home.nix b/home.nix index c8d92c63..d8ab06ae 100644 --- a/home.nix +++ b/home.nix @@ -147,15 +147,23 @@ extensions = with pkgs; [ vscode-extensions.bbenoist.nix vscode-extensions.ms-python.python + vscode-extensions.kamadorueda.alejandra ]; userSettings = { "git.autofetch" = true; "update.mode" = "none"; "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; "editor.fontLigatures" = true; - "redhat.telemetry.enabled" = false; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailiable"; + "editor.minimap.autohide" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; "markdown.extension.tableFormatter.normalizeIndentation" = true; "markdown.extension.toc.orderedList" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; + "workbench.enableExperiments" = false; }; }; From 72e2acdef1d1186f55726cb1262475ad7ccbcb5f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 27 Aug 2023 20:24:57 +0200 Subject: [PATCH 0017/1295] add roaming ssh pubkey --- common.nix | 6 +++++- home.nix | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/common.nix b/common.nix index 6f36d020..73e101ed 100644 --- a/common.nix +++ b/common.nix @@ -83,7 +83,11 @@ # Enable the OpenSSH daemon. openssh = { enable = true; - settings.PermitRootLogin = "no"; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; }; }; diff --git a/home.nix b/home.nix index d8ab06ae..9529fa1a 100644 --- a/home.nix +++ b/home.nix @@ -9,7 +9,9 @@ description = "Vinzenz Schroeter"; extraGroups = ["networkmanager" "wheel"]; shell = pkgs.zsh; - # openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3NzaC1kc3MAAACBAPIkGWVEt4..." ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" + ]; }; # home manager @@ -37,7 +39,6 @@ insync # gnome-secrets tdesktop - lutris simple-scan wireguard-tools # steamlink @@ -66,6 +67,15 @@ jetbrains.pycharm-professional kdiff3 docker + + (lutris.override { + extraPkgs = pkgs: [ + # List package dependencies here + ]; + extraLibraries = pkgs: [ + # List library dependencies here + ]; + }) ]; file.".nanorc".text = '' From 33ef4623a1d416ed534ee02474cf7f7c892b8814 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 27 Aug 2023 22:48:32 +0200 Subject: [PATCH 0018/1295] figured out mount problems --- home.nix | 22 ++++++++++++---------- kde.nix | 17 ++++++++++++++++- vinzenz-pc3-hardware-configuration.nix | 25 +++++++++++++++---------- 3 files changed, 43 insertions(+), 21 deletions(-) diff --git a/home.nix b/home.nix index 9529fa1a..80d9741c 100644 --- a/home.nix +++ b/home.nix @@ -110,7 +110,9 @@ initExtra = "eval \"$(direnv hook zsh)\""; shellAliases = { - my-update = "sudo nixos-rebuild switch"; + my-apply = "sudo nixos-rebuild boot"; + my-switch = "sudo nixos-rebuild switch"; + my-update = "sudo nixos-rebuild boot --upgrade"; my-fmt = "alejandra ."; }; @@ -165,10 +167,11 @@ "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; "editor.fontLigatures" = true; "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailiable"; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; "editor.minimap.autohide" = true; "diffEditor.diffAlgorithm" = "advanced"; "explorer.excludeGitIgnore" = true; + "workbench.startupEditor" = "readme"; "markdown.extension.tableFormatter.normalizeIndentation" = true; "markdown.extension.toc.orderedList" = false; "telemetry.telemetryLevel" = "off"; @@ -205,14 +208,13 @@ exa = { enable = true; - # not availiable at 22.11 - # git = true; - # icons = true; - # enableAliases = true; - # extraOptions = [ - # "--group-directories-first" - # "--header" - # ]; + git = true; + icons = true; + enableAliases = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; }; # checked https://rycee.gitlab.io/home-manager/options.html until "programs.jq" diff --git a/kde.nix b/kde.nix index 6535c597..2d890a88 100644 --- a/kde.nix +++ b/kde.nix @@ -6,11 +6,25 @@ services = { # Enable the KDE Plasma Desktop Environment. xserver = { - displayManager.sddm.enable = true; desktopManager.plasma5.enable = true; + + displayManager = { + sddm.enable = true; + defaultSession = "plasmawayland"; + }; }; }; + environment.plasma5.excludePackages = with pkgs.libsForQt5; [ + elisa + gwenview + okular + khelpcenter + ]; + + programs.dconf.enable = true; + programs.partition-manager.enable = true; + home-manager.users.vinzenz = { config, pkgs, @@ -20,6 +34,7 @@ packages = with pkgs; [ ]; }; + services.kdeconnect = { enable = true; indicator = true; diff --git a/vinzenz-pc3-hardware-configuration.nix b/vinzenz-pc3-hardware-configuration.nix index 3f603b11..a3f26fdd 100644 --- a/vinzenz-pc3-hardware-configuration.nix +++ b/vinzenz-pc3-hardware-configuration.nix @@ -29,17 +29,22 @@ fsType = "vfat"; }; -# "/sdmanjaro" = { -# device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; -# fsType = "btrfs"; -# options = ["subvol=@"]; -# }; + "/mnt/manjaro" = { + device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; -# "/sdmanjaro/home" = { -# device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; -# fsType = "btrfs"; -# options = ["subvol=home"]; -# }; + "/mnt/manjaro/home" = { + device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; + fsType = "btrfs"; + options = ["subvol=@home"]; + }; + + "/mnt/ssd2" = { + device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; + fsType = "ext4"; + }; }; swapDevices = []; From 786a6703fdb841c9c5012e0cd424ea3f1f895e77 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Sep 2023 14:41:58 +0200 Subject: [PATCH 0019/1295] authorized keys per device --- home.nix | 3 --- vinzenz-pc3.nix | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/home.nix b/home.nix index 80d9741c..5e3806b1 100644 --- a/home.nix +++ b/home.nix @@ -9,9 +9,6 @@ description = "Vinzenz Schroeter"; extraGroups = ["networkmanager" "wheel"]; shell = pkgs.zsh; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" - ]; }; # home manager diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index 458a499b..f1e995ed 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -6,4 +6,8 @@ ./common.nix ./kde.nix ]; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" + ]; } From f1b46e56bfc967756f28d2e9a66b22f6f82ab0e1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Sep 2023 14:53:25 +0200 Subject: [PATCH 0020/1295] merge hw config and machine config --- common.nix | 32 ++----------- home.nix => home-vinzenz.nix | 0 vinzenz-lpt-hardware-configuration.nix | 46 ------------------- vinzenz-lpt.nix | 45 ++++++++++++++++++- vinzenz-pc3-hardware-configuration.nix | 62 -------------------------- vinzenz-pc3.nix | 60 ++++++++++++++++++++++++- 6 files changed, 105 insertions(+), 140 deletions(-) rename home.nix => home-vinzenz.nix (100%) delete mode 100644 vinzenz-lpt-hardware-configuration.nix delete mode 100644 vinzenz-pc3-hardware-configuration.nix diff --git a/common.nix b/common.nix index 73e101ed..344e4aa0 100644 --- a/common.nix +++ b/common.nix @@ -6,7 +6,7 @@ imports = [ # enable home manager - ./home.nix + (modulesPath + "/installer/scan/not-detected.nix") ]; nixpkgs.config = { @@ -25,10 +25,6 @@ # wireless.enable = true; # Enables wireless support via wpa_supplicant. # wireless.userControlled.enable = true; - # Configure network proxy if necessary - # proxy.default = "http://user:password@proxy:port/"; - # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Enable networking networkmanager.enable = true; @@ -103,33 +99,11 @@ alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; }; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - system = { - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - stateVersion = "22.11"; # Did you read the comment? - - # enable auto updates - autoUpgrade.enable = true; + stateVersion = "22.11"; + autoUpgrade.enable = true; # enable auto updates }; nix.gc = { diff --git a/home.nix b/home-vinzenz.nix similarity index 100% rename from home.nix rename to home-vinzenz.nix diff --git a/vinzenz-lpt-hardware-configuration.nix b/vinzenz-lpt-hardware-configuration.nix deleted file mode 100644 index 096c2f24..00000000 --- a/vinzenz-lpt-hardware-configuration.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot = { - initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; - initrd.kernelModules = []; - kernelModules = ["kvm-intel"]; - extraModulePackages = []; - loader.efi.efiSysMountPoint = "/boot/efi"; - }; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - fileSystems."/boot/efi" = { - device = "/dev/disk/by-uuid/2381-1CD2"; - fsType = "vfat"; - }; - - swapDevices = [ - {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} - ]; - - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.enableRedistributableFirmware = true; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index fa1218cd..dc2fa6a3 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -1,9 +1,50 @@ -{...}: { +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { networking.hostName = "vinzenz-lpt"; imports = [ - ./vinzenz-lpt-hardware-configuration.nix ./common.nix ./gnome.nix + ./home-vinzenz.nix ]; + + boot = { + initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; + initrd.kernelModules = []; + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + loader.efi.efiSysMountPoint = "/boot/efi"; + }; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + fileSystems."/boot/efi" = { + device = "/dev/disk/by-uuid/2381-1CD2"; + fsType = "vfat"; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} + ]; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.enableRedistributableFirmware = true; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/vinzenz-pc3-hardware-configuration.nix b/vinzenz-pc3-hardware-configuration.nix deleted file mode 100644 index a3f26fdd..00000000 --- a/vinzenz-pc3-hardware-configuration.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot = { - initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" - initrd.kernelModules = []; - kernelModules = ["kvm-amd"]; - extraModulePackages = []; - loader.efi.efiSysMountPoint = "/boot"; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/AF67-8F16"; - fsType = "vfat"; - }; - - "/mnt/manjaro" = { - device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/mnt/manjaro/home" = { - device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; - fsType = "btrfs"; - options = ["subvol=@home"]; - }; - - "/mnt/ssd2" = { - device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; - fsType = "ext4"; - }; - }; - - swapDevices = []; - - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index f1e995ed..efc90c6e 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -1,13 +1,71 @@ -{...}: { +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { networking.hostName = "vinzenz-pc3"; imports = [ ./vinzenz-pc3-hardware-configuration.nix ./common.nix ./kde.nix + ./home-vinzenz.nix ]; users.users.vinzenz.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" ]; + + boot = { + initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" + initrd.kernelModules = []; + kernelModules = ["kvm-amd"]; + extraModulePackages = []; + loader.efi.efiSysMountPoint = "/boot"; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/AF67-8F16"; + fsType = "vfat"; + }; + + "/mnt/manjaro" = { + device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/mnt/manjaro/home" = { + device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; + fsType = "btrfs"; + options = ["subvol=@home"]; + }; + + "/mnt/ssd2" = { + device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; + fsType = "ext4"; + }; + }; + + swapDevices = []; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } From 6984b3ff6926ee30c920c67d5e2dfdcd3095f18f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Sep 2023 14:54:30 +0200 Subject: [PATCH 0021/1295] Fix broken import --- common.nix | 1 + vinzenz-lpt.nix | 1 - vinzenz-pc3.nix | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common.nix b/common.nix index 344e4aa0..24afd2e3 100644 --- a/common.nix +++ b/common.nix @@ -1,6 +1,7 @@ { config, pkgs, + modulesPath, ... }: { imports = [ diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index dc2fa6a3..882f6712 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -2,7 +2,6 @@ config, lib, pkgs, - modulesPath, ... }: { networking.hostName = "vinzenz-lpt"; diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index efc90c6e..b02846ab 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -2,7 +2,6 @@ config, lib, pkgs, - modulesPath, ... }: { networking.hostName = "vinzenz-pc3"; From ae956898d99232fd64d97f1707177b032c9b329b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Sep 2023 15:18:05 +0200 Subject: [PATCH 0022/1295] add user ronja to pc3 --- home-ronja.nix | 118 +++++++++++++++++++++++++++++++++++++++++++++++ home-vinzenz.nix | 2 +- vinzenz-lpt.nix | 18 ++++---- vinzenz-pc3.nix | 2 +- 4 files changed, 130 insertions(+), 10 deletions(-) create mode 100644 home-ronja.nix diff --git a/home-ronja.nix b/home-ronja.nix new file mode 100644 index 00000000..429e9706 --- /dev/null +++ b/home-ronja.nix @@ -0,0 +1,118 @@ +{ + config, + pkgs, + ... +}: { + # Define user account + users.users.ronja = { + isNormalUser = true; + description = "Ronja Spiegelberg"; + extraGroups = ["networkmanager" "wheel"]; + shell = pkgs.zsh; + }; + + # home manager + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + home-manager.users.ronja = { + config, + pkgs, + ... + }: { + home = { + username = "ronja"; + homeDirectory = "/home/ronja"; + stateVersion = "22.11"; + + sessionVariables = { + EDITOR = "nano"; + }; + + packages = with pkgs; [ + ## Apps + steam + wine-staging + telegram-desktop + tldr + powerline + powerline-fonts + lutris + kdiff3 + + (lutris.override { + extraPkgs = pkgs: [ + # List package dependencies here + ]; + extraLibraries = pkgs: [ + # List library dependencies here + ]; + }) + ]; + + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + + programs = { + home-manager.enable = true; + + firefox.enable = true; + command-not-found.enable = true; + dircolors.enable = true; + htop.enable = true; + + zsh = { + enable = true; + + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "systemadmin"]; + }; + }; + + git = { + enable = true; + userName = "Ronja Spiegelberg"; + userEmail = "ronja.spiegelberg@gmail.com"; + + extraConfig = { + pull.ff = "only"; + init.defaultBranch = "main"; + merge.tool = "kdiff3"; + }; + }; + + gh = { + enable = true; + enableGitCredentialHelper = true; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + }; + }; +} diff --git a/home-vinzenz.nix b/home-vinzenz.nix index 5e3806b1..3821c900 100644 --- a/home-vinzenz.nix +++ b/home-vinzenz.nix @@ -35,7 +35,7 @@ wine-staging insync # gnome-secrets - tdesktop + telegram-desktop simple-scan wireguard-tools # steamlink diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 882f6712..28df583c 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -20,15 +20,17 @@ loader.efi.efiSysMountPoint = "/boot/efi"; }; - fileSystems."/" = { - device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; - fileSystems."/boot/efi" = { - device = "/dev/disk/by-uuid/2381-1CD2"; - fsType = "vfat"; + "/boot/efi" = { + device = "/dev/disk/by-uuid/2381-1CD2"; + fsType = "vfat"; + }; }; swapDevices = [ diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index b02846ab..60ef59ac 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -7,10 +7,10 @@ networking.hostName = "vinzenz-pc3"; imports = [ - ./vinzenz-pc3-hardware-configuration.nix ./common.nix ./kde.nix ./home-vinzenz.nix + ./home-ronja.nix ]; users.users.vinzenz.openssh.authorizedKeys.keys = [ From 930acac8d2860eadd70f3d040536c79ba8173e7e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 1 Sep 2023 17:36:49 +0200 Subject: [PATCH 0023/1295] set systemd shutdown timeout to 7s --- common.nix | 4 ++++ kde.nix | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/common.nix b/common.nix index 24afd2e3..4b55e40e 100644 --- a/common.nix +++ b/common.nix @@ -88,6 +88,10 @@ }; }; + systemd.extraConfig = '' + DefaultTimeoutStopSec=7s + ''; + # Configure console keymap console.keyMap = "de"; diff --git a/kde.nix b/kde.nix index 2d890a88..30372498 100644 --- a/kde.nix +++ b/kde.nix @@ -22,8 +22,10 @@ khelpcenter ]; - programs.dconf.enable = true; - programs.partition-manager.enable = true; + programs = { + dconf.enable = true; + partition-manager.enable = true; + }; home-manager.users.vinzenz = { config, From 7c59588d4e339f64321178102c1c0da78fd67735 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 3 Sep 2023 16:44:26 +0200 Subject: [PATCH 0024/1295] split game subvol, adjust wine pkgs --- home-ronja.nix | 3 ++- home-vinzenz.nix | 13 +++---------- vinzenz-pc3.nix | 10 ++++++++++ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/home-ronja.nix b/home-ronja.nix index 429e9706..ca4eabe1 100644 --- a/home-ronja.nix +++ b/home-ronja.nix @@ -31,13 +31,14 @@ packages = with pkgs; [ ## Apps steam - wine-staging telegram-desktop tldr powerline powerline-fonts lutris kdiff3 + wineWowPackages.staging + winetricks (lutris.override { extraPkgs = pkgs: [ diff --git a/home-vinzenz.nix b/home-vinzenz.nix index 3821c900..08887f92 100644 --- a/home-vinzenz.nix +++ b/home-vinzenz.nix @@ -29,33 +29,24 @@ }; packages = with pkgs; [ - ## Apps keepassxc steam - wine-staging insync - # gnome-secrets telegram-desktop simple-scan wireguard-tools - # steamlink element-desktop - # youtube-music etcher - ## system monitoring iotop radeontop lsof wirelesstools - # lm-sensors - ## command line niceness + lm-sensors tldr powerline powerline-fonts thefuck - ## development dotnet-sdk_7 - # gnome workbench jetbrains.rider alejandra arduino @@ -64,6 +55,8 @@ jetbrains.pycharm-professional kdiff3 docker + wineWowPackages.staging + winetricks (lutris.override { extraPkgs = pkgs: [ diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index 60ef59ac..8ab194a9 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -13,6 +13,10 @@ ./home-ronja.nix ]; + users.groups."games" = { + members = ["vinzenz" "ronja"]; + }; + users.users.vinzenz.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" ]; @@ -32,6 +36,12 @@ options = ["subvol=@"]; }; + "/games" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@games"]; + }; + "/boot" = { device = "/dev/disk/by-uuid/AF67-8F16"; fsType = "vfat"; From dd92427e85830a3eee28dc01e6ec2b2117d033b0 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 3 Sep 2023 16:48:01 +0200 Subject: [PATCH 0025/1295] fix typo, move to system install --- common.nix | 6 ++++-- home-ronja.nix | 1 - home-vinzenz.nix | 2 -- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common.nix b/common.nix index 4b55e40e..a6cab202 100644 --- a/common.nix +++ b/common.nix @@ -134,7 +134,9 @@ environment = { pathsToLink = ["/share/zsh"]; - # List packages installed in system profile. - # systemPackages = []; + systemPackages = with pkgs; [ + lm_sensors + tldr + ]; }; } diff --git a/home-ronja.nix b/home-ronja.nix index ca4eabe1..e350503e 100644 --- a/home-ronja.nix +++ b/home-ronja.nix @@ -32,7 +32,6 @@ ## Apps steam telegram-desktop - tldr powerline powerline-fonts lutris diff --git a/home-vinzenz.nix b/home-vinzenz.nix index 08887f92..ecd82461 100644 --- a/home-vinzenz.nix +++ b/home-vinzenz.nix @@ -41,8 +41,6 @@ radeontop lsof wirelesstools - lm-sensors - tldr powerline powerline-fonts thefuck From ae4dd5280881730c208b7a7e5f06d29b6be91872 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 3 Sep 2023 17:23:55 +0200 Subject: [PATCH 0026/1295] add wine fonts, kate for kde --- home-ronja.nix | 3 ++- home-vinzenz.nix | 3 ++- kde.nix | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/home-ronja.nix b/home-ronja.nix index e350503e..7bb3e872 100644 --- a/home-ronja.nix +++ b/home-ronja.nix @@ -36,7 +36,8 @@ powerline-fonts lutris kdiff3 - wineWowPackages.staging + wineWowPackages.stagingFull + wineWowPackages.fonts winetricks (lutris.override { diff --git a/home-vinzenz.nix b/home-vinzenz.nix index ecd82461..636176b5 100644 --- a/home-vinzenz.nix +++ b/home-vinzenz.nix @@ -53,7 +53,8 @@ jetbrains.pycharm-professional kdiff3 docker - wineWowPackages.staging + wineWowPackages.stagingFull + wineWowPackages.fonts winetricks (lutris.override { diff --git a/kde.nix b/kde.nix index 30372498..7d4976a1 100644 --- a/kde.nix +++ b/kde.nix @@ -15,6 +15,10 @@ }; }; + environment.systemPackages = with pkgs; [ + libsForQt5.kate + ]; + environment.plasma5.excludePackages = with pkgs.libsForQt5; [ elisa gwenview From b418834c210618222297395c9dae1c4b4105395d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 3 Sep 2023 18:17:07 +0200 Subject: [PATCH 0027/1295] enable flatpak support --- common.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common.nix b/common.nix index a6cab202..999b87ac 100644 --- a/common.nix +++ b/common.nix @@ -86,6 +86,8 @@ KbdInteractiveAuthentication = false; }; }; + + flatpak.enable = true; }; systemd.extraConfig = '' From a75d5f54d82b92c6e5a4d2638bb4d9b502155e7c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 4 Sep 2023 18:36:41 +0200 Subject: [PATCH 0028/1295] fix thefuck --- home-vinzenz.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/home-vinzenz.nix b/home-vinzenz.nix index 636176b5..41640a1a 100644 --- a/home-vinzenz.nix +++ b/home-vinzenz.nix @@ -55,7 +55,7 @@ docker wineWowPackages.stagingFull wineWowPackages.fonts - winetricks + winetricks (lutris.override { extraPkgs = pkgs: [ @@ -96,7 +96,10 @@ enableAutosuggestions = true; enableVteIntegration = true; - initExtra = "eval \"$(direnv hook zsh)\""; + initExtra = '' + eval "$(direnv hook zsh)"; + eval $(thefuck --alias); + ''; shellAliases = { my-apply = "sudo nixos-rebuild boot"; From 7a5297a0ddc057c48b28c642a3035a1073b4092e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 5 Sep 2023 19:24:39 +0200 Subject: [PATCH 0029/1295] mount btrfs root subvol --- vinzenz-pc3.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index 8ab194a9..50af8224 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -42,6 +42,14 @@ options = ["subvol=@games"]; }; + "/mnt/nixos_btrfs_root" = { + # subvolume with id 5 is always the root volume + # this is convenient for managing the flat subvolume hierarchy + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvolid=5"]; + }; + "/boot" = { device = "/dev/disk/by-uuid/AF67-8F16"; fsType = "vfat"; From bc7daf2be1a8b2388ad46f74d55a9e0ebb3ba9c7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 5 Sep 2023 21:19:58 +0200 Subject: [PATCH 0030/1295] repartitioning --- common.nix | 1 + kde.nix | 1 + vinzenz-pc3.nix | 12 ------------ 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/common.nix b/common.nix index 999b87ac..b6b0f62c 100644 --- a/common.nix +++ b/common.nix @@ -139,6 +139,7 @@ systemPackages = with pkgs; [ lm_sensors tldr + ncdu ]; }; } diff --git a/kde.nix b/kde.nix index 7d4976a1..bebf59e3 100644 --- a/kde.nix +++ b/kde.nix @@ -17,6 +17,7 @@ environment.systemPackages = with pkgs; [ libsForQt5.kate + libsForQt5.kalk ]; environment.plasma5.excludePackages = with pkgs.libsForQt5; [ diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index 50af8224..65cd6429 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -55,18 +55,6 @@ fsType = "vfat"; }; - "/mnt/manjaro" = { - device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/mnt/manjaro/home" = { - device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; - fsType = "btrfs"; - options = ["subvol=@home"]; - }; - "/mnt/ssd2" = { device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; fsType = "ext4"; From c12681a75742d3f4ba5c26f43f9cc9ea7361c9dd Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 5 Sep 2023 21:46:36 +0200 Subject: [PATCH 0031/1295] flatpak somehow breaks kde? --- common.nix | 2 -- vinzenz-lpt.nix | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common.nix b/common.nix index b6b0f62c..f954f14a 100644 --- a/common.nix +++ b/common.nix @@ -86,8 +86,6 @@ KbdInteractiveAuthentication = false; }; }; - - flatpak.enable = true; }; systemd.extraConfig = '' diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 28df583c..7b07dabf 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -12,6 +12,8 @@ ./home-vinzenz.nix ]; + services.flatpak.enable = true; + boot = { initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; initrd.kernelModules = []; From 2dd3032a02a84ef07b270544943e101c56820cac Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 6 Sep 2023 22:01:29 +0200 Subject: [PATCH 0032/1295] seperate home volume --- .gitignore | 1 + vinzenz-pc3.nix | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..727bc05f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.directory diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index 65cd6429..3c32a635 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -36,12 +36,23 @@ options = ["subvol=@"]; }; + "/home" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@home"]; + }; + "/games" = { device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; fsType = "btrfs"; options = ["subvol=@games"]; }; + "/boot" = { + device = "/dev/disk/by-uuid/AF67-8F16"; + fsType = "vfat"; + }; + "/mnt/nixos_btrfs_root" = { # subvolume with id 5 is always the root volume # this is convenient for managing the flat subvolume hierarchy @@ -49,12 +60,7 @@ fsType = "btrfs"; options = ["subvolid=5"]; }; - - "/boot" = { - device = "/dev/disk/by-uuid/AF67-8F16"; - fsType = "vfat"; - }; - + "/mnt/ssd2" = { device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; fsType = "ext4"; From 9582ea3119537798c2b686a6936f1128ed89a3eb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 12:39:22 +0200 Subject: [PATCH 0033/1295] enable numlock on start for gnome --- gnome.nix | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/gnome.nix b/gnome.nix index c03bc227..8259f2d1 100644 --- a/gnome.nix +++ b/gnome.nix @@ -32,14 +32,27 @@ pkgs.gnome-connections ]; - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - home.packages = with pkgs; [ - gnome.gpaste - amberol - ]; + home-manager.users = { + vinzenz = {pkgs, ...}: { + home.packages = with pkgs; [ + gnome.gpaste + amberol + ]; + + dconf.settings = { + "org/gnome/desktop/peripherals/keyboard" = { + numlock-state = true; + }; + }; + }; + + gdm = {...}: { + home.stateVersion = "23.05"; + dconf.settings = { + "org/gnome/desktop/peripherals/keyboard" = { + numlock-state = true; + }; + }; + }; }; } From 45280d24d7218e1c061b3fda367956769d7ad651 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 12:45:51 +0200 Subject: [PATCH 0034/1295] turns out gdm is read only --- gnome.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/gnome.nix b/gnome.nix index 8259f2d1..bc6aa4d8 100644 --- a/gnome.nix +++ b/gnome.nix @@ -45,14 +45,5 @@ }; }; }; - - gdm = {...}: { - home.stateVersion = "23.05"; - dconf.settings = { - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; - }; - }; }; } From 3a7d1784fa32dfb2050fdf610df8c991c374459a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 13:36:21 +0200 Subject: [PATCH 0035/1295] wip create meta configuration --- gnome.nix | 49 ------- home-ronja.nix | 119 ----------------- home-vinzenz.nix | 233 --------------------------------- kde.nix | 50 ------- common.nix => my/default.nix | 11 +- my/gnome.nix | 59 +++++++++ my/home-ronja.nix | 129 +++++++++++++++++++ my/home-vinzenz.nix | 243 +++++++++++++++++++++++++++++++++++ my/kde.nix | 60 +++++++++ vinzenz-lpt.nix | 9 +- vinzenz-pc3.nix | 2 +- 11 files changed, 506 insertions(+), 458 deletions(-) delete mode 100644 gnome.nix delete mode 100644 home-ronja.nix delete mode 100644 home-vinzenz.nix delete mode 100644 kde.nix rename common.nix => my/default.nix (95%) create mode 100644 my/gnome.nix create mode 100644 my/home-ronja.nix create mode 100644 my/home-vinzenz.nix create mode 100644 my/kde.nix diff --git a/gnome.nix b/gnome.nix deleted file mode 100644 index bc6aa4d8..00000000 --- a/gnome.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - config, - pkgs, - ... -}: { - services = { - xserver = { - # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; - desktopManager.gnome.enable = true; - }; - - gnome = { - tracker-miners.enable = false; - tracker.enable = false; - }; - }; - - environment.systemPackages = [pkgs.gnomeExtensions.gsconnect]; - - # remove some gnome default apps - environment.gnome.excludePackages = with pkgs.gnome; [ - cheese # photo booth - epiphany # web browser - evince # document viewer - geary # email client - seahorse # password manager - gnome-clocks - gnome-maps - gnome-weather - gnome-music - pkgs.gnome-connections - ]; - - home-manager.users = { - vinzenz = {pkgs, ...}: { - home.packages = with pkgs; [ - gnome.gpaste - amberol - ]; - - dconf.settings = { - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; - }; - }; - }; -} diff --git a/home-ronja.nix b/home-ronja.nix deleted file mode 100644 index 7bb3e872..00000000 --- a/home-ronja.nix +++ /dev/null @@ -1,119 +0,0 @@ -{ - config, - pkgs, - ... -}: { - # Define user account - users.users.ronja = { - isNormalUser = true; - description = "Ronja Spiegelberg"; - extraGroups = ["networkmanager" "wheel"]; - shell = pkgs.zsh; - }; - - # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - home-manager.users.ronja = { - config, - pkgs, - ... - }: { - home = { - username = "ronja"; - homeDirectory = "/home/ronja"; - stateVersion = "22.11"; - - sessionVariables = { - EDITOR = "nano"; - }; - - packages = with pkgs; [ - ## Apps - steam - telegram-desktop - powerline - powerline-fonts - lutris - kdiff3 - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks - - (lutris.override { - extraPkgs = pkgs: [ - # List package dependencies here - ]; - extraLibraries = pkgs: [ - # List library dependencies here - ]; - }) - ]; - - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - - programs = { - home-manager.enable = true; - - firefox.enable = true; - command-not-found.enable = true; - dircolors.enable = true; - htop.enable = true; - - zsh = { - enable = true; - - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "systemadmin"]; - }; - }; - - git = { - enable = true; - userName = "Ronja Spiegelberg"; - userEmail = "ronja.spiegelberg@gmail.com"; - - extraConfig = { - pull.ff = "only"; - init.defaultBranch = "main"; - merge.tool = "kdiff3"; - }; - }; - - gh = { - enable = true; - enableGitCredentialHelper = true; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - }; - }; -} diff --git a/home-vinzenz.nix b/home-vinzenz.nix deleted file mode 100644 index 41640a1a..00000000 --- a/home-vinzenz.nix +++ /dev/null @@ -1,233 +0,0 @@ -{ - config, - pkgs, - ... -}: { - # Define user account - users.users.vinzenz = { - isNormalUser = true; - description = "Vinzenz Schroeter"; - extraGroups = ["networkmanager" "wheel"]; - shell = pkgs.zsh; - }; - - # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - home = { - username = "vinzenz"; - homeDirectory = "/home/vinzenz"; - stateVersion = "22.11"; - - sessionVariables = { - EDITOR = "nano"; - }; - - packages = with pkgs; [ - keepassxc - steam - insync - telegram-desktop - simple-scan - wireguard-tools - element-desktop - etcher - iotop - radeontop - lsof - wirelesstools - powerline - powerline-fonts - thefuck - dotnet-sdk_7 - jetbrains.rider - alejandra - arduino - uucp - screen - jetbrains.pycharm-professional - kdiff3 - docker - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks - - (lutris.override { - extraPkgs = pkgs: [ - # List package dependencies here - ]; - extraLibraries = pkgs: [ - # List library dependencies here - ]; - }) - ]; - - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - - services = { - kdeconnect = { - enable = true; - indicator = true; - }; - }; - - programs = { - home-manager.enable = true; - - firefox.enable = true; - command-not-found.enable = true; - dircolors.enable = true; - fzf.enable = true; - htop.enable = true; - - zsh = { - enable = true; - - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - - initExtra = '' - eval "$(direnv hook zsh)"; - eval $(thefuck --alias); - ''; - - shellAliases = { - my-apply = "sudo nixos-rebuild boot"; - my-switch = "sudo nixos-rebuild switch"; - my-update = "sudo nixos-rebuild boot --upgrade"; - my-fmt = "alejandra ."; - }; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; - }; - }; - - git = { - enable = true; - userName = "Vinzenz Schroeter"; - userEmail = "vinzenz.f.s@gmail.com"; - - #package = pkgs.gitFull; - #config.credential.helper = "libsecret"; - - aliases = { - prettylog = "log --pretty=oneline --graph"; - }; - extraConfig = { - pull.ff = "only"; - init.defaultBranch = "main"; - merge.tool = "kdiff3"; - }; - }; - - gh = { - enable = true; - enableGitCredentialHelper = true; - }; - - vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs; [ - vscode-extensions.bbenoist.nix - vscode-extensions.ms-python.python - vscode-extensions.kamadorueda.alejandra - ]; - userSettings = { - "git.autofetch" = true; - "update.mode" = "none"; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; - "workbench.startupEditor" = "readme"; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; - "workbench.enableExperiments" = false; - }; - }; - - direnv = { - enable = true; - nix-direnv.enable = true; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - - bottom = { - enable = true; - settings = { - # https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml - }; - }; - - exa = { - enable = true; - git = true; - icons = true; - enableAliases = true; - extraOptions = [ - "--group-directories-first" - "--header" - ]; - }; - - # checked https://rycee.gitlab.io/home-manager/options.html until "programs.jq" - }; - - editorconfig = { - enable = true; - settings = { - "*" = { - charset = "utf-8"; - end_of_line = "lf"; - trim_trailing_whitespace = true; - insert_final_newline = true; - max_line_width = 120; - indent_style = "space"; - indent_size = 4; - }; - "*.nix" = { - indent_size = 2; - }; - }; - }; - }; -} diff --git a/kde.nix b/kde.nix deleted file mode 100644 index bebf59e3..00000000 --- a/kde.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - config, - pkgs, - ... -}: { - services = { - # Enable the KDE Plasma Desktop Environment. - xserver = { - desktopManager.plasma5.enable = true; - - displayManager = { - sddm.enable = true; - defaultSession = "plasmawayland"; - }; - }; - }; - - environment.systemPackages = with pkgs; [ - libsForQt5.kate - libsForQt5.kalk - ]; - - environment.plasma5.excludePackages = with pkgs.libsForQt5; [ - elisa - gwenview - okular - khelpcenter - ]; - - programs = { - dconf.enable = true; - partition-manager.enable = true; - }; - - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - home = { - packages = with pkgs; [ - ]; - }; - - services.kdeconnect = { - enable = true; - indicator = true; - }; - }; -} diff --git a/common.nix b/my/default.nix similarity index 95% rename from common.nix rename to my/default.nix index f954f14a..444be5a2 100644 --- a/common.nix +++ b/my/default.nix @@ -2,9 +2,18 @@ config, pkgs, modulesPath, + lib, ... -}: { +}: +with lib; let + cfg = config.my; +in { imports = [ + ./gnome.nix + ./home-vinzenz.nix + ./home-ronja.nix + ./kde.nix + # enable home manager (modulesPath + "/installer/scan/not-detected.nix") diff --git a/my/gnome.nix b/my/gnome.nix new file mode 100644 index 00000000..5acffebf --- /dev/null +++ b/my/gnome.nix @@ -0,0 +1,59 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.my.gnome; +in { + options.my.gnome = { + enable = lib.mkEnableOption "gnome desktop"; + }; + + config = lib.mkIf cfg.enable { + services = { + xserver = { + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + }; + + gnome = { + tracker-miners.enable = false; + tracker.enable = false; + }; + }; + + environment.systemPackages = [pkgs.gnomeExtensions.gsconnect]; + + # remove some gnome default apps + environment.gnome.excludePackages = with pkgs.gnome; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + seahorse # password manager + gnome-clocks + gnome-maps + gnome-weather + gnome-music + pkgs.gnome-connections + ]; + + home-manager.users = { + vinzenz = {pkgs, ...}: { + home.packages = with pkgs; [ + gnome.gpaste + amberol + ]; + + dconf.settings = { + "org/gnome/desktop/peripherals/keyboard" = { + numlock-state = true; + }; + }; + }; + }; + }; +} diff --git a/my/home-ronja.nix b/my/home-ronja.nix new file mode 100644 index 00000000..c8cf4a28 --- /dev/null +++ b/my/home-ronja.nix @@ -0,0 +1,129 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.my.users.ronja; +in { + options.my.users.ronja = { + enable = lib.mkEnableOption "user ronja"; + }; + + config = lib.mkIf cfg.enable { + # Define user account + users.users.ronja = { + isNormalUser = true; + description = "Ronja Spiegelberg"; + extraGroups = ["networkmanager" "wheel"]; + shell = pkgs.zsh; + }; + + # home manager + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + home-manager.users.ronja = { + config, + pkgs, + ... + }: { + home = { + username = "ronja"; + homeDirectory = "/home/ronja"; + stateVersion = "22.11"; + + sessionVariables = { + EDITOR = "nano"; + }; + + packages = with pkgs; [ + ## Apps + steam + telegram-desktop + powerline + powerline-fonts + lutris + kdiff3 + wineWowPackages.stagingFull + wineWowPackages.fonts + winetricks + + (lutris.override { + extraPkgs = pkgs: [ + # List package dependencies here + ]; + extraLibraries = pkgs: [ + # List library dependencies here + ]; + }) + ]; + + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + + programs = { + home-manager.enable = true; + + firefox.enable = true; + command-not-found.enable = true; + dircolors.enable = true; + htop.enable = true; + + zsh = { + enable = true; + + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "systemadmin"]; + }; + }; + + git = { + enable = true; + userName = "Ronja Spiegelberg"; + userEmail = "ronja.spiegelberg@gmail.com"; + + extraConfig = { + pull.ff = "only"; + init.defaultBranch = "main"; + merge.tool = "kdiff3"; + }; + }; + + gh = { + enable = true; + enableGitCredentialHelper = true; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + }; + }; + }; +} diff --git a/my/home-vinzenz.nix b/my/home-vinzenz.nix new file mode 100644 index 00000000..ceed7ffa --- /dev/null +++ b/my/home-vinzenz.nix @@ -0,0 +1,243 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.my.users.vinzenz; +in { + options.my.users.vinzenz = { + enable = lib.mkEnableOption "user vinzenz"; + }; + + config = lib.mkIf cfg.enable { + # Define user account + users.users.vinzenz = { + isNormalUser = true; + description = "Vinzenz Schroeter"; + extraGroups = ["networkmanager" "wheel"]; + shell = pkgs.zsh; + }; + + # home manager + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + home-manager.users.vinzenz = { + config, + pkgs, + ... + }: { + home = { + username = "vinzenz"; + homeDirectory = "/home/vinzenz"; + stateVersion = "22.11"; + + sessionVariables = { + EDITOR = "nano"; + }; + + packages = with pkgs; [ + keepassxc + steam + insync + telegram-desktop + simple-scan + wireguard-tools + element-desktop + etcher + iotop + radeontop + lsof + wirelesstools + powerline + powerline-fonts + thefuck + dotnet-sdk_7 + jetbrains.rider + alejandra + arduino + uucp + screen + jetbrains.pycharm-professional + kdiff3 + docker + wineWowPackages.stagingFull + wineWowPackages.fonts + winetricks + + (lutris.override { + extraPkgs = pkgs: [ + # List package dependencies here + ]; + extraLibraries = pkgs: [ + # List library dependencies here + ]; + }) + ]; + + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + + services = { + kdeconnect = { + enable = true; + indicator = true; + }; + }; + + programs = { + home-manager.enable = true; + + firefox.enable = true; + command-not-found.enable = true; + dircolors.enable = true; + fzf.enable = true; + htop.enable = true; + + zsh = { + enable = true; + + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + + initExtra = '' + eval "$(direnv hook zsh)"; + eval $(thefuck --alias); + ''; + + shellAliases = { + my-apply = "sudo nixos-rebuild boot"; + my-switch = "sudo nixos-rebuild switch"; + my-update = "sudo nixos-rebuild boot --upgrade"; + my-fmt = "alejandra ."; + }; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; + }; + }; + + git = { + enable = true; + userName = "Vinzenz Schroeter"; + userEmail = "vinzenz.f.s@gmail.com"; + + #package = pkgs.gitFull; + #config.credential.helper = "libsecret"; + + aliases = { + prettylog = "log --pretty=oneline --graph"; + }; + extraConfig = { + pull.ff = "only"; + init.defaultBranch = "main"; + merge.tool = "kdiff3"; + }; + }; + + gh = { + enable = true; + enableGitCredentialHelper = true; + }; + + vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs; [ + vscode-extensions.bbenoist.nix + vscode-extensions.ms-python.python + vscode-extensions.kamadorueda.alejandra + ]; + userSettings = { + "git.autofetch" = true; + "update.mode" = "none"; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "workbench.startupEditor" = "readme"; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; + "workbench.enableExperiments" = false; + }; + }; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + + bottom = { + enable = true; + settings = { + # https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml + }; + }; + + exa = { + enable = true; + git = true; + icons = true; + enableAliases = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + }; + + # checked https://rycee.gitlab.io/home-manager/options.html until "programs.jq" + }; + + editorconfig = { + enable = true; + settings = { + "*" = { + charset = "utf-8"; + end_of_line = "lf"; + trim_trailing_whitespace = true; + insert_final_newline = true; + max_line_width = 120; + indent_style = "space"; + indent_size = 4; + }; + "*.nix" = { + indent_size = 2; + }; + }; + }; + }; + }; +} diff --git a/my/kde.nix b/my/kde.nix new file mode 100644 index 00000000..26e65f8c --- /dev/null +++ b/my/kde.nix @@ -0,0 +1,60 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.my.kde; +in { + options.my.kde = { + enable = lib.mkEnableOption "KDE desktop"; + }; + + config = lib.mkIf cfg.enable { + services = { + # Enable the KDE Plasma Desktop Environment. + xserver = { + desktopManager.plasma5.enable = true; + + displayManager = { + sddm.enable = true; + defaultSession = "plasmawayland"; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + libsForQt5.kate + libsForQt5.kalk + ]; + + environment.plasma5.excludePackages = with pkgs.libsForQt5; [ + elisa + gwenview + okular + khelpcenter + ]; + + programs = { + dconf.enable = true; + partition-manager.enable = true; + }; + + home-manager.users.vinzenz = { + config, + pkgs, + ... + }: { + home = { + packages = with pkgs; [ + ]; + }; + + services.kdeconnect = { + enable = true; + indicator = true; + }; + }; + }; +} diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 7b07dabf..ccc550ee 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -6,11 +6,10 @@ }: { networking.hostName = "vinzenz-lpt"; - imports = [ - ./common.nix - ./gnome.nix - ./home-vinzenz.nix - ]; + my.gnome.enable = true; + my.users.vinzenz.enable = true; + + imports = [./my/default.nix]; services.flatpak.enable = true; diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index 3c32a635..ea232259 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -60,7 +60,7 @@ fsType = "btrfs"; options = ["subvolid=5"]; }; - + "/mnt/ssd2" = { device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; fsType = "ext4"; From fae9e320454400ab31822c3806199b46b3e2a561 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 14:01:51 +0200 Subject: [PATCH 0036/1295] update pc3 for lib --- vinzenz-pc3.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index ea232259..afa05282 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -6,12 +6,13 @@ }: { networking.hostName = "vinzenz-pc3"; - imports = [ - ./common.nix - ./kde.nix - ./home-vinzenz.nix - ./home-ronja.nix - ]; + my.kde.enable = true; + my.users = { + vinzenz.enable = true; + ronja.enable = true; + }; + + imports = [./my/default.nix]; users.groups."games" = { members = ["vinzenz" "ronja"]; From a24b916572e56d1ddc2b9087dca47409c6355500 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 14:57:55 +0200 Subject: [PATCH 0037/1295] misc changes --- my/gnome.nix | 5 +- my/home-vinzenz.nix | 3 +- my/kde.nix | 3 +- vinzenz-lpt.nix | 76 ++++++++++++----------- vinzenz-pc3.nix | 148 ++++++++++++++++++++++---------------------- 5 files changed, 118 insertions(+), 117 deletions(-) diff --git a/my/gnome.nix b/my/gnome.nix index 5acffebf..07c8d1ac 100644 --- a/my/gnome.nix +++ b/my/gnome.nix @@ -3,8 +3,7 @@ pkgs, lib, ... -}: -let +}: let cfg = config.my.gnome; in { options.my.gnome = { @@ -42,7 +41,7 @@ in { ]; home-manager.users = { - vinzenz = {pkgs, ...}: { + vinzenz = lib.mkIf config.my.users.vinzenz.enable { home.packages = with pkgs; [ gnome.gpaste amberol diff --git a/my/home-vinzenz.nix b/my/home-vinzenz.nix index ceed7ffa..21a70b78 100644 --- a/my/home-vinzenz.nix +++ b/my/home-vinzenz.nix @@ -3,8 +3,7 @@ pkgs, lib, ... -}: -let +}: let cfg = config.my.users.vinzenz; in { options.my.users.vinzenz = { diff --git a/my/kde.nix b/my/kde.nix index 26e65f8c..e874c50b 100644 --- a/my/kde.nix +++ b/my/kde.nix @@ -3,8 +3,7 @@ pkgs, lib, ... -}: -let +}: let cfg = config.my.kde; in { options.my.kde = { diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index ccc550ee..2b2da57e 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -4,49 +4,51 @@ pkgs, ... }: { - networking.hostName = "vinzenz-lpt"; - - my.gnome.enable = true; - my.users.vinzenz.enable = true; - imports = [./my/default.nix]; - services.flatpak.enable = true; + config = { + networking.hostName = "vinzenz-lpt"; - boot = { - initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; - initrd.kernelModules = []; - kernelModules = ["kvm-intel"]; - extraModulePackages = []; - loader.efi.efiSysMountPoint = "/boot/efi"; - }; + my.gnome.enable = true; + my.users.vinzenz.enable = true; - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; - fsType = "btrfs"; - options = ["subvol=@"]; + services.flatpak.enable = true; + + boot = { + initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; + initrd.kernelModules = []; + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + loader.efi.efiSysMountPoint = "/boot/efi"; }; - "/boot/efi" = { - device = "/dev/disk/by-uuid/2381-1CD2"; - fsType = "vfat"; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/boot/efi" = { + device = "/dev/disk/by-uuid/2381-1CD2"; + fsType = "vfat"; + }; }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} + ]; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.enableRedistributableFirmware = true; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }; - - swapDevices = [ - {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} - ]; - - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.enableRedistributableFirmware = true; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index afa05282..2b961dbf 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -4,80 +4,82 @@ pkgs, ... }: { - networking.hostName = "vinzenz-pc3"; - - my.kde.enable = true; - my.users = { - vinzenz.enable = true; - ronja.enable = true; - }; - imports = [./my/default.nix]; - users.groups."games" = { - members = ["vinzenz" "ronja"]; + config = { + networking.hostName = "vinzenz-pc3"; + + my.kde.enable = true; + my.users = { + vinzenz.enable = true; + ronja.enable = true; + }; + + users.groups."games" = { + members = ["vinzenz" "ronja"]; + }; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" + ]; + + boot = { + initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" + initrd.kernelModules = []; + kernelModules = ["kvm-amd"]; + extraModulePackages = []; + loader.efi.efiSysMountPoint = "/boot"; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/home" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@home"]; + }; + + "/games" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@games"]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/AF67-8F16"; + fsType = "vfat"; + }; + + "/mnt/nixos_btrfs_root" = { + # subvolume with id 5 is always the root volume + # this is convenient for managing the flat subvolume hierarchy + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvolid=5"]; + }; + + "/mnt/ssd2" = { + device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; + fsType = "ext4"; + }; + }; + + swapDevices = []; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" - ]; - - boot = { - initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" - initrd.kernelModules = []; - kernelModules = ["kvm-amd"]; - extraModulePackages = []; - loader.efi.efiSysMountPoint = "/boot"; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/home" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@home"]; - }; - - "/games" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@games"]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/AF67-8F16"; - fsType = "vfat"; - }; - - "/mnt/nixos_btrfs_root" = { - # subvolume with id 5 is always the root volume - # this is convenient for managing the flat subvolume hierarchy - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvolid=5"]; - }; - - "/mnt/ssd2" = { - device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; - fsType = "ext4"; - }; - }; - - swapDevices = []; - - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } From 068c4469b29e5361121c58d7e8dddd05666571aa Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 15:01:01 +0200 Subject: [PATCH 0038/1295] apply numlock to multiple users without copy paste --- my/gnome.nix | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/my/gnome.nix b/my/gnome.nix index 07c8d1ac..2f505c66 100644 --- a/my/gnome.nix +++ b/my/gnome.nix @@ -5,6 +5,19 @@ ... }: let cfg = config.my.gnome; + + applyGnomeUserSettings = { + home.packages = with pkgs; [ + gnome.gpaste + amberol + ]; + + dconf.settings = { + "org/gnome/desktop/peripherals/keyboard" = { + numlock-state = true; + }; + }; + }; in { options.my.gnome = { enable = lib.mkEnableOption "gnome desktop"; @@ -41,18 +54,8 @@ in { ]; home-manager.users = { - vinzenz = lib.mkIf config.my.users.vinzenz.enable { - home.packages = with pkgs; [ - gnome.gpaste - amberol - ]; - - dconf.settings = { - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; - }; - }; + vinzenz = lib.mkIf config.my.users.vinzenz.enable applyGnomeUserSettings; + ronja = lib.mkIf config.my.users.ronja.enable applyGnomeUserSettings; }; }; } From 48024a6bae76d399a93236911265363d23f01d73 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 15:11:49 +0200 Subject: [PATCH 0039/1295] home submodule --- my/default.nix | 6 +---- my/gnome.nix | 4 ++-- my/home/default.nix | 25 +++++++++++++++++++ my/{home-ronja.nix => home/ronja.nix} | 7 +++--- my/{home-vinzenz.nix => home/vinzenz.nix} | 7 +++--- my/kde.nix | 29 ++++++++++++----------- vinzenz-lpt.nix | 2 +- vinzenz-pc3.nix | 2 +- 8 files changed, 51 insertions(+), 31 deletions(-) create mode 100644 my/home/default.nix rename my/{home-ronja.nix => home/ronja.nix} (95%) rename my/{home-vinzenz.nix => home/vinzenz.nix} (97%) diff --git a/my/default.nix b/my/default.nix index 444be5a2..952b919f 100644 --- a/my/default.nix +++ b/my/default.nix @@ -9,13 +9,9 @@ with lib; let cfg = config.my; in { imports = [ + ./home/default.nix ./gnome.nix - ./home-vinzenz.nix - ./home-ronja.nix ./kde.nix - - # enable home manager - (modulesPath + "/installer/scan/not-detected.nix") ]; diff --git a/my/gnome.nix b/my/gnome.nix index 2f505c66..3044b0d3 100644 --- a/my/gnome.nix +++ b/my/gnome.nix @@ -54,8 +54,8 @@ in { ]; home-manager.users = { - vinzenz = lib.mkIf config.my.users.vinzenz.enable applyGnomeUserSettings; - ronja = lib.mkIf config.my.users.ronja.enable applyGnomeUserSettings; + vinzenz = lib.mkIf config.my.home.vinzenz.enable applyGnomeUserSettings; + ronja = lib.mkIf config.my.home.ronja.enable applyGnomeUserSettings; }; }; } diff --git a/my/home/default.nix b/my/home/default.nix new file mode 100644 index 00000000..d32d8a7b --- /dev/null +++ b/my/home/default.nix @@ -0,0 +1,25 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.my.home; +in { + imports = [ + ./vinzenz.nix + ./ronja.nix + # enable home manager + + ]; + + options.my.home = { + enable = lib.mkEnableOption "my home management"; + }; + + config = lib.mkIf cfg.enable { + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + }; +} diff --git a/my/home-ronja.nix b/my/home/ronja.nix similarity index 95% rename from my/home-ronja.nix rename to my/home/ronja.nix index c8cf4a28..0b11beae 100644 --- a/my/home-ronja.nix +++ b/my/home/ronja.nix @@ -5,9 +5,9 @@ ... }: with lib; let - cfg = config.my.users.ronja; + cfg = config.my.home.ronja; in { - options.my.users.ronja = { + options.my.home.ronja = { enable = lib.mkEnableOption "user ronja"; }; @@ -21,8 +21,7 @@ in { }; # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; + my.home.enable = true; home-manager.users.ronja = { config, pkgs, diff --git a/my/home-vinzenz.nix b/my/home/vinzenz.nix similarity index 97% rename from my/home-vinzenz.nix rename to my/home/vinzenz.nix index 21a70b78..7846eeea 100644 --- a/my/home-vinzenz.nix +++ b/my/home/vinzenz.nix @@ -4,9 +4,9 @@ lib, ... }: let - cfg = config.my.users.vinzenz; + cfg = config.my.home.vinzenz; in { - options.my.users.vinzenz = { + options.my.home.vinzenz = { enable = lib.mkEnableOption "user vinzenz"; }; @@ -20,8 +20,7 @@ in { }; # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; + my.home.enable = true; home-manager.users.vinzenz = { config, pkgs, diff --git a/my/kde.nix b/my/kde.nix index e874c50b..87b0835c 100644 --- a/my/kde.nix +++ b/my/kde.nix @@ -5,6 +5,18 @@ ... }: let cfg = config.my.kde; + + applyKdeUserSettings = { + home = { + packages = with pkgs; [ + ]; + }; + + services.kdeconnect = { + enable = true; + indicator = true; + }; + }; in { options.my.kde = { enable = lib.mkEnableOption "KDE desktop"; @@ -40,20 +52,9 @@ in { partition-manager.enable = true; }; - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - home = { - packages = with pkgs; [ - ]; - }; - - services.kdeconnect = { - enable = true; - indicator = true; - }; + home-manager.users = { + vinzenz = lib.mkIf config.my.home.vinzenz.enable applyKdeUserSettings; + ronja = lib.mkIf config.my.home.ronja.enable applyKdeUserSettings; }; }; } diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 2b2da57e..39c3068e 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -10,7 +10,7 @@ networking.hostName = "vinzenz-lpt"; my.gnome.enable = true; - my.users.vinzenz.enable = true; + my.home.vinzenz.enable = true; services.flatpak.enable = true; diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index 2b961dbf..d2a35d2d 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -10,7 +10,7 @@ networking.hostName = "vinzenz-pc3"; my.kde.enable = true; - my.users = { + my.home = { vinzenz.enable = true; ronja.enable = true; }; From 8df61f216eae02b4b3e26838b543b1ac9840195b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 15:21:27 +0200 Subject: [PATCH 0040/1295] split hardware back out again, dir rename --- hardware/vinzenz-lpt.nix | 44 +++++++++++++++++++++ hardware/vinzenz-pc3.nix | 67 ++++++++++++++++++++++++++++++++ {my => modules}/default.nix | 2 +- {my => modules}/gnome.nix | 0 {my => modules}/home/default.nix | 0 {my => modules}/home/ronja.nix | 0 {my => modules}/home/vinzenz.nix | 0 {my => modules}/kde.nix | 8 ++-- vinzenz-lpt.nix | 42 ++------------------ vinzenz-pc3.nix | 64 ++---------------------------- 10 files changed, 124 insertions(+), 103 deletions(-) create mode 100644 hardware/vinzenz-lpt.nix create mode 100644 hardware/vinzenz-pc3.nix rename {my => modules}/default.nix (99%) rename {my => modules}/gnome.nix (100%) rename {my => modules}/home/default.nix (100%) rename {my => modules}/home/ronja.nix (100%) rename {my => modules}/home/vinzenz.nix (100%) rename {my => modules}/kde.nix (94%) diff --git a/hardware/vinzenz-lpt.nix b/hardware/vinzenz-lpt.nix new file mode 100644 index 00000000..bcb7160a --- /dev/null +++ b/hardware/vinzenz-lpt.nix @@ -0,0 +1,44 @@ +{ + config, + lib, + ... +}: { + config = { + boot = { + initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; + initrd.kernelModules = []; + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + loader.efi.efiSysMountPoint = "/boot/efi"; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/boot/efi" = { + device = "/dev/disk/by-uuid/2381-1CD2"; + fsType = "vfat"; + }; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} + ]; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.enableRedistributableFirmware = true; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} diff --git a/hardware/vinzenz-pc3.nix b/hardware/vinzenz-pc3.nix new file mode 100644 index 00000000..6c25f47f --- /dev/null +++ b/hardware/vinzenz-pc3.nix @@ -0,0 +1,67 @@ +{ + config, + lib, + pkgs, + ... +}: { + config = { + boot = { + initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" + initrd.kernelModules = []; + kernelModules = ["kvm-amd"]; + extraModulePackages = []; + loader.efi.efiSysMountPoint = "/boot"; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/home" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@home"]; + }; + + "/games" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@games"]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/AF67-8F16"; + fsType = "vfat"; + }; + + "/mnt/nixos_btrfs_root" = { + # subvolume with id 5 is always the root volume + # this is convenient for managing the flat subvolume hierarchy + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvolid=5"]; + }; + + "/mnt/ssd2" = { + device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; + fsType = "ext4"; + }; + }; + + swapDevices = []; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} diff --git a/my/default.nix b/modules/default.nix similarity index 99% rename from my/default.nix rename to modules/default.nix index 952b919f..16df2198 100644 --- a/my/default.nix +++ b/modules/default.nix @@ -9,7 +9,7 @@ with lib; let cfg = config.my; in { imports = [ - ./home/default.nix + ./home ./gnome.nix ./kde.nix (modulesPath + "/installer/scan/not-detected.nix") diff --git a/my/gnome.nix b/modules/gnome.nix similarity index 100% rename from my/gnome.nix rename to modules/gnome.nix diff --git a/my/home/default.nix b/modules/home/default.nix similarity index 100% rename from my/home/default.nix rename to modules/home/default.nix diff --git a/my/home/ronja.nix b/modules/home/ronja.nix similarity index 100% rename from my/home/ronja.nix rename to modules/home/ronja.nix diff --git a/my/home/vinzenz.nix b/modules/home/vinzenz.nix similarity index 100% rename from my/home/vinzenz.nix rename to modules/home/vinzenz.nix diff --git a/my/kde.nix b/modules/kde.nix similarity index 94% rename from my/kde.nix rename to modules/kde.nix index 87b0835c..0faececd 100644 --- a/my/kde.nix +++ b/modules/kde.nix @@ -7,10 +7,10 @@ cfg = config.my.kde; applyKdeUserSettings = { - home = { - packages = with pkgs; [ - ]; - }; + #home = { + # packages = with pkgs; [ + # ]; + #}; services.kdeconnect = { enable = true; diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 39c3068e..edb2e140 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -4,7 +4,10 @@ pkgs, ... }: { - imports = [./my/default.nix]; + imports = [ + ./modules + ./hardware/vinzenz-lpt.nix + ]; config = { networking.hostName = "vinzenz-lpt"; @@ -13,42 +16,5 @@ my.home.vinzenz.enable = true; services.flatpak.enable = true; - - boot = { - initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; - initrd.kernelModules = []; - kernelModules = ["kvm-intel"]; - extraModulePackages = []; - loader.efi.efiSysMountPoint = "/boot/efi"; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/boot/efi" = { - device = "/dev/disk/by-uuid/2381-1CD2"; - fsType = "vfat"; - }; - }; - - swapDevices = [ - {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} - ]; - - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.enableRedistributableFirmware = true; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }; } diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index d2a35d2d..817a647a 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -4,7 +4,10 @@ pkgs, ... }: { - imports = [./my/default.nix]; + imports = [ + ./modules + ./hardware/vinzenz-pc3.nix + ]; config = { networking.hostName = "vinzenz-pc3"; @@ -22,64 +25,5 @@ users.users.vinzenz.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" ]; - - boot = { - initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" - initrd.kernelModules = []; - kernelModules = ["kvm-amd"]; - extraModulePackages = []; - loader.efi.efiSysMountPoint = "/boot"; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/home" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@home"]; - }; - - "/games" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@games"]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/AF67-8F16"; - fsType = "vfat"; - }; - - "/mnt/nixos_btrfs_root" = { - # subvolume with id 5 is always the root volume - # this is convenient for managing the flat subvolume hierarchy - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvolid=5"]; - }; - - "/mnt/ssd2" = { - device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; - fsType = "ext4"; - }; - }; - - swapDevices = []; - - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }; } From 00fbfd0fefe985786f4d19a75adc4a4795499f89 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 15:44:15 +0200 Subject: [PATCH 0041/1295] split configs --- modules/default.nix | 148 ++++++++------------------------ modules/desktop/default.nix | 64 ++++++++++++++ modules/{ => desktop}/gnome.nix | 2 + modules/{ => desktop}/kde.nix | 2 + modules/home/vinzenz.nix | 5 +- modules/i18n.nix | 28 ++++++ modules/nixpkgs.nix | 21 +++++ 7 files changed, 153 insertions(+), 117 deletions(-) create mode 100644 modules/desktop/default.nix rename modules/{ => desktop}/gnome.nix (97%) rename modules/{ => desktop}/kde.nix (97%) create mode 100644 modules/i18n.nix create mode 100644 modules/nixpkgs.nix diff --git a/modules/default.nix b/modules/default.nix index 16df2198..759034d4 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -10,80 +10,30 @@ with lib; let in { imports = [ ./home - ./gnome.nix - ./kde.nix + ./desktop + ./i18n.nix + ./nixpkgs.nix (modulesPath + "/installer/scan/not-detected.nix") ]; - nixpkgs.config = { - allowUnfree = true; - permittedInsecurePackages = [ - "electron-12.2.3" - ]; - }; - - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - - networking = { - # wireless.enable = true; # Enables wireless support via wpa_supplicant. - # wireless.userControlled.enable = true; - - # Enable networking - networkmanager.enable = true; - - firewall = { - enable = true; - allowedTCPPortRanges = [ - { - # KDE Connect - from = 1714; - to = 1764; - } - ]; - allowedUDPPortRanges = [ - { - # KDE Connect - from = 1714; - to = 1764; - } - ]; - }; - }; - - time.timeZone = "Europe/Berlin"; - i18n = { - defaultLocale = "en_US.UTF-8"; - extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; - }; - }; - - services = { - xserver = { - # Enable the X11 windowing system / wayland depending on DE - enable = true; - - # Configure keymap in X11 - layout = "de"; - xkbVariant = ""; + config = { + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; }; - # Enable CUPS to print documents. - printing.enable = true; + networking = { + # wireless.enable = true; # Enables wireless support via wpa_supplicant. + # wireless.userControlled.enable = true; + + # Enable networking + networkmanager.enable = true; + + firewall.enable = true; + }; # Enable the OpenSSH daemon. - openssh = { + services.openssh = { enable = true; settings = { PermitRootLogin = "no"; @@ -91,58 +41,28 @@ in { KbdInteractiveAuthentication = false; }; }; - }; - systemd.extraConfig = '' - DefaultTimeoutStopSec=7s - ''; + systemd.extraConfig = '' + DefaultTimeoutStopSec=12s + ''; - # Configure console keymap - console.keyMap = "de"; + programs = { + zsh.enable = true; - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - system = { - stateVersion = "22.11"; - autoUpgrade.enable = true; # enable auto updates - }; - - nix.gc = { - automatic = true; - dates = "00:30"; - }; - - programs = { - git = { - enable = true; - package = pkgs.gitFull; + git = { + enable = true; + package = pkgs.gitFull; + }; }; - steam = { - enable = true; - remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + environment = { + pathsToLink = ["/share/zsh"]; + + systemPackages = with pkgs; [ + lm_sensors + tldr + ncdu + ]; }; - - zsh.enable = true; - }; - - environment = { - pathsToLink = ["/share/zsh"]; - - systemPackages = with pkgs; [ - lm_sensors - tldr - ncdu - ]; }; } diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix new file mode 100644 index 00000000..771dff80 --- /dev/null +++ b/modules/desktop/default.nix @@ -0,0 +1,64 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.my.desktop; +in { + imports = [ + ./gnome.nix + ./kde.nix + ]; + + options.my.desktop = { + enable = lib.mkEnableOption "desktop"; + }; + + config = lib.mkIf cfg.enable { + services = { + # Enable the X11 windowing system / wayland depending on DE + xserver.enable = true; + + # Enable CUPS to print documents. + printing.enable = true; + }; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + programs = { + steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; + }; + + # unblock kde connect / gsconnect + networking.firewall = { + allowedTCPPortRanges = [ + { + # KDE Connect + from = 1714; + to = 1764; + } + ]; + allowedUDPPortRanges = [ + { + # KDE Connect + from = 1714; + to = 1764; + } + ]; + }; + }; +} diff --git a/modules/gnome.nix b/modules/desktop/gnome.nix similarity index 97% rename from modules/gnome.nix rename to modules/desktop/gnome.nix index 3044b0d3..8b3c5c0f 100644 --- a/modules/gnome.nix +++ b/modules/desktop/gnome.nix @@ -24,6 +24,8 @@ in { }; config = lib.mkIf cfg.enable { + my.desktop.enable = true; + services = { xserver = { # Enable the GNOME Desktop Environment. diff --git a/modules/kde.nix b/modules/desktop/kde.nix similarity index 97% rename from modules/kde.nix rename to modules/desktop/kde.nix index 0faececd..d56f322d 100644 --- a/modules/kde.nix +++ b/modules/desktop/kde.nix @@ -23,6 +23,8 @@ in { }; config = lib.mkIf cfg.enable { + my.desktop.enable = true; + services = { # Enable the KDE Plasma Desktop Environment. xserver = { diff --git a/modules/home/vinzenz.nix b/modules/home/vinzenz.nix index 7846eeea..25380771 100644 --- a/modules/home/vinzenz.nix +++ b/modules/home/vinzenz.nix @@ -133,16 +133,15 @@ in { userName = "Vinzenz Schroeter"; userEmail = "vinzenz.f.s@gmail.com"; - #package = pkgs.gitFull; - #config.credential.helper = "libsecret"; - aliases = { prettylog = "log --pretty=oneline --graph"; }; + extraConfig = { pull.ff = "only"; init.defaultBranch = "main"; merge.tool = "kdiff3"; + push.autoSetupRemote = "true"; }; }; diff --git a/modules/i18n.nix b/modules/i18n.nix new file mode 100644 index 00000000..3d38ec15 --- /dev/null +++ b/modules/i18n.nix @@ -0,0 +1,28 @@ +{...}: { + config = { + time.timeZone = "Europe/Berlin"; + i18n = { + defaultLocale = "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + }; + + services.xserver = { + # Configure keymap in X11 + layout = "de"; + xkbVariant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + }; +} diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix new file mode 100644 index 00000000..dc7c9e99 --- /dev/null +++ b/modules/nixpkgs.nix @@ -0,0 +1,21 @@ +{...}: { + config = { + nixpkgs.config = { + allowUnfree = true; + permittedInsecurePackages = [ + "electron-12.2.3" + ]; + }; + + system = { + stateVersion = "22.11"; + # enable auto updates + autoUpgrade.enable = true; + }; + + nix.gc = { + automatic = true; + dates = "00:30"; + }; + }; +} From d2f8f28143ac0b4e28cbdceab7fef4db8ec12109 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 15:54:03 +0200 Subject: [PATCH 0042/1295] common hardware config --- hardware/common.nix | 28 ++++++++++++++++++++++++++++ hardware/vinzenz-lpt.nix | 16 +++++----------- hardware/vinzenz-pc3.nix | 20 +++++++------------- modules/default.nix | 11 ----------- 4 files changed, 40 insertions(+), 35 deletions(-) create mode 100644 hardware/common.nix diff --git a/hardware/common.nix b/hardware/common.nix new file mode 100644 index 00000000..c5b01d85 --- /dev/null +++ b/hardware/common.nix @@ -0,0 +1,28 @@ +{ + modulesPath, + lib, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + config = { + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + hardware.enableRedistributableFirmware = true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + }; +} diff --git a/hardware/vinzenz-lpt.nix b/hardware/vinzenz-lpt.nix index bcb7160a..a82ae335 100644 --- a/hardware/vinzenz-lpt.nix +++ b/hardware/vinzenz-lpt.nix @@ -1,8 +1,12 @@ { - config, lib, + config, ... }: { + imports = [ + ./common.nix + ]; + config = { boot = { initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; @@ -29,16 +33,6 @@ {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} ]; - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.enableRedistributableFirmware = true; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }; } diff --git a/hardware/vinzenz-pc3.nix b/hardware/vinzenz-pc3.nix index 6c25f47f..a15c1cba 100644 --- a/hardware/vinzenz-pc3.nix +++ b/hardware/vinzenz-pc3.nix @@ -1,9 +1,12 @@ { - config, lib, - pkgs, + config, ... }: { + imports = [ + ./common.nix + ]; + config = { boot = { initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" @@ -52,16 +55,7 @@ }; swapDevices = []; - - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }; + + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/modules/default.nix b/modules/default.nix index 759034d4..d908e69f 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -13,22 +13,11 @@ in { ./desktop ./i18n.nix ./nixpkgs.nix - (modulesPath + "/installer/scan/not-detected.nix") ]; config = { - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - networking = { - # wireless.enable = true; # Enables wireless support via wpa_supplicant. - # wireless.userControlled.enable = true; - - # Enable networking networkmanager.enable = true; - firewall.enable = true; }; From 00c2c2afefda2622ebe6b3e9169022fe5e1aad2f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 19:22:11 +0200 Subject: [PATCH 0043/1295] temporary fix for recursion, remove duplicate hostname in main config --- hardware/{common.nix => default.nix} | 5 ++++- hardware/vinzenz-lpt.nix | 12 ++---------- hardware/vinzenz-pc3.nix | 12 ++---------- modules/default.nix | 5 +---- modules/desktop/gnome.nix | 26 +++++++++++++------------- modules/desktop/kde.nix | 24 ++++++++++++------------ modules/home/default.nix | 3 +-- vinzenz-lpt.nix | 4 +--- vinzenz-pc3.nix | 4 +--- 9 files changed, 37 insertions(+), 58 deletions(-) rename hardware/{common.nix => default.nix} (89%) diff --git a/hardware/common.nix b/hardware/default.nix similarity index 89% rename from hardware/common.nix rename to hardware/default.nix index c5b01d85..3a06ecb2 100644 --- a/hardware/common.nix +++ b/hardware/default.nix @@ -1,13 +1,16 @@ -{ +hostName: { modulesPath, lib, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") + (builtins.toString ./. + "/${hostName}.nix") ]; config = { + networking.hostName = hostName; + boot.loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; diff --git a/hardware/vinzenz-lpt.nix b/hardware/vinzenz-lpt.nix index a82ae335..cf01a43d 100644 --- a/hardware/vinzenz-lpt.nix +++ b/hardware/vinzenz-lpt.nix @@ -1,12 +1,4 @@ -{ - lib, - config, - ... -}: { - imports = [ - ./common.nix - ]; - +{...}: { config = { boot = { initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; @@ -33,6 +25,6 @@ {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} ]; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = true; }; } diff --git a/hardware/vinzenz-pc3.nix b/hardware/vinzenz-pc3.nix index a15c1cba..c09eca71 100644 --- a/hardware/vinzenz-pc3.nix +++ b/hardware/vinzenz-pc3.nix @@ -1,12 +1,4 @@ -{ - lib, - config, - ... -}: { - imports = [ - ./common.nix - ]; - +{...}: { config = { boot = { initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" @@ -57,5 +49,5 @@ swapDevices = []; }; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = true; } diff --git a/modules/default.nix b/modules/default.nix index d908e69f..71d87d1f 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,11 +1,8 @@ { config, pkgs, - modulesPath, - lib, ... -}: -with lib; let +}: let cfg = config.my; in { imports = [ diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 8b3c5c0f..f440fa21 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -6,18 +6,18 @@ }: let cfg = config.my.gnome; - applyGnomeUserSettings = { - home.packages = with pkgs; [ - gnome.gpaste - amberol - ]; + #applyGnomeUserSettings = { + # home.packages = with pkgs; [ + # gnome.gpaste + # amberol + # ]; - dconf.settings = { - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; - }; - }; +# dconf.settings = { + # "org/gnome/desktop/peripherals/keyboard" = { + # numlock-state = true; + # }; + # }; + #}; in { options.my.gnome = { enable = lib.mkEnableOption "gnome desktop"; @@ -56,8 +56,8 @@ in { ]; home-manager.users = { - vinzenz = lib.mkIf config.my.home.vinzenz.enable applyGnomeUserSettings; - ronja = lib.mkIf config.my.home.ronja.enable applyGnomeUserSettings; + # vinzenz = lib.mkIf config.my.home.vinzenz.enable applyGnomeUserSettings; + # ronja = lib.mkIf config.my.home.ronja.enable applyGnomeUserSettings; }; }; } diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix index d56f322d..24af742e 100644 --- a/modules/desktop/kde.nix +++ b/modules/desktop/kde.nix @@ -6,17 +6,17 @@ }: let cfg = config.my.kde; - applyKdeUserSettings = { - #home = { - # packages = with pkgs; [ - # ]; - #}; + # applyKdeUserSettings = { + # #home = { + # # packages = with pkgs; [ + # # ]; + # #}; - services.kdeconnect = { - enable = true; - indicator = true; - }; - }; + # services.kdeconnect = { + # enable = true; + # indicator = true; + # }; + # }; in { options.my.kde = { enable = lib.mkEnableOption "KDE desktop"; @@ -55,8 +55,8 @@ in { }; home-manager.users = { - vinzenz = lib.mkIf config.my.home.vinzenz.enable applyKdeUserSettings; - ronja = lib.mkIf config.my.home.ronja.enable applyKdeUserSettings; + #vinzenz = lib.mkIf config.my.home.vinzenz.enable applyKdeUserSettings; + #ronja = lib.mkIf config.my.home.ronja.enable applyKdeUserSettings; }; }; } diff --git a/modules/home/default.nix b/modules/home/default.nix index d32d8a7b..6d85a0d1 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -3,8 +3,7 @@ pkgs, lib, ... -}: -with lib; let +}: let cfg = config.my.home; in { imports = [ diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index edb2e140..db74c7f6 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -6,12 +6,10 @@ }: { imports = [ ./modules - ./hardware/vinzenz-lpt.nix + (import ./hardware "vinzenz-lpt") ]; config = { - networking.hostName = "vinzenz-lpt"; - my.gnome.enable = true; my.home.vinzenz.enable = true; diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index 817a647a..cbbbf613 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -6,12 +6,10 @@ }: { imports = [ ./modules - ./hardware/vinzenz-pc3.nix + (import ./hardware "vinzenz-pc3") ]; config = { - networking.hostName = "vinzenz-pc3"; - my.kde.enable = true; my.home = { vinzenz.enable = true; From 0423ab72dc0a8416adf90070261821a791d34fe7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 19:34:23 +0200 Subject: [PATCH 0044/1295] remove imports --- vinzenz-lpt.nix | 7 +------ vinzenz-pc3.nix | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index db74c7f6..5474c3d8 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -1,9 +1,4 @@ -{ - config, - lib, - pkgs, - ... -}: { +{...}: { imports = [ ./modules (import ./hardware "vinzenz-lpt") diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index cbbbf613..5e0f097b 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -1,9 +1,4 @@ -{ - config, - lib, - pkgs, - ... -}: { +{...}: { imports = [ ./modules (import ./hardware "vinzenz-pc3") From e085501d0007006e610d8362f03454943bcacdac Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 19:37:08 +0200 Subject: [PATCH 0045/1295] fix braces --- hardware/vinzenz-pc3.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hardware/vinzenz-pc3.nix b/hardware/vinzenz-pc3.nix index c09eca71..8e27145b 100644 --- a/hardware/vinzenz-pc3.nix +++ b/hardware/vinzenz-pc3.nix @@ -47,7 +47,7 @@ }; swapDevices = []; - }; - hardware.cpu.amd.updateMicrocode = true; + hardware.cpu.amd.updateMicrocode = true; + }; } From dbe364c39cea31ebafe2be5c21bd304c79203c12 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 19:38:21 +0200 Subject: [PATCH 0046/1295] pc3 is pc2 --- hardware/{vinzenz-pc3.nix => vinzenz-pc2.nix} | 0 vinzenz-pc3.nix => vinzenz-pc2.nix | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename hardware/{vinzenz-pc3.nix => vinzenz-pc2.nix} (100%) rename vinzenz-pc3.nix => vinzenz-pc2.nix (91%) diff --git a/hardware/vinzenz-pc3.nix b/hardware/vinzenz-pc2.nix similarity index 100% rename from hardware/vinzenz-pc3.nix rename to hardware/vinzenz-pc2.nix diff --git a/vinzenz-pc3.nix b/vinzenz-pc2.nix similarity index 91% rename from vinzenz-pc3.nix rename to vinzenz-pc2.nix index 5e0f097b..83ea523f 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc2.nix @@ -1,7 +1,7 @@ {...}: { imports = [ ./modules - (import ./hardware "vinzenz-pc3") + (import ./hardware "vinzenz-pc2") ]; config = { From db67663eb6e2bd1496ae3cc8ea12a1f42f924bd7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 10 Sep 2023 11:32:18 +0200 Subject: [PATCH 0047/1295] re-enable kde/gnome user specific settings --- modules/desktop/gnome.nix | 32 +++++++++++++------------- modules/desktop/kde.nix | 47 ++++++++++++++++++++------------------- modules/home/vinzenz.nix | 7 ------ 3 files changed, 40 insertions(+), 46 deletions(-) diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index f440fa21..96ff7def 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -5,19 +5,17 @@ ... }: let cfg = config.my.gnome; - - #applyGnomeUserSettings = { - # home.packages = with pkgs; [ - # gnome.gpaste - # amberol - # ]; - -# dconf.settings = { - # "org/gnome/desktop/peripherals/keyboard" = { - # numlock-state = true; - # }; - # }; - #}; + applyGnomeUserSettings = { + home.packages = with pkgs; [ + gnome.gpaste + amberol + ]; + dconf.settings = { + "org/gnome/desktop/peripherals/keyboard" = { + numlock-state = true; + }; + }; + }; in { options.my.gnome = { enable = lib.mkEnableOption "gnome desktop"; @@ -39,7 +37,9 @@ in { }; }; - environment.systemPackages = [pkgs.gnomeExtensions.gsconnect]; + environment.systemPackages = with pkgs; [ + gnomeExtensions.gsconnect + ]; # remove some gnome default apps environment.gnome.excludePackages = with pkgs.gnome; [ @@ -56,8 +56,8 @@ in { ]; home-manager.users = { - # vinzenz = lib.mkIf config.my.home.vinzenz.enable applyGnomeUserSettings; - # ronja = lib.mkIf config.my.home.ronja.enable applyGnomeUserSettings; + vinzenz = lib.mkIf config.my.home.vinzenz.enable applyGnomeUserSettings; + ronja = lib.mkIf config.my.home.ronja.enable applyGnomeUserSettings; }; }; } diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix index 24af742e..aa622625 100644 --- a/modules/desktop/kde.nix +++ b/modules/desktop/kde.nix @@ -6,17 +6,16 @@ }: let cfg = config.my.kde; - # applyKdeUserSettings = { - # #home = { - # # packages = with pkgs; [ - # # ]; - # #}; - - # services.kdeconnect = { - # enable = true; - # indicator = true; - # }; - # }; + applyKdeUserSettings = { + home = { + packages = with pkgs; [ + ]; + }; + services.kdeconnect = { + enable = true; + indicator = true; + }; + }; in { options.my.kde = { enable = lib.mkEnableOption "KDE desktop"; @@ -37,17 +36,19 @@ in { }; }; - environment.systemPackages = with pkgs; [ - libsForQt5.kate - libsForQt5.kalk - ]; + environment = { + systemPackages = with pkgs; [ + libsForQt5.kate + libsForQt5.kalk + ]; - environment.plasma5.excludePackages = with pkgs.libsForQt5; [ - elisa - gwenview - okular - khelpcenter - ]; + plasma5.excludePackages = with pkgs.libsForQt5; [ + elisa + gwenview + okular + khelpcenter + ]; + }; programs = { dconf.enable = true; @@ -55,8 +56,8 @@ in { }; home-manager.users = { - #vinzenz = lib.mkIf config.my.home.vinzenz.enable applyKdeUserSettings; - #ronja = lib.mkIf config.my.home.ronja.enable applyKdeUserSettings; + vinzenz = lib.mkIf config.my.home.vinzenz.enable applyKdeUserSettings; + ronja = lib.mkIf config.my.home.ronja.enable applyKdeUserSettings; }; }; } diff --git a/modules/home/vinzenz.nix b/modules/home/vinzenz.nix index 25380771..799eb62d 100644 --- a/modules/home/vinzenz.nix +++ b/modules/home/vinzenz.nix @@ -80,13 +80,6 @@ in { ''; }; - services = { - kdeconnect = { - enable = true; - indicator = true; - }; - }; - programs = { home-manager.enable = true; From e65ba7c8a622aff78c5dd946e2c12ec7871d38bd Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 10 Sep 2023 14:12:01 +0200 Subject: [PATCH 0048/1295] prepare configuration for server use --- hardware/common-desktop.nix | 33 +++++++++++++++ hardware/default.nix | 1 + hardware/hetzner-vpn1.nix | 80 +++++++++++++++++++++++++++++++++++++ hardware/vinzenz-lpt.nix | 2 + hardware/vinzenz-pc2.nix | 2 + helpers/default.nix | 7 ++++ hetzner-vpn1.nix | 16 ++++++++ modules/default.nix | 3 +- modules/desktop/default.nix | 2 + modules/server/default.nix | 33 +++++++++++++++ vinzenz-lpt.nix | 6 ++- vinzenz-pc2.nix | 10 +++-- 12 files changed, 188 insertions(+), 7 deletions(-) create mode 100644 hardware/common-desktop.nix create mode 100644 hardware/hetzner-vpn1.nix create mode 100644 helpers/default.nix create mode 100644 hetzner-vpn1.nix create mode 100644 modules/server/default.nix diff --git a/hardware/common-desktop.nix b/hardware/common-desktop.nix new file mode 100644 index 00000000..83a34f6c --- /dev/null +++ b/hardware/common-desktop.nix @@ -0,0 +1,33 @@ +{ + lib, + config, + ... +}: let + isEnabled = config.my.hardware.common-desktop.enable; +in { + imports = [ + ]; + + options.my.hardware.common-desktop = { + enable = lib.mkEnableOption "common desktop hardware settings"; + }; + + config = lib.mkIf isEnabled { + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + hardware.enableRedistributableFirmware = true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + }; +} diff --git a/hardware/default.nix b/hardware/default.nix index 3a06ecb2..a5608dca 100644 --- a/hardware/default.nix +++ b/hardware/default.nix @@ -6,6 +6,7 @@ hostName: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") (builtins.toString ./. + "/${hostName}.nix") + ./common-desktop.nix ]; config = { diff --git a/hardware/hetzner-vpn1.nix b/hardware/hetzner-vpn1.nix new file mode 100644 index 00000000..7b62a41f --- /dev/null +++ b/hardware/hetzner-vpn1.nix @@ -0,0 +1,80 @@ +{ + lib, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.cleanTmpDir = true; + zramSwap.enable = true; + networking.domain = ""; + + boot.loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + device = "nodev"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/77CF-345D"; + fsType = "vfat"; + }; + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"]; + boot.initrd.kernelModules = ["nvme"]; + fileSystems."/" = { + device = "/dev/sda1"; + fsType = "ext4"; + }; + + # This file was populated at runtime with the networking + # details gathered from the active system. + networking = { + nameservers = [ + "8.8.8.8" + ]; + defaultGateway = "172.31.1.1"; + defaultGateway6 = { + address = "fe80::1"; + interface = "eth0"; + }; + dhcpcd.enable = false; + usePredictableInterfaceNames = lib.mkForce false; + interfaces = { + eth0 = { + ipv4.addresses = [ + { + address = "157.90.146.125"; + prefixLength = 32; + } + ]; + ipv6.addresses = [ + { + address = "2a01:4f8:c012:7137::1"; + prefixLength = 64; + } + { + address = "fe80::9400:2ff:fe87:7fc9"; + prefixLength = 64; + } + ]; + ipv4.routes = [ + { + address = "172.31.1.1"; + prefixLength = 32; + } + ]; + ipv6.routes = [ + { + address = "fe80::1"; + prefixLength = 128; + } + ]; + }; + }; + }; + services.udev.extraRules = '' + ATTR{address}=="96:00:02:87:7f:c9", NAME="eth0" + + ''; +} diff --git a/hardware/vinzenz-lpt.nix b/hardware/vinzenz-lpt.nix index cf01a43d..3b36625f 100644 --- a/hardware/vinzenz-lpt.nix +++ b/hardware/vinzenz-lpt.nix @@ -1,5 +1,7 @@ {...}: { config = { + my.hardware.common-desktop.enable = true; + boot = { initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; initrd.kernelModules = []; diff --git a/hardware/vinzenz-pc2.nix b/hardware/vinzenz-pc2.nix index 8e27145b..609479ee 100644 --- a/hardware/vinzenz-pc2.nix +++ b/hardware/vinzenz-pc2.nix @@ -1,5 +1,7 @@ {...}: { config = { + my.hardware.common-desktop.enable = true; + boot = { initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" initrd.kernelModules = []; diff --git a/helpers/default.nix b/helpers/default.nix new file mode 100644 index 00000000..1a1041bb --- /dev/null +++ b/helpers/default.nix @@ -0,0 +1,7 @@ +{lib, ...}: { + mkIfElse = p: yes: no: + lib.mkMerge [ + (mkIf p yes) + (mkIf (!p) no) + ]; +} diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix new file mode 100644 index 00000000..b45da073 --- /dev/null +++ b/hetzner-vpn1.nix @@ -0,0 +1,16 @@ +{...}: { + imports = [ + ./modules + (import ./hardware "hetzner-vpn1") + ]; + + config = { + my = { + desktop.enable = false; + server.enable = true; + }; + users.users.root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ]; + }; +} diff --git a/modules/default.nix b/modules/default.nix index 71d87d1f..74584f56 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -4,6 +4,7 @@ ... }: let cfg = config.my; + helpers = import ../helpers; in { imports = [ ./home @@ -22,7 +23,7 @@ in { services.openssh = { enable = true; settings = { - PermitRootLogin = "no"; + PermitRootLogin = helpers.mkIfElse config.my.server.enable "yes" "no"; PasswordAuthentication = false; KbdInteractiveAuthentication = false; }; diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 771dff80..dca04994 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -22,6 +22,8 @@ in { # Enable CUPS to print documents. printing.enable = true; + + openssh.settings.PermitRootLogin = "no"; }; # Enable sound with pipewire. diff --git a/modules/server/default.nix b/modules/server/default.nix new file mode 100644 index 00000000..a8f584cd --- /dev/null +++ b/modules/server/default.nix @@ -0,0 +1,33 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.my.server; +in { + imports = []; + + options.my.server = { + enable = lib.mkEnableOption "server role"; + }; + + config = lib.mkIf cfg.enable { + services = { + services.openssh.enable = true; + }; + + programs = { + }; + + networking.firewall = { + allowedTCPPortRanges = [ + { + # ssh + from = 22; + to = 22; + } + ]; + }; + }; +} diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 5474c3d8..eb7957d1 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -5,8 +5,10 @@ ]; config = { - my.gnome.enable = true; - my.home.vinzenz.enable = true; + my = { + gnome.enable = true; + home.vinzenz.enable = true; + }; services.flatpak.enable = true; }; diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 83ea523f..200ed8ab 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -5,10 +5,12 @@ ]; config = { - my.kde.enable = true; - my.home = { - vinzenz.enable = true; - ronja.enable = true; + my = { + kde.enable = true; + home = { + vinzenz.enable = true; + ronja.enable = true; + }; }; users.groups."games" = { From 69026cb4614d3501b55ee19a4140559379d908e0 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 11 Sep 2023 18:46:47 +0200 Subject: [PATCH 0049/1295] make home manager optional --- helpers/default.nix | 4 ++-- modules/default.nix | 2 +- modules/home/default.nix | 13 +++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/helpers/default.nix b/helpers/default.nix index 1a1041bb..4845b6f6 100644 --- a/helpers/default.nix +++ b/helpers/default.nix @@ -1,7 +1,7 @@ {lib, ...}: { mkIfElse = p: yes: no: lib.mkMerge [ - (mkIf p yes) - (mkIf (!p) no) + (lib.mkIf p yes) + (lib.mkIf (!p) no) ]; } diff --git a/modules/default.nix b/modules/default.nix index 74584f56..48e19904 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -23,7 +23,7 @@ in { services.openssh = { enable = true; settings = { - PermitRootLogin = helpers.mkIfElse config.my.server.enable "yes" "no"; + # PermitRootLogin = "no"; # this is managed through authorized keys PasswordAuthentication = false; KbdInteractiveAuthentication = false; }; diff --git a/modules/home/default.nix b/modules/home/default.nix index 6d85a0d1..5e63d11d 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -6,12 +6,13 @@ }: let cfg = config.my.home; in { - imports = [ - ./vinzenz.nix - ./ronja.nix - # enable home manager - - ]; + imports = + [ + ./vinzenz.nix + ./ronja.nix + # enable home manager + ] + ++ lib.optional (builtins.pathExists ) ; options.my.home = { enable = lib.mkEnableOption "my home management"; From 5e9a74280e6f767d9ec0b2049c3cf9b8c7c9ae47 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 11 Sep 2023 19:16:26 +0200 Subject: [PATCH 0050/1295] split server desktop, move stuff --- helpers/default.nix | 7 -- hetzner-vpn1.nix | 6 +- modules/default.nix | 55 -------------- modules/desktop/default.nix | 74 +++++++++++++++---- modules/desktop/gnome.nix | 10 ++- modules/{ => desktop}/i18n.nix | 0 modules/desktop/kde.nix | 9 ++- modules/{ => desktop}/nixpkgs.nix | 0 modules/{home => desktop}/ronja.nix | 5 +- modules/{home => desktop}/vinzenz.nix | 5 +- .../hardware}/common-desktop.nix | 0 {hardware => modules/hardware}/default.nix | 0 .../hardware}/hetzner-vpn1.nix | 0 .../hardware}/vinzenz-lpt.nix | 0 .../hardware}/vinzenz-pc2.nix | 0 modules/home/default.nix | 25 ------- modules/server/default.nix | 20 ++++- vinzenz-lpt.nix | 11 ++- vinzenz-pc2.nix | 7 +- 19 files changed, 107 insertions(+), 127 deletions(-) delete mode 100644 helpers/default.nix delete mode 100644 modules/default.nix rename modules/{ => desktop}/i18n.nix (100%) rename modules/{ => desktop}/nixpkgs.nix (100%) rename modules/{home => desktop}/ronja.nix (96%) rename modules/{home => desktop}/vinzenz.nix (98%) rename {hardware => modules/hardware}/common-desktop.nix (100%) rename {hardware => modules/hardware}/default.nix (100%) rename {hardware => modules/hardware}/hetzner-vpn1.nix (100%) rename {hardware => modules/hardware}/vinzenz-lpt.nix (100%) rename {hardware => modules/hardware}/vinzenz-pc2.nix (100%) delete mode 100644 modules/home/default.nix diff --git a/helpers/default.nix b/helpers/default.nix deleted file mode 100644 index 4845b6f6..00000000 --- a/helpers/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{lib, ...}: { - mkIfElse = p: yes: no: - lib.mkMerge [ - (lib.mkIf p yes) - (lib.mkIf (!p) no) - ]; -} diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index b45da073..415b8cb9 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -1,14 +1,14 @@ {...}: { imports = [ - ./modules - (import ./hardware "hetzner-vpn1") + ./modules/server + (import ./modules/hardware "hetzner-vpn1") ]; config = { my = { - desktop.enable = false; server.enable = true; }; + users.users.root.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' ]; diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100644 index 48e19904..00000000 --- a/modules/default.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - config, - pkgs, - ... -}: let - cfg = config.my; - helpers = import ../helpers; -in { - imports = [ - ./home - ./desktop - ./i18n.nix - ./nixpkgs.nix - ]; - - config = { - networking = { - networkmanager.enable = true; - firewall.enable = true; - }; - - # Enable the OpenSSH daemon. - services.openssh = { - enable = true; - settings = { - # PermitRootLogin = "no"; # this is managed through authorized keys - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - }; - }; - - systemd.extraConfig = '' - DefaultTimeoutStopSec=12s - ''; - - programs = { - zsh.enable = true; - - git = { - enable = true; - package = pkgs.gitFull; - }; - }; - - environment = { - pathsToLink = ["/share/zsh"]; - - systemPackages = with pkgs; [ - lm_sensors - tldr - ncdu - ]; - }; - }; -} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index dca04994..aa508810 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -7,8 +7,13 @@ cfg = config.my.desktop; in { imports = [ + ./gnome.nix ./kde.nix + ./i18n.nix + ./nixpkgs.nix + ./vinzenz.nix + ./ronja.nix ]; options.my.desktop = { @@ -16,6 +21,9 @@ in { }; config = lib.mkIf cfg.enable { + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + services = { # Enable the X11 windowing system / wayland depending on DE xserver.enable = true; @@ -23,7 +31,15 @@ in { # Enable CUPS to print documents. printing.enable = true; - openssh.settings.PermitRootLogin = "no"; + # Enable the OpenSSH daemon. + openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; + }; }; # Enable sound with pipewire. @@ -46,20 +62,48 @@ in { }; # unblock kde connect / gsconnect - networking.firewall = { - allowedTCPPortRanges = [ - { - # KDE Connect - from = 1714; - to = 1764; - } - ]; - allowedUDPPortRanges = [ - { - # KDE Connect - from = 1714; - to = 1764; - } + networking = { + networkmanager.enable = true; + firewall.enable = true; + + firewall = { + allowedTCPPortRanges = [ + { + # KDE Connect + from = 1714; + to = 1764; + } + ]; + allowedUDPPortRanges = [ + { + # KDE Connect + from = 1714; + to = 1764; + } + ]; + }; + }; + + systemd.extraConfig = '' + DefaultTimeoutStopSec=12s + ''; + + programs = { + zsh.enable = true; + + git = { + enable = true; + package = pkgs.gitFull; + }; + }; + + environment = { + pathsToLink = ["/share/zsh"]; + + systemPackages = with pkgs; [ + lm_sensors + tldr + ncdu ]; }; }; diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 96ff7def..38b9fee0 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -4,7 +4,9 @@ lib, ... }: let - cfg = config.my.gnome; + desktopCfg = config.my.desktop; + cfg = desktopCfg.gnome; + applyGnomeUserSettings = { home.packages = with pkgs; [ gnome.gpaste @@ -17,7 +19,7 @@ }; }; in { - options.my.gnome = { + options.my.desktop.gnome = { enable = lib.mkEnableOption "gnome desktop"; }; @@ -56,8 +58,8 @@ in { ]; home-manager.users = { - vinzenz = lib.mkIf config.my.home.vinzenz.enable applyGnomeUserSettings; - ronja = lib.mkIf config.my.home.ronja.enable applyGnomeUserSettings; + vinzenz = lib.mkIf desktopCfg.vinzenz.enable applyGnomeUserSettings; + ronja = lib.mkIf desktopCfg.ronja.enable applyGnomeUserSettings; }; }; } diff --git a/modules/i18n.nix b/modules/desktop/i18n.nix similarity index 100% rename from modules/i18n.nix rename to modules/desktop/i18n.nix diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix index aa622625..08b0c03d 100644 --- a/modules/desktop/kde.nix +++ b/modules/desktop/kde.nix @@ -4,7 +4,8 @@ lib, ... }: let - cfg = config.my.kde; + desktopCfg = config.my.desktop; + cfg = desktopCfg.kde; applyKdeUserSettings = { home = { @@ -17,7 +18,7 @@ }; }; in { - options.my.kde = { + options.my.desktop.kde = { enable = lib.mkEnableOption "KDE desktop"; }; @@ -56,8 +57,8 @@ in { }; home-manager.users = { - vinzenz = lib.mkIf config.my.home.vinzenz.enable applyKdeUserSettings; - ronja = lib.mkIf config.my.home.ronja.enable applyKdeUserSettings; + vinzenz = lib.mkIf desktopCfg.vinzenz.enable applyKdeUserSettings; + ronja = lib.mkIf desktopCfg.ronja.enable applyKdeUserSettings; }; }; } diff --git a/modules/nixpkgs.nix b/modules/desktop/nixpkgs.nix similarity index 100% rename from modules/nixpkgs.nix rename to modules/desktop/nixpkgs.nix diff --git a/modules/home/ronja.nix b/modules/desktop/ronja.nix similarity index 96% rename from modules/home/ronja.nix rename to modules/desktop/ronja.nix index 0b11beae..f7f34f58 100644 --- a/modules/home/ronja.nix +++ b/modules/desktop/ronja.nix @@ -5,9 +5,9 @@ ... }: with lib; let - cfg = config.my.home.ronja; + cfg = config.my.desktop.ronja; in { - options.my.home.ronja = { + options.my.desktop.ronja = { enable = lib.mkEnableOption "user ronja"; }; @@ -21,7 +21,6 @@ in { }; # home manager - my.home.enable = true; home-manager.users.ronja = { config, pkgs, diff --git a/modules/home/vinzenz.nix b/modules/desktop/vinzenz.nix similarity index 98% rename from modules/home/vinzenz.nix rename to modules/desktop/vinzenz.nix index 799eb62d..010becb7 100644 --- a/modules/home/vinzenz.nix +++ b/modules/desktop/vinzenz.nix @@ -4,9 +4,9 @@ lib, ... }: let - cfg = config.my.home.vinzenz; + cfg = config.my.desktop.vinzenz; in { - options.my.home.vinzenz = { + options.my.desktop.vinzenz = { enable = lib.mkEnableOption "user vinzenz"; }; @@ -20,7 +20,6 @@ in { }; # home manager - my.home.enable = true; home-manager.users.vinzenz = { config, pkgs, diff --git a/hardware/common-desktop.nix b/modules/hardware/common-desktop.nix similarity index 100% rename from hardware/common-desktop.nix rename to modules/hardware/common-desktop.nix diff --git a/hardware/default.nix b/modules/hardware/default.nix similarity index 100% rename from hardware/default.nix rename to modules/hardware/default.nix diff --git a/hardware/hetzner-vpn1.nix b/modules/hardware/hetzner-vpn1.nix similarity index 100% rename from hardware/hetzner-vpn1.nix rename to modules/hardware/hetzner-vpn1.nix diff --git a/hardware/vinzenz-lpt.nix b/modules/hardware/vinzenz-lpt.nix similarity index 100% rename from hardware/vinzenz-lpt.nix rename to modules/hardware/vinzenz-lpt.nix diff --git a/hardware/vinzenz-pc2.nix b/modules/hardware/vinzenz-pc2.nix similarity index 100% rename from hardware/vinzenz-pc2.nix rename to modules/hardware/vinzenz-pc2.nix diff --git a/modules/home/default.nix b/modules/home/default.nix deleted file mode 100644 index 5e63d11d..00000000 --- a/modules/home/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - cfg = config.my.home; -in { - imports = - [ - ./vinzenz.nix - ./ronja.nix - # enable home manager - ] - ++ lib.optional (builtins.pathExists ) ; - - options.my.home = { - enable = lib.mkEnableOption "my home management"; - }; - - config = lib.mkIf cfg.enable { - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - }; -} diff --git a/modules/server/default.nix b/modules/server/default.nix index a8f584cd..f6874d8c 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -14,13 +14,25 @@ in { config = lib.mkIf cfg.enable { services = { - services.openssh.enable = true; + # Enable the OpenSSH daemon. + services.openssh = { + enable = true; + settings = { + # PermitRootLogin = "no"; # this is managed through authorized keys + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; + }; + }; programs = { + git.enable = true; + zsh.enable = true; }; networking.firewall = { + enable = true; allowedTCPPortRanges = [ { # ssh @@ -29,5 +41,11 @@ in { } ]; }; + + environment = { + systemPackages = with pkgs; [ + ncdu + ]; + }; }; } diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index eb7957d1..cf67dd5b 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -1,13 +1,16 @@ {...}: { imports = [ - ./modules - (import ./hardware "vinzenz-lpt") + ./modules/desktop + (import ./modules/hardware "vinzenz-lpt") ]; config = { my = { - gnome.enable = true; - home.vinzenz.enable = true; + desktop = { + enable = true; + gnome.enable = true; + vinzenz.enable = true; + }; }; services.flatpak.enable = true; diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 200ed8ab..d348a3fd 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -1,13 +1,14 @@ {...}: { imports = [ ./modules - (import ./hardware "vinzenz-pc2") + (import ./modules/hardware "vinzenz-pc2") ]; config = { my = { - kde.enable = true; - home = { + desktop = { + enable = true; + kde.enable = true; vinzenz.enable = true; ronja.enable = true; }; From c022eb979b52a037d03ef920bf90defe446aa637 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 11 Sep 2023 19:17:32 +0200 Subject: [PATCH 0051/1295] fix ssh --- modules/server/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/server/default.nix b/modules/server/default.nix index f6874d8c..06918bc8 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -15,7 +15,7 @@ in { config = lib.mkIf cfg.enable { services = { # Enable the OpenSSH daemon. - services.openssh = { + openssh = { enable = true; settings = { # PermitRootLogin = "no"; # this is managed through authorized keys From c1e4cdb929faf75af7cbfb20b8f040f1ed9b4f49 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 11 Sep 2023 19:21:31 +0200 Subject: [PATCH 0052/1295] move out common stuff again --- modules/_common/default.nix | 6 ++++++ modules/{desktop => _common}/i18n.nix | 0 modules/{desktop => _common}/nixpkgs.nix | 0 modules/desktop/default.nix | 3 +-- modules/server/default.nix | 5 +++-- 5 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 modules/_common/default.nix rename modules/{desktop => _common}/i18n.nix (100%) rename modules/{desktop => _common}/nixpkgs.nix (100%) diff --git a/modules/_common/default.nix b/modules/_common/default.nix new file mode 100644 index 00000000..64323568 --- /dev/null +++ b/modules/_common/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./i18n.nix + ./nixpkgs.nix + ]; +} diff --git a/modules/desktop/i18n.nix b/modules/_common/i18n.nix similarity index 100% rename from modules/desktop/i18n.nix rename to modules/_common/i18n.nix diff --git a/modules/desktop/nixpkgs.nix b/modules/_common/nixpkgs.nix similarity index 100% rename from modules/desktop/nixpkgs.nix rename to modules/_common/nixpkgs.nix diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index aa508810..f9553c66 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -8,10 +8,9 @@ in { imports = [ + ../_common ./gnome.nix ./kde.nix - ./i18n.nix - ./nixpkgs.nix ./vinzenz.nix ./ronja.nix ]; diff --git a/modules/server/default.nix b/modules/server/default.nix index 06918bc8..39940cd3 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -6,7 +6,9 @@ }: let cfg = config.my.server; in { - imports = []; + imports = [ + ../_common + ]; options.my.server = { enable = lib.mkEnableOption "server role"; @@ -23,7 +25,6 @@ in { KbdInteractiveAuthentication = false; }; }; - }; programs = { From ec2166ec2dc1d101c1bfb1a29d0f9fc09e965a2e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 11 Sep 2023 21:00:02 +0200 Subject: [PATCH 0053/1295] fix vpn1 config --- modules/_common/nixpkgs.nix | 7 +- modules/desktop/default.nix | 4 + modules/hardware/hetzner-vpn1.nix | 151 +++++++++++++++++------------- 3 files changed, 89 insertions(+), 73 deletions(-) diff --git a/modules/_common/nixpkgs.nix b/modules/_common/nixpkgs.nix index dc7c9e99..be3e7441 100644 --- a/modules/_common/nixpkgs.nix +++ b/modules/_common/nixpkgs.nix @@ -1,11 +1,6 @@ {...}: { config = { - nixpkgs.config = { - allowUnfree = true; - permittedInsecurePackages = [ - "electron-12.2.3" - ]; - }; + nixpkgs.config.allowUnfree = true; system = { stateVersion = "22.11"; diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index f9553c66..95846506 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -105,5 +105,9 @@ in { ncdu ]; }; + + nixpkgs.config.permittedInsecurePackages = [ + "electron-12.2.3" + ]; }; } diff --git a/modules/hardware/hetzner-vpn1.nix b/modules/hardware/hetzner-vpn1.nix index 7b62a41f..8ac8edc4 100644 --- a/modules/hardware/hetzner-vpn1.nix +++ b/modules/hardware/hetzner-vpn1.nix @@ -7,74 +7,91 @@ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.cleanTmpDir = true; - zramSwap.enable = true; - networking.domain = ""; - - boot.loader.grub = { - efiSupport = true; - efiInstallAsRemovable = true; - device = "nodev"; - }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/77CF-345D"; - fsType = "vfat"; - }; - boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"]; - boot.initrd.kernelModules = ["nvme"]; - fileSystems."/" = { - device = "/dev/sda1"; - fsType = "ext4"; - }; - - # This file was populated at runtime with the networking - # details gathered from the active system. - networking = { - nameservers = [ - "8.8.8.8" - ]; - defaultGateway = "172.31.1.1"; - defaultGateway6 = { - address = "fe80::1"; - interface = "eth0"; - }; - dhcpcd.enable = false; - usePredictableInterfaceNames = lib.mkForce false; - interfaces = { - eth0 = { - ipv4.addresses = [ - { - address = "157.90.146.125"; - prefixLength = 32; - } - ]; - ipv6.addresses = [ - { - address = "2a01:4f8:c012:7137::1"; - prefixLength = 64; - } - { - address = "fe80::9400:2ff:fe87:7fc9"; - prefixLength = 64; - } - ]; - ipv4.routes = [ - { - address = "172.31.1.1"; - prefixLength = 32; - } - ]; - ipv6.routes = [ - { - address = "fe80::1"; - prefixLength = 128; - } - ]; + config = { + boot = { + tmp.cleanOnBoot = true; + loader = { + systemd-boot.enable = lib.mkForce false; + efi.canTouchEfiVariables = lib.mkForce false; + grub = { + enable = true; + efiSupport = true; + efiInstallAsRemovable = true; + device = "nodev"; + }; + }; + initrd = { + availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"]; + kernelModules = ["nvme"]; }; }; - }; - services.udev.extraRules = '' - ATTR{address}=="96:00:02:87:7f:c9", NAME="eth0" - ''; + zramSwap.enable = true; + networking.domain = ""; + + fileSystems = { + "/boot" = { + device = "/dev/disk/by-uuid/77CF-345D"; + fsType = "vfat"; + }; + "/" = { + device = "/dev/sda1"; + fsType = "ext4"; + }; + }; + + # This file was populated at runtime with the networking + # details gathered from the active system. + networking = { + nameservers = ["8.8.8.8"]; + defaultGateway = "172.31.1.1"; + defaultGateway6 = { + address = "fe80::1"; + interface = "eth0"; + }; + dhcpcd.enable = false; + usePredictableInterfaceNames = lib.mkForce false; + interfaces = { + eth0 = { + ipv4 = { + addresses = [ + { + address = "157.90.146.125"; + prefixLength = 32; + } + ]; + routes = [ + { + address = "172.31.1.1"; + prefixLength = 32; + } + ]; + }; + ipv6 = { + addresses = [ + { + address = "2a01:4f8:c012:7137::1"; + prefixLength = 64; + } + { + address = "fe80::9400:2ff:fe87:7fc9"; + prefixLength = 64; + } + ]; + routes = [ + { + address = "fe80::1"; + prefixLength = 128; + } + ]; + }; + }; + }; + }; + + services.udev.extraRules = '' + ATTR{address}=="96:00:02:87:7f:c9", NAME="eth0" + + ''; + }; } From 2764393d065efc1b569385995a128277d6b6b953 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 11 Sep 2023 21:42:33 +0200 Subject: [PATCH 0054/1295] vpn1 is aarch64 --- modules/hardware/hetzner-vpn1.nix | 5 +++++ modules/server/default.nix | 1 + 2 files changed, 6 insertions(+) diff --git a/modules/hardware/hetzner-vpn1.nix b/modules/hardware/hetzner-vpn1.nix index 8ac8edc4..e1476680 100644 --- a/modules/hardware/hetzner-vpn1.nix +++ b/modules/hardware/hetzner-vpn1.nix @@ -8,6 +8,11 @@ ]; config = { + nixpkgs = { + hostPlatform = "aarch64-linux"; + system = "aarch64-linux"; + }; + boot = { tmp.cleanOnBoot = true; loader = { diff --git a/modules/server/default.nix b/modules/server/default.nix index 39940cd3..cc132786 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -46,6 +46,7 @@ in { environment = { systemPackages = with pkgs; [ ncdu + htop ]; }; }; From c6eefbb5bc2ac2cea2bf188a65dd81fc2fab3984 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 11 Sep 2023 21:49:40 +0200 Subject: [PATCH 0055/1295] move imports, options --- modules/desktop/default.nix | 4 ++++ modules/desktop/gnome.nix | 4 ---- modules/desktop/kde.nix | 4 ---- modules/desktop/ronja.nix | 4 ---- modules/desktop/vinzenz.nix | 4 ---- modules/hardware/common-desktop.nix | 17 ++--------------- modules/hardware/default.nix | 1 - modules/hardware/vinzenz-lpt.nix | 6 ++++-- modules/hardware/vinzenz-pc2.nix | 6 ++++-- 9 files changed, 14 insertions(+), 36 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 95846506..6d768c7a 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -17,6 +17,10 @@ in { options.my.desktop = { enable = lib.mkEnableOption "desktop"; + gnome .enable = lib.mkEnableOption "gnome desktop"; + kde.enable = lib.mkEnableOption "KDE desktop"; + ronja.enable = lib.mkEnableOption "user ronja"; + vinzenz.enable = lib.mkEnableOption "user vinzenz"; }; config = lib.mkIf cfg.enable { diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 38b9fee0..2e406a40 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -19,10 +19,6 @@ }; }; in { - options.my.desktop.gnome = { - enable = lib.mkEnableOption "gnome desktop"; - }; - config = lib.mkIf cfg.enable { my.desktop.enable = true; diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix index 08b0c03d..9c045790 100644 --- a/modules/desktop/kde.nix +++ b/modules/desktop/kde.nix @@ -18,10 +18,6 @@ }; }; in { - options.my.desktop.kde = { - enable = lib.mkEnableOption "KDE desktop"; - }; - config = lib.mkIf cfg.enable { my.desktop.enable = true; diff --git a/modules/desktop/ronja.nix b/modules/desktop/ronja.nix index f7f34f58..d39f6871 100644 --- a/modules/desktop/ronja.nix +++ b/modules/desktop/ronja.nix @@ -7,10 +7,6 @@ with lib; let cfg = config.my.desktop.ronja; in { - options.my.desktop.ronja = { - enable = lib.mkEnableOption "user ronja"; - }; - config = lib.mkIf cfg.enable { # Define user account users.users.ronja = { diff --git a/modules/desktop/vinzenz.nix b/modules/desktop/vinzenz.nix index 010becb7..c6853c26 100644 --- a/modules/desktop/vinzenz.nix +++ b/modules/desktop/vinzenz.nix @@ -6,10 +6,6 @@ }: let cfg = config.my.desktop.vinzenz; in { - options.my.desktop.vinzenz = { - enable = lib.mkEnableOption "user vinzenz"; - }; - config = lib.mkIf cfg.enable { # Define user account users.users.vinzenz = { diff --git a/modules/hardware/common-desktop.nix b/modules/hardware/common-desktop.nix index 83a34f6c..2750bbf6 100644 --- a/modules/hardware/common-desktop.nix +++ b/modules/hardware/common-desktop.nix @@ -1,18 +1,5 @@ -{ - lib, - config, - ... -}: let - isEnabled = config.my.hardware.common-desktop.enable; -in { - imports = [ - ]; - - options.my.hardware.common-desktop = { - enable = lib.mkEnableOption "common desktop hardware settings"; - }; - - config = lib.mkIf isEnabled { +{lib, ...}: { + config = { boot.loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index a5608dca..3a06ecb2 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -6,7 +6,6 @@ hostName: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") (builtins.toString ./. + "/${hostName}.nix") - ./common-desktop.nix ]; config = { diff --git a/modules/hardware/vinzenz-lpt.nix b/modules/hardware/vinzenz-lpt.nix index 3b36625f..37064218 100644 --- a/modules/hardware/vinzenz-lpt.nix +++ b/modules/hardware/vinzenz-lpt.nix @@ -1,7 +1,9 @@ {...}: { - config = { - my.hardware.common-desktop.enable = true; + imports = [ + ./common-desktop.nix + ]; + config = { boot = { initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; initrd.kernelModules = []; diff --git a/modules/hardware/vinzenz-pc2.nix b/modules/hardware/vinzenz-pc2.nix index 609479ee..607d0f88 100644 --- a/modules/hardware/vinzenz-pc2.nix +++ b/modules/hardware/vinzenz-pc2.nix @@ -1,7 +1,9 @@ {...}: { - config = { - my.hardware.common-desktop.enable = true; + imports = [ + ./common-desktop.nix + ]; + config = { boot = { initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" initrd.kernelModules = []; From b2e8ad5ff1ef54a3941d7e59ff3714e3c908e3ad Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 11 Sep 2023 22:44:22 +0200 Subject: [PATCH 0056/1295] fix pc2 --- modules/desktop/kde.nix | 3 +++ vinzenz-lpt.nix | 1 + vinzenz-pc2.nix | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix index 9c045790..caa0ab35 100644 --- a/modules/desktop/kde.nix +++ b/modules/desktop/kde.nix @@ -21,6 +21,9 @@ in { config = lib.mkIf cfg.enable { my.desktop.enable = true; + # flatpak xdg-portal-kde crashes, otherwise this would be global + services.flatpak.enable = false; + services = { # Enable the KDE Plasma Desktop Environment. xserver = { diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index cf67dd5b..cdeb670c 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -13,6 +13,7 @@ }; }; + # flatpak xdg-portal-kde crashes, otherwise this would be global services.flatpak.enable = true; }; } diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index d348a3fd..67162fc0 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -1,6 +1,6 @@ {...}: { imports = [ - ./modules + ./modules/desktop (import ./modules/hardware "vinzenz-pc2") ]; From bd2790e0015d9f01b7f10eb1de7a89103072df3f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Sep 2023 11:15:06 +0200 Subject: [PATCH 0057/1295] new aliases direnvallow ipv4 --- modules/desktop/vinzenz.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/desktop/vinzenz.nix b/modules/desktop/vinzenz.nix index c6853c26..8910f7dd 100644 --- a/modules/desktop/vinzenz.nix +++ b/modules/desktop/vinzenz.nix @@ -101,6 +101,8 @@ in { my-switch = "sudo nixos-rebuild switch"; my-update = "sudo nixos-rebuild boot --upgrade"; my-fmt = "alejandra ."; + my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; + my-ip4 = "ip addr show | grep 192"; }; history = { From 61c75dd4924e60e234a9474a0b49b4151f3a2b63 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Sep 2023 12:44:20 +0200 Subject: [PATCH 0058/1295] add yt music --- modules/desktop/vinzenz.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/desktop/vinzenz.nix b/modules/desktop/vinzenz.nix index 8910f7dd..c76ae79a 100644 --- a/modules/desktop/vinzenz.nix +++ b/modules/desktop/vinzenz.nix @@ -58,6 +58,7 @@ in { wineWowPackages.stagingFull wineWowPackages.fonts winetricks + youtube-music (lutris.override { extraPkgs = pkgs: [ From 4615aad131437a4bf2b1ae31fed82c1cfb4ce843 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Sep 2023 14:03:37 +0200 Subject: [PATCH 0059/1295] boot faster by not waiting for network --- modules/desktop/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 6d768c7a..49a25993 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -87,9 +87,14 @@ in { }; }; - systemd.extraConfig = '' - DefaultTimeoutStopSec=12s - ''; + systemd = { + # save some boot time because nothing actually requires network connectivity + services.NetworkManager-wait-online.enable = false; + + extraConfig = '' + DefaultTimeoutStopSec=12s + ''; + }; programs = { zsh.enable = true; From f0028ba7a7be2726c06c16c073d88e4a622b43ac Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Sep 2023 15:20:18 +0200 Subject: [PATCH 0060/1295] auto update and gc settings --- modules/_common/nixpkgs.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/_common/nixpkgs.nix b/modules/_common/nixpkgs.nix index be3e7441..b8299d3a 100644 --- a/modules/_common/nixpkgs.nix +++ b/modules/_common/nixpkgs.nix @@ -5,12 +5,16 @@ system = { stateVersion = "22.11"; # enable auto updates - autoUpgrade.enable = true; + autoUpgrade = { + enable = true; + dates = "weekly"; + }; }; nix.gc = { automatic = true; - dates = "00:30"; + dates = "monthly"; + options = "--delete-older-than 30d"; }; }; } From 1508d9a6acd1b1babfb028098773a2482333cb69 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Sep 2023 15:20:45 +0200 Subject: [PATCH 0061/1295] zen kernel and quiet boot --- modules/hardware/common-desktop.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/hardware/common-desktop.nix b/modules/hardware/common-desktop.nix index 2750bbf6..0e549180 100644 --- a/modules/hardware/common-desktop.nix +++ b/modules/hardware/common-desktop.nix @@ -1,8 +1,16 @@ -{lib, ...}: { +{ + lib, + pkgs, + ... +}: { config = { - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; + boot = { + kernelPackages = pkgs.linuxPackages_zen; + kernelParams = ["quiet" "loglevel=3"]; + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; }; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking From 6a28114eb378882c0c50f1d7d6122612ee28cb3a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Sep 2023 16:54:18 +0200 Subject: [PATCH 0062/1295] fix missing icons in gnome console --- modules/desktop/default.nix | 14 ++++++++++++++ modules/desktop/ronja.nix | 2 -- modules/desktop/vinzenz.nix | 9 --------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 49a25993..6ad0cca1 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -118,5 +118,19 @@ in { nixpkgs.config.permittedInsecurePackages = [ "electron-12.2.3" ]; + + fonts = { + fonts = with pkgs; [ + (nerdfonts.override {fonts = ["FiraCode"];}) + ]; + + fontconfig = { + defaultFonts = { + serif = []; + sansSerif = []; + monospace = ["FiraCode Nerd Font"]; + }; + }; + }; }; } diff --git a/modules/desktop/ronja.nix b/modules/desktop/ronja.nix index d39f6871..c9384433 100644 --- a/modules/desktop/ronja.nix +++ b/modules/desktop/ronja.nix @@ -35,8 +35,6 @@ in { ## Apps steam telegram-desktop - powerline - powerline-fonts lutris kdiff3 wineWowPackages.stagingFull diff --git a/modules/desktop/vinzenz.nix b/modules/desktop/vinzenz.nix index c76ae79a..94814f05 100644 --- a/modules/desktop/vinzenz.nix +++ b/modules/desktop/vinzenz.nix @@ -43,8 +43,6 @@ in { radeontop lsof wirelesstools - powerline - powerline-fonts thefuck dotnet-sdk_7 jetbrains.rider @@ -188,13 +186,6 @@ in { ]; }; - bottom = { - enable = true; - settings = { - # https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml - }; - }; - exa = { enable = true; git = true; From 3f5720d73c1177fd22bad9bcab90da76d40d326b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Sep 2023 16:56:11 +0200 Subject: [PATCH 0063/1295] prettier font config --- modules/desktop/default.nix | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 6ad0cca1..bb84321f 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -120,17 +120,10 @@ in { ]; fonts = { + fontconfig.defaultFonts.monospace = ["FiraCode Nerd Font"]; fonts = with pkgs; [ (nerdfonts.override {fonts = ["FiraCode"];}) ]; - - fontconfig = { - defaultFonts = { - serif = []; - sansSerif = []; - monospace = ["FiraCode Nerd Font"]; - }; - }; }; }; } From 1df749075201095faada163b493058ce474a0b32 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 23 Sep 2023 11:29:46 +0200 Subject: [PATCH 0064/1295] new gaming module --- modules/desktop/default.nix | 2 ++ modules/desktop/gaming.nix | 29 +++++++++++++++++++++++++++++ modules/desktop/ronja.nix | 14 -------------- modules/desktop/vinzenz.nix | 14 -------------- vinzenz-pc2.nix | 17 +++++++++-------- 5 files changed, 40 insertions(+), 36 deletions(-) create mode 100644 modules/desktop/gaming.nix diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index bb84321f..f007c144 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -13,6 +13,7 @@ in { ./kde.nix ./vinzenz.nix ./ronja.nix + ./gaming.nix ]; options.my.desktop = { @@ -21,6 +22,7 @@ in { kde.enable = lib.mkEnableOption "KDE desktop"; ronja.enable = lib.mkEnableOption "user ronja"; vinzenz.enable = lib.mkEnableOption "user vinzenz"; + gaming.enable = lib.mkEnableOption "gaming with wine"; }; config = lib.mkIf cfg.enable { diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix new file mode 100644 index 00000000..81382f74 --- /dev/null +++ b/modules/desktop/gaming.nix @@ -0,0 +1,29 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.my.desktop.gaming; +in { + imports = []; + config = lib.mkIf cfg.enable { + hardware.opengl.driSupport32Bit = true; + + environment.systemPackages = with pkgs; [ + wineWowPackages.stagingFull + wineWowPackages.fonts + winetricks + steam + + (lutris.override { + extraPkgs = pkgs: [ + # List package dependencies here + ]; + extraLibraries = pkgs: [ + # List library dependencies here + ]; + }) + ]; + }; +} diff --git a/modules/desktop/ronja.nix b/modules/desktop/ronja.nix index c9384433..ef5e71ca 100644 --- a/modules/desktop/ronja.nix +++ b/modules/desktop/ronja.nix @@ -33,22 +33,8 @@ in { packages = with pkgs; [ ## Apps - steam telegram-desktop - lutris kdiff3 - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks - - (lutris.override { - extraPkgs = pkgs: [ - # List package dependencies here - ]; - extraLibraries = pkgs: [ - # List library dependencies here - ]; - }) ]; file.".nanorc".text = '' diff --git a/modules/desktop/vinzenz.nix b/modules/desktop/vinzenz.nix index 94814f05..62bc3a66 100644 --- a/modules/desktop/vinzenz.nix +++ b/modules/desktop/vinzenz.nix @@ -32,7 +32,6 @@ in { packages = with pkgs; [ keepassxc - steam insync telegram-desktop simple-scan @@ -40,7 +39,6 @@ in { element-desktop etcher iotop - radeontop lsof wirelesstools thefuck @@ -53,19 +51,7 @@ in { jetbrains.pycharm-professional kdiff3 docker - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks youtube-music - - (lutris.override { - extraPkgs = pkgs: [ - # List package dependencies here - ]; - extraLibraries = pkgs: [ - # List library dependencies here - ]; - }) ]; file.".nanorc".text = '' diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 67162fc0..61818a36 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -1,19 +1,20 @@ -{...}: { +{pkgs, ...}: { imports = [ ./modules/desktop (import ./modules/hardware "vinzenz-pc2") ]; config = { - my = { - desktop = { - enable = true; - kde.enable = true; - vinzenz.enable = true; - ronja.enable = true; - }; + my.desktop = { + enable = true; + kde.enable = true; + vinzenz.enable = true; + ronja.enable = true; + gaming.enable = true; }; + environment.systemPackages = [pkgs.radeontop]; + users.groups."games" = { members = ["vinzenz" "ronja"]; }; From b0d12bd9cd076599f82f0f4a3b5ba4c811c75b32 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 23 Sep 2023 11:30:03 +0200 Subject: [PATCH 0065/1295] more quiet boot --- modules/hardware/common-desktop.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/hardware/common-desktop.nix b/modules/hardware/common-desktop.nix index 0e549180..24df1edc 100644 --- a/modules/hardware/common-desktop.nix +++ b/modules/hardware/common-desktop.nix @@ -6,9 +6,14 @@ config = { boot = { kernelPackages = pkgs.linuxPackages_zen; - kernelParams = ["quiet" "loglevel=3"]; + kernelParams = ["quiet" "udev.log_level=3"]; + supportedFilesystems = ["btrfs"]; + initrd.supportedFilesystems = ["btrfs"]; + consoleLogLevel = 0; + initrd.verbose = false; loader = { systemd-boot.enable = true; + timeout = 3; efi.canTouchEfiVariables = true; }; }; From 2298114e101352216c0a5b0162b74f3a4c39d126 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 23 Sep 2023 16:55:06 +0200 Subject: [PATCH 0066/1295] micro --- modules/desktop/vinzenz.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/desktop/vinzenz.nix b/modules/desktop/vinzenz.nix index 62bc3a66..2a19d6f6 100644 --- a/modules/desktop/vinzenz.nix +++ b/modules/desktop/vinzenz.nix @@ -68,6 +68,7 @@ in { dircolors.enable = true; fzf.enable = true; htop.enable = true; + mangohud.enable = true; zsh = { enable = true; @@ -183,7 +184,19 @@ in { ]; }; - # checked https://rycee.gitlab.io/home-manager/options.html until "programs.jq" + micro = { + enable = true; + settings = { + colorcolumn = 120; + hlsearch = true; + savecursor = true; + saveundo = true; + scrollbar = true; + smartpaste = true; + }; + }; + + # checked https://rycee.gitlab.io/home-manager/options.html until "programs.notmuch" }; editorconfig = { From bf3946e06f1cc11dac8a97d0365520928e5d7a93 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 23 Sep 2023 16:56:14 +0200 Subject: [PATCH 0067/1295] add gaming on lpt --- vinzenz-lpt.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index cdeb670c..641c2aca 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -10,6 +10,7 @@ enable = true; gnome.enable = true; vinzenz.enable = true; + gaming.enable = true; }; }; From 1b7989336e67c863c3c8a58eb25474c91b57a121 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 10:15:53 +0200 Subject: [PATCH 0068/1295] convoluted solution looking for a problem unified modules structure --- .gitignore | 1 + hetzner-vpn1.nix | 12 ++++++------ modules/_common/default.nix | 6 ------ modules/default.nix | 16 ++++++++++++++++ modules/desktop/default.nix | 10 ++++++---- modules/hardware/common-desktop.nix | 9 +++++++-- modules/hardware/default.nix | 11 +++++++++-- modules/hardware/vinzenz-lpt.nix | 6 ++---- modules/hardware/vinzenz-pc2.nix | 6 ++---- modules/{_common => }/i18n.nix | 0 modules/{_common => }/nixpkgs.nix | 0 modules/{server/default.nix => server.nix} | 4 ---- vinzenz-lpt.nix | 17 ++++++++--------- vinzenz-pc2.nix | 7 ++++--- 14 files changed, 61 insertions(+), 44 deletions(-) delete mode 100644 modules/_common/default.nix create mode 100644 modules/default.nix rename modules/{_common => }/i18n.nix (100%) rename modules/{_common => }/nixpkgs.nix (100%) rename modules/{server/default.nix => server.nix} (96%) diff --git a/.gitignore b/.gitignore index 727bc05f..8e21b1dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .directory +result diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 415b8cb9..2c2f7123 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -1,13 +1,13 @@ -{...}: { +{pkgs, ...}: { imports = [ - ./modules/server - (import ./modules/hardware "hetzner-vpn1") + (import ./modules { + hostName = "hetzner-vpn1"; + enableDesktop = false; + }) ]; config = { - my = { - server.enable = true; - }; + my.server.enable = true; users.users.root.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' diff --git a/modules/_common/default.nix b/modules/_common/default.nix deleted file mode 100644 index 64323568..00000000 --- a/modules/_common/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...}: { - imports = [ - ./i18n.nix - ./nixpkgs.nix - ]; -} diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 00000000..199fa075 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,16 @@ +modulesCfg: {lib, ...}: { + imports = + [ + ./i18n.nix + ./nixpkgs.nix + ./server.nix + ] + ++ (map (path: (import path modulesCfg)) [ + ./desktop + ./hardware + ]); + + config = { + my.modulesCfg = modulesCfg; + }; +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index f007c144..ea268fc2 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -1,14 +1,14 @@ -{ +modulesCfg: { config, pkgs, lib, ... }: let + isEnabled = modulesCfg.enableDesktop; cfg = config.my.desktop; in { - imports = [ + imports = lib.optionals isEnabled [ - ../_common ./gnome.nix ./kde.nix ./vinzenz.nix @@ -16,9 +16,11 @@ in { ./gaming.nix ]; + options.my.modulesCfg.enableDesktop = lib.mkEnableOption "enable desktop module"; + options.my.desktop = { enable = lib.mkEnableOption "desktop"; - gnome .enable = lib.mkEnableOption "gnome desktop"; + gnome.enable = lib.mkEnableOption "gnome desktop"; kde.enable = lib.mkEnableOption "KDE desktop"; ronja.enable = lib.mkEnableOption "user ronja"; vinzenz.enable = lib.mkEnableOption "user vinzenz"; diff --git a/modules/hardware/common-desktop.nix b/modules/hardware/common-desktop.nix index 24df1edc..dea948e2 100644 --- a/modules/hardware/common-desktop.nix +++ b/modules/hardware/common-desktop.nix @@ -1,9 +1,14 @@ { lib, pkgs, + config, ... -}: { - config = { +}: let + isEnabled = config.my.hardware.enableCommonDesktopSettings; +in { + options.my.hardware.enableCommonDesktopSettings = lib.mkEnableOption "common hw settings for desktops"; + + config = lib.mkIf isEnabled { boot = { kernelPackages = pkgs.linuxPackages_zen; kernelParams = ["quiet" "udev.log_level=3"]; diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index 3a06ecb2..5e4911e2 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -1,13 +1,20 @@ -hostName: { +modulesCfg: { modulesPath, lib, ... -}: { +}: let + hostName = modulesCfg.hostName; +in { imports = [ (modulesPath + "/installer/scan/not-detected.nix") (builtins.toString ./. + "/${hostName}.nix") + ./common-desktop.nix ]; + options.my.modulesCfg.hostName = lib.mkOption { + type = lib.types.str; + }; + config = { networking.hostName = hostName; diff --git a/modules/hardware/vinzenz-lpt.nix b/modules/hardware/vinzenz-lpt.nix index 37064218..152d8048 100644 --- a/modules/hardware/vinzenz-lpt.nix +++ b/modules/hardware/vinzenz-lpt.nix @@ -1,9 +1,7 @@ {...}: { - imports = [ - ./common-desktop.nix - ]; - config = { + my.hardware.enableCommonDesktopSettings = true; + boot = { initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; initrd.kernelModules = []; diff --git a/modules/hardware/vinzenz-pc2.nix b/modules/hardware/vinzenz-pc2.nix index 607d0f88..ccd65c68 100644 --- a/modules/hardware/vinzenz-pc2.nix +++ b/modules/hardware/vinzenz-pc2.nix @@ -1,9 +1,7 @@ {...}: { - imports = [ - ./common-desktop.nix - ]; - config = { + my.hardware.enableCommonDesktopSettings = true; + boot = { initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" initrd.kernelModules = []; diff --git a/modules/_common/i18n.nix b/modules/i18n.nix similarity index 100% rename from modules/_common/i18n.nix rename to modules/i18n.nix diff --git a/modules/_common/nixpkgs.nix b/modules/nixpkgs.nix similarity index 100% rename from modules/_common/nixpkgs.nix rename to modules/nixpkgs.nix diff --git a/modules/server/default.nix b/modules/server.nix similarity index 96% rename from modules/server/default.nix rename to modules/server.nix index cc132786..f5bf2f5e 100644 --- a/modules/server/default.nix +++ b/modules/server.nix @@ -6,10 +6,6 @@ }: let cfg = config.my.server; in { - imports = [ - ../_common - ]; - options.my.server = { enable = lib.mkEnableOption "server role"; }; diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 641c2aca..f2e05860 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -1,17 +1,16 @@ {...}: { imports = [ - ./modules/desktop - (import ./modules/hardware "vinzenz-lpt") + (import ./modules { + hostName = "vinzenz-lpt"; + enableDesktop = true; + }) ]; config = { - my = { - desktop = { - enable = true; - gnome.enable = true; - vinzenz.enable = true; - gaming.enable = true; - }; + my.desktop = { + gnome.enable = true; + vinzenz.enable = true; + gaming.enable = true; }; # flatpak xdg-portal-kde crashes, otherwise this would be global diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 61818a36..1d6243bb 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -1,12 +1,13 @@ {pkgs, ...}: { imports = [ - ./modules/desktop - (import ./modules/hardware "vinzenz-pc2") + (import ./modules { + hostName = "vinzenz-pc2"; + enableDesktop = true; + }) ]; config = { my.desktop = { - enable = true; kde.enable = true; vinzenz.enable = true; ronja.enable = true; From 3a9a7242fc680e5d7b77cbdbf63e398d20bd2069 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 10:46:15 +0200 Subject: [PATCH 0069/1295] split/rename options, bundle vendor settings --- hetzner-vpn1.nix | 2 +- modules/default.nix | 1 + modules/desktop/default.nix | 34 +++++++++++++------------------- modules/desktop/gaming.nix | 7 +++++-- modules/desktop/gnome.nix | 6 ++++-- modules/desktop/kde.nix | 6 ++++-- modules/desktop/ronja.nix | 2 ++ modules/desktop/vinzenz.nix | 2 ++ modules/globalinstalls.nix | 10 ++++++++++ modules/hardware/amdcpu.nix | 15 ++++++++++++++ modules/hardware/amdgpu.nix | 16 +++++++++++++++ modules/hardware/default.nix | 3 +++ modules/hardware/intelcpu.nix | 14 +++++++++++++ modules/hardware/vinzenz-lpt.nix | 11 +++++------ modules/hardware/vinzenz-pc2.nix | 11 +++++------ modules/server.nix | 7 ------- vinzenz-lpt.nix | 7 ++++--- vinzenz-pc2.nix | 9 ++++----- 18 files changed, 109 insertions(+), 54 deletions(-) create mode 100644 modules/globalinstalls.nix create mode 100644 modules/hardware/amdcpu.nix create mode 100644 modules/hardware/amdgpu.nix create mode 100644 modules/hardware/intelcpu.nix diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 2c2f7123..5aaf7ce1 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -2,7 +2,7 @@ imports = [ (import ./modules { hostName = "hetzner-vpn1"; - enableDesktop = false; + enableHomeManager = false; }) ]; diff --git a/modules/default.nix b/modules/default.nix index 199fa075..0585543c 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,6 +3,7 @@ modulesCfg: {lib, ...}: { [ ./i18n.nix ./nixpkgs.nix + ./globalinstalls.nix ./server.nix ] ++ (map (path: (import path modulesCfg)) [ diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index ea268fc2..6d9ed44f 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -4,28 +4,24 @@ modulesCfg: { lib, ... }: let - isEnabled = modulesCfg.enableDesktop; + enableHomeManager = modulesCfg.enableHomeManager; cfg = config.my.desktop; in { - imports = lib.optionals isEnabled [ - - ./gnome.nix - ./kde.nix - ./vinzenz.nix - ./ronja.nix - ./gaming.nix - ]; + imports = + [ + ./gnome.nix + ./kde.nix + ./vinzenz.nix + ./ronja.nix + ./gaming.nix + ] + ++ lib.optionals enableHomeManager [ + + ]; - options.my.modulesCfg.enableDesktop = lib.mkEnableOption "enable desktop module"; + options.my.modulesCfg.enableHomeManager = lib.mkEnableOption "enable home manager"; - options.my.desktop = { - enable = lib.mkEnableOption "desktop"; - gnome.enable = lib.mkEnableOption "gnome desktop"; - kde.enable = lib.mkEnableOption "KDE desktop"; - ronja.enable = lib.mkEnableOption "user ronja"; - vinzenz.enable = lib.mkEnableOption "user vinzenz"; - gaming.enable = lib.mkEnableOption "gaming with wine"; - }; + options.my.desktop.enable = lib.mkEnableOption "desktop"; config = lib.mkIf cfg.enable { home-manager.useUserPackages = true; @@ -114,8 +110,6 @@ in { systemPackages = with pkgs; [ lm_sensors - tldr - ncdu ]; }; diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index 81382f74..8b9cd348 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -4,10 +4,13 @@ lib, ... }: let - cfg = config.my.desktop.gaming; + isEnabled = config.my.desktop.enableGaming; in { imports = []; - config = lib.mkIf cfg.enable { + + options.my.desktop.enableGaming = lib.mkEnableOption "gaming with wine"; + + config = lib.mkIf isEnabled { hardware.opengl.driSupport32Bit = true; environment.systemPackages = with pkgs; [ diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 2e406a40..4a399913 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -5,7 +5,7 @@ ... }: let desktopCfg = config.my.desktop; - cfg = desktopCfg.gnome; + isEnabled = desktopCfg.enableGnome; applyGnomeUserSettings = { home.packages = with pkgs; [ @@ -19,7 +19,9 @@ }; }; in { - config = lib.mkIf cfg.enable { + options.my.desktop.enableGnome = lib.mkEnableOption "gnome desktop"; + + config = lib.mkIf isEnabled { my.desktop.enable = true; services = { diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix index caa0ab35..ed07670a 100644 --- a/modules/desktop/kde.nix +++ b/modules/desktop/kde.nix @@ -5,7 +5,7 @@ ... }: let desktopCfg = config.my.desktop; - cfg = desktopCfg.kde; + isEnabled = desktopCfg.enableKde; applyKdeUserSettings = { home = { @@ -18,7 +18,9 @@ }; }; in { - config = lib.mkIf cfg.enable { + options.my.desktop.enableKde = lib.mkEnableOption "KDE desktop"; + + config = lib.mkIf isEnabled { my.desktop.enable = true; # flatpak xdg-portal-kde crashes, otherwise this would be global diff --git a/modules/desktop/ronja.nix b/modules/desktop/ronja.nix index ef5e71ca..151b0133 100644 --- a/modules/desktop/ronja.nix +++ b/modules/desktop/ronja.nix @@ -7,6 +7,8 @@ with lib; let cfg = config.my.desktop.ronja; in { + options.my.desktop.ronja.enable = lib.mkEnableOption "user ronja"; + config = lib.mkIf cfg.enable { # Define user account users.users.ronja = { diff --git a/modules/desktop/vinzenz.nix b/modules/desktop/vinzenz.nix index 2a19d6f6..8a6dccf7 100644 --- a/modules/desktop/vinzenz.nix +++ b/modules/desktop/vinzenz.nix @@ -6,6 +6,8 @@ }: let cfg = config.my.desktop.vinzenz; in { + options.my.desktop.vinzenz.enable = lib.mkEnableOption "user vinzenz"; + config = lib.mkIf cfg.enable { # Define user account users.users.vinzenz = { diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix new file mode 100644 index 00000000..dd60577d --- /dev/null +++ b/modules/globalinstalls.nix @@ -0,0 +1,10 @@ +{pkgs, ...}: { + config = { + environment.systemPackages = with pkgs; [ + pciutils + ncdu + htop + tldr + ]; + }; +} diff --git a/modules/hardware/amdcpu.nix b/modules/hardware/amdcpu.nix new file mode 100644 index 00000000..6eedbb1a --- /dev/null +++ b/modules/hardware/amdcpu.nix @@ -0,0 +1,15 @@ +{ + lib, + config, + pkgs, + ... +}: let + isEnabled = config.my.hardware.isAmdCpu; +in { + options.my.hardware.isAmdCpu = lib.mkEnableOption "amd cpu"; + + config = lib.mkIf isEnabled { + boot.kernelModules = ["kvm-amd"]; + hardware.cpu.amd.updateMicrocode = true; + }; +} diff --git a/modules/hardware/amdgpu.nix b/modules/hardware/amdgpu.nix new file mode 100644 index 00000000..5c847aec --- /dev/null +++ b/modules/hardware/amdgpu.nix @@ -0,0 +1,16 @@ +{ + lib, + config, + pkgs, + ... +}: let + isEnabled = config.my.hardware.isAmdGpu; +in { + options.my.hardware.isAmdGpu = lib.mkEnableOption "amd gpu"; + + config = lib.mkIf isEnabled { + environment.systemPackages = with pkgs; [ + radeontop + ]; + }; +} diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index 5e4911e2..a6dfabc9 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -9,6 +9,9 @@ in { (modulesPath + "/installer/scan/not-detected.nix") (builtins.toString ./. + "/${hostName}.nix") ./common-desktop.nix + ./amdcpu.nix + ./amdgpu.nix + ./intelcpu.nix ]; options.my.modulesCfg.hostName = lib.mkOption { diff --git a/modules/hardware/intelcpu.nix b/modules/hardware/intelcpu.nix new file mode 100644 index 00000000..e9d5ba82 --- /dev/null +++ b/modules/hardware/intelcpu.nix @@ -0,0 +1,14 @@ +{ + lib, + config, + ... +}: let + isEnabled = config.my.hardware.isIntelCpu; +in { + options.my.hardware.isIntelCpu = lib.mkEnableOption "intel cpu"; + + config = lib.mkIf isEnabled { + boot.kernelModules = ["kvm-intel"]; + hardware.cpu.intel.updateMicrocode = true; + }; +} diff --git a/modules/hardware/vinzenz-lpt.nix b/modules/hardware/vinzenz-lpt.nix index 152d8048..bec7a08e 100644 --- a/modules/hardware/vinzenz-lpt.nix +++ b/modules/hardware/vinzenz-lpt.nix @@ -1,12 +1,13 @@ {...}: { config = { - my.hardware.enableCommonDesktopSettings = true; + my.hardware = { + enableCommonDesktopSettings = true; + isIntelCpu = true; + isAmdGpu = true; + }; boot = { initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; - initrd.kernelModules = []; - kernelModules = ["kvm-intel"]; - extraModulePackages = []; loader.efi.efiSysMountPoint = "/boot/efi"; }; @@ -26,7 +27,5 @@ swapDevices = [ {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} ]; - - hardware.cpu.intel.updateMicrocode = true; }; } diff --git a/modules/hardware/vinzenz-pc2.nix b/modules/hardware/vinzenz-pc2.nix index ccd65c68..9fdaca72 100644 --- a/modules/hardware/vinzenz-pc2.nix +++ b/modules/hardware/vinzenz-pc2.nix @@ -1,12 +1,13 @@ {...}: { config = { - my.hardware.enableCommonDesktopSettings = true; + my.hardware = { + enableCommonDesktopSettings = true; + isAmdCpu = true; + isAmdGpu = true; + }; boot = { initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" - initrd.kernelModules = []; - kernelModules = ["kvm-amd"]; - extraModulePackages = []; loader.efi.efiSysMountPoint = "/boot"; }; @@ -49,7 +50,5 @@ }; swapDevices = []; - - hardware.cpu.amd.updateMicrocode = true; }; } diff --git a/modules/server.nix b/modules/server.nix index f5bf2f5e..46dffb43 100644 --- a/modules/server.nix +++ b/modules/server.nix @@ -38,12 +38,5 @@ in { } ]; }; - - environment = { - systemPackages = with pkgs; [ - ncdu - htop - ]; - }; }; } diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index f2e05860..a12faeeb 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -2,15 +2,16 @@ imports = [ (import ./modules { hostName = "vinzenz-lpt"; - enableDesktop = true; + enableHomeManager = true; }) ]; config = { my.desktop = { - gnome.enable = true; + enableGnome = true; + enableGaming = true; + vinzenz.enable = true; - gaming.enable = true; }; # flatpak xdg-portal-kde crashes, otherwise this would be global diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 1d6243bb..668b4b8a 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -2,20 +2,19 @@ imports = [ (import ./modules { hostName = "vinzenz-pc2"; - enableDesktop = true; + enableHomeManager = true; }) ]; config = { my.desktop = { - kde.enable = true; + enableKde = true; + enableGaming = true; + vinzenz.enable = true; ronja.enable = true; - gaming.enable = true; }; - environment.systemPackages = [pkgs.radeontop]; - users.groups."games" = { members = ["vinzenz" "ronja"]; }; From ddb7df4a4ef25c4254bbe0d89e198c7065a205eb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 12:39:28 +0200 Subject: [PATCH 0070/1295] restructure user management --- hetzner-vpn1.nix | 6 +- modules/default.nix | 3 +- modules/desktop/default.nix | 31 ++--- modules/desktop/gnome.nix | 101 +++++++-------- modules/desktop/kde.nix | 92 +++++++------- modules/desktop/ronja.nix | 109 ---------------- modules/desktop/vinzenz.nix | 223 --------------------------------- modules/globalinstalls.nix | 20 ++- modules/server.nix | 5 - modules/users/default.nix | 69 ++++++++++ modules/users/ronja-home.nix | 55 ++++++++ modules/users/ronja.nix | 25 ++++ modules/users/vinzenz-home.nix | 173 +++++++++++++++++++++++++ modules/users/vinzenz.nix | 24 ++++ vinzenz-lpt.nix | 11 +- vinzenz-pc2.nix | 16 +-- 16 files changed, 482 insertions(+), 481 deletions(-) delete mode 100644 modules/desktop/ronja.nix delete mode 100644 modules/desktop/vinzenz.nix create mode 100644 modules/users/default.nix create mode 100644 modules/users/ronja-home.nix create mode 100644 modules/users/ronja.nix create mode 100644 modules/users/vinzenz-home.nix create mode 100644 modules/users/vinzenz.nix diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 5aaf7ce1..da00bf02 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -7,8 +7,12 @@ ]; config = { - my.server.enable = true; + my = { + enabledUsers = ["vinzenz"]; + server.enable = true; + }; + # TODO change to user "vinzenz" when tested users.users.root.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' ]; diff --git a/modules/default.nix b/modules/default.nix index 0585543c..60755fac 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -5,10 +5,11 @@ modulesCfg: {lib, ...}: { ./nixpkgs.nix ./globalinstalls.nix ./server.nix + ./desktop ] ++ (map (path: (import path modulesCfg)) [ - ./desktop ./hardware + ./users ]); config = { diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 6d9ed44f..d8f88b51 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -1,25 +1,16 @@ -modulesCfg: { +{ config, pkgs, lib, ... }: let - enableHomeManager = modulesCfg.enableHomeManager; cfg = config.my.desktop; in { - imports = - [ - ./gnome.nix - ./kde.nix - ./vinzenz.nix - ./ronja.nix - ./gaming.nix - ] - ++ lib.optionals enableHomeManager [ - - ]; - - options.my.modulesCfg.enableHomeManager = lib.mkEnableOption "enable home manager"; + imports = [ + ./gnome.nix + ./kde.nix + ./gaming.nix + ]; options.my.desktop.enable = lib.mkEnableOption "desktop"; @@ -57,6 +48,7 @@ in { }; programs = { + git.package = pkgs.gitFull; steam = { enable = true; remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play @@ -96,15 +88,6 @@ in { ''; }; - programs = { - zsh.enable = true; - - git = { - enable = true; - package = pkgs.gitFull; - }; - }; - environment = { pathsToLink = ["/share/zsh"]; diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 4a399913..9e754f30 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -4,60 +4,63 @@ lib, ... }: let - desktopCfg = config.my.desktop; - isEnabled = desktopCfg.enableGnome; - - applyGnomeUserSettings = { - home.packages = with pkgs; [ - gnome.gpaste - amberol - ]; - dconf.settings = { - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; - }; - }; + isEnabled = config.my.desktop.enableGnome; + enableHomeManager = config.my.modulesCfg.enableHomeManager; in { options.my.desktop.enableGnome = lib.mkEnableOption "gnome desktop"; - config = lib.mkIf isEnabled { - my.desktop.enable = true; + config = lib.mkMerge [ + (lib.mkIf isEnabled { + my.desktop.enable = true; - services = { - xserver = { - # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; - desktopManager.gnome.enable = true; + services = { + xserver = { + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + }; + + gnome = { + tracker-miners.enable = false; + tracker.enable = false; + }; }; - gnome = { - tracker-miners.enable = false; - tracker.enable = false; + programs.gpaste.enable = true; + + environment = { + systemPackages = with pkgs; [ + gnomeExtensions.gsconnect + ]; + + # remove some gnome default apps + gnome.excludePackages = with pkgs.gnome; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + seahorse # password manager + gnome-clocks + gnome-maps + gnome-weather + gnome-music + pkgs.gnome-connections + ]; }; - }; - - environment.systemPackages = with pkgs; [ - gnomeExtensions.gsconnect - ]; - - # remove some gnome default apps - environment.gnome.excludePackages = with pkgs.gnome; [ - cheese # photo booth - epiphany # web browser - evince # document viewer - geary # email client - seahorse # password manager - gnome-clocks - gnome-maps - gnome-weather - gnome-music - pkgs.gnome-connections - ]; - - home-manager.users = { - vinzenz = lib.mkIf desktopCfg.vinzenz.enable applyGnomeUserSettings; - ronja = lib.mkIf desktopCfg.ronja.enable applyGnomeUserSettings; - }; - }; + }) + (lib.mkIf (isEnabled && enableHomeManager) { + home-manager.sharedModules = [ + { + home.packages = with pkgs; [ + amberol + ]; + dconf.settings = { + "org/gnome/desktop/peripherals/keyboard" = { + numlock-state = true; + }; + }; + } + ]; + }) + ]; } diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix index ed07670a..253ff296 100644 --- a/modules/desktop/kde.nix +++ b/modules/desktop/kde.nix @@ -4,62 +4,58 @@ lib, ... }: let - desktopCfg = config.my.desktop; - isEnabled = desktopCfg.enableKde; - - applyKdeUserSettings = { - home = { - packages = with pkgs; [ - ]; - }; - services.kdeconnect = { - enable = true; - indicator = true; - }; - }; + isEnabled = config.my.desktop.enableKde; + enableHomeManager = config.my.modulesCfg.enableHomeManager; in { options.my.desktop.enableKde = lib.mkEnableOption "KDE desktop"; - config = lib.mkIf isEnabled { - my.desktop.enable = true; + config = lib.mkMerge [ + (lib.mkIf isEnabled { + my.desktop.enable = true; - # flatpak xdg-portal-kde crashes, otherwise this would be global - services.flatpak.enable = false; + # flatpak xdg-portal-kde crashes, otherwise this would be global + services.flatpak.enable = false; - services = { - # Enable the KDE Plasma Desktop Environment. - xserver = { - desktopManager.plasma5.enable = true; + services = { + # Enable the KDE Plasma Desktop Environment. + xserver = { + desktopManager.plasma5.enable = true; - displayManager = { - sddm.enable = true; - defaultSession = "plasmawayland"; + displayManager = { + sddm.enable = true; + defaultSession = "plasmawayland"; + }; }; }; - }; - environment = { - systemPackages = with pkgs; [ - libsForQt5.kate - libsForQt5.kalk + environment = { + systemPackages = with pkgs; [ + libsForQt5.kate + libsForQt5.kalk + ]; + + plasma5.excludePackages = with pkgs.libsForQt5; [ + elisa + gwenview + okular + khelpcenter + ]; + }; + + programs = { + dconf.enable = true; + partition-manager.enable = true; + }; + }) + (lib.mkIf (isEnabled && enableHomeManager) { + home-manager.sharedModules = [ + { + services.kdeconnect = { + enable = true; + indicator = true; + }; + } ]; - - plasma5.excludePackages = with pkgs.libsForQt5; [ - elisa - gwenview - okular - khelpcenter - ]; - }; - - programs = { - dconf.enable = true; - partition-manager.enable = true; - }; - - home-manager.users = { - vinzenz = lib.mkIf desktopCfg.vinzenz.enable applyKdeUserSettings; - ronja = lib.mkIf desktopCfg.ronja.enable applyKdeUserSettings; - }; - }; + }) + ]; } diff --git a/modules/desktop/ronja.nix b/modules/desktop/ronja.nix deleted file mode 100644 index 151b0133..00000000 --- a/modules/desktop/ronja.nix +++ /dev/null @@ -1,109 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -with lib; let - cfg = config.my.desktop.ronja; -in { - options.my.desktop.ronja.enable = lib.mkEnableOption "user ronja"; - - config = lib.mkIf cfg.enable { - # Define user account - users.users.ronja = { - isNormalUser = true; - description = "Ronja Spiegelberg"; - extraGroups = ["networkmanager" "wheel"]; - shell = pkgs.zsh; - }; - - # home manager - home-manager.users.ronja = { - config, - pkgs, - ... - }: { - home = { - username = "ronja"; - homeDirectory = "/home/ronja"; - stateVersion = "22.11"; - - sessionVariables = { - EDITOR = "nano"; - }; - - packages = with pkgs; [ - ## Apps - telegram-desktop - kdiff3 - ]; - - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - - programs = { - home-manager.enable = true; - - firefox.enable = true; - command-not-found.enable = true; - dircolors.enable = true; - htop.enable = true; - - zsh = { - enable = true; - - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "systemadmin"]; - }; - }; - - git = { - enable = true; - userName = "Ronja Spiegelberg"; - userEmail = "ronja.spiegelberg@gmail.com"; - - extraConfig = { - pull.ff = "only"; - init.defaultBranch = "main"; - merge.tool = "kdiff3"; - }; - }; - - gh = { - enable = true; - enableGitCredentialHelper = true; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - }; - }; - }; -} diff --git a/modules/desktop/vinzenz.nix b/modules/desktop/vinzenz.nix deleted file mode 100644 index 8a6dccf7..00000000 --- a/modules/desktop/vinzenz.nix +++ /dev/null @@ -1,223 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - cfg = config.my.desktop.vinzenz; -in { - options.my.desktop.vinzenz.enable = lib.mkEnableOption "user vinzenz"; - - config = lib.mkIf cfg.enable { - # Define user account - users.users.vinzenz = { - isNormalUser = true; - description = "Vinzenz Schroeter"; - extraGroups = ["networkmanager" "wheel"]; - shell = pkgs.zsh; - }; - - # home manager - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - home = { - username = "vinzenz"; - homeDirectory = "/home/vinzenz"; - stateVersion = "22.11"; - - sessionVariables = { - EDITOR = "nano"; - }; - - packages = with pkgs; [ - keepassxc - insync - telegram-desktop - simple-scan - wireguard-tools - element-desktop - etcher - iotop - lsof - wirelesstools - thefuck - dotnet-sdk_7 - jetbrains.rider - alejandra - arduino - uucp - screen - jetbrains.pycharm-professional - kdiff3 - docker - youtube-music - ]; - - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - - programs = { - home-manager.enable = true; - - firefox.enable = true; - command-not-found.enable = true; - dircolors.enable = true; - fzf.enable = true; - htop.enable = true; - mangohud.enable = true; - - zsh = { - enable = true; - - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - - initExtra = '' - eval "$(direnv hook zsh)"; - eval $(thefuck --alias); - ''; - - shellAliases = { - my-apply = "sudo nixos-rebuild boot"; - my-switch = "sudo nixos-rebuild switch"; - my-update = "sudo nixos-rebuild boot --upgrade"; - my-fmt = "alejandra ."; - my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; - my-ip4 = "ip addr show | grep 192"; - }; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; - }; - }; - - git = { - enable = true; - userName = "Vinzenz Schroeter"; - userEmail = "vinzenz.f.s@gmail.com"; - - aliases = { - prettylog = "log --pretty=oneline --graph"; - }; - - extraConfig = { - pull.ff = "only"; - init.defaultBranch = "main"; - merge.tool = "kdiff3"; - push.autoSetupRemote = "true"; - }; - }; - - gh = { - enable = true; - enableGitCredentialHelper = true; - }; - - vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs; [ - vscode-extensions.bbenoist.nix - vscode-extensions.ms-python.python - vscode-extensions.kamadorueda.alejandra - ]; - userSettings = { - "git.autofetch" = true; - "update.mode" = "none"; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; - "workbench.startupEditor" = "readme"; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; - "workbench.enableExperiments" = false; - }; - }; - - direnv = { - enable = true; - nix-direnv.enable = true; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - - exa = { - enable = true; - git = true; - icons = true; - enableAliases = true; - extraOptions = [ - "--group-directories-first" - "--header" - ]; - }; - - micro = { - enable = true; - settings = { - colorcolumn = 120; - hlsearch = true; - savecursor = true; - saveundo = true; - scrollbar = true; - smartpaste = true; - }; - }; - - # checked https://rycee.gitlab.io/home-manager/options.html until "programs.notmuch" - }; - - editorconfig = { - enable = true; - settings = { - "*" = { - charset = "utf-8"; - end_of_line = "lf"; - trim_trailing_whitespace = true; - insert_final_newline = true; - max_line_width = 120; - indent_style = "space"; - indent_size = 4; - }; - "*.nix" = { - indent_size = 2; - }; - }; - }; - }; - }; -} diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix index dd60577d..412a50a5 100644 --- a/modules/globalinstalls.nix +++ b/modules/globalinstalls.nix @@ -1,10 +1,18 @@ {pkgs, ...}: { config = { - environment.systemPackages = with pkgs; [ - pciutils - ncdu - htop - tldr - ]; + environment = { + pathsToLink = ["/share/zsh"]; + systemPackages = with pkgs; [ + pciutils + ncdu + tldr + ]; + }; + + programs = { + git.enable = true; + zsh.enable = true; + htop.enable = true; + }; }; } diff --git a/modules/server.nix b/modules/server.nix index 46dffb43..a79adad8 100644 --- a/modules/server.nix +++ b/modules/server.nix @@ -23,11 +23,6 @@ in { }; }; - programs = { - git.enable = true; - zsh.enable = true; - }; - networking.firewall = { enable = true; allowedTCPPortRanges = [ diff --git a/modules/users/default.nix b/modules/users/default.nix new file mode 100644 index 00000000..6e336070 --- /dev/null +++ b/modules/users/default.nix @@ -0,0 +1,69 @@ +modulesCfg: { + config, + pkgs, + lib, + ... +}: let + enableHomeManager = modulesCfg.enableHomeManager; +in { + options.my = { + modulesCfg.enableHomeManager = lib.mkEnableOption "enable home manager"; + enabledUsers = lib.mkOption { + type = lib.types.listOf lib.types.str; + }; + }; + + imports = + [ + ./vinzenz.nix + ./ronja.nix + ] + ++ lib.optionals enableHomeManager [ + + ]; + + config = lib.mkIf enableHomeManager { + home-manager.sharedModules = [ + # set stateVersion + {home.stateVersion = "22.11";} + # make nano the default editor + { + home = { + sessionVariables.EDITOR = "nano"; + file.".nanorc".text = lib.mkDefault '' + set linenumbers + set mouse + ''; + }; + } + # command line niceness + { + programs = { + command-not-found.enable = true; + dircolors.enable = true; + + zsh = { + enable = true; + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + }; + }; + } + # common git config + { + programs = { + git = { + enable = true; + extraConfig.init.defaultBranch = "main"; + }; + + gh = { + enable = true; + enableGitCredentialHelper = true; + }; + }; + } + ]; + }; +} diff --git a/modules/users/ronja-home.nix b/modules/users/ronja-home.nix new file mode 100644 index 00000000..3e1982dc --- /dev/null +++ b/modules/users/ronja-home.nix @@ -0,0 +1,55 @@ +{ + config, + pkgs, + ... +}: { + home .packages = with pkgs; [ + ## Apps + telegram-desktop + kdiff3 + ]; + + programs = { + home-manager.enable = true; + + firefox.enable = true; + + zsh = { + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "systemadmin"]; + }; + }; + + git = { + userName = "Ronja Spiegelberg"; + userEmail = "ronja.spiegelberg@gmail.com"; + + extraConfig = { + pull.ff = "only"; + merge.tool = "kdiff3"; + }; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + }; +} diff --git a/modules/users/ronja.nix b/modules/users/ronja.nix new file mode 100644 index 00000000..8ca83118 --- /dev/null +++ b/modules/users/ronja.nix @@ -0,0 +1,25 @@ +{ + config, + pkgs, + lib, + ... +}: let + isUserEnabled = builtins.elem "ronja" config.my.enabledUsers; +in { + config = lib.mkMerge [ + (lib.mkIf isUserEnabled { + # Define user account + users.users.ronja = { + isNormalUser = true; + name = "ronja"; + description = "Ronja Spiegelberg"; + home = "/home/ronja"; + extraGroups = ["networkmanager" "wheel" "games"]; + shell = pkgs.zsh; + }; + }) + (lib.mkIf (isUserEnabled && config.my.modulesCfg.enableHomeManager) { + home-manager.users.ronja = import ./ronja-home.nix; + }) + ]; +} diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix new file mode 100644 index 00000000..351fcd80 --- /dev/null +++ b/modules/users/vinzenz-home.nix @@ -0,0 +1,173 @@ +{ + config, + pkgs, + ... +}: { + home.packages = with pkgs; [ + keepassxc + insync + telegram-desktop + simple-scan + wireguard-tools + element-desktop + etcher + iotop + lsof + wirelesstools + thefuck + dotnet-sdk_7 + jetbrains.rider + alejandra + arduino + uucp + screen + jetbrains.pycharm-professional + kdiff3 + docker + youtube-music + ]; + + programs = { + home-manager.enable = true; + + firefox.enable = true; + fzf.enable = true; + mangohud.enable = true; + + zsh = { + initExtra = '' + eval "$(direnv hook zsh)"; + eval $(thefuck --alias); + ''; + + shellAliases = { + my-apply = "sudo nixos-rebuild boot"; + my-switch = "sudo nixos-rebuild switch"; + my-update = "sudo nixos-rebuild boot --upgrade"; + my-fmt = "alejandra ."; + my-test = "sudo nixos-rebuild test"; + my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; + my-ip4 = "ip addr show | grep 192"; + }; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; + }; + }; + + git = { + enable = true; + userName = "Vinzenz Schroeter"; + userEmail = "vinzenz.f.s@gmail.com"; + + aliases = { + prettylog = "log --pretty=oneline --graph"; + }; + + extraConfig = { + pull.ff = "only"; + init.defaultBranch = "main"; + merge.tool = "kdiff3"; + push.autoSetupRemote = "true"; + }; + }; + + vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs; [ + vscode-extensions.bbenoist.nix + vscode-extensions.ms-python.python + vscode-extensions.kamadorueda.alejandra + ]; + userSettings = { + "git.autofetch" = true; + "update.mode" = "none"; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "workbench.startupEditor" = "readme"; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; + "workbench.enableExperiments" = false; + }; + }; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + + exa = { + enable = true; + git = true; + icons = true; + enableAliases = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + }; + + micro = { + enable = true; + settings = { + colorcolumn = 120; + hlsearch = true; + savecursor = true; + saveundo = true; + scrollbar = true; + smartpaste = true; + }; + }; + + # checked https://rycee.gitlab.io/home-manager/options.html until "programs.notmuch" + }; + + editorconfig = { + enable = true; + settings = { + "*" = { + charset = "utf-8"; + end_of_line = "lf"; + trim_trailing_whitespace = true; + insert_final_newline = true; + max_line_width = 120; + indent_style = "space"; + indent_size = 4; + }; + "*.nix" = { + indent_size = 2; + }; + }; + }; +} diff --git a/modules/users/vinzenz.nix b/modules/users/vinzenz.nix new file mode 100644 index 00000000..58cff2df --- /dev/null +++ b/modules/users/vinzenz.nix @@ -0,0 +1,24 @@ +{ + config, + pkgs, + lib, + ... +}: let + isUserEnabled = builtins.elem "vinzenz" config.my.enabledUsers; +in { + config = lib.mkMerge [ + (lib.mkIf isUserEnabled { + users.users.vinzenz = { + isNormalUser = true; + name = "vinzenz"; + description = "Vinzenz Schroeter"; + home = "/home/vinzenz"; + extraGroups = ["networkmanager" "wheel" "games"]; + shell = pkgs.zsh; + }; + }) + (lib.mkIf (isUserEnabled && config.my.modulesCfg.enableHomeManager) { + home-manager.users.vinzenz = import ./vinzenz-home.nix; + }) + ]; +} diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index a12faeeb..e184e77a 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -7,11 +7,12 @@ ]; config = { - my.desktop = { - enableGnome = true; - enableGaming = true; - - vinzenz.enable = true; + my = { + enabledUsers = ["vinzenz"]; + desktop = { + enableGnome = true; + enableGaming = true; + }; }; # flatpak xdg-portal-kde crashes, otherwise this would be global diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 668b4b8a..a67ce961 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -7,16 +7,12 @@ ]; config = { - my.desktop = { - enableKde = true; - enableGaming = true; - - vinzenz.enable = true; - ronja.enable = true; - }; - - users.groups."games" = { - members = ["vinzenz" "ronja"]; + my = { + enabledUsers = ["vinzenz" "ronja"]; + desktop = { + enableKde = true; + enableGaming = true; + }; }; users.users.vinzenz.openssh.authorizedKeys.keys = [ From 9b60bc19886fac43ab8e25334c2b7a2533c72efb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 13:04:45 +0200 Subject: [PATCH 0071/1295] move config to better places --- modules/desktop/default.nix | 14 +----- modules/desktop/gaming.nix | 9 +++- modules/users/default.nix | 80 ++++++++++++++++++---------------- modules/users/vinzenz-home.nix | 1 + 4 files changed, 53 insertions(+), 51 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index d8f88b51..a7bbc6f2 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -4,7 +4,7 @@ lib, ... }: let - cfg = config.my.desktop; + isEnabled = config.my.desktop.enable; in { imports = [ ./gnome.nix @@ -14,10 +14,7 @@ in { options.my.desktop.enable = lib.mkEnableOption "desktop"; - config = lib.mkIf cfg.enable { - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - + config = lib.mkIf isEnabled { services = { # Enable the X11 windowing system / wayland depending on DE xserver.enable = true; @@ -49,11 +46,6 @@ in { programs = { git.package = pkgs.gitFull; - steam = { - enable = true; - remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server - }; }; # unblock kde connect / gsconnect @@ -89,8 +81,6 @@ in { }; environment = { - pathsToLink = ["/share/zsh"]; - systemPackages = with pkgs; [ lm_sensors ]; diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index 8b9cd348..f179765f 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -17,7 +17,6 @@ in { wineWowPackages.stagingFull wineWowPackages.fonts winetricks - steam (lutris.override { extraPkgs = pkgs: [ @@ -28,5 +27,13 @@ in { ]; }) ]; + + programs = { + steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; + }; }; } diff --git a/modules/users/default.nix b/modules/users/default.nix index 6e336070..bc0f0c0f 100644 --- a/modules/users/default.nix +++ b/modules/users/default.nix @@ -23,47 +23,51 @@ in { ]; config = lib.mkIf enableHomeManager { - home-manager.sharedModules = [ - # set stateVersion - {home.stateVersion = "22.11";} - # make nano the default editor - { - home = { - sessionVariables.EDITOR = "nano"; - file.".nanorc".text = lib.mkDefault '' - set linenumbers - set mouse - ''; - }; - } - # command line niceness - { - programs = { - command-not-found.enable = true; - dircolors.enable = true; + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + sharedModules = [ + # set stateVersion + {home.stateVersion = "22.11";} + # make nano the default editor + { + home = { + sessionVariables.EDITOR = "nano"; + file.".nanorc".text = lib.mkDefault '' + set linenumbers + set mouse + ''; + }; + } + # command line niceness + { + programs = { + command-not-found.enable = true; + dircolors.enable = true; - zsh = { - enable = true; - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - }; - }; - } - # common git config - { - programs = { - git = { - enable = true; - extraConfig.init.defaultBranch = "main"; + zsh = { + enable = true; + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + }; }; + } + # common git config + { + programs = { + git = { + enable = true; + extraConfig.init.defaultBranch = "main"; + }; - gh = { - enable = true; - enableGitCredentialHelper = true; + gh = { + enable = true; + enableGitCredentialHelper = true; + }; }; - }; - } - ]; + } + ]; + }; }; } diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 351fcd80..0477049d 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -70,6 +70,7 @@ aliases = { prettylog = "log --pretty=oneline --graph"; + spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; }; extraConfig = { From 44bbfc2fa0d3b13e37f34a8b7baab0fbe8f12e50 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 13:12:09 +0200 Subject: [PATCH 0072/1295] better split of home manager specific stuff --- modules/users/default.nix | 51 +------------------------- modules/users/home-manager.nix | 65 ++++++++++++++++++++++++++++++++++ modules/users/ronja.nix | 27 ++++++-------- modules/users/vinzenz.nix | 25 ++++++------- 4 files changed, 87 insertions(+), 81 deletions(-) create mode 100644 modules/users/home-manager.nix diff --git a/modules/users/default.nix b/modules/users/default.nix index bc0f0c0f..1d84a1d0 100644 --- a/modules/users/default.nix +++ b/modules/users/default.nix @@ -19,55 +19,6 @@ in { ./ronja.nix ] ++ lib.optionals enableHomeManager [ - + ./home-manager.nix ]; - - config = lib.mkIf enableHomeManager { - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - sharedModules = [ - # set stateVersion - {home.stateVersion = "22.11";} - # make nano the default editor - { - home = { - sessionVariables.EDITOR = "nano"; - file.".nanorc".text = lib.mkDefault '' - set linenumbers - set mouse - ''; - }; - } - # command line niceness - { - programs = { - command-not-found.enable = true; - dircolors.enable = true; - - zsh = { - enable = true; - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - }; - }; - } - # common git config - { - programs = { - git = { - enable = true; - extraConfig.init.defaultBranch = "main"; - }; - - gh = { - enable = true; - enableGitCredentialHelper = true; - }; - }; - } - ]; - }; - }; } diff --git a/modules/users/home-manager.nix b/modules/users/home-manager.nix new file mode 100644 index 00000000..3166eb1c --- /dev/null +++ b/modules/users/home-manager.nix @@ -0,0 +1,65 @@ +{ + config, + pkgs, + lib, + ... +}: { + imports = [ + + ]; + + config = { + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + + users = { + ronja = lib.mkIf (builtins.elem "ronja" config.my.enabledUsers) (import ./ronja-home.nix); + vinzenz = lib.mkIf (builtins.elem "ronja" config.my.enabledUsers) (import ./vinzenz-home.nix); + }; + + sharedModules = [ + # set stateVersion + {home.stateVersion = "22.11";} + # make nano the default editor + { + home = { + sessionVariables.EDITOR = "nano"; + file.".nanorc".text = lib.mkDefault '' + set linenumbers + set mouse + ''; + }; + } + # command line niceness + { + programs = { + command-not-found.enable = true; + dircolors.enable = true; + + zsh = { + enable = true; + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + }; + }; + } + # common git config + { + programs = { + git = { + enable = true; + extraConfig.init.defaultBranch = "main"; + }; + + gh = { + enable = true; + enableGitCredentialHelper = true; + }; + }; + } + ]; + }; + }; +} diff --git a/modules/users/ronja.nix b/modules/users/ronja.nix index 8ca83118..79177922 100644 --- a/modules/users/ronja.nix +++ b/modules/users/ronja.nix @@ -6,20 +6,15 @@ }: let isUserEnabled = builtins.elem "ronja" config.my.enabledUsers; in { - config = lib.mkMerge [ - (lib.mkIf isUserEnabled { - # Define user account - users.users.ronja = { - isNormalUser = true; - name = "ronja"; - description = "Ronja Spiegelberg"; - home = "/home/ronja"; - extraGroups = ["networkmanager" "wheel" "games"]; - shell = pkgs.zsh; - }; - }) - (lib.mkIf (isUserEnabled && config.my.modulesCfg.enableHomeManager) { - home-manager.users.ronja = import ./ronja-home.nix; - }) - ]; + config = lib.mkIf isUserEnabled { + # Define user account + users.users.ronja = { + isNormalUser = true; + name = "ronja"; + description = "Ronja Spiegelberg"; + home = "/home/ronja"; + extraGroups = ["networkmanager" "wheel" "games"]; + shell = pkgs.zsh; + }; + }; } diff --git a/modules/users/vinzenz.nix b/modules/users/vinzenz.nix index 58cff2df..ac270a63 100644 --- a/modules/users/vinzenz.nix +++ b/modules/users/vinzenz.nix @@ -6,19 +6,14 @@ }: let isUserEnabled = builtins.elem "vinzenz" config.my.enabledUsers; in { - config = lib.mkMerge [ - (lib.mkIf isUserEnabled { - users.users.vinzenz = { - isNormalUser = true; - name = "vinzenz"; - description = "Vinzenz Schroeter"; - home = "/home/vinzenz"; - extraGroups = ["networkmanager" "wheel" "games"]; - shell = pkgs.zsh; - }; - }) - (lib.mkIf (isUserEnabled && config.my.modulesCfg.enableHomeManager) { - home-manager.users.vinzenz = import ./vinzenz-home.nix; - }) - ]; + config = lib.mkIf isUserEnabled { + users.users.vinzenz = { + isNormalUser = true; + name = "vinzenz"; + description = "Vinzenz Schroeter"; + home = "/home/vinzenz"; + extraGroups = ["networkmanager" "wheel" "games"]; + shell = pkgs.zsh; + }; + }; } From adb51fd36ebece2a0a9a85acca3c2c565785a0fc Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 13:20:34 +0200 Subject: [PATCH 0073/1295] better split also for desktop envs --- modules/default.nix | 2 +- modules/desktop/default.nix | 18 +++++--- modules/desktop/gnome-home.nix | 23 ++++++++++ modules/desktop/gnome.nix | 83 ++++++++++++++-------------------- modules/desktop/kde-home.nix | 18 ++++++++ modules/desktop/kde.nix | 73 ++++++++++++------------------ 6 files changed, 117 insertions(+), 100 deletions(-) create mode 100644 modules/desktop/gnome-home.nix create mode 100644 modules/desktop/kde-home.nix diff --git a/modules/default.nix b/modules/default.nix index 60755fac..9ae0dec7 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -5,11 +5,11 @@ modulesCfg: {lib, ...}: { ./nixpkgs.nix ./globalinstalls.nix ./server.nix - ./desktop ] ++ (map (path: (import path modulesCfg)) [ ./hardware ./users + ./desktop ]); config = { diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index a7bbc6f2..cb56ba0c 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -1,16 +1,22 @@ -{ +modulesCfg: { config, pkgs, lib, ... }: let isEnabled = config.my.desktop.enable; + isHomeManager = modulesCfg.enableHomeManager; in { - imports = [ - ./gnome.nix - ./kde.nix - ./gaming.nix - ]; + imports = + [ + ./gnome.nix + ./kde.nix + ./gaming.nix + ] + ++ lib.optionals isHomeManager [ + ./gnome-home.nix + ./kde-home.nix + ]; options.my.desktop.enable = lib.mkEnableOption "desktop"; diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix new file mode 100644 index 00000000..ee3870bd --- /dev/null +++ b/modules/desktop/gnome-home.nix @@ -0,0 +1,23 @@ +{ + lib, + config, + pkgs, + ... +}: let + isEnabled = config.my.desktop.enableGnome; +in { + config = lib.mkIf isEnabled { + home-manager.sharedModules = [ + { + home.packages = with pkgs; [ + amberol + ]; + dconf.settings = { + "org/gnome/desktop/peripherals/keyboard" = { + numlock-state = true; + }; + }; + } + ]; + }; +} diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 9e754f30..6fef40df 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -5,62 +5,45 @@ ... }: let isEnabled = config.my.desktop.enableGnome; - enableHomeManager = config.my.modulesCfg.enableHomeManager; in { options.my.desktop.enableGnome = lib.mkEnableOption "gnome desktop"; - config = lib.mkMerge [ - (lib.mkIf isEnabled { - my.desktop.enable = true; + config = lib.mkIf isEnabled { + my.desktop.enable = true; - services = { - xserver = { - # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; - desktopManager.gnome.enable = true; - }; - - gnome = { - tracker-miners.enable = false; - tracker.enable = false; - }; + services = { + xserver = { + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; }; - programs.gpaste.enable = true; - - environment = { - systemPackages = with pkgs; [ - gnomeExtensions.gsconnect - ]; - - # remove some gnome default apps - gnome.excludePackages = with pkgs.gnome; [ - cheese # photo booth - epiphany # web browser - evince # document viewer - geary # email client - seahorse # password manager - gnome-clocks - gnome-maps - gnome-weather - gnome-music - pkgs.gnome-connections - ]; + gnome = { + tracker-miners.enable = false; + tracker.enable = false; }; - }) - (lib.mkIf (isEnabled && enableHomeManager) { - home-manager.sharedModules = [ - { - home.packages = with pkgs; [ - amberol - ]; - dconf.settings = { - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; - }; - } + }; + + programs.gpaste.enable = true; + + environment = { + systemPackages = with pkgs; [ + gnomeExtensions.gsconnect ]; - }) - ]; + + # remove some gnome default apps + gnome.excludePackages = with pkgs.gnome; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + seahorse # password manager + gnome-clocks + gnome-maps + gnome-weather + gnome-music + pkgs.gnome-connections + ]; + }; + }; } diff --git a/modules/desktop/kde-home.nix b/modules/desktop/kde-home.nix new file mode 100644 index 00000000..2ece5e07 --- /dev/null +++ b/modules/desktop/kde-home.nix @@ -0,0 +1,18 @@ +{ + lib, + config, + ... +}: let + isEnabled = config.my.desktop.enableKde; +in { + config = lib.mkIf isEnabled { + home-manager.sharedModules = [ + { + services.kdeconnect = { + enable = true; + indicator = true; + }; + } + ]; + }; +} diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix index 253ff296..45c31ee2 100644 --- a/modules/desktop/kde.nix +++ b/modules/desktop/kde.nix @@ -5,57 +5,44 @@ ... }: let isEnabled = config.my.desktop.enableKde; - enableHomeManager = config.my.modulesCfg.enableHomeManager; in { options.my.desktop.enableKde = lib.mkEnableOption "KDE desktop"; - config = lib.mkMerge [ - (lib.mkIf isEnabled { - my.desktop.enable = true; + config = lib.mkIf isEnabled { + my.desktop.enable = true; - # flatpak xdg-portal-kde crashes, otherwise this would be global - services.flatpak.enable = false; + # flatpak xdg-portal-kde crashes, otherwise this would be global + services.flatpak.enable = false; - services = { - # Enable the KDE Plasma Desktop Environment. - xserver = { - desktopManager.plasma5.enable = true; + services = { + # Enable the KDE Plasma Desktop Environment. + xserver = { + desktopManager.plasma5.enable = true; - displayManager = { - sddm.enable = true; - defaultSession = "plasmawayland"; - }; + displayManager = { + sddm.enable = true; + defaultSession = "plasmawayland"; }; }; + }; - environment = { - systemPackages = with pkgs; [ - libsForQt5.kate - libsForQt5.kalk - ]; - - plasma5.excludePackages = with pkgs.libsForQt5; [ - elisa - gwenview - okular - khelpcenter - ]; - }; - - programs = { - dconf.enable = true; - partition-manager.enable = true; - }; - }) - (lib.mkIf (isEnabled && enableHomeManager) { - home-manager.sharedModules = [ - { - services.kdeconnect = { - enable = true; - indicator = true; - }; - } + environment = { + systemPackages = with pkgs; [ + libsForQt5.kate + libsForQt5.kalk ]; - }) - ]; + + plasma5.excludePackages = with pkgs.libsForQt5; [ + elisa + gwenview + okular + khelpcenter + ]; + }; + + programs = { + dconf.enable = true; + partition-manager.enable = true; + }; + }; } From db31ee7ba1fd4334d5630d2e94bac1df7fd5d902 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 13:48:16 +0200 Subject: [PATCH 0074/1295] sync manually installed extensions into config --- modules/users/vinzenz-home.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 0477049d..5f39c5bd 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -85,10 +85,15 @@ enable = true; package = pkgs.vscodium; enableUpdateCheck = false; - extensions = with pkgs; [ - vscode-extensions.bbenoist.nix - vscode-extensions.ms-python.python - vscode-extensions.kamadorueda.alejandra + extensions = with pkgs.vscode-extensions; [ + bbenoist.nix + ms-python.python + kamadorueda.alejandra + samuelcolvin.jinjahtml + EditorConfig.EditorConfig + KnisterPeter.vscode-github + yzhang.markdown-all-in-one + redhat.vscode-yaml ]; userSettings = { "git.autofetch" = true; From 821d057aca4be8181b3cacc60a271274aad7e1d5 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 14:25:24 +0200 Subject: [PATCH 0075/1295] fix user without home-manager -_- --- modules/users/home-manager.nix | 2 +- modules/users/vinzenz-home.nix | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/users/home-manager.nix b/modules/users/home-manager.nix index 3166eb1c..4601b8dd 100644 --- a/modules/users/home-manager.nix +++ b/modules/users/home-manager.nix @@ -15,7 +15,7 @@ users = { ronja = lib.mkIf (builtins.elem "ronja" config.my.enabledUsers) (import ./ronja-home.nix); - vinzenz = lib.mkIf (builtins.elem "ronja" config.my.enabledUsers) (import ./vinzenz-home.nix); + vinzenz = lib.mkIf (builtins.elem "vinzenz" config.my.enabledUsers) (import ./vinzenz-home.nix); }; sharedModules = [ diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 5f39c5bd..477b649c 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -89,11 +89,13 @@ bbenoist.nix ms-python.python kamadorueda.alejandra - samuelcolvin.jinjahtml - EditorConfig.EditorConfig - KnisterPeter.vscode-github + #samuelcolvin.jinjahtml + #EditorConfig.EditorConfig + #KnisterPeter.vscode-github yzhang.markdown-all-in-one redhat.vscode-yaml + #PKief.material-icon-theme + mhutchie.git-graph ]; userSettings = { "git.autofetch" = true; @@ -105,12 +107,13 @@ "editor.minimap.autohide" = true; "diffEditor.diffAlgorithm" = "advanced"; "explorer.excludeGitIgnore" = true; - "workbench.startupEditor" = "readme"; "markdown.extension.tableFormatter.normalizeIndentation" = true; "markdown.extension.toc.orderedList" = false; "telemetry.telemetryLevel" = "off"; "redhat.telemetry.enabled" = false; + "workbench.startupEditor" = "readme"; "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; }; }; From 37f5f73a761cdf9e3d94ecb67c7df0f5d0c6811b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 14:56:07 +0200 Subject: [PATCH 0076/1295] sshd module, home-shared-modules --- modules/default.nix | 1 + modules/desktop/default.nix | 10 ------ modules/server.nix | 22 +++---------- modules/sshd.nix | 13 ++++++++ modules/users/home-manager.nix | 46 ++------------------------- modules/users/home-shared-modules.nix | 44 +++++++++++++++++++++++++ modules/users/vinzenz-home.nix | 1 - 7 files changed, 66 insertions(+), 71 deletions(-) create mode 100644 modules/sshd.nix create mode 100644 modules/users/home-shared-modules.nix diff --git a/modules/default.nix b/modules/default.nix index 9ae0dec7..841095eb 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -5,6 +5,7 @@ modulesCfg: {lib, ...}: { ./nixpkgs.nix ./globalinstalls.nix ./server.nix + ./sshd.nix ] ++ (map (path: (import path modulesCfg)) [ ./hardware diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index cb56ba0c..66ede1e3 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -27,16 +27,6 @@ in { # Enable CUPS to print documents. printing.enable = true; - - # Enable the OpenSSH daemon. - openssh = { - enable = true; - settings = { - PermitRootLogin = "no"; - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - }; - }; }; # Enable sound with pipewire. diff --git a/modules/server.nix b/modules/server.nix index a79adad8..a3db9273 100644 --- a/modules/server.nix +++ b/modules/server.nix @@ -11,26 +11,14 @@ in { }; config = lib.mkIf cfg.enable { - services = { - # Enable the OpenSSH daemon. - openssh = { - enable = true; - settings = { - # PermitRootLogin = "no"; # this is managed through authorized keys - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - }; - }; - }; - networking.firewall = { enable = true; allowedTCPPortRanges = [ - { - # ssh - from = 22; - to = 22; - } + # { + # # ssh + # from = 22; + # to = 22; + # } ]; }; }; diff --git a/modules/sshd.nix b/modules/sshd.nix new file mode 100644 index 00000000..747eeaca --- /dev/null +++ b/modules/sshd.nix @@ -0,0 +1,13 @@ +{...}: { + config = { + services.openssh = { + enable = true; + openFirewall = true; + settings = { + PermitRootLogin = "without-password"; + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; + }; + }; +} diff --git a/modules/users/home-manager.nix b/modules/users/home-manager.nix index 4601b8dd..73adcc6d 100644 --- a/modules/users/home-manager.nix +++ b/modules/users/home-manager.nix @@ -13,53 +13,13 @@ useUserPackages = true; useGlobalPkgs = true; + # defaults for users + sharedModules = import ./home-shared-modules.nix; + users = { ronja = lib.mkIf (builtins.elem "ronja" config.my.enabledUsers) (import ./ronja-home.nix); vinzenz = lib.mkIf (builtins.elem "vinzenz" config.my.enabledUsers) (import ./vinzenz-home.nix); }; - - sharedModules = [ - # set stateVersion - {home.stateVersion = "22.11";} - # make nano the default editor - { - home = { - sessionVariables.EDITOR = "nano"; - file.".nanorc".text = lib.mkDefault '' - set linenumbers - set mouse - ''; - }; - } - # command line niceness - { - programs = { - command-not-found.enable = true; - dircolors.enable = true; - - zsh = { - enable = true; - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - }; - }; - } - # common git config - { - programs = { - git = { - enable = true; - extraConfig.init.defaultBranch = "main"; - }; - - gh = { - enable = true; - enableGitCredentialHelper = true; - }; - }; - } - ]; }; }; } diff --git a/modules/users/home-shared-modules.nix b/modules/users/home-shared-modules.nix new file mode 100644 index 00000000..b2bd91a4 --- /dev/null +++ b/modules/users/home-shared-modules.nix @@ -0,0 +1,44 @@ +[ + # set stateVersion + { + home.stateVersion = "22.11"; + } + # make nano the default editor + { + home = { + sessionVariables.EDITOR = "nano"; + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + } + # command line niceness + { + programs = { + command-not-found.enable = true; + dircolors.enable = true; + + zsh = { + enable = true; + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + }; + }; + } + # common git config + { + programs = { + git = { + enable = true; + extraConfig.init.defaultBranch = "main"; + }; + + gh = { + enable = true; + enableGitCredentialHelper = true; + }; + }; + } +] diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 477b649c..3ee1b642 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -75,7 +75,6 @@ extraConfig = { pull.ff = "only"; - init.defaultBranch = "main"; merge.tool = "kdiff3"; push.autoSetupRemote = "true"; }; From 436c91561630c3feed572fb1c3758a5070b8b09a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 14:57:20 +0200 Subject: [PATCH 0077/1295] remove user from server --- hetzner-vpn1.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index da00bf02..5aaf7ce1 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -7,12 +7,8 @@ ]; config = { - my = { - enabledUsers = ["vinzenz"]; - server.enable = true; - }; + my.server.enable = true; - # TODO change to user "vinzenz" when tested users.users.root.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' ]; From 04c82ccd9975d34d05df43b50b3dbc7132d66a96 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 14:59:21 +0200 Subject: [PATCH 0078/1295] fix vpn1 not building --- hetzner-vpn1.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 5aaf7ce1..9e42020e 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -7,7 +7,10 @@ ]; config = { - my.server.enable = true; + my = { + enabledUsers = []; + server.enable = true; + }; users.users.root.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' From 82ae5a89fc6be7e36005f24b4a7018dc5420277a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 23 Sep 2023 11:53:52 +0200 Subject: [PATCH 0079/1295] explicitly install dxvk --- modules/desktop/gaming.nix | 16 +++++++++++----- modules/hardware/amdgpu.nix | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index f179765f..2c9b6ab2 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -6,17 +6,22 @@ }: let isEnabled = config.my.desktop.enableGaming; in { - imports = []; - options.my.desktop.enableGaming = lib.mkEnableOption "gaming with wine"; config = lib.mkIf isEnabled { - hardware.opengl.driSupport32Bit = true; + hardware.opengl = { + driSupport32Bit = true; + extraPackages = with pkgs; [mangohud]; + extraPackages32 = with pkgs; [mangohud]; + }; environment.systemPackages = with pkgs; [ wineWowPackages.stagingFull wineWowPackages.fonts winetricks + dxvk + mangohud + vulkan-tools (lutris.override { extraPkgs = pkgs: [ @@ -29,10 +34,11 @@ in { ]; programs = { + xwayland.enable = true; steam = { enable = true; - remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; }; }; }; diff --git a/modules/hardware/amdgpu.nix b/modules/hardware/amdgpu.nix index 5c847aec..2e4486bd 100644 --- a/modules/hardware/amdgpu.nix +++ b/modules/hardware/amdgpu.nix @@ -11,6 +11,7 @@ in { config = lib.mkIf isEnabled { environment.systemPackages = with pkgs; [ radeontop + amdvlk ]; }; } From 996ed9e0268af5cfd641ee08f3d53be530079542 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Sep 2023 15:27:13 +0200 Subject: [PATCH 0080/1295] fixup kdeconnect, enable some more settings globally --- modules/desktop/default.nix | 2 +- modules/desktop/gnome.nix | 37 +++++++++++++++++-------------------- modules/desktop/kde.nix | 1 + modules/globalinstalls.nix | 7 ++++++- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 66ede1e3..7e5f08ac 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -41,7 +41,7 @@ in { }; programs = { - git.package = pkgs.gitFull; + kdeconnect.enable = true; }; # unblock kde connect / gsconnect diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 6fef40df..d48c9bae 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -24,26 +24,23 @@ in { }; }; - programs.gpaste.enable = true; - - environment = { - systemPackages = with pkgs; [ - gnomeExtensions.gsconnect - ]; - - # remove some gnome default apps - gnome.excludePackages = with pkgs.gnome; [ - cheese # photo booth - epiphany # web browser - evince # document viewer - geary # email client - seahorse # password manager - gnome-clocks - gnome-maps - gnome-weather - gnome-music - pkgs.gnome-connections - ]; + programs = { + gpaste.enable = true; + kdeconnect.package = pkgs.gnomeExtensions.gsconnect; }; + + # remove some gnome default apps + environment.gnome.excludePackages = with pkgs.gnome; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + seahorse # password manager + gnome-clocks + gnome-maps + gnome-weather + gnome-music + pkgs.gnome-connections + ]; }; } diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix index 45c31ee2..0c5a7136 100644 --- a/modules/desktop/kde.nix +++ b/modules/desktop/kde.nix @@ -43,6 +43,7 @@ in { programs = { dconf.enable = true; partition-manager.enable = true; + kdeconnect.enable = true; }; }; } diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix index 412a50a5..aa7681ef 100644 --- a/modules/globalinstalls.nix +++ b/modules/globalinstalls.nix @@ -10,9 +10,14 @@ }; programs = { - git.enable = true; zsh.enable = true; htop.enable = true; + iotop.enable = true; + nano.syntaxHighlight = true; + git = { + enable = true; + package = pkgs.gitFull; + }; }; }; } From 61419b3559a58d2b4e8d6d502388d9185f0a0d84 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 2 Oct 2023 17:14:20 +0200 Subject: [PATCH 0081/1295] use some unstable pkgs, reorganize hw --- README.md | 20 ++++++++------ hetzner-vpn1.nix | 2 +- modules/desktop/default.nix | 4 +++ modules/desktop/gaming.nix | 1 + modules/hardware/amd.nix | 47 ++++++++++++++++++++++++++++++++ modules/hardware/amdcpu.nix | 15 ---------- modules/hardware/amdgpu.nix | 17 ------------ modules/hardware/default.nix | 5 ++-- modules/hardware/intel.nix | 39 ++++++++++++++++++++++++++ modules/hardware/intelcpu.nix | 14 ---------- modules/hardware/vinzenz-lpt.nix | 7 +++-- modules/hardware/vinzenz-pc2.nix | 6 ++-- modules/nixpkgs.nix | 15 ++++++++-- modules/users/ronja-home.nix | 2 -- modules/users/vinzenz-home.nix | 1 - vinzenz-lpt.nix | 5 ++++ vinzenz-pc2.nix | 2 +- 17 files changed, 133 insertions(+), 69 deletions(-) create mode 100644 modules/hardware/amd.nix delete mode 100644 modules/hardware/amdcpu.nix delete mode 100644 modules/hardware/amdgpu.nix create mode 100644 modules/hardware/intel.nix delete mode 100644 modules/hardware/intelcpu.nix diff --git a/README.md b/README.md index 3195c038..4d254da9 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # nixos-configuration -When adding a new host: -1. install NixOS via the graphical installer -2. `mv /etc/hardware-configuration ./devicename-hardware-configuration.nix` -3. copy an existing devicename.nix -5. change import to `new-devicename-hardware-configuration.nix` -6. set the hostname and optional imports in `new-devicename.nix` -7. `ln -s ./new-devicename.nix /etc/nixos/configuration.nix` -8. `sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager` -9. apply +/ +├── modules +│ ├── desktop +│ ├── hardware (includes hostname.nix) +│ └── users +└── hostname.nix (imports modules) + +When adding a new host: `ln -s ./new-devicename.nix /etc/nixos/configuration.nix` + +Use `sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager` to add home manager support. + diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 9e42020e..d2c2fba3 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +{...}: { imports = [ (import ./modules { hostName = "hetzner-vpn1"; diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 7e5f08ac..ab3aa05e 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -42,6 +42,10 @@ in { programs = { kdeconnect.enable = true; + firefox = { + enable = true; + languagePacks = ["en-US" "de"]; + }; }; # unblock kde connect / gsconnect diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index 2c9b6ab2..e0ae169f 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -10,6 +10,7 @@ in { config = lib.mkIf isEnabled { hardware.opengl = { + driSupport = true; driSupport32Bit = true; extraPackages = with pkgs; [mangohud]; extraPackages32 = with pkgs; [mangohud]; diff --git a/modules/hardware/amd.nix b/modules/hardware/amd.nix new file mode 100644 index 00000000..d00b99c9 --- /dev/null +++ b/modules/hardware/amd.nix @@ -0,0 +1,47 @@ +{ + lib, + config, + pkgs, + ... +}: let + cfg = config.my.hardware.amd; +in { + options.my.hardware.amd = { + cpu = lib.mkEnableOption "amd cpu"; + gpu = lib.mkEnableOption "amd gpu"; + radeon = lib.mkEnableOption "amd legacy gpu"; # old hardware, dont judge + }; + + config = lib.mkMerge [ + (lib.mkIf cfg.cpu { + boot.kernelModules = ["kvm-amd"]; + hardware.cpu.amd.updateMicrocode = true; + }) + + (lib.mkIf cfg.gpu { + boot.kernelModules = ["amdgpu"]; + services.xserver.videoDrivers = ["amdgpu"]; + + hardware.opengl = { + extraPackages = with pkgs; [ + amdvlk + ]; + extraPackages32 = with pkgs; [ + driversi686Linux.amdvlk + ]; + }; + + environment.systemPackages = with pkgs; [ + unstable.nvtop-amd + ]; + }) + + (lib.mkIf cfg.radeon { + boot.kernelModules = ["radeon"]; + services.xserver.videoDrivers = ["radeon"]; + environment.systemPackages = with pkgs; [ + radeontop + ]; + }) + ]; +} diff --git a/modules/hardware/amdcpu.nix b/modules/hardware/amdcpu.nix deleted file mode 100644 index 6eedbb1a..00000000 --- a/modules/hardware/amdcpu.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = config.my.hardware.isAmdCpu; -in { - options.my.hardware.isAmdCpu = lib.mkEnableOption "amd cpu"; - - config = lib.mkIf isEnabled { - boot.kernelModules = ["kvm-amd"]; - hardware.cpu.amd.updateMicrocode = true; - }; -} diff --git a/modules/hardware/amdgpu.nix b/modules/hardware/amdgpu.nix deleted file mode 100644 index 2e4486bd..00000000 --- a/modules/hardware/amdgpu.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - isEnabled = config.my.hardware.isAmdGpu; -in { - options.my.hardware.isAmdGpu = lib.mkEnableOption "amd gpu"; - - config = lib.mkIf isEnabled { - environment.systemPackages = with pkgs; [ - radeontop - amdvlk - ]; - }; -} diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index a6dfabc9..a9a4a841 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -9,9 +9,8 @@ in { (modulesPath + "/installer/scan/not-detected.nix") (builtins.toString ./. + "/${hostName}.nix") ./common-desktop.nix - ./amdcpu.nix - ./amdgpu.nix - ./intelcpu.nix + ./amd.nix + ./intel.nix ]; options.my.modulesCfg.hostName = lib.mkOption { diff --git a/modules/hardware/intel.nix b/modules/hardware/intel.nix new file mode 100644 index 00000000..a2795c29 --- /dev/null +++ b/modules/hardware/intel.nix @@ -0,0 +1,39 @@ +{ + lib, + config, + pkgs, + ... +}: let + cfg = config.my.hardware.intel; +in { + options.my.hardware.intel = { + cpu = lib.mkEnableOption "intel cpu"; + iGpu = lib.mkEnableOption "intel integrated gpu"; + }; + + config = lib.mkMerge [ + (lib.mkIf cfg.cpu { + boot.kernelModules = ["kvm-intel"]; + hardware.cpu.intel.updateMicrocode = true; + }) + (lib.mkIf cfg.iGpu { + hardware.opengl = { + extraPackages = with pkgs; [ + intel-media-driver + vaapiIntel + vaapiVdpau + libvdpau-va-gl + ]; + extraPackages32 = with pkgs.pkgsi686Linux; [ + intel-media-driver + vaapiIntel + vaapiVdpau + libvdpau-va-gl + ]; + }; + environment.systemPackages = with pkgs; [ + unstable.nvtop-intel + ]; + }) + ]; +} diff --git a/modules/hardware/intelcpu.nix b/modules/hardware/intelcpu.nix deleted file mode 100644 index e9d5ba82..00000000 --- a/modules/hardware/intelcpu.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - lib, - config, - ... -}: let - isEnabled = config.my.hardware.isIntelCpu; -in { - options.my.hardware.isIntelCpu = lib.mkEnableOption "intel cpu"; - - config = lib.mkIf isEnabled { - boot.kernelModules = ["kvm-intel"]; - hardware.cpu.intel.updateMicrocode = true; - }; -} diff --git a/modules/hardware/vinzenz-lpt.nix b/modules/hardware/vinzenz-lpt.nix index bec7a08e..5f028ef5 100644 --- a/modules/hardware/vinzenz-lpt.nix +++ b/modules/hardware/vinzenz-lpt.nix @@ -2,8 +2,11 @@ config = { my.hardware = { enableCommonDesktopSettings = true; - isIntelCpu = true; - isAmdGpu = true; + amd.radeon = true; + intel = { + cpu = true; + iGpu = true; + }; }; boot = { diff --git a/modules/hardware/vinzenz-pc2.nix b/modules/hardware/vinzenz-pc2.nix index 9fdaca72..3f6ce4aa 100644 --- a/modules/hardware/vinzenz-pc2.nix +++ b/modules/hardware/vinzenz-pc2.nix @@ -2,8 +2,10 @@ config = { my.hardware = { enableCommonDesktopSettings = true; - isAmdCpu = true; - isAmdGpu = true; + amd = { + cpu = true; + gpu = true; + }; }; boot = { diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index b8299d3a..3bb6d9a2 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -1,6 +1,17 @@ -{...}: { +{config, ...}: let + unstable-commit-sha = "f5892ddac112a1e9b3612c39af1b72987ee5783a"; +in { config = { - nixpkgs.config.allowUnfree = true; + nixpkgs.config = { + allowUnfree = true; + + # make nixos-unstable availiable as 'pkgs.unstable' + packageOverrides = pkgs: { + unstable = import (fetchTarball "https://github.com/nixos/nixpkgs/tarball/${unstable-commit-sha}") { + config = config.nixpkgs.config; + }; + }; + }; system = { stateVersion = "22.11"; diff --git a/modules/users/ronja-home.nix b/modules/users/ronja-home.nix index 3e1982dc..aed4e1e3 100644 --- a/modules/users/ronja-home.nix +++ b/modules/users/ronja-home.nix @@ -12,8 +12,6 @@ programs = { home-manager.enable = true; - firefox.enable = true; - zsh = { history = { size = 10000; diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 3ee1b642..04a1f816 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -30,7 +30,6 @@ programs = { home-manager.enable = true; - firefox.enable = true; fzf.enable = true; mangohud.enable = true; diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index e184e77a..5c5d8478 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -17,5 +17,10 @@ # flatpak xdg-portal-kde crashes, otherwise this would be global services.flatpak.enable = true; + + # force rendering on dedicated graphics + environment.sessionVariables = rec { + DRI_PRIME = "1"; + }; }; } diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index a67ce961..775be57c 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +{...}: { imports = [ (import ./modules { hostName = "vinzenz-pc2"; From 80b5a14c5e6c19d7a81050596c4c1f4edce55a9a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 2 Oct 2023 18:14:05 +0200 Subject: [PATCH 0082/1295] whitelist for nonfree packages --- modules/desktop/default.nix | 9 +++++++++ modules/desktop/gaming.nix | 6 ++++++ modules/nixpkgs.nix | 17 ++++++++++++++--- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index ab3aa05e..262fccef 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -38,6 +38,7 @@ in { alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; + #jack.enable = true; }; programs = { @@ -90,6 +91,14 @@ in { "electron-12.2.3" ]; + my.allowUnfreePackages = [ + "insync" + "insync-pkg" + + "rider" + "pycharm-professional" + ]; + fonts = { fontconfig.defaultFonts.monospace = ["FiraCode Nerd Font"]; fonts = with pkgs; [ diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index e0ae169f..69c8c83b 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -42,5 +42,11 @@ in { dedicatedServer.openFirewall = true; }; }; + + my.allowUnfreePackages = [ + "steam" + "steam-original" + "steam-run" + ]; }; } diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index 3bb6d9a2..d3db3945 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -1,16 +1,27 @@ -{config, ...}: let +{ + config, + lib, + ... +}: let unstable-commit-sha = "f5892ddac112a1e9b3612c39af1b72987ee5783a"; in { + options.my.allowUnfreePackages = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = []; + example = ["steam"]; + }; + config = { nixpkgs.config = { - allowUnfree = true; - # make nixos-unstable availiable as 'pkgs.unstable' packageOverrides = pkgs: { unstable = import (fetchTarball "https://github.com/nixos/nixpkgs/tarball/${unstable-commit-sha}") { config = config.nixpkgs.config; }; }; + + # https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085 + allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.my.allowUnfreePackages; }; system = { From e6366c642dd2f7dc73541a49fb605dbbbd95f536 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 2 Oct 2023 20:44:44 +0200 Subject: [PATCH 0083/1295] disable dedicated graphics by default again --- vinzenz-lpt.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 5c5d8478..e184e77a 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -17,10 +17,5 @@ # flatpak xdg-portal-kde crashes, otherwise this would be global services.flatpak.enable = true; - - # force rendering on dedicated graphics - environment.sessionVariables = rec { - DRI_PRIME = "1"; - }; }; } From 9e91c721d078cf47b41612d823dde96a70c00ab1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 6 Oct 2023 00:02:00 +0200 Subject: [PATCH 0084/1295] add splash screen for prettier boot --- modules/hardware/common-desktop.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/hardware/common-desktop.nix b/modules/hardware/common-desktop.nix index dea948e2..bdae3914 100644 --- a/modules/hardware/common-desktop.nix +++ b/modules/hardware/common-desktop.nix @@ -21,6 +21,8 @@ in { timeout = 3; efi.canTouchEfiVariables = true; }; + + plymouth.enable = true; }; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking From d445fab12a6e29f154e17901e6808bc45cf1c405 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 6 Oct 2023 19:50:24 +0200 Subject: [PATCH 0085/1295] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4d254da9..5cee1902 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # nixos-configuration +``` / ├── modules │ ├── desktop │ ├── hardware (includes hostname.nix) │ └── users └── hostname.nix (imports modules) +``` When adding a new host: `ln -s ./new-devicename.nix /etc/nixos/configuration.nix` From b2e3cc27b5d65dfa0a885940914d8c625f499a53 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 8 Oct 2023 12:29:20 +0200 Subject: [PATCH 0086/1295] glxinfo, new alias --- modules/desktop/gaming.nix | 1 + modules/users/vinzenz-home.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index 69c8c83b..eab70987 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -23,6 +23,7 @@ in { dxvk mangohud vulkan-tools + glxinfo (lutris.override { extraPkgs = pkgs: [ diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 04a1f816..9820d5be 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -43,6 +43,7 @@ my-apply = "sudo nixos-rebuild boot"; my-switch = "sudo nixos-rebuild switch"; my-update = "sudo nixos-rebuild boot --upgrade"; + my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; my-fmt = "alejandra ."; my-test = "sudo nixos-rebuild test"; my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; From 8197774471b26085dc56e8dbf44a502362722bf5 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 8 Oct 2023 17:17:14 +0200 Subject: [PATCH 0087/1295] enable bluetooth, misc settings --- modules/desktop/default.nix | 9 ++++++--- modules/desktop/gaming.nix | 2 ++ modules/hardware/common-desktop.nix | 5 +++++ modules/nixpkgs.nix | 8 ++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 262fccef..01b8f998 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -22,11 +22,14 @@ in { config = lib.mkIf isEnabled { services = { - # Enable the X11 windowing system / wayland depending on DE - xserver.enable = true; - # Enable CUPS to print documents. printing.enable = true; + + xserver = { + # Enable the X11 windowing system / wayland depending on DE + enable = true; + libinput.enable = true; + }; }; # Enable sound with pipewire. diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index eab70987..82ea784b 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -35,6 +35,8 @@ in { }) ]; + hardware.steam-hardware.enable = true; + programs = { xwayland.enable = true; steam = { diff --git a/modules/hardware/common-desktop.nix b/modules/hardware/common-desktop.nix index bdae3914..a63aef9a 100644 --- a/modules/hardware/common-desktop.nix +++ b/modules/hardware/common-desktop.nix @@ -36,5 +36,10 @@ in { hardware.enableRedistributableFirmware = true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + hardware.bluetooth = { + enable = true; + package = pkgs.bluezFull; + }; }; } diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index d3db3945..cb453895 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -38,5 +38,13 @@ in { dates = "monthly"; options = "--delete-older-than 30d"; }; + + documentation = { + enable = true; # documentation of packages + nixos.enable = false; # nixos documentation + man.enable = true; # manual pages and the man command + info.enable = false; # info pages and the info command + doc.enable = false; # documentation distributed in packages' /share/doc + }; }; } From a488df8854303ff134889c4e169e5b60aa48e544 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 8 Oct 2023 21:34:45 +0200 Subject: [PATCH 0088/1295] open factorio port --- modules/desktop/default.nix | 7 +++---- modules/desktop/gaming.nix | 8 ++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 01b8f998..47fe492e 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -52,22 +52,21 @@ in { }; }; - # unblock kde connect / gsconnect networking = { networkmanager.enable = true; - firewall.enable = true; firewall = { + enable = true; allowedTCPPortRanges = [ { - # KDE Connect + # KDE Connect / gsconnect from = 1714; to = 1764; } ]; allowedUDPPortRanges = [ { - # KDE Connect + # KDE Connect / gsconnect from = 1714; to = 1764; } diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index 82ea784b..8355621c 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -46,6 +46,14 @@ in { }; }; + networking.firewall.allowedUDPPortRanges = [ + { + # Factorio + from = 34197; + to = 34197; + } + ]; + my.allowUnfreePackages = [ "steam" "steam-original" From 5cd119f65e01dfdc5299010ccb37c87247b2bbff Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 22 Oct 2023 14:14:39 +0200 Subject: [PATCH 0089/1295] add printing and libreoffice --- modules/desktop/default.nix | 10 +++++++--- modules/desktop/printing.nix | 23 +++++++++++++++++++++++ vinzenz-lpt.nix | 1 + vinzenz-pc2.nix | 1 + 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 modules/desktop/printing.nix diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 47fe492e..04085814 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -12,6 +12,7 @@ in { ./gnome.nix ./kde.nix ./gaming.nix + ./printing.nix ] ++ lib.optionals isHomeManager [ ./gnome-home.nix @@ -22,9 +23,6 @@ in { config = lib.mkIf isEnabled { services = { - # Enable CUPS to print documents. - printing.enable = true; - xserver = { # Enable the X11 windowing system / wayland depending on DE enable = true; @@ -86,6 +84,12 @@ in { environment = { systemPackages = with pkgs; [ lm_sensors + + # office + libreoffice-qt + hunspell + hunspellDicts.de-de + hunspellDicts.en-us-large ]; }; diff --git a/modules/desktop/printing.nix b/modules/desktop/printing.nix new file mode 100644 index 00000000..5f958aa9 --- /dev/null +++ b/modules/desktop/printing.nix @@ -0,0 +1,23 @@ +{ + config, + pkgs, + lib, + ... +}: let + isEnabled = config.my.desktop.enablePrinting; +in { + options.my.desktop.enablePrinting = lib.mkEnableOption "printing"; + + config = lib.mkIf isEnabled { + services = { + # Enable CUPS to print documents. + printing.enable = true; + + avahi = { + enable = true; # runs the Avahi daemon + nssmdns = true; # enables the mDNS NSS plug-in + openFirewall = true; # opens the firewall for UDP port 5353 + }; + }; + }; +} diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index e184e77a..1d04d758 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -12,6 +12,7 @@ desktop = { enableGnome = true; enableGaming = true; + enablePrinting = true; }; }; diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 775be57c..2d4437ca 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -12,6 +12,7 @@ desktop = { enableKde = true; enableGaming = true; + enablePrinting = true; }; }; From 1559d8ccbd085db2207b68a50bea1e32a159d6ab Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 22 Oct 2023 14:15:28 +0200 Subject: [PATCH 0090/1295] add rustup and vscode extensions --- modules/users/vinzenz-home.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 9820d5be..08950bdd 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -25,6 +25,7 @@ kdiff3 docker youtube-music + rustup ]; programs = { @@ -89,12 +90,13 @@ ms-python.python kamadorueda.alejandra #samuelcolvin.jinjahtml - #EditorConfig.EditorConfig + editorconfig.editorconfig #KnisterPeter.vscode-github yzhang.markdown-all-in-one redhat.vscode-yaml - #PKief.material-icon-theme + pkief.material-icon-theme mhutchie.git-graph + rust-lang.rust-analyzer ]; userSettings = { "git.autofetch" = true; From 37f5935b3f490d43973b0ba362fa5bfb3d5d2e49 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 31 Oct 2023 14:43:00 +0100 Subject: [PATCH 0091/1295] enable cachix --- modules/nixpkgs.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index cb453895..48431929 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -24,6 +24,13 @@ in { allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.my.allowUnfreePackages; }; + nix = { + settings = { + substituters = ["https://nix-community.cachix.org" "https://cache.nixos.org/"]; + trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="]; + }; + }; + system = { stateVersion = "22.11"; # enable auto updates From fa9bf1f0f8c78866bf6a9ac2a0d5d39e8ecc9cc2 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 31 Oct 2023 14:43:19 +0100 Subject: [PATCH 0092/1295] more rust stuff --- modules/users/vinzenz-home.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 08950bdd..bc8019bd 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -25,7 +25,13 @@ kdiff3 docker youtube-music - rustup + + cargo + rustc + gcc + rustfmt + clippy + cargo-generate ]; programs = { @@ -97,6 +103,7 @@ pkief.material-icon-theme mhutchie.git-graph rust-lang.rust-analyzer + bungcip.better-toml ]; userSettings = { "git.autofetch" = true; @@ -115,6 +122,7 @@ "workbench.startupEditor" = "readme"; "workbench.enableExperiments" = false; "workbench.iconTheme" = "material-icon-theme"; + "rust-analyzer.checkOnSave.command" = "clippy"; }; }; From 3d1f8393f4cfc0d9bf73592e6fcbacb600dff090 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 3 Nov 2023 20:38:08 +0100 Subject: [PATCH 0093/1295] ultrastable nixpkgs for rarely used big apps, update unstable --- modules/globalinstalls.nix | 1 + modules/nixpkgs.nix | 6 +++++- modules/users/vinzenz-home.nix | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix index aa7681ef..aa2f826c 100644 --- a/modules/globalinstalls.nix +++ b/modules/globalinstalls.nix @@ -6,6 +6,7 @@ pciutils ncdu tldr + glances ]; }; diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index 48431929..c9e66484 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -3,7 +3,8 @@ lib, ... }: let - unstable-commit-sha = "f5892ddac112a1e9b3612c39af1b72987ee5783a"; + unstable-commit-sha = "fa804edfb7869c9fb230e174182a8a1a7e512c40"; + ultrastable-commit-sha = "34bdaaf1f0b7fb6d9091472edc968ff10a8c2857"; in { options.my.allowUnfreePackages = lib.mkOption { type = lib.types.listOf lib.types.str; @@ -18,6 +19,9 @@ in { unstable = import (fetchTarball "https://github.com/nixos/nixpkgs/tarball/${unstable-commit-sha}") { config = config.nixpkgs.config; }; + ultrastable = import (fetchTarball "https://github.com/nixos/nixpkgs/tarball/${ultrastable-commit-sha}") { + config = config.nixpkgs.config; + }; }; # https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085 diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index bc8019bd..583c309b 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -5,7 +5,7 @@ }: { home.packages = with pkgs; [ keepassxc - insync + unstable.insync telegram-desktop simple-scan wireguard-tools @@ -16,12 +16,12 @@ wirelesstools thefuck dotnet-sdk_7 - jetbrains.rider + ultrastable.jetbrains.rider alejandra arduino uucp screen - jetbrains.pycharm-professional + ultrastable.jetbrains.pycharm-professional kdiff3 docker youtube-music From c45080ccd5451fefba52a3ac5adfd9de7b84a594 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 6 Nov 2023 13:37:38 +0100 Subject: [PATCH 0094/1295] enable flatpak on all desktops --- modules/desktop/default.nix | 6 +++++- modules/desktop/kde.nix | 3 --- vinzenz-lpt.nix | 3 --- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 04085814..33a8fcc4 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -23,11 +23,14 @@ in { config = lib.mkIf isEnabled { services = { + # Enable the X11 windowing system / wayland depending on DE xserver = { - # Enable the X11 windowing system / wayland depending on DE enable = true; libinput.enable = true; }; + + # flatpak xdg-portal-kde crashes, otherwise this would be global + flatpak.enable = true; }; # Enable sound with pipewire. @@ -76,6 +79,7 @@ in { # save some boot time because nothing actually requires network connectivity services.NetworkManager-wait-online.enable = false; + # prevent stuck units from preventing shutdown (default is 120s) extraConfig = '' DefaultTimeoutStopSec=12s ''; diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix index 0c5a7136..c6b6590a 100644 --- a/modules/desktop/kde.nix +++ b/modules/desktop/kde.nix @@ -11,9 +11,6 @@ in { config = lib.mkIf isEnabled { my.desktop.enable = true; - # flatpak xdg-portal-kde crashes, otherwise this would be global - services.flatpak.enable = false; - services = { # Enable the KDE Plasma Desktop Environment. xserver = { diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 1d04d758..1bb1eda3 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -15,8 +15,5 @@ enablePrinting = true; }; }; - - # flatpak xdg-portal-kde crashes, otherwise this would be global - services.flatpak.enable = true; }; } From 50b0025f12d6f0f790dc8995fae6d1f3eb90330a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 6 Nov 2023 13:53:11 +0100 Subject: [PATCH 0095/1295] more gnome config managed by nix --- modules/desktop/gnome-home.nix | 37 +++++++++++++++++++++++++++++++--- modules/desktop/gnome.nix | 8 +++++++- modules/users/vinzenz-home.nix | 2 ++ 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index ee3870bd..c77d6138 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -9,13 +9,44 @@ in { config = lib.mkIf isEnabled { home-manager.sharedModules = [ { - home.packages = with pkgs; [ - amberol - ]; + home.packages = with pkgs; + [ + amberol + ] + ++ (with gnome; [ + dconf-editor + gpaste + ]) + ++ (with gnomeExtensions; [ + caffeine + appindicator + gsconnect + ]); + dconf.settings = { "org/gnome/desktop/peripherals/keyboard" = { numlock-state = true; }; + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + }; + "org/gnome/tweaks" = { + show-extensions-notice = false; + }; + "ca/desrt/dconf-editor" = { + show-warning = false; + }; + "org/gnome/shell" = { + disable-user-extensions = false; + disabled-extensions = []; + enabled-extensions = [ + "appindicatorsupport@rgcjonas.gmail.com" + "workspace-indicator@gnome-shell-extensions.gcampax.github.com" + "caffeine@patapon.info" + "GPaste@gnome-shell-extensions.gnome.org" + "gsconnect@andyholmes.github.io" + ]; + }; }; } ]; diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index d48c9bae..2931202c 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -14,17 +14,23 @@ in { services = { xserver = { # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; + displayManager = { + gdm.enable = true; + defaultSession = "gnome"; + }; desktopManager.gnome.enable = true; }; gnome = { tracker-miners.enable = false; tracker.enable = false; + sushi.enable = true; + #gnome-remote-desktop.enable = true; }; }; programs = { + dconf.enable = true; gpaste.enable = true; kdeconnect.package = pkgs.gnomeExtensions.gsconnect; }; diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 583c309b..6da8e6ca 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -123,6 +123,8 @@ "workbench.enableExperiments" = false; "workbench.iconTheme" = "material-icon-theme"; "rust-analyzer.checkOnSave.command" = "clippy"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; }; }; From 2600e6a9fbaf077ca65c78240f95be8604e0b6de Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 24 Nov 2023 14:32:58 +0100 Subject: [PATCH 0096/1295] update ultrastable, misc gnome stuff --- modules/desktop/gnome.nix | 5 +- modules/nixpkgs.nix | 2 +- modules/users/vinzenz-home.nix | 370 +++++++++++++++++---------------- 3 files changed, 194 insertions(+), 183 deletions(-) diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 2931202c..726ea996 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -25,7 +25,7 @@ in { tracker-miners.enable = false; tracker.enable = false; sushi.enable = true; - #gnome-remote-desktop.enable = true; + gnome-remote-desktop.enable = true; }; }; @@ -41,12 +41,11 @@ in { epiphany # web browser evince # document viewer geary # email client - seahorse # password manager + #seahorse # password manager gnome-clocks gnome-maps gnome-weather gnome-music - pkgs.gnome-connections ]; }; } diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index c9e66484..0b47cdca 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -4,7 +4,7 @@ ... }: let unstable-commit-sha = "fa804edfb7869c9fb230e174182a8a1a7e512c40"; - ultrastable-commit-sha = "34bdaaf1f0b7fb6d9091472edc968ff10a8c2857"; + ultrastable-commit-sha = "8f1180704ac35baded1a74164365ac7cdfba6f38"; in { options.my.allowUnfreePackages = lib.mkOption { type = lib.types.listOf lib.types.str; diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 6da8e6ca..f2aa8caa 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -1,193 +1,205 @@ { config, + osConfig, pkgs, + lib, ... -}: { - home.packages = with pkgs; [ - keepassxc - unstable.insync - telegram-desktop - simple-scan - wireguard-tools - element-desktop - etcher - iotop - lsof - wirelesstools - thefuck - dotnet-sdk_7 - ultrastable.jetbrains.rider - alejandra - arduino - uucp - screen - ultrastable.jetbrains.pycharm-professional - kdiff3 - docker - youtube-music +}: let + isGnomeEnabled = osConfig.my.desktop.enableGnome; +in + lib.mkMerge [ + { + home.packages = with pkgs; [ + keepassxc + unstable.insync + telegram-desktop + simple-scan + wireguard-tools + element-desktop + etcher + iotop + lsof + wirelesstools + thefuck + dotnet-sdk_7 + ultrastable.jetbrains.rider + alejandra + arduino + uucp + screen + ultrastable.jetbrains.pycharm-professional + kdiff3 + docker + youtube-music - cargo - rustc - gcc - rustfmt - clippy - cargo-generate - ]; + cargo + rustc + gcc + rustfmt + clippy + cargo-generate + ]; - programs = { - home-manager.enable = true; + programs = { + home-manager.enable = true; - fzf.enable = true; - mangohud.enable = true; + fzf.enable = true; + mangohud.enable = true; - zsh = { - initExtra = '' - eval "$(direnv hook zsh)"; - eval $(thefuck --alias); - ''; + zsh = { + initExtra = '' + eval "$(direnv hook zsh)"; + eval $(thefuck --alias); + ''; - shellAliases = { - my-apply = "sudo nixos-rebuild boot"; - my-switch = "sudo nixos-rebuild switch"; - my-update = "sudo nixos-rebuild boot --upgrade"; - my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; - my-fmt = "alejandra ."; - my-test = "sudo nixos-rebuild test"; - my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; - my-ip4 = "ip addr show | grep 192"; + shellAliases = { + my-apply = "sudo nixos-rebuild boot"; + my-switch = "sudo nixos-rebuild switch"; + my-update = "sudo nixos-rebuild boot --upgrade"; + my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; + my-fmt = "alejandra ."; + my-test = "sudo nixos-rebuild test"; + my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; + my-ip4 = "ip addr show | grep 192"; + }; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; + }; + }; + + git = { + enable = true; + userName = "Vinzenz Schroeter"; + userEmail = "vinzenz.f.s@gmail.com"; + + aliases = { + prettylog = "log --pretty=oneline --graph"; + spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; + }; + + extraConfig = { + pull.ff = "only"; + merge.tool = "kdiff3"; + push.autoSetupRemote = "true"; + }; + }; + + vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + bbenoist.nix + ms-python.python + kamadorueda.alejandra + #samuelcolvin.jinjahtml + editorconfig.editorconfig + #KnisterPeter.vscode-github + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + mhutchie.git-graph + rust-lang.rust-analyzer + bungcip.better-toml + ]; + userSettings = { + "git.autofetch" = true; + "update.mode" = "none"; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; + "rust-analyzer.checkOnSave.command" = "clippy"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; + }; + }; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + + exa = { + enable = true; + git = true; + icons = true; + enableAliases = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + }; + + micro = { + enable = true; + settings = { + colorcolumn = 120; + hlsearch = true; + savecursor = true; + saveundo = true; + scrollbar = true; + smartpaste = true; + }; + }; + + # checked https://rycee.gitlab.io/home-manager/options.html until "programs.notmuch" }; - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { + editorconfig = { enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; + settings = { + "*" = { + charset = "utf-8"; + end_of_line = "lf"; + trim_trailing_whitespace = true; + insert_final_newline = true; + max_line_width = 120; + indent_style = "space"; + indent_size = 4; + }; + "*.nix" = { + indent_size = 2; + }; + }; }; - }; - - git = { - enable = true; - userName = "Vinzenz Schroeter"; - userEmail = "vinzenz.f.s@gmail.com"; - - aliases = { - prettylog = "log --pretty=oneline --graph"; - spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; - }; - - extraConfig = { - pull.ff = "only"; - merge.tool = "kdiff3"; - push.autoSetupRemote = "true"; - }; - }; - - vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - bbenoist.nix - ms-python.python - kamadorueda.alejandra - #samuelcolvin.jinjahtml - editorconfig.editorconfig - #KnisterPeter.vscode-github - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - mhutchie.git-graph - rust-lang.rust-analyzer - bungcip.better-toml + } + (lib.mkIf isGnomeEnabled { + home.packages = with pkgs; [ + fractal ]; - userSettings = { - "git.autofetch" = true; - "update.mode" = "none"; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; - "workbench.startupEditor" = "readme"; - "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; - "rust-analyzer.checkOnSave.command" = "clippy"; - "extensions.autoUpdate" = false; - "extensions.autoCheckUpdates" = false; - }; - }; - - direnv = { - enable = true; - nix-direnv.enable = true; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - - exa = { - enable = true; - git = true; - icons = true; - enableAliases = true; - extraOptions = [ - "--group-directories-first" - "--header" - ]; - }; - - micro = { - enable = true; - settings = { - colorcolumn = 120; - hlsearch = true; - savecursor = true; - saveundo = true; - scrollbar = true; - smartpaste = true; - }; - }; - - # checked https://rycee.gitlab.io/home-manager/options.html until "programs.notmuch" - }; - - editorconfig = { - enable = true; - settings = { - "*" = { - charset = "utf-8"; - end_of_line = "lf"; - trim_trailing_whitespace = true; - insert_final_newline = true; - max_line_width = 120; - indent_style = "space"; - indent_size = 4; - }; - "*.nix" = { - indent_size = 2; - }; - }; - }; -} + }) + ] From 504c17e3718c90770336e990c0357bc480160405 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 24 Nov 2023 16:12:21 +0100 Subject: [PATCH 0097/1295] switch pc2 to gnome --- modules/desktop/gnome.nix | 3 +++ vinzenz-pc2.nix | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 726ea996..51367e1a 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -47,5 +47,8 @@ in { gnome-weather gnome-music ]; + + # RDP connections + networking.firewall.allowedTCPPorts = [3389]; }; } diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 2d4437ca..b04fe294 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -10,7 +10,7 @@ my = { enabledUsers = ["vinzenz" "ronja"]; desktop = { - enableKde = true; + enableGnome = true; enableGaming = true; enablePrinting = true; }; From 9bf73e91fb17c5ef31285b9c89495a7a35e1bbe7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 24 Nov 2023 16:14:37 +0100 Subject: [PATCH 0098/1295] fresh rider from current unstable --- modules/nixpkgs.nix | 2 +- modules/users/vinzenz-home.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index 0b47cdca..86376568 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -3,7 +3,7 @@ lib, ... }: let - unstable-commit-sha = "fa804edfb7869c9fb230e174182a8a1a7e512c40"; + unstable-commit-sha = "19cbff58383a4ae384dea4d1d0c823d72b49d614"; ultrastable-commit-sha = "8f1180704ac35baded1a74164365ac7cdfba6f38"; in { options.my.allowUnfreePackages = lib.mkOption { diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index f2aa8caa..84d2016f 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -21,8 +21,8 @@ in lsof wirelesstools thefuck - dotnet-sdk_7 - ultrastable.jetbrains.rider + dotnet-sdk_8 + unstable.jetbrains.rider alejandra arduino uucp From 6d43dd0ecbfc9a90d75097e8d46ed2a572609e9b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 30 Nov 2023 16:53:47 +0100 Subject: [PATCH 0099/1295] enable gnome-clocks, show seconds in top bar --- modules/desktop/gnome-home.nix | 1 + modules/desktop/gnome.nix | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index c77d6138..0511079d 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -29,6 +29,7 @@ in { }; "org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; + clock-show-seconds = true; }; "org/gnome/tweaks" = { show-extensions-notice = false; diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 51367e1a..633647c3 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -42,7 +42,6 @@ in { evince # document viewer geary # email client #seahorse # password manager - gnome-clocks gnome-maps gnome-weather gnome-music From 0b7e4e0e614dca6e7d57a8587db04c886c078665 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 30 Nov 2023 16:54:06 +0100 Subject: [PATCH 0100/1295] use IDEs from toolbox app --- modules/desktop/default.nix | 1 + modules/users/vinzenz-home.nix | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 33a8fcc4..78487f0c 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -107,6 +107,7 @@ in { "rider" "pycharm-professional" + "jetbrains-toolbox" ]; fonts = { diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 84d2016f..3c9e8a42 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -21,17 +21,17 @@ in lsof wirelesstools thefuck - dotnet-sdk_8 - unstable.jetbrains.rider alejandra arduino uucp screen - ultrastable.jetbrains.pycharm-professional kdiff3 docker youtube-music + unstable.jetbrains-toolbox + unstable.dotnet-sdk_8 + cargo rustc gcc From 7b517087556d87151e3053c9d3adea429c0e5a47 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 30 Nov 2023 17:25:44 +0100 Subject: [PATCH 0101/1295] gnome gtk3 adwaita theme --- modules/desktop/gnome-home.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index 0511079d..5120bdeb 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -49,6 +49,16 @@ in { ]; }; }; + + gtk = { + enable = true; + iconTheme.name = "Adwaita"; + cursorTheme.name = "Adwaita"; + theme = { + name = "adw-gtk3"; + package = pkgs.adw-gtk3; + }; + }; } ]; }; From 38c7c96dcc0fe798bc66d3a52ecb7b8d655fa2e9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 3 Dec 2023 13:12:48 +0100 Subject: [PATCH 0102/1295] upgrade to nixos-23.11 nix-channel --add https://nixos.org/channels/nixos-23.11 nixos nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager nix-channel --update sudo nixos-rebuild boot --upgrade --- modules/desktop/default.nix | 5 +++-- modules/globalinstalls.nix | 5 ++++- modules/hardware/common-desktop.nix | 5 +---- modules/users/home-shared-modules.nix | 4 ++-- modules/users/vinzenz-home.nix | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 78487f0c..f7902704 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -98,7 +98,7 @@ in { }; nixpkgs.config.permittedInsecurePackages = [ - "electron-12.2.3" + "electron-19.1.9" ]; my.allowUnfreePackages = [ @@ -111,8 +111,9 @@ in { ]; fonts = { + enableDefaultPackages = true; fontconfig.defaultFonts.monospace = ["FiraCode Nerd Font"]; - fonts = with pkgs; [ + packages = with pkgs; [ (nerdfonts.override {fonts = ["FiraCode"];}) ]; }; diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix index aa2f826c..cade3793 100644 --- a/modules/globalinstalls.nix +++ b/modules/globalinstalls.nix @@ -14,7 +14,10 @@ zsh.enable = true; htop.enable = true; iotop.enable = true; - nano.syntaxHighlight = true; + nano = { + enable = true; + syntaxHighlight = true; + }; git = { enable = true; package = pkgs.gitFull; diff --git a/modules/hardware/common-desktop.nix b/modules/hardware/common-desktop.nix index a63aef9a..a427d18c 100644 --- a/modules/hardware/common-desktop.nix +++ b/modules/hardware/common-desktop.nix @@ -37,9 +37,6 @@ in { nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.bluetooth = { - enable = true; - package = pkgs.bluezFull; - }; + hardware.bluetooth.enable = true; }; } diff --git a/modules/users/home-shared-modules.nix b/modules/users/home-shared-modules.nix index b2bd91a4..0ca565da 100644 --- a/modules/users/home-shared-modules.nix +++ b/modules/users/home-shared-modules.nix @@ -21,7 +21,7 @@ zsh = { enable = true; - enableSyntaxHighlighting = true; + syntaxHighlighting.enable = true; enableAutosuggestions = true; enableVteIntegration = true; }; @@ -37,7 +37,7 @@ gh = { enable = true; - enableGitCredentialHelper = true; + gitCredentialHelper.enable = true; }; }; } diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 3c9e8a42..801fe53a 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -153,7 +153,7 @@ in ]; }; - exa = { + eza = { enable = true; git = true; icons = true; From d0e9a9dc595710f182871c27f70a754d29a50739 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 3 Dec 2023 13:13:31 +0100 Subject: [PATCH 0103/1295] additional gnome apps --- modules/desktop/gnome-home.nix | 3 +++ modules/desktop/gnome.nix | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index 5120bdeb..ded868b8 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -12,6 +12,9 @@ in { home.packages = with pkgs; [ amberol + gitg + gnome-builder + meld ] ++ (with gnome; [ dconf-editor diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 633647c3..cd4d37f4 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -14,11 +14,11 @@ in { services = { xserver = { # Enable the GNOME Desktop Environment. + desktopManager.gnome.enable = true; displayManager = { gdm.enable = true; defaultSession = "gnome"; }; - desktopManager.gnome.enable = true; }; gnome = { @@ -38,15 +38,16 @@ in { # remove some gnome default apps environment.gnome.excludePackages = with pkgs.gnome; [ cheese # photo booth - epiphany # web browser + #epiphany # web browser evince # document viewer geary # email client - #seahorse # password manager gnome-maps gnome-weather gnome-music ]; + environment.systemPackages = with pkgs.gnome; [ghex]; + # RDP connections networking.firewall.allowedTCPPorts = [3389]; }; From 8dce5f6c9d9d484fb51305dff171bacce4bbdf0f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 3 Dec 2023 13:28:29 +0100 Subject: [PATCH 0104/1295] update unstable/ultrastable for more compat with 23.11 --- modules/nixpkgs.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index 86376568..fa3d0e42 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -3,8 +3,8 @@ lib, ... }: let - unstable-commit-sha = "19cbff58383a4ae384dea4d1d0c823d72b49d614"; - ultrastable-commit-sha = "8f1180704ac35baded1a74164365ac7cdfba6f38"; + unstable-commit-sha = "e92039b55bcd58469325ded85d4f58dd5a4eaf58"; + ultrastable-commit-sha = "5de0b32be6e85dc1a9404c75131316e4ffbc634c"; in { options.my.allowUnfreePackages = lib.mkOption { type = lib.types.listOf lib.types.str; From 822a75d842d9ea95447fd118ff959e6dc51fac90 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 3 Dec 2023 13:31:34 +0100 Subject: [PATCH 0105/1295] can now use default packages instead of unstable --- modules/hardware/amd.nix | 2 +- modules/hardware/intel.nix | 2 +- modules/users/vinzenz-home.nix | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/hardware/amd.nix b/modules/hardware/amd.nix index d00b99c9..94b959a4 100644 --- a/modules/hardware/amd.nix +++ b/modules/hardware/amd.nix @@ -32,7 +32,7 @@ in { }; environment.systemPackages = with pkgs; [ - unstable.nvtop-amd + nvtop-amd ]; }) diff --git a/modules/hardware/intel.nix b/modules/hardware/intel.nix index a2795c29..177ba552 100644 --- a/modules/hardware/intel.nix +++ b/modules/hardware/intel.nix @@ -32,7 +32,7 @@ in { ]; }; environment.systemPackages = with pkgs; [ - unstable.nvtop-intel + nvtop-intel ]; }) ]; diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 801fe53a..c2c0d636 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -11,7 +11,7 @@ in { home.packages = with pkgs; [ keepassxc - unstable.insync + insync telegram-desktop simple-scan wireguard-tools @@ -26,11 +26,10 @@ in uucp screen kdiff3 - docker youtube-music - unstable.jetbrains-toolbox - unstable.dotnet-sdk_8 + jetbrains-toolbox + dotnet-sdk_8 cargo rustc From e85ece08598ab57b27a663b817d8d8a0a0854475 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 4 Dec 2023 15:08:22 +0100 Subject: [PATCH 0106/1295] remove micro, epiphany, gnome-tour --- modules/desktop/gnome.nix | 3 ++- modules/users/vinzenz-home.nix | 12 ------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index cd4d37f4..fc42f25f 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -38,12 +38,13 @@ in { # remove some gnome default apps environment.gnome.excludePackages = with pkgs.gnome; [ cheese # photo booth - #epiphany # web browser + epiphany # web browser evince # document viewer geary # email client gnome-maps gnome-weather gnome-music + pkgs.gnome-tour ]; environment.systemPackages = with pkgs.gnome; [ghex]; diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index c2c0d636..16758151 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -163,18 +163,6 @@ in ]; }; - micro = { - enable = true; - settings = { - colorcolumn = 120; - hlsearch = true; - savecursor = true; - saveundo = true; - scrollbar = true; - smartpaste = true; - }; - }; - # checked https://rycee.gitlab.io/home-manager/options.html until "programs.notmuch" }; From d790d3ba3e99b83f0d77dee3d14649c3cd38e23c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 4 Dec 2023 22:24:43 +0100 Subject: [PATCH 0107/1295] add tailscale --- modules/default.nix | 1 + modules/desktop/gnome-home.nix | 5 +++++ modules/tailscale.nix | 19 +++++++++++++++++++ vinzenz-lpt.nix | 1 + 4 files changed, 26 insertions(+) create mode 100644 modules/tailscale.nix diff --git a/modules/default.nix b/modules/default.nix index 841095eb..7adcf2c4 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -6,6 +6,7 @@ modulesCfg: {lib, ...}: { ./globalinstalls.nix ./server.nix ./sshd.nix + ./tailscale.nix ] ++ (map (path: (import path modulesCfg)) [ ./hardware diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index ded868b8..86d2dab8 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -63,6 +63,11 @@ in { }; }; } + (lib.mkIf config.my.tailscale.enable + { + home.packages = with pkgs.gnomeExtensions; [tailscale-qs]; + dconf.settings."org/gnome/shell".enabled-extensions = ["tailscale@joaophi.github.com"]; + }) ]; }; } diff --git a/modules/tailscale.nix b/modules/tailscale.nix new file mode 100644 index 00000000..b301dcb8 --- /dev/null +++ b/modules/tailscale.nix @@ -0,0 +1,19 @@ +{ + pkgs, + config, + lib, + ... +}: let + cfg = config.my.tailscale; +in { + options.my.tailscale = { + enable = lib.mkEnableOption "enable tailscale vpn"; + }; + + config = lib.mkIf cfg.enable { + services.tailscale = { + enable = true; + openFirewall = true; + }; + }; +} diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 1bb1eda3..1872c0ae 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -9,6 +9,7 @@ config = { my = { enabledUsers = ["vinzenz"]; + tailscale.enable = true; desktop = { enableGnome = true; enableGaming = true; From 34b04b9ed147ac5397d2afe49552c4993d71b83f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 4 Dec 2023 22:25:12 +0100 Subject: [PATCH 0108/1295] switch to gnome impression for creating bootable usb sticks --- modules/desktop/gnome.nix | 2 +- modules/users/vinzenz-home.nix | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index fc42f25f..12cde3da 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -47,7 +47,7 @@ in { pkgs.gnome-tour ]; - environment.systemPackages = with pkgs.gnome; [ghex]; + environment.systemPackages = with pkgs; [gnome.ghex impression]; # RDP connections networking.firewall.allowedTCPPorts = [3389]; diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 16758151..27ed3e2c 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -16,7 +16,6 @@ in simple-scan wireguard-tools element-desktop - etcher iotop lsof wirelesstools From e5f8fbb4467c006f49eae609174fb1cb798a70db Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 4 Dec 2023 22:45:50 +0100 Subject: [PATCH 0109/1295] tailscale everywhere --- hetzner-vpn1.nix | 1 + vinzenz-pc2.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index d2c2fba3..21581d4d 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -10,6 +10,7 @@ my = { enabledUsers = []; server.enable = true; + tailscale.enable = true; }; users.users.root.openssh.authorizedKeys.keys = [ diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index b04fe294..62b2c81d 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -9,6 +9,7 @@ config = { my = { enabledUsers = ["vinzenz" "ronja"]; + tailscale.enable = true; desktop = { enableGnome = true; enableGaming = true; From c2e62ec81b2ab2ff688414264647cb3525d43747 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 5 Dec 2023 14:50:19 +0100 Subject: [PATCH 0110/1295] allow phone ssh key on all hosts --- hetzner-vpn1.nix | 1 + vinzenz-lpt.nix | 5 +++++ vinzenz-pc2.nix | 1 + 3 files changed, 7 insertions(+) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 21581d4d..85793e63 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -15,6 +15,7 @@ users.users.root.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ]; }; } diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 1872c0ae..40b27bb6 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -16,5 +16,10 @@ enablePrinting = true; }; }; + + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ]; }; } diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 62b2c81d..f1f8aa24 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -19,6 +19,7 @@ users.users.vinzenz.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ]; }; } From abd0d146eabf362b6835e39f621fd4ed97f77bdc Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 5 Dec 2023 15:00:02 +0100 Subject: [PATCH 0111/1295] allow pc2 ssh key on all hosts --- hetzner-vpn1.nix | 1 + vinzenz-lpt.nix | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 85793e63..e1e73ad2 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -16,6 +16,7 @@ users.users.root.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' ]; }; } diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 40b27bb6..b1dbe8e3 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -17,9 +17,9 @@ }; }; - users.users.vinzenz.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' ]; }; } From 04ccf5cdd4a44e8d3d72c6f1c280050071115335 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 5 Dec 2023 15:00:22 +0100 Subject: [PATCH 0112/1295] add dig --- modules/globalinstalls.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix index cade3793..bb43059a 100644 --- a/modules/globalinstalls.nix +++ b/modules/globalinstalls.nix @@ -7,6 +7,7 @@ ncdu tldr glances + dig ]; }; From 026f592b178f61ad00b3f9bde9d1a79b082711c9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 16 Dec 2023 11:28:44 +0100 Subject: [PATCH 0113/1295] add builttools as an option --- modules/buildtools.nix | 40 ++++++++++++++++++++++++++++++++++ modules/default.nix | 1 + modules/users/vinzenz-home.nix | 9 -------- vinzenz-pc2.nix | 5 +++++ 4 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 modules/buildtools.nix diff --git a/modules/buildtools.nix b/modules/buildtools.nix new file mode 100644 index 00000000..8dce6233 --- /dev/null +++ b/modules/buildtools.nix @@ -0,0 +1,40 @@ +{ + pkgs, + lib, + config, + ... +}: let + cfg = config.my.buildtools; +in { + options.my.buildtools = { + native = lib.mkEnableOption "include native build tools"; + dotnet = lib.mkEnableOption "include dotnet build tools"; + rust = lib.mkEnableOption "include rust build tools"; + }; + + config = lib.mkMerge [ + (lib.mkIf cfg.native + { + environment.systemPackages = with pkgs; [ + cmake + gnumake + gcc + gdb + ]; + }) + (lib.mkIf cfg.dotnet { + environment.systemPackages = with pkgs; [ + dotnet-sdk_8 + ]; + }) + (lib.mkIf cfg.rust { + environment.systemPackages = with pkgs; [ + cargo + rustc + rustfmt + clippy + cargo-generate + ]; + }) + ]; +} diff --git a/modules/default.nix b/modules/default.nix index 7adcf2c4..b6f047d4 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -7,6 +7,7 @@ modulesCfg: {lib, ...}: { ./server.nix ./sshd.nix ./tailscale.nix + ./buildtools.nix ] ++ (map (path: (import path modulesCfg)) [ ./hardware diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 27ed3e2c..ecbe173f 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -26,16 +26,7 @@ in screen kdiff3 youtube-music - jetbrains-toolbox - dotnet-sdk_8 - - cargo - rustc - gcc - rustfmt - clippy - cargo-generate ]; programs = { diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index f1f8aa24..27e23afb 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -15,6 +15,11 @@ enableGaming = true; enablePrinting = true; }; + buildtools = { + native = true; + dotnet = true; + rust = true; + }; }; users.users.vinzenz.openssh.authorizedKeys.keys = [ From 419e2b26dc638ab0bcc0b13090d64dc2bb966256 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 16 Dec 2023 12:38:20 +0100 Subject: [PATCH 0114/1295] empty file template --- modules/users/home-shared-modules.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/users/home-shared-modules.nix b/modules/users/home-shared-modules.nix index 0ca565da..00ca57de 100644 --- a/modules/users/home-shared-modules.nix +++ b/modules/users/home-shared-modules.nix @@ -41,4 +41,8 @@ }; }; } + # Templates + { + home.file."Templates/Empty file".text = ""; + } ] From 623b9a96711ea4362ac24b776637723c933b2102 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 16 Dec 2023 12:38:58 +0100 Subject: [PATCH 0115/1295] move packages around, remove yt-music --- modules/desktop/gnome-home.nix | 1 + modules/globalinstalls.nix | 12 ++++++++++-- modules/users/vinzenz-home.nix | 15 +++++++-------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index 86d2dab8..ecec1bb4 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -15,6 +15,7 @@ in { gitg gnome-builder meld + simple-scan ] ++ (with gnome; [ dconf-editor diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix index bb43059a..7aebf9b2 100644 --- a/modules/globalinstalls.nix +++ b/modules/globalinstalls.nix @@ -3,11 +3,19 @@ environment = { pathsToLink = ["/share/zsh"]; systemPackages = with pkgs; [ - pciutils ncdu - tldr glances + iotop + + pciutils + lsof dig + + screen + + tldr + + icu ]; }; diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index ecbe173f..c84761a3 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -12,20 +12,19 @@ in home.packages = with pkgs; [ keepassxc insync + telegram-desktop - simple-scan - wireguard-tools element-desktop - iotop - lsof + + wireguard-tools wirelesstools - thefuck - alejandra + + alejandra # nix formatter + arduino uucp - screen + kdiff3 - youtube-music jetbrains-toolbox ]; From 885d7e9d26f02136b6925f6862fb8200abd09ecf Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 16 Dec 2023 13:02:59 +0100 Subject: [PATCH 0116/1295] remove thefuck --- modules/users/vinzenz-home.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index c84761a3..ade07e85 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -37,7 +37,6 @@ in zsh = { initExtra = '' eval "$(direnv hook zsh)"; - eval $(thefuck --alias); ''; shellAliases = { @@ -60,7 +59,7 @@ in oh-my-zsh = { enable = true; theme = "agnoster"; - plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; + plugins = ["git" "sudo" "docker" "systemadmin"]; }; }; From 61ba08a9bf9a85623b0d1c8c47019ef1b368e16f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 16 Dec 2023 13:07:12 +0100 Subject: [PATCH 0117/1295] opt out of dotnet telemetry --- modules/buildtools.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/buildtools.nix b/modules/buildtools.nix index 8dce6233..484fea2b 100644 --- a/modules/buildtools.nix +++ b/modules/buildtools.nix @@ -23,9 +23,14 @@ in { ]; }) (lib.mkIf cfg.dotnet { - environment.systemPackages = with pkgs; [ - dotnet-sdk_8 - ]; + environment = { + systemPackages = with pkgs; [ + dotnet-sdk_8 + ]; + variables = { + DOTNET_CLI_TELEMETRY_OPTOUT = "1"; + }; + }; }) (lib.mkIf cfg.rust { environment.systemPackages = with pkgs; [ From 0a9eed4fd200a52f3158f02cea746fbe3ace4c30 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 16 Dec 2023 15:33:20 +0100 Subject: [PATCH 0118/1295] fix dotnet publish --- modules/buildtools.nix | 6 ++++++ modules/globalinstalls.nix | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/buildtools.nix b/modules/buildtools.nix index 484fea2b..1f8c830b 100644 --- a/modules/buildtools.nix +++ b/modules/buildtools.nix @@ -20,12 +20,18 @@ in { gnumake gcc gdb + llvmPackages_latest.llvm + llvmPackages.clangUseLLVM ]; }) (lib.mkIf cfg.dotnet { environment = { systemPackages = with pkgs; [ dotnet-sdk_8 + + zlib zlib.dev + openssl + icu ]; variables = { DOTNET_CLI_TELEMETRY_OPTOUT = "1"; diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix index 7aebf9b2..4c617d7e 100644 --- a/modules/globalinstalls.nix +++ b/modules/globalinstalls.nix @@ -14,8 +14,6 @@ screen tldr - - icu ]; }; From 04a3c309fe9523df41381e419530c925fd661cf5 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 25 Dec 2023 12:06:50 +0100 Subject: [PATCH 0119/1295] jetbrais-remote-server --- modules/buildtools.nix | 14 ++++++++++++++ modules/desktop/default.nix | 4 +--- vinzenz-pc2.nix | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/modules/buildtools.nix b/modules/buildtools.nix index 1f8c830b..5aad730b 100644 --- a/modules/buildtools.nix +++ b/modules/buildtools.nix @@ -10,6 +10,7 @@ in { native = lib.mkEnableOption "include native build tools"; dotnet = lib.mkEnableOption "include dotnet build tools"; rust = lib.mkEnableOption "include rust build tools"; + jetbrains-remote-server = lib.mkEnableOption "setup jetbrais IDE installs so -remote-dev-server can be started"; }; config = lib.mkMerge [ @@ -47,5 +48,18 @@ in { cargo-generate ]; }) + (lib.mkIf cfg.jetbrains-remote-server { + environment.systemPackages = with pkgs.jetbrains; [ + jdk # required for all of them + rider + clion + pycharm-professional + ]; + my.allowUnfreePackages = [ + "rider" + "clion" + "pycharm-professional" + ]; + }) ]; } diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index f7902704..575b99e5 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -97,9 +97,7 @@ in { ]; }; - nixpkgs.config.permittedInsecurePackages = [ - "electron-19.1.9" - ]; + nixpkgs.config.permittedInsecurePackages = []; my.allowUnfreePackages = [ "insync" diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 27e23afb..a40a53ac 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -19,6 +19,7 @@ native = true; dotnet = true; rust = true; + jetbrains-remote-server = true; }; }; From a7fedb9e8abccc8aa6d511b8ab18fc126145695e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 25 Dec 2023 12:06:58 +0100 Subject: [PATCH 0120/1295] script template --- modules/users/home-shared-modules.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/users/home-shared-modules.nix b/modules/users/home-shared-modules.nix index 00ca57de..12f12cf7 100644 --- a/modules/users/home-shared-modules.nix +++ b/modules/users/home-shared-modules.nix @@ -43,6 +43,15 @@ } # Templates { - home.file."Templates/Empty file".text = ""; + home.file = { + "Templates/Empty file".text = ""; + "Templates/Empty bash script".text = '' + #!/usr/bin/env bash + # abort on error, undefined variables + set -eu + # print commands before execution + set -x + ''; + }; } ] From d451f0e5313423b9845f76733ef7d2f484f069f1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 25 Dec 2023 12:30:11 +0100 Subject: [PATCH 0121/1295] misc small changes --- modules/desktop/gnome-home.nix | 10 ++++++++-- modules/users/vinzenz.nix | 2 +- vinzenz-pc2.nix | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index ecec1bb4..bdc0d1e4 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -59,14 +59,20 @@ in { iconTheme.name = "Adwaita"; cursorTheme.name = "Adwaita"; theme = { - name = "adw-gtk3"; + name = "adw-gtk3-dark"; package = pkgs.adw-gtk3; }; }; } (lib.mkIf config.my.tailscale.enable { - home.packages = with pkgs.gnomeExtensions; [tailscale-qs]; + home.packages = with pkgs; + [ + trayscale + ] + ++ (with gnomeExtensions; [ + tailscale-qs + ]); dconf.settings."org/gnome/shell".enabled-extensions = ["tailscale@joaophi.github.com"]; }) ]; diff --git a/modules/users/vinzenz.nix b/modules/users/vinzenz.nix index ac270a63..3c90d2fa 100644 --- a/modules/users/vinzenz.nix +++ b/modules/users/vinzenz.nix @@ -12,7 +12,7 @@ in { name = "vinzenz"; description = "Vinzenz Schroeter"; home = "/home/vinzenz"; - extraGroups = ["networkmanager" "wheel" "games"]; + extraGroups = ["networkmanager" "wheel" "games" "dialout"]; shell = pkgs.zsh; }; }; diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index a40a53ac..8f0f22e3 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -24,7 +24,7 @@ }; users.users.vinzenz.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ]; }; From d1af4262c36162c74e188df96bebab715b396b89 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 14 Jan 2024 11:37:42 +0100 Subject: [PATCH 0122/1295] install dotnet on laptop --- vinzenz-lpt.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index b1dbe8e3..347fedd9 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -15,6 +15,9 @@ enableGaming = true; enablePrinting = true; }; + buildtools = { + dotnet = true; + }; }; users.users.vinzenz.openssh.authorizedKeys.keys = [ From 3aff0c255bb8d90bb26abb0d61f2cd7c37ef2930 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 21 Jan 2024 11:08:18 +0100 Subject: [PATCH 0123/1295] add xpadneo to gaming --- modules/desktop/gaming.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index 8355621c..88b9c6aa 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -9,11 +9,16 @@ in { options.my.desktop.enableGaming = lib.mkEnableOption "gaming with wine"; config = lib.mkIf isEnabled { - hardware.opengl = { - driSupport = true; - driSupport32Bit = true; - extraPackages = with pkgs; [mangohud]; - extraPackages32 = with pkgs; [mangohud]; + hardware = { + opengl = { + driSupport = true; + driSupport32Bit = true; + extraPackages = with pkgs; [mangohud]; + extraPackages32 = with pkgs; [mangohud]; + }; + + steam-hardware.enable = true; + xpadneo.enable = true; }; environment.systemPackages = with pkgs; [ @@ -35,8 +40,6 @@ in { }) ]; - hardware.steam-hardware.enable = true; - programs = { xwayland.enable = true; steam = { From 0ce50fb0dee650714a67c681cef6505ca7caaf7d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 5 Feb 2024 21:46:55 +0100 Subject: [PATCH 0124/1295] add new laptop --- modules/desktop/gnome-home.nix | 1 + modules/hardware/vinzenz-lpt2.nix | 40 +++++++++++++++++++++++++++++++ vinzenz-lpt2.nix | 28 ++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 modules/hardware/vinzenz-lpt2.nix create mode 100644 vinzenz-lpt2.nix diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index bdc0d1e4..92a36358 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -34,6 +34,7 @@ in { "org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; clock-show-seconds = true; + show-battery-percentage = true; }; "org/gnome/tweaks" = { show-extensions-notice = false; diff --git a/modules/hardware/vinzenz-lpt2.nix b/modules/hardware/vinzenz-lpt2.nix new file mode 100644 index 00000000..5aec4f59 --- /dev/null +++ b/modules/hardware/vinzenz-lpt2.nix @@ -0,0 +1,40 @@ +# 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") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/e4dad0c8-26a1-45e9-bbd9-48565eb6574e"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + boot.initrd.luks.devices."luks-2c654ff2-3c42-48d3-a1e3-9545679afaa3".device = "/dev/disk/by-uuid/2c654ff2-3c42-48d3-a1e3-9545679afaa3"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/E2B7-2BC1"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix new file mode 100644 index 00000000..9db00740 --- /dev/null +++ b/vinzenz-lpt2.nix @@ -0,0 +1,28 @@ +{...}: { + imports = [ + (import ./modules { + hostName = "vinzenz-lpt2"; + enableHomeManager = true; + }) + ]; + + config = { + my = { + enabledUsers = ["vinzenz"]; + tailscale.enable = true; + desktop = { + enableGnome = true; + enableGaming = true; + enablePrinting = true; + }; + buildtools = { + dotnet = true; + }; + }; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ]; + }; +} From b3f1de1a7dd3887a872f0434c210d473cdd52a5b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 5 Feb 2024 22:44:35 +0100 Subject: [PATCH 0125/1295] lp2 config --- modules/desktop/gaming.nix | 10 +---- modules/desktop/gnome-home.nix | 1 + modules/hardware/intel.nix | 14 +++++++ modules/hardware/vinzenz-lpt2.nix | 61 ++++++++++++++----------------- modules/nixpkgs.nix | 2 +- 5 files changed, 45 insertions(+), 43 deletions(-) diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index 88b9c6aa..a8715a87 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -29,15 +29,7 @@ in { mangohud vulkan-tools glxinfo - - (lutris.override { - extraPkgs = pkgs: [ - # List package dependencies here - ]; - extraLibraries = pkgs: [ - # List library dependencies here - ]; - }) + lutris ]; programs = { diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index 92a36358..dfe09076 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -25,6 +25,7 @@ in { caffeine appindicator gsconnect + battery-health-charging ]); dconf.settings = { diff --git a/modules/hardware/intel.nix b/modules/hardware/intel.nix index 177ba552..d38b194d 100644 --- a/modules/hardware/intel.nix +++ b/modules/hardware/intel.nix @@ -9,6 +9,7 @@ in { options.my.hardware.intel = { cpu = lib.mkEnableOption "intel cpu"; iGpu = lib.mkEnableOption "intel integrated gpu"; + xe = lib.mkEnableOption "intel xe gpu"; }; config = lib.mkMerge [ @@ -35,5 +36,18 @@ in { nvtop-intel ]; }) + (lib.mkIf cfg.xe { + hardware.opengl = { + extraPackages = with pkgs; [ + intel-media-driver + vaapiIntel + vaapiVdpau + libvdpau-va-gl + ]; + }; + environment.systemPackages = with pkgs; [ + nvtop-intel + ]; + }) ]; } diff --git a/modules/hardware/vinzenz-lpt2.nix b/modules/hardware/vinzenz-lpt2.nix index 5aec4f59..a56f735d 100644 --- a/modules/hardware/vinzenz-lpt2.nix +++ b/modules/hardware/vinzenz-lpt2.nix @@ -1,40 +1,35 @@ -# 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") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/e4dad0c8-26a1-45e9-bbd9-48565eb6574e"; - fsType = "btrfs"; - options = [ "subvol=@" ]; +{...}: { + config = { + my.hardware = { + enableCommonDesktopSettings = true; + intel = { + cpu = true; + xe = true; + }; }; - boot.initrd.luks.devices."luks-2c654ff2-3c42-48d3-a1e3-9545679afaa3".device = "/dev/disk/by-uuid/2c654ff2-3c42-48d3-a1e3-9545679afaa3"; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/E2B7-2BC1"; - fsType = "vfat"; + boot.initrd = { + availableKernelModules = ["xhci_pci" "thunderbolt" "nvme"]; + luks.devices = { + "luks-2c654ff2-3c42-48d3-a1e3-9545679afaa3" = { + device = "/dev/disk/by-uuid/2c654ff2-3c42-48d3-a1e3-9545679afaa3"; + }; + }; }; - swapDevices = [ ]; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/e4dad0c8-26a1-45e9-bbd9-48565eb6574e"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + "/boot" = { + device = "/dev/disk/by-uuid/E2B7-2BC1"; + fsType = "vfat"; + }; + }; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + swapDevices = []; + }; } diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index fa3d0e42..5f7ae014 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -3,7 +3,7 @@ lib, ... }: let - unstable-commit-sha = "e92039b55bcd58469325ded85d4f58dd5a4eaf58"; + unstable-commit-sha = "e92b6015881907e698782c77641aa49298330223"; ultrastable-commit-sha = "5de0b32be6e85dc1a9404c75131316e4ffbc634c"; in { options.my.allowUnfreePackages = lib.mkOption { From 368596c1e44746758baac1b2037a399598b003dc Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 9 Feb 2024 18:51:59 +0100 Subject: [PATCH 0126/1295] more settings for new laptop --- modules/desktop/default.nix | 4 ++++ modules/desktop/gnome-home.nix | 19 +++++++++++++------ modules/hardware/vinzenz-lpt2.nix | 2 ++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 575b99e5..8b01ac28 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -31,6 +31,8 @@ in { # flatpak xdg-portal-kde crashes, otherwise this would be global flatpak.enable = true; + + fstrim.enable = true; }; # Enable sound with pipewire. @@ -106,6 +108,8 @@ in { "rider" "pycharm-professional" "jetbrains-toolbox" + + "anydesk" ]; fonts = { diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index dfe09076..03839a32 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -29,20 +29,24 @@ in { ]); dconf.settings = { - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; "org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; clock-show-seconds = true; show-battery-percentage = true; }; + "org/gnome/mutter" = { + edge-tiling = true; + }; + "org/gnome/desktop/peripherals/keyboard" = { + numlock-state = true; + }; + "org/gnome/desktop/peripherals/touchpad" = { + tap-to-click = true; + two-finger-scrolling-enabled = true; + }; "org/gnome/tweaks" = { show-extensions-notice = false; }; - "ca/desrt/dconf-editor" = { - show-warning = false; - }; "org/gnome/shell" = { disable-user-extensions = false; disabled-extensions = []; @@ -54,6 +58,9 @@ in { "gsconnect@andyholmes.github.io" ]; }; + "ca/desrt/dconf-editor" = { + show-warning = false; + }; }; gtk = { diff --git a/modules/hardware/vinzenz-lpt2.nix b/modules/hardware/vinzenz-lpt2.nix index a56f735d..3d866153 100644 --- a/modules/hardware/vinzenz-lpt2.nix +++ b/modules/hardware/vinzenz-lpt2.nix @@ -31,5 +31,7 @@ }; swapDevices = []; + + services.thermald.enable = true; }; } From e7da5bf627bb71afbc9442ba5a0250efc4ecb220 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 9 Feb 2024 18:52:20 +0100 Subject: [PATCH 0127/1295] add ronja to lp2 --- modules/users/ronja.nix | 2 +- modules/users/vinzenz.nix | 2 +- vinzenz-lpt2.nix | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/users/ronja.nix b/modules/users/ronja.nix index 79177922..8b53c537 100644 --- a/modules/users/ronja.nix +++ b/modules/users/ronja.nix @@ -13,7 +13,7 @@ in { name = "ronja"; description = "Ronja Spiegelberg"; home = "/home/ronja"; - extraGroups = ["networkmanager" "wheel" "games"]; + extraGroups = ["networkmanager" "wheel" "games" "podman"]; shell = pkgs.zsh; }; }; diff --git a/modules/users/vinzenz.nix b/modules/users/vinzenz.nix index 3c90d2fa..f93dd787 100644 --- a/modules/users/vinzenz.nix +++ b/modules/users/vinzenz.nix @@ -12,7 +12,7 @@ in { name = "vinzenz"; description = "Vinzenz Schroeter"; home = "/home/vinzenz"; - extraGroups = ["networkmanager" "wheel" "games" "dialout"]; + extraGroups = ["networkmanager" "wheel" "games" "dialout" "podman"]; shell = pkgs.zsh; }; }; diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index 9db00740..08c1f346 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -1,4 +1,4 @@ -{...}: { +{pkgs, ...}: { imports = [ (import ./modules { hostName = "vinzenz-lpt2"; @@ -8,7 +8,7 @@ config = { my = { - enabledUsers = ["vinzenz"]; + enabledUsers = ["vinzenz" "ronja"]; tailscale.enable = true; desktop = { enableGnome = true; @@ -20,9 +20,20 @@ }; }; + environment.systemPackages = with pkgs; [anydesk]; + + virtualisation.podman = { + enable = true; + }; + users.users.vinzenz.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + ]; + + users.users.ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' ]; }; } From a82113d1afdd937022a6a3a7f574ea874b94f814 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 9 Feb 2024 18:52:40 +0100 Subject: [PATCH 0128/1295] add neofetch globally --- modules/globalinstalls.nix | 1 + modules/server.nix | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix index 4c617d7e..b602f993 100644 --- a/modules/globalinstalls.nix +++ b/modules/globalinstalls.nix @@ -14,6 +14,7 @@ screen tldr + neofetch ]; }; diff --git a/modules/server.nix b/modules/server.nix index a3db9273..2fb6e404 100644 --- a/modules/server.nix +++ b/modules/server.nix @@ -14,11 +14,6 @@ in { networking.firewall = { enable = true; allowedTCPPortRanges = [ - # { - # # ssh - # from = 22; - # to = 22; - # } ]; }; }; From b900cc337fdee00620dd2c9a42bdad6779c1f057 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 23 Feb 2024 22:27:52 +0100 Subject: [PATCH 0129/1295] objective c --- modules/buildtools.nix | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/modules/buildtools.nix b/modules/buildtools.nix index 5aad730b..b9e6406d 100644 --- a/modules/buildtools.nix +++ b/modules/buildtools.nix @@ -11,6 +11,7 @@ in { dotnet = lib.mkEnableOption "include dotnet build tools"; rust = lib.mkEnableOption "include rust build tools"; jetbrains-remote-server = lib.mkEnableOption "setup jetbrais IDE installs so -remote-dev-server can be started"; + objective-c = lib.mkEnableOption "Objective-C with GNUStep"; }; config = lib.mkMerge [ @@ -30,7 +31,8 @@ in { systemPackages = with pkgs; [ dotnet-sdk_8 - zlib zlib.dev + zlib + zlib.dev openssl icu ]; @@ -56,10 +58,29 @@ in { pycharm-professional ]; my.allowUnfreePackages = [ - "rider" - "clion" - "pycharm-professional" - ]; + "rider" + "clion" + "pycharm-professional" + ]; + }) + (lib.mkIf cfg.objective-c { + environment.systemPackages = + (with pkgs.gnustep; [ + gui + make + gorm + base + back + system_preferences + projectcenter + libobjc + gworkspace + ]) + ++ (with pkgs; [ + clang-tools + clang + gnumake + ]); }) ]; } From 6911d314f41f9f4de915b40ea4e4e0a74b77cbc2 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 23 Feb 2024 22:30:00 +0100 Subject: [PATCH 0130/1295] more gnome settins --- modules/desktop/gnome-home.nix | 7 +++++++ modules/users/vinzenz-home.nix | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index 03839a32..d2156d8f 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -36,6 +36,7 @@ in { }; "org/gnome/mutter" = { edge-tiling = true; + dynamic-workspaces = true; }; "org/gnome/desktop/peripherals/keyboard" = { numlock-state = true; @@ -61,6 +62,12 @@ in { "ca/desrt/dconf-editor" = { show-warning = false; }; + "org/gnome/desktop/wm/keybindings" = { + switch-windows = ["Tab"]; + switch-windows-backward = ["Tab"]; + switch-applications = ["Tab"]; + switch-applications-backward = ["Tab"]; + }; }; gtk = { diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index ade07e85..a7c1abd1 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -172,9 +172,4 @@ in }; }; } - (lib.mkIf isGnomeEnabled { - home.packages = with pkgs; [ - fractal - ]; - }) ] From 648c853e7cf2596f94b98ac45c69c87afe3124ac Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 23 Feb 2024 22:30:43 +0100 Subject: [PATCH 0131/1295] deduplicate driver code --- modules/hardware/intel.nix | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/modules/hardware/intel.nix b/modules/hardware/intel.nix index d38b194d..2c51461a 100644 --- a/modules/hardware/intel.nix +++ b/modules/hardware/intel.nix @@ -17,7 +17,7 @@ in { boot.kernelModules = ["kvm-intel"]; hardware.cpu.intel.updateMicrocode = true; }) - (lib.mkIf cfg.iGpu { + (lib.mkIf (cfg.iGpu || cfg.xe) { hardware.opengl = { extraPackages = with pkgs; [ intel-media-driver @@ -36,18 +36,5 @@ in { nvtop-intel ]; }) - (lib.mkIf cfg.xe { - hardware.opengl = { - extraPackages = with pkgs; [ - intel-media-driver - vaapiIntel - vaapiVdpau - libvdpau-va-gl - ]; - }; - environment.systemPackages = with pkgs; [ - nvtop-intel - ]; - }) ]; } From fbacdee5781bb2b777880c9ff9a9985dfb747554 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 23 Feb 2024 22:31:46 +0100 Subject: [PATCH 0132/1295] a big mess of specific service config --- .gitignore | 1 + modules/hardware/vinzenz-lpt2.nix | 7 ++- vinzenz-lpt2.nix | 98 +++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8e21b1dd..d3f13a7c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .directory result +secrets diff --git a/modules/hardware/vinzenz-lpt2.nix b/modules/hardware/vinzenz-lpt2.nix index 3d866153..2f296c48 100644 --- a/modules/hardware/vinzenz-lpt2.nix +++ b/modules/hardware/vinzenz-lpt2.nix @@ -30,7 +30,12 @@ }; }; - swapDevices = []; + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 32 * 1024; + } + ]; services.thermald.enable = true; }; diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index 08c1f346..cc9fe02a 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -17,7 +17,14 @@ }; buildtools = { dotnet = true; + #objective-c = true; }; + + allowUnfreePackages = [ + "rider" + "clion" + "pycharm-professional" + ]; }; environment.systemPackages = with pkgs; [anydesk]; @@ -35,5 +42,96 @@ users.users.ronja.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' ]; + + # TODO: move to own module + services.openvscode-server = { + enable = true; + telemetryLevel = "off"; + port = 8542; + host = "127.0.0.1"; + extraPackages = with pkgs; [nodejs]; + }; + + services.nginx = { + enable = true; + virtualHosts = { + "vscode" = { + serverName = "vinzenz-lpt2"; + locations = { + "/" = { + proxyPass = "http://127.0.0.1:8542"; + extraConfig = '' + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; + ''; + }; + }; + + listen = [ + { + addr = "0.0.0.0"; + port = 5000; + ssl = true; + } + ]; + + serverAliases = ["localhost" "vinzenz-lpt2.lan"]; + addSSL = true; + sslCertificateKey = "/etc/nginx-secrets/nginx-selfsigned.key"; + sslCertificate = "/etc/nginx-secrets/nginx-selfsigned.crt"; + }; + "app" = { + serverName = "vinzenz-lpt2"; + locations = { + "/" = { + proxyPass = "http://127.0.0.1:3000/"; + }; + }; + + listen = [ + { + addr = "0.0.0.0"; + port = 5001; + ssl = true; + } + ]; + + serverAliases = ["localhost" "vinzenz-lpt2.lan"]; + addSSL = true; + sslCertificateKey = "/etc/nginx-secrets/nginx-selfsigned.key"; + sslCertificate = "/etc/nginx-secrets/nginx-selfsigned.crt"; + }; + "api" = { + serverName = "vinzenz-lpt2"; + locations = { + "/" = { + proxyPass = "http://127.0.0.1:3002/"; + }; + }; + + listen = [ + { + addr = "0.0.0.0"; + port = 5002; + ssl = true; + } + ]; + + serverAliases = ["localhost" "vinzenz-lpt2.lan"]; + addSSL = true; + sslCertificateKey = "/etc/nginx-secrets/nginx-selfsigned.key"; + sslCertificate = "/etc/nginx-secrets/nginx-selfsigned.crt"; + }; + }; + }; + + networking.firewall.allowedTCPPortRanges = [ + { + from = 5000; + to = 5005; + } + ]; }; } From 07a9c7a7f7c3c4037ffcac4fefb6a321796aa3cd Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 1 Mar 2024 17:39:37 +0100 Subject: [PATCH 0133/1295] add new key for lpt2 --- hetzner-vpn1.nix | 1 + vinzenz-pc2.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index e1e73ad2..f31a4451 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -17,6 +17,7 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' ]; }; } diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 8f0f22e3..d22319de 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -26,6 +26,7 @@ users.users.vinzenz.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' ]; }; } From 4f1138c9e33a74a2986ca03fbb45a78e4cceb0cf Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Mar 2024 12:09:21 +0100 Subject: [PATCH 0134/1295] WIP route traffic from vpn1 to other nodes --- hetzner-vpn1.nix | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index f31a4451..b6a9e56a 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -19,5 +19,60 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' ]; + + security.acme = { + acceptTerms = true; + defaults.email = "acme@zerforschen.plus"; + }; + + services.nginx = { + enable = true; + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + + virtualHosts = { + "vscode.services.zerforschen.plus" = { + addSSL = true; + enableACME = true; + locations."/" = { + extraConfig = '' + #proxy_set_header Host vinzenz-lpt2.donkey-pentatonic.ts.net; + proxy_ssl_verify = false; + ''; + proxyPass = "https://vinzenz-lpt2.donkey-pentatonic.ts.net:8542/"; + proxyWebsockets = true; + }; + }; + + "preon-app.services.zerforschen.plus" = { + enableACME = true; + addSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:3000/"; + }; + }; + + "preon-api.services.zerforschen.plus" = { + enableACME = true; + addSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:3002/"; + }; + }; + }; + }; + + networking.firewall = { + checkReversePath = "loose"; + allowedTCPPortRanges = [ + { + from = 5000; + to = 5005; + } + ]; + allowedTCPPorts = [80 443]; + }; }; } From 3945a335b12ed6a33b606904be17e21f3795031a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Mar 2024 13:02:14 +0100 Subject: [PATCH 0135/1295] simplify firewall config --- hetzner-vpn1.nix | 12 +----------- modules/default.nix | 6 +++++- modules/desktop/default.nix | 1 - modules/desktop/gaming.nix | 9 +++------ modules/server.nix | 20 -------------------- 5 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 modules/server.nix diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index b6a9e56a..c534929c 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -9,7 +9,6 @@ config = { my = { enabledUsers = []; - server.enable = true; tailscale.enable = true; }; @@ -64,15 +63,6 @@ }; }; - networking.firewall = { - checkReversePath = "loose"; - allowedTCPPortRanges = [ - { - from = 5000; - to = 5005; - } - ]; - allowedTCPPorts = [80 443]; - }; + networking.firewall.allowedTCPPorts = [80 443]; }; } diff --git a/modules/default.nix b/modules/default.nix index b6f047d4..f794bcf6 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -4,7 +4,6 @@ modulesCfg: {lib, ...}: { ./i18n.nix ./nixpkgs.nix ./globalinstalls.nix - ./server.nix ./sshd.nix ./tailscale.nix ./buildtools.nix @@ -17,5 +16,10 @@ modulesCfg: {lib, ...}: { config = { my.modulesCfg = modulesCfg; + + networking.firewall = { + enable = true; + checkReversePath = "loose"; + }; }; } diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 8b01ac28..005a2103 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -59,7 +59,6 @@ in { networkmanager.enable = true; firewall = { - enable = true; allowedTCPPortRanges = [ { # KDE Connect / gsconnect diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index a8715a87..5015ca22 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -41,12 +41,9 @@ in { }; }; - networking.firewall.allowedUDPPortRanges = [ - { - # Factorio - from = 34197; - to = 34197; - } + networking.firewall.allowedUDPPorts = [ + # Factorio + 34197 ]; my.allowUnfreePackages = [ diff --git a/modules/server.nix b/modules/server.nix deleted file mode 100644 index 2fb6e404..00000000 --- a/modules/server.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - cfg = config.my.server; -in { - options.my.server = { - enable = lib.mkEnableOption "server role"; - }; - - config = lib.mkIf cfg.enable { - networking.firewall = { - enable = true; - allowedTCPPortRanges = [ - ]; - }; - }; -} From c94e085e666f6ab88d8828251cde20837f19a6b4 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Mar 2024 13:05:41 +0100 Subject: [PATCH 0136/1295] vscode works now --- hetzner-vpn1.nix | 5 ++- vinzenz-lpt2.nix | 86 +++--------------------------------------------- 2 files changed, 6 insertions(+), 85 deletions(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index c534929c..78898032 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -37,10 +37,9 @@ enableACME = true; locations."/" = { extraConfig = '' - #proxy_set_header Host vinzenz-lpt2.donkey-pentatonic.ts.net; - proxy_ssl_verify = false; + proxy_bind 100.88.118.60; ''; - proxyPass = "https://vinzenz-lpt2.donkey-pentatonic.ts.net:8542/"; + proxyPass = "http://vinzenz-lpt2:8542/"; proxyWebsockets = true; }; }; diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index cc9fe02a..b52771dc 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -43,95 +43,17 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' ]; - # TODO: move to own module services.openvscode-server = { enable = true; telemetryLevel = "off"; port = 8542; - host = "127.0.0.1"; + host = "100.103.93.126"; # tailscale extraPackages = with pkgs; [nodejs]; }; - services.nginx = { - enable = true; - virtualHosts = { - "vscode" = { - serverName = "vinzenz-lpt2"; - locations = { - "/" = { - proxyPass = "http://127.0.0.1:8542"; - extraConfig = '' - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - proxy_set_header Host $host; - ''; - }; - }; - - listen = [ - { - addr = "0.0.0.0"; - port = 5000; - ssl = true; - } - ]; - - serverAliases = ["localhost" "vinzenz-lpt2.lan"]; - addSSL = true; - sslCertificateKey = "/etc/nginx-secrets/nginx-selfsigned.key"; - sslCertificate = "/etc/nginx-secrets/nginx-selfsigned.crt"; - }; - "app" = { - serverName = "vinzenz-lpt2"; - locations = { - "/" = { - proxyPass = "http://127.0.0.1:3000/"; - }; - }; - - listen = [ - { - addr = "0.0.0.0"; - port = 5001; - ssl = true; - } - ]; - - serverAliases = ["localhost" "vinzenz-lpt2.lan"]; - addSSL = true; - sslCertificateKey = "/etc/nginx-secrets/nginx-selfsigned.key"; - sslCertificate = "/etc/nginx-secrets/nginx-selfsigned.crt"; - }; - "api" = { - serverName = "vinzenz-lpt2"; - locations = { - "/" = { - proxyPass = "http://127.0.0.1:3002/"; - }; - }; - - listen = [ - { - addr = "0.0.0.0"; - port = 5002; - ssl = true; - } - ]; - - serverAliases = ["localhost" "vinzenz-lpt2.lan"]; - addSSL = true; - sslCertificateKey = "/etc/nginx-secrets/nginx-selfsigned.key"; - sslCertificate = "/etc/nginx-secrets/nginx-selfsigned.crt"; - }; - }; + networking.firewall = { + checkReversePath = "loose"; + allowedTCPPorts = [8542]; }; - - networking.firewall.allowedTCPPortRanges = [ - { - from = 5000; - to = 5005; - } - ]; }; } From 2ff6ddc89fd084f1756fae281e37fcd25c3280c6 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Mar 2024 13:11:01 +0100 Subject: [PATCH 0137/1295] more frequent nix gc --- modules/nixpkgs.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index 5f7ae014..231996ec 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -46,8 +46,8 @@ in { nix.gc = { automatic = true; - dates = "monthly"; - options = "--delete-older-than 30d"; + dates = "daily"; + options = "--delete-older-than 7d"; }; documentation = { From 4439c7f9de84ea8fe915b852c6c6823df1d45fb3 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Mar 2024 13:18:05 +0100 Subject: [PATCH 0138/1295] wip pam auth --- hetzner-vpn1.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 78898032..67e7b9b7 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -24,8 +24,15 @@ defaults.email = "acme@zerforschen.plus"; }; + security.pam.services.nginx.setEnvironment = false; + systemd.services.nginx.serviceConfig = { + SupplementaryGroups = ["shadow"]; + }; + services.nginx = { enable = true; + additionalModules = [pkgs.nginxModules.pam]; + recommendedProxySettings = true; recommendedTlsSettings = true; recommendedGzipSettings = true; @@ -37,9 +44,12 @@ enableACME = true; locations."/" = { extraConfig = '' + # bind to tailscale ip proxy_bind 100.88.118.60; + auth_pam "Password Required"; + auth_pam_service_name "nginx"; ''; - proxyPass = "http://vinzenz-lpt2:8542/"; + proxyPass = "http://vinzenz-lpt2:8542/"; #tailscale magic dns proxyWebsockets = true; }; }; From c93aa33aebccf0e05423f71160da873f587c5141 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Mar 2024 13:26:32 +0100 Subject: [PATCH 0139/1295] no connection token for vscode --- vinzenz-lpt2.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index b52771dc..9e5ec12a 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -48,6 +48,7 @@ telemetryLevel = "off"; port = 8542; host = "100.103.93.126"; # tailscale + withoutConnectionToken = true; extraPackages = with pkgs; [nodejs]; }; From 2a0f184fac2e0d292385b152b296a276ef5765cb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Mar 2024 13:27:17 +0100 Subject: [PATCH 0140/1295] pam auth works now --- hetzner-vpn1.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 67e7b9b7..4f3f751d 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -1,4 +1,4 @@ -{...}: { +{pkgs, ...}: { imports = [ (import ./modules { hostName = "hetzner-vpn1"; @@ -8,7 +8,7 @@ config = { my = { - enabledUsers = []; + enabledUsers = ["ronja" "vinzenz"]; tailscale.enable = true; }; From 84657bb2a842aa77d34c4c2c5277e09be243543d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Mar 2024 13:46:13 +0100 Subject: [PATCH 0141/1295] dry services config --- hetzner-vpn1.nix | 58 ++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 4f3f751d..5a3f6484 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -1,4 +1,24 @@ -{pkgs, ...}: { +{ + pkgs, + lib, + ... +}: let + servicesDomain = "services.zerforschen.plus"; + mkServiceConfig = port: { + addSSL = true; + enableACME = true; + locations."/" = { + extraConfig = '' + # bind to tailscale ip + proxy_bind 100.88.118.60; + # pam auth + auth_pam "Password Required"; + auth_pam_service_name "nginx"; + ''; + proxyPass = "http://vinzenz-lpt2.donkey-pentatonic.ts.net:${toString port}/"; + }; + }; +in { imports = [ (import ./modules { hostName = "hetzner-vpn1"; @@ -39,36 +59,12 @@ recommendedOptimisation = true; virtualHosts = { - "vscode.services.zerforschen.plus" = { - addSSL = true; - enableACME = true; - locations."/" = { - extraConfig = '' - # bind to tailscale ip - proxy_bind 100.88.118.60; - auth_pam "Password Required"; - auth_pam_service_name "nginx"; - ''; - proxyPass = "http://vinzenz-lpt2:8542/"; #tailscale magic dns - proxyWebsockets = true; - }; - }; - - "preon-app.services.zerforschen.plus" = { - enableACME = true; - addSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:3000/"; - }; - }; - - "preon-api.services.zerforschen.plus" = { - enableACME = true; - addSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:3002/"; - }; - }; + "preon-app.${servicesDomain}" = mkServiceConfig 8541; + "preon-api.${servicesDomain}" = mkServiceConfig 8542; + "vscode.${servicesDomain}" = lib.mkMerge [ + (mkServiceConfig 8543) + {locations."/" .proxyWebsockets = true;} + ]; }; }; From 1cf414683be4c239995c77cf8425d4c05d1eb109 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Mar 2024 13:54:39 +0100 Subject: [PATCH 0142/1295] hostname parameter --- hetzner-vpn1.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 5a3f6484..f6c355e1 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -4,7 +4,7 @@ ... }: let servicesDomain = "services.zerforschen.plus"; - mkServiceConfig = port: { + mkServiceConfig = host: port: { addSSL = true; enableACME = true; locations."/" = { @@ -15,9 +15,10 @@ auth_pam "Password Required"; auth_pam_service_name "nginx"; ''; - proxyPass = "http://vinzenz-lpt2.donkey-pentatonic.ts.net:${toString port}/"; + proxyPass = "http://${host}:${toString port}/"; }; }; + lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net"; in { imports = [ (import ./modules { @@ -59,10 +60,10 @@ in { recommendedOptimisation = true; virtualHosts = { - "preon-app.${servicesDomain}" = mkServiceConfig 8541; - "preon-api.${servicesDomain}" = mkServiceConfig 8542; + "preon-app.${servicesDomain}" = mkServiceConfig lpt2 8541; + "preon-api.${servicesDomain}" = mkServiceConfig lpt2 8542; "vscode.${servicesDomain}" = lib.mkMerge [ - (mkServiceConfig 8543) + (mkServiceConfig lpt2 8543) {locations."/" .proxyWebsockets = true;} ]; }; From d17023aa899cfdda46d4567c22e255204cfe43ef Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 3 Mar 2024 12:45:55 +0100 Subject: [PATCH 0143/1295] fix ports --- hetzner-vpn1.nix | 6 +++--- vinzenz-lpt2.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index f6c355e1..6da1829d 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -60,12 +60,12 @@ in { recommendedOptimisation = true; virtualHosts = { - "preon-app.${servicesDomain}" = mkServiceConfig lpt2 8541; - "preon-api.${servicesDomain}" = mkServiceConfig lpt2 8542; "vscode.${servicesDomain}" = lib.mkMerge [ - (mkServiceConfig lpt2 8543) + (mkServiceConfig lpt2 8542) {locations."/" .proxyWebsockets = true;} ]; + "preon-app.${servicesDomain}" = mkServiceConfig lpt2 8543; + "preon-api.${servicesDomain}" = mkServiceConfig lpt2 8544; }; }; diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index 9e5ec12a..4cb89df2 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -54,7 +54,7 @@ networking.firewall = { checkReversePath = "loose"; - allowedTCPPorts = [8542]; + allowedTCPPorts = [8542 8543 8544]; }; }; } From 91f5f886d73000964952627d0e7d26676edef79c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Mar 2024 13:36:43 +0100 Subject: [PATCH 0144/1295] move vscode server to pc2 --- vinzenz-lpt2.nix | 14 -------------- vinzenz-pc2.nix | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index 4cb89df2..9f57054c 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -42,19 +42,5 @@ users.users.ronja.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' ]; - - services.openvscode-server = { - enable = true; - telemetryLevel = "off"; - port = 8542; - host = "100.103.93.126"; # tailscale - withoutConnectionToken = true; - extraPackages = with pkgs; [nodejs]; - }; - - networking.firewall = { - checkReversePath = "loose"; - allowedTCPPorts = [8542 8543 8544]; - }; }; } diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index d22319de..2a493098 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -1,4 +1,4 @@ -{...}: { +{pkgs, ...}: { imports = [ (import ./modules { hostName = "vinzenz-pc2"; @@ -28,5 +28,18 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' ]; + + services.openvscode-server = { + enable = true; + telemetryLevel = "off"; + port = 8542; + host = "100.125.93.127"; # tailscale + withoutConnectionToken = true; + extraPackages = with pkgs; [nodejs gitFull gh]; + }; + + networking.firewall = { + allowedTCPPorts = [8542 8543 8544]; + }; }; } From ac7b33374155f237f0c857e31275d9bedaa46f1a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Mar 2024 13:43:27 +0100 Subject: [PATCH 0145/1295] route domains to new service location --- hetzner-vpn1.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 6da1829d..b4761383 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -8,6 +8,7 @@ addSSL = true; enableACME = true; locations."/" = { + proxyPass = "http://${host}:${toString port}/"; extraConfig = '' # bind to tailscale ip proxy_bind 100.88.118.60; @@ -15,10 +16,10 @@ auth_pam "Password Required"; auth_pam_service_name "nginx"; ''; - proxyPass = "http://${host}:${toString port}/"; }; }; lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net"; + pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; in { imports = [ (import ./modules { @@ -61,10 +62,10 @@ in { virtualHosts = { "vscode.${servicesDomain}" = lib.mkMerge [ - (mkServiceConfig lpt2 8542) + (mkServiceConfig pc2 8542) {locations."/" .proxyWebsockets = true;} ]; - "preon-app.${servicesDomain}" = mkServiceConfig lpt2 8543; + "preon-app.${servicesDomain}" = mkServiceConfig pc2 8543; "preon-api.${servicesDomain}" = mkServiceConfig lpt2 8544; }; }; From 1bc68837d329a55885958ee6e2b488cc02da9322 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Mar 2024 13:44:26 +0100 Subject: [PATCH 0146/1295] CORS requests are allowed without basic auth --- hetzner-vpn1.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index b4761383..010f7819 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -13,8 +13,10 @@ # bind to tailscale ip proxy_bind 100.88.118.60; # pam auth - auth_pam "Password Required"; - auth_pam_service_name "nginx"; + limit_except OPTIONS { + auth_pam "Password Required"; + auth_pam_service_name "nginx"; + } ''; }; }; From d4289402997abc296532ff58de16be8c0cf27f09 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Mar 2024 14:08:14 +0100 Subject: [PATCH 0147/1295] route preon api to pc2 --- hetzner-vpn1.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index 010f7819..fda6b56c 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -68,7 +68,7 @@ in { {locations."/" .proxyWebsockets = true;} ]; "preon-app.${servicesDomain}" = mkServiceConfig pc2 8543; - "preon-api.${servicesDomain}" = mkServiceConfig lpt2 8544; + "preon-api.${servicesDomain}" = mkServiceConfig pc2 8544; }; }; From 99f553a4c6aa15a181874d8a43e4d057e2d8776c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Mar 2024 17:56:02 +0100 Subject: [PATCH 0148/1295] js, wip net native aot --- modules/buildtools.nix | 32 ++++++++++++++++++++++++++++++-- modules/desktop/default.nix | 37 +++++++++++++++++++++++++++---------- modules/nixpkgs.nix | 4 ++-- vinzenz-lpt2.nix | 1 + 4 files changed, 60 insertions(+), 14 deletions(-) diff --git a/modules/buildtools.nix b/modules/buildtools.nix index b9e6406d..c73337c6 100644 --- a/modules/buildtools.nix +++ b/modules/buildtools.nix @@ -5,6 +5,9 @@ ... }: let cfg = config.my.buildtools; + dotnetPackage = with pkgs; (dotnetCorePackages.combinePackages [ + dotnet-sdk_8 + ]); in { options.my.buildtools = { native = lib.mkEnableOption "include native build tools"; @@ -12,6 +15,7 @@ in { rust = lib.mkEnableOption "include rust build tools"; jetbrains-remote-server = lib.mkEnableOption "setup jetbrais IDE installs so -remote-dev-server can be started"; objective-c = lib.mkEnableOption "Objective-C with GNUStep"; + js = lib.mkEnableOption "node stuff"; }; config = lib.mkMerge [ @@ -22,24 +26,43 @@ in { gnumake gcc gdb - llvmPackages_latest.llvm + llvmPackages.llvm llvmPackages.clangUseLLVM ]; }) (lib.mkIf cfg.dotnet { environment = { systemPackages = with pkgs; [ - dotnet-sdk_8 + unstable.jetbrains.jdk + unstable.jetbrains.rider + + dotnetPackage zlib zlib.dev openssl icu + icu.dev + + # native aot + gcc + libunwind ]; variables = { DOTNET_CLI_TELEMETRY_OPTOUT = "1"; }; }; + programs.nix-ld.libraries = with pkgs; [ + # native aot + libunwind + icu + zlib + zlib.dev + openssl + icu + icu.dev + dotnetPackage + ]; }) (lib.mkIf cfg.rust { environment.systemPackages = with pkgs; [ @@ -82,5 +105,10 @@ in { gnumake ]); }) + (lib.mkIf cfg.js { + environment.systemPackages = with pkgs; [ + nodejs + ]; + }) ]; } diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 005a2103..923be0fd 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -53,6 +53,25 @@ in { enable = true; languagePacks = ["en-US" "de"]; }; + nix-ld = { + enable = true; + libraries = with pkgs; [ + stdenv.cc.cc + zlib + zstd + curl + openssl + attr + libssh + bzip2 + libxml2 + acl + libsodium + util-linux + xz + systemd + ]; + }; }; networking = { @@ -86,17 +105,15 @@ in { ''; }; - environment = { - systemPackages = with pkgs; [ - lm_sensors + environment.systemPackages = with pkgs; [ + lm_sensors - # office - libreoffice-qt - hunspell - hunspellDicts.de-de - hunspellDicts.en-us-large - ]; - }; + # office + libreoffice-qt + hunspell + hunspellDicts.de-de + hunspellDicts.en-us-large + ]; nixpkgs.config.permittedInsecurePackages = []; diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index 231996ec..6f282ae1 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -3,8 +3,8 @@ lib, ... }: let - unstable-commit-sha = "e92b6015881907e698782c77641aa49298330223"; - ultrastable-commit-sha = "5de0b32be6e85dc1a9404c75131316e4ffbc634c"; + unstable-commit-sha = "9df3e30ce24fd28c7b3e2de0d986769db5d6225d"; + ultrastable-commit-sha = "2be119add7b37dc535da2dd4cba68e2cf8d1517e"; in { options.my.allowUnfreePackages = lib.mkOption { type = lib.types.listOf lib.types.str; diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index 9f57054c..b41fcd2d 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -18,6 +18,7 @@ buildtools = { dotnet = true; #objective-c = true; + js = true; }; allowUnfreePackages = [ From 1ef2f2c4646a170ea87883bf813166d265a04c26 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Mar 2024 18:11:59 +0100 Subject: [PATCH 0149/1295] ide only on desktop, remove llvm --- modules/buildtools.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/buildtools.nix b/modules/buildtools.nix index c73337c6..da1bd304 100644 --- a/modules/buildtools.nix +++ b/modules/buildtools.nix @@ -26,16 +26,11 @@ in { gnumake gcc gdb - llvmPackages.llvm - llvmPackages.clangUseLLVM ]; }) (lib.mkIf cfg.dotnet { environment = { systemPackages = with pkgs; [ - unstable.jetbrains.jdk - unstable.jetbrains.rider - dotnetPackage zlib @@ -64,6 +59,14 @@ in { dotnetPackage ]; }) + (lib.mkIf (cfg.dotnet || config.my.desktop.enable) { + environment = { + systemPackages = with pkgs; [ + unstable.jetbrains.jdk + unstable.jetbrains.rider + ]; + }; + }) (lib.mkIf cfg.rust { environment.systemPackages = with pkgs; [ cargo From 7e331074b02d97de3e66a260155364040a094b5d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Mar 2024 09:18:44 +0100 Subject: [PATCH 0150/1295] high res boot menu --- modules/hardware/common-desktop.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/hardware/common-desktop.nix b/modules/hardware/common-desktop.nix index a427d18c..c0e3d6f1 100644 --- a/modules/hardware/common-desktop.nix +++ b/modules/hardware/common-desktop.nix @@ -16,13 +16,16 @@ in { initrd.supportedFilesystems = ["btrfs"]; consoleLogLevel = 0; initrd.verbose = false; + plymouth.enable = true; loader = { - systemd-boot.enable = true; timeout = 3; efi.canTouchEfiVariables = true; + systemd-boot = { + enable = true; + editor = false; # do not allow changing kernel parameters + consoleMode = "max"; + }; }; - - plymouth.enable = true; }; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking From 88d86b149e10281c98c4524f86f90d678002125c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 19 Apr 2024 12:27:51 +0200 Subject: [PATCH 0151/1295] add some packages --- modules/desktop/default.nix | 2 ++ modules/desktop/gnome-home.nix | 1 + modules/users/vinzenz-home.nix | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 923be0fd..f6df8931 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -113,6 +113,8 @@ in { hunspell hunspellDicts.de-de hunspellDicts.en-us-large + + gnumake ]; nixpkgs.config.permittedInsecurePackages = []; diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index d2156d8f..fd5d4d1b 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -16,6 +16,7 @@ in { gnome-builder meld simple-scan + pinta ] ++ (with gnome; [ dconf-editor diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index a7c1abd1..d099ad51 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -32,7 +32,6 @@ in home-manager.enable = true; fzf.enable = true; - mangohud.enable = true; zsh = { initExtra = '' @@ -97,6 +96,7 @@ in mhutchie.git-graph rust-lang.rust-analyzer bungcip.better-toml + llvm-vs-code-extensions.vscode-clangd ]; userSettings = { "git.autofetch" = true; From b01a072cc91b587fd614cf88c65d2bcee8c12a9a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 2 May 2024 13:02:12 +0200 Subject: [PATCH 0152/1295] add ferral gamemode --- modules/desktop/gaming.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix index 5015ca22..81e4011a 100644 --- a/modules/desktop/gaming.nix +++ b/modules/desktop/gaming.nix @@ -39,6 +39,7 @@ in { remotePlay.openFirewall = true; dedicatedServer.openFirewall = true; }; + gamemode.enable = true; }; networking.firewall.allowedUDPPorts = [ From 96483fbaefdda6130a34575908e6e749f776cccd Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 2 May 2024 13:02:32 +0200 Subject: [PATCH 0153/1295] enable fwupd on desktops --- modules/hardware/common-desktop.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/hardware/common-desktop.nix b/modules/hardware/common-desktop.nix index c0e3d6f1..05047a28 100644 --- a/modules/hardware/common-desktop.nix +++ b/modules/hardware/common-desktop.nix @@ -36,10 +36,13 @@ in { # networking.interfaces.eno1.useDHCP = lib.mkDefault true; # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - hardware.enableRedistributableFirmware = true; + hardware = { + enableRedistributableFirmware = true; + bluetooth.enable = true; + }; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.bluetooth.enable = true; + services.fwupd.enable = true; }; } From cca472cf1251fa90d9de6849b1ccd48e1acb0e82 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 2 May 2024 15:35:04 +0200 Subject: [PATCH 0154/1295] enable bolt for thunderbolt security --- modules/hardware/vinzenz-lpt2.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hardware/vinzenz-lpt2.nix b/modules/hardware/vinzenz-lpt2.nix index 2f296c48..d220276b 100644 --- a/modules/hardware/vinzenz-lpt2.nix +++ b/modules/hardware/vinzenz-lpt2.nix @@ -38,5 +38,6 @@ ]; services.thermald.enable = true; + services.hardware.bolt.enable = true; # thunderbolt security }; } From 5ab99e7d607016519fc0f5d95ecc8204d9060dc5 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 2 May 2024 15:35:19 +0200 Subject: [PATCH 0155/1295] ssh_config --- modules/users/vinzenz-home.nix | 50 +++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index d099ad51..155708b3 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -140,7 +140,7 @@ in ]; }; - eza = { + eza = { enable = true; git = true; icons = true; @@ -152,6 +152,54 @@ in }; # checked https://rycee.gitlab.io/home-manager/options.html until "programs.notmuch" + + ssh = { + enable = true; + matchBlocks = { + "vpn1" = { + host = "vpn1 hetzner-vpn1"; + hostname = "157.90.146.125"; # 2a01:4f8:c012:7137::/64 + user = "root"; + }; + "vpn1-ts" = { + host = "vpn1-ts hetzner-vpn1.donkey-pentatonic.ts.net"; + hostname = "hetzner-vpn1.donkey-pentatonic.ts.net"; + user = "root"; + }; + "openwrt" = { + host = "openwrt openwrt.lan"; + hostname = "openwrt.lan"; + user = "root"; + }; + "openwrt-ts" = { + hostname = "openwrt.donkey-pentatonic.ts.net"; + port = 2222; + user = "root"; + }; + "openwrt-j" = { + hostname = "openwrt.donkey-pentatonic.ts.net"; + proxyJump = "vpn1"; + port = 2222; + user = "root"; + }; + "pc2-power" = { + hostname = "openwrt.donkey-pentatonic.ts.net"; + proxyJump = "vpn1"; + port = 2222; + user = "pc2-power"; + }; + "avd-power" = { + # hostname = "2001:678:560:23:9833:63ff:fe2d:f477" + # hostname = "195.160.172.25"; + hostname = "avd-jumphost.club.berlin.ccc.de"; + user = "power"; + }; + "avd" = { + hostname = "avd.club.berlin.ccc.de"; + user = "vinzenz"; + }; + }; + }; }; editorconfig = { From 3b72d80fb7b339294dd43a2e95d6c1c45f4b508a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 2 May 2024 15:49:00 +0200 Subject: [PATCH 0156/1295] extended ssh keys for vpn1 --- hetzner-vpn1.nix | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix index fda6b56c..7a06a079 100644 --- a/hetzner-vpn1.nix +++ b/hetzner-vpn1.nix @@ -36,12 +36,23 @@ in { tailscale.enable = true; }; - users.users.root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; + users.users = { + root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + ]; + }; security.acme = { acceptTerms = true; From 18ecc85b770e0c811aeb9440def6304865b1a718 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 25 May 2024 11:23:22 +0200 Subject: [PATCH 0157/1295] update build tools --- modules/buildtools.nix | 71 +++++++++++++++++++++--------------------- vinzenz-lpt2.nix | 3 +- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/modules/buildtools.nix b/modules/buildtools.nix index da1bd304..bcb260b4 100644 --- a/modules/buildtools.nix +++ b/modules/buildtools.nix @@ -5,7 +5,8 @@ ... }: let cfg = config.my.buildtools; - dotnetPackage = with pkgs; (dotnetCorePackages.combinePackages [ + isDesktop = config.my.desktop.enable; + dotnetPackage = with pkgs.unstable; (dotnetCorePackages.combinePackages [ dotnet-sdk_8 ]); in { @@ -16,18 +17,20 @@ in { jetbrains-remote-server = lib.mkEnableOption "setup jetbrais IDE installs so -remote-dev-server can be started"; objective-c = lib.mkEnableOption "Objective-C with GNUStep"; js = lib.mkEnableOption "node stuff"; + android = lib.mkEnableOption "android development"; + python = lib.mkEnableOption "generic python 3"; }; config = lib.mkMerge [ - (lib.mkIf cfg.native - { - environment.systemPackages = with pkgs; [ - cmake - gnumake - gcc - gdb - ]; - }) + (lib.mkIf cfg.native { + environment.systemPackages = with pkgs; [ + cmake + gnumake + gcc + gdb + ]; + }) + (lib.mkIf cfg.dotnet { environment = { systemPackages = with pkgs; [ @@ -59,37 +62,28 @@ in { dotnetPackage ]; }) - (lib.mkIf (cfg.dotnet || config.my.desktop.enable) { - environment = { - systemPackages = with pkgs; [ - unstable.jetbrains.jdk - unstable.jetbrains.rider - ]; - }; + + (lib.mkIf cfg.js { + environment.systemPackages = with pkgs; [ + nodejs + ]; }) + (lib.mkIf cfg.rust { environment.systemPackages = with pkgs; [ - cargo - rustc - rustfmt - clippy - cargo-generate + rustup + musl ]; }) + (lib.mkIf cfg.jetbrains-remote-server { - environment.systemPackages = with pkgs.jetbrains; [ - jdk # required for all of them - rider - clion - pycharm-professional - ]; - my.allowUnfreePackages = [ - "rider" - "clion" - "pycharm-professional" - ]; + my.buildtools.dotnet = true; + my.buildtools.native = true; + my.buildtools.python = true; }) + (lib.mkIf cfg.objective-c { + my.buildtools.native = true; environment.systemPackages = (with pkgs.gnustep; [ gui @@ -105,13 +99,18 @@ in { ++ (with pkgs; [ clang-tools clang - gnumake ]); }) - (lib.mkIf cfg.js { + + (lib.mkIf cfg.android { environment.systemPackages = with pkgs; [ - nodejs + android-tools + android-udev-rules ]; }) + + (lib.mkIf cfg.python { + environment.systemPackages = with pkgs; [python3 python3Packages.pip]; + }) ]; } diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index b41fcd2d..086c1857 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -17,8 +17,9 @@ }; buildtools = { dotnet = true; - #objective-c = true; js = true; + rust = true; + native = true; }; allowUnfreePackages = [ From c4a99e93ed0f1f823701a9dc08c0bdd281763253 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 25 May 2024 11:24:00 +0200 Subject: [PATCH 0158/1295] update home config --- modules/desktop/gnome-home.nix | 1 + modules/users/ronja.nix | 2 +- modules/users/vinzenz-home.nix | 28 +++++++++++++++++++++++++--- modules/users/vinzenz.nix | 5 +++-- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index fd5d4d1b..c7481a75 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -27,6 +27,7 @@ in { appindicator gsconnect battery-health-charging + quick-settings-tweaker ]); dconf.settings = { diff --git a/modules/users/ronja.nix b/modules/users/ronja.nix index 8b53c537..61323ba3 100644 --- a/modules/users/ronja.nix +++ b/modules/users/ronja.nix @@ -11,7 +11,7 @@ in { users.users.ronja = { isNormalUser = true; name = "ronja"; - description = "Ronja Spiegelberg"; + description = "Ronja"; home = "/home/ronja"; extraGroups = ["networkmanager" "wheel" "games" "podman"]; shell = pkgs.zsh; diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 155708b3..942f5e9d 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -36,6 +36,7 @@ in zsh = { initExtra = '' eval "$(direnv hook zsh)"; + export PATH=$PATH:/home/vinzenz/.cargo/bin ''; shellAliases = { @@ -87,16 +88,17 @@ in bbenoist.nix ms-python.python kamadorueda.alejandra - #samuelcolvin.jinjahtml editorconfig.editorconfig - #KnisterPeter.vscode-github yzhang.markdown-all-in-one redhat.vscode-yaml pkief.material-icon-theme mhutchie.git-graph rust-lang.rust-analyzer - bungcip.better-toml + tamasfe.even-better-toml llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + vadimcn.vscode-lldb + ms-dotnettools.csharp ]; userSettings = { "git.autofetch" = true; @@ -219,5 +221,25 @@ in }; }; }; + + home.file."policy.json" = { + target = ".config/containers/policy.json"; + text = '' + { + "default": [ + { + "type": "insecureAcceptAnything" + } + ], + "transports": + { + "docker-daemon": + { + "": [{"type":"insecureAcceptAnything"}] + } + } + } + ''; + }; } ] diff --git a/modules/users/vinzenz.nix b/modules/users/vinzenz.nix index f93dd787..08c30112 100644 --- a/modules/users/vinzenz.nix +++ b/modules/users/vinzenz.nix @@ -10,10 +10,11 @@ in { users.users.vinzenz = { isNormalUser = true; name = "vinzenz"; - description = "Vinzenz Schroeter"; + description = "Vinzenz"; home = "/home/vinzenz"; - extraGroups = ["networkmanager" "wheel" "games" "dialout" "podman"]; + extraGroups = ["networkmanager" "wheel" "games" "dialout" "podman" "nginx"]; shell = pkgs.zsh; + autoSubUidGidRange = true; }; }; } From 9b8947a1a7170c717a9f07ca40f2b3a980aaeefe Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 21 Jun 2024 17:11:13 +0200 Subject: [PATCH 0159/1295] add key to pc2 --- vinzenz-pc2.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 2a493098..b942d3cf 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -29,6 +29,10 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' ]; + users.users.ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' + ]; + services.openvscode-server = { enable = true; telemetryLevel = "off"; From d355e877cd4cc20a6d5b97b1c4b5d85df93ce823 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 21 Jun 2024 17:12:04 +0200 Subject: [PATCH 0160/1295] change vscode-server, WOL --- vinzenz-pc2.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index b942d3cf..82b0dd65 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -39,11 +39,19 @@ port = 8542; host = "100.125.93.127"; # tailscale withoutConnectionToken = true; - extraPackages = with pkgs; [nodejs gitFull gh]; + extraPackages = with pkgs; [nodejs gitFull gh direnv]; }; - networking.firewall = { - allowedTCPPorts = [8542 8543 8544]; + virtualisation.podman = { + enable = true; + }; + + networking = { + firewall = { + allowedTCPPorts = [8542 8543 8544 80]; + }; + + interfaces.eno1.wakeOnLan.enable = true; }; }; } From 246eca567ad68701d093e81c31da5ddf8cab86c0 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 21 Jun 2024 17:13:58 +0200 Subject: [PATCH 0161/1295] update to 24.05 --- modules/desktop/default.nix | 5 +++-- modules/desktop/gnome.nix | 5 +++-- modules/desktop/printing.nix | 2 +- modules/hardware/amd.nix | 2 +- modules/hardware/intel.nix | 2 +- modules/i18n.nix | 4 ++-- modules/users/home-shared-modules.nix | 2 +- modules/users/vinzenz-home.nix | 3 +-- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index f6df8931..e18119e4 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -26,8 +26,9 @@ in { # Enable the X11 windowing system / wayland depending on DE xserver = { enable = true; - libinput.enable = true; - }; + }; + + libinput.enable = true; # flatpak xdg-portal-kde crashes, otherwise this would be global flatpak.enable = true; diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index 12cde3da..c5d6643d 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -17,10 +17,11 @@ in { desktopManager.gnome.enable = true; displayManager = { gdm.enable = true; - defaultSession = "gnome"; - }; + }; }; + displayManager.defaultSession = "gnome"; + gnome = { tracker-miners.enable = false; tracker.enable = false; diff --git a/modules/desktop/printing.nix b/modules/desktop/printing.nix index 5f958aa9..e4ab50d9 100644 --- a/modules/desktop/printing.nix +++ b/modules/desktop/printing.nix @@ -15,7 +15,7 @@ in { avahi = { enable = true; # runs the Avahi daemon - nssmdns = true; # enables the mDNS NSS plug-in + nssmdns4 = true; # enables the mDNS NSS plug-in openFirewall = true; # opens the firewall for UDP port 5353 }; }; diff --git a/modules/hardware/amd.nix b/modules/hardware/amd.nix index 94b959a4..06f3a855 100644 --- a/modules/hardware/amd.nix +++ b/modules/hardware/amd.nix @@ -32,7 +32,7 @@ in { }; environment.systemPackages = with pkgs; [ - nvtop-amd + nvtopPackages.amd ]; }) diff --git a/modules/hardware/intel.nix b/modules/hardware/intel.nix index 2c51461a..c84a3bb8 100644 --- a/modules/hardware/intel.nix +++ b/modules/hardware/intel.nix @@ -33,7 +33,7 @@ in { ]; }; environment.systemPackages = with pkgs; [ - nvtop-intel + nvtopPackages.intel ]; }) ]; diff --git a/modules/i18n.nix b/modules/i18n.nix index 3d38ec15..d3fbebc0 100644 --- a/modules/i18n.nix +++ b/modules/i18n.nix @@ -16,10 +16,10 @@ }; }; - services.xserver = { + services.xserver.xkb = { # Configure keymap in X11 layout = "de"; - xkbVariant = ""; + variant = ""; }; # Configure console keymap diff --git a/modules/users/home-shared-modules.nix b/modules/users/home-shared-modules.nix index 12f12cf7..3ad3365e 100644 --- a/modules/users/home-shared-modules.nix +++ b/modules/users/home-shared-modules.nix @@ -22,7 +22,7 @@ zsh = { enable = true; syntaxHighlighting.enable = true; - enableAutosuggestions = true; + autosuggestion.enable = true; enableVteIntegration = true; }; }; diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 942f5e9d..622bec6c 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -146,8 +146,7 @@ in enable = true; git = true; icons = true; - enableAliases = true; - extraOptions = [ + extraOptions = [ "--group-directories-first" "--header" ]; From 5e630f9066eb5940d2140dfb55c0b9ce9e6a277f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 21 Jun 2024 17:14:14 +0200 Subject: [PATCH 0162/1295] enable AppImage support --- modules/desktop/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index e18119e4..eae87c5e 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -73,6 +73,10 @@ in { systemd ]; }; +appimage = { + enable = true; + binfmt = true; + }; }; networking = { From 06074d16ecc5a1efb0f76506f64617707b204de1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 21 Jun 2024 17:16:47 +0200 Subject: [PATCH 0163/1295] change keys for lpt --- vinzenz-lpt2.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index 086c1857..969568b6 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -38,11 +38,10 @@ users.users.vinzenz.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' ]; users.users.ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' ]; }; } From b72e5b904e6d02ef704b91e50047b0e02f28eb84 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 21 Jun 2024 17:17:13 +0200 Subject: [PATCH 0164/1295] podman for lpt, remove package --- vinzenz-lpt2.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index 969568b6..13f7f41f 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -29,10 +29,14 @@ ]; }; - environment.systemPackages = with pkgs; [anydesk]; - - virtualisation.podman = { + virtualisation = { + containers.enable = true; + podman = { enable = true; + dockerCompat = true; + dockerSocket.enable = true; + autoPrune.enable = true; + }; }; users.users.vinzenz.openssh.authorizedKeys.keys = [ From f3ca2dd34bf1ee60e1a67eca3f7f8873e596545c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 21 Jun 2024 17:17:37 +0200 Subject: [PATCH 0165/1295] fix editorconfig for makefile --- modules/users/vinzenz-home.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 622bec6c..d2a95546 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -120,6 +120,10 @@ in "rust-analyzer.checkOnSave.command" = "clippy"; "extensions.autoUpdate" = false; "extensions.autoCheckUpdates" = false; + "\[makefile\]" = { + "editor.insertSpaces" = false; + "editor.detectIndentation" = false; + }; }; }; From 049c48ddbd83aae622adaccace19c6231a56427d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 21 Jun 2024 17:18:13 +0200 Subject: [PATCH 0166/1295] lpt nginx --- vinzenz-lpt2.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index 13f7f41f..cf994f74 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -47,5 +47,31 @@ users.users.ronja.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' ]; + + services.nginx = { + enable = true; + + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + + virtualHosts = { + "vinzenz-lpt2" = { + locations."/" = { + proxyPass = "http://127.0.0.1:3000/"; + proxyWebsockets = true; + }; + + serverAliases = ["172.23.42.96"]; + }; + }; + }; + + networking.firewall = { + allowedTCPPorts = [80 8001 3000]; + allowedUDPPorts = [2342]; + }; + }; } From ce7ca5450fd8fea9d2ffbbea4e8eafe345ebd44c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 21 Jul 2024 14:00:10 +0200 Subject: [PATCH 0167/1295] switch nix implementation to lix --- modules/nixpkgs.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index 6f282ae1..761d1aec 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -12,6 +12,24 @@ in { example = ["steam"]; }; + imports = [ + # this switches the nix implementation to lix everywhere, but means recompiling lix every build. + # https://lix.systems/add-to-config/ + (let + module = fetchTarball { + name = "source"; + url = "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0.tar.gz"; + sha256 = "sha256-yEO2cGNgzm9x/XxiDQI+WckSWnZX63R8aJLBRSXtYNE="; + }; + lixSrc = fetchTarball { + name = "source"; + url = "https://git.lix.systems/lix-project/lix/archive/2.90.0.tar.gz"; + sha256 = "sha256-f8k+BezKdJfmE+k7zgBJiohtS3VkkriycdXYsKOm3sc="; + }; + in import "${module}/module.nix" { lix = lixSrc; } + ) + ]; + config = { nixpkgs.config = { # make nixos-unstable availiable as 'pkgs.unstable' From 1f7bf4ca7a6b7ceb60d4033c3b345b5b31d53ee2 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 21 Jul 2024 14:07:59 +0200 Subject: [PATCH 0168/1295] do not install build tools on lpt2, latex --- modules/desktop/default.nix | 1 + modules/desktop/latex.nix | 20 ++++++++++++++++++++ vinzenz-lpt2.nix | 9 ++------- 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 modules/desktop/latex.nix diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index eae87c5e..e6bf3732 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -13,6 +13,7 @@ in { ./kde.nix ./gaming.nix ./printing.nix + ./latex.nix ] ++ lib.optionals isHomeManager [ ./gnome-home.nix diff --git a/modules/desktop/latex.nix b/modules/desktop/latex.nix new file mode 100644 index 00000000..a0cb9a08 --- /dev/null +++ b/modules/desktop/latex.nix @@ -0,0 +1,20 @@ +{ + config, + pkgs, + lib, + ... +}: let + isEnabled = config.my.desktop.enableLaTeX; +in { + options.my.desktop.enableLaTeX = lib.mkEnableOption "LaTeX tools and IDE"; + + config = lib.mkIf isEnabled { + my.desktop.enable = true; + + environment.systemPackages = with pkgs; [ + fontconfig + texliveFull + texstudio + ]; + }; +} diff --git a/vinzenz-lpt2.nix b/vinzenz-lpt2.nix index cf994f74..3dcbed00 100644 --- a/vinzenz-lpt2.nix +++ b/vinzenz-lpt2.nix @@ -14,12 +14,7 @@ enableGnome = true; enableGaming = true; enablePrinting = true; - }; - buildtools = { - dotnet = true; - js = true; - rust = true; - native = true; + enableLaTeX = true; }; allowUnfreePackages = [ @@ -32,7 +27,7 @@ virtualisation = { containers.enable = true; podman = { - enable = true; + enable = true; dockerCompat = true; dockerSocket.enable = true; autoPrune.enable = true; From 517753081e6914ee31543f01c7d42237fd40bfa3 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 21 Jul 2024 14:10:13 +0200 Subject: [PATCH 0169/1295] intel-ocl --- modules/hardware/intel.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/hardware/intel.nix b/modules/hardware/intel.nix index c84a3bb8..271a2850 100644 --- a/modules/hardware/intel.nix +++ b/modules/hardware/intel.nix @@ -24,6 +24,7 @@ in { vaapiIntel vaapiVdpau libvdpau-va-gl + intel-ocl ]; extraPackages32 = with pkgs.pkgsi686Linux; [ intel-media-driver @@ -35,6 +36,7 @@ in { environment.systemPackages = with pkgs; [ nvtopPackages.intel ]; + my.allowUnfreePackages = ["intel-ocl"]; }) ]; } From 16c9d8e6157f32350bbd8fa2a90aeb2b31988deb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 21 Jul 2024 14:10:41 +0200 Subject: [PATCH 0170/1295] formatting --- modules/desktop/gnome.nix | 2 +- modules/desktop/printing.nix | 2 +- modules/nixpkgs.nix | 17 +++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index c5d6643d..efdf0801 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -17,7 +17,7 @@ in { desktopManager.gnome.enable = true; displayManager = { gdm.enable = true; - }; + }; }; displayManager.defaultSession = "gnome"; diff --git a/modules/desktop/printing.nix b/modules/desktop/printing.nix index e4ab50d9..ba73ac9d 100644 --- a/modules/desktop/printing.nix +++ b/modules/desktop/printing.nix @@ -12,7 +12,7 @@ in { services = { # Enable CUPS to print documents. printing.enable = true; - + avahi = { enable = true; # runs the Avahi daemon nssmdns4 = true; # enables the mDNS NSS plug-in diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index 761d1aec..a1444dfd 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -15,7 +15,8 @@ in { imports = [ # this switches the nix implementation to lix everywhere, but means recompiling lix every build. # https://lix.systems/add-to-config/ - (let + ( + let module = fetchTarball { name = "source"; url = "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0.tar.gz"; @@ -26,7 +27,8 @@ in { url = "https://git.lix.systems/lix-project/lix/archive/2.90.0.tar.gz"; sha256 = "sha256-f8k+BezKdJfmE+k7zgBJiohtS3VkkriycdXYsKOm3sc="; }; - in import "${module}/module.nix" { lix = lixSrc; } + in + import "${module}/module.nix" {lix = lixSrc;} ) ]; @@ -51,6 +53,11 @@ in { substituters = ["https://nix-community.cachix.org" "https://cache.nixos.org/"]; trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="]; }; + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + }; }; system = { @@ -62,12 +69,6 @@ in { }; }; - nix.gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 7d"; - }; - documentation = { enable = true; # documentation of packages nixos.enable = false; # nixos documentation From 63d5b6141403ea2d483ed1ce6d3991fd914b6ffd Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 3 Aug 2024 17:35:55 +0200 Subject: [PATCH 0171/1295] add solaar to default desktop --- modules/desktop/default.nix | 13 +++++++++---- modules/desktop/gnome-home.nix | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index e6bf3732..2adf62c2 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -27,7 +27,7 @@ in { # Enable the X11 windowing system / wayland depending on DE xserver = { enable = true; - }; + }; libinput.enable = true; @@ -74,9 +74,9 @@ in { systemd ]; }; -appimage = { - enable = true; - binfmt = true; + appimage = { + enable = true; + binfmt = true; }; }; @@ -143,5 +143,10 @@ appimage = { (nerdfonts.override {fonts = ["FiraCode"];}) ]; }; + + hardware.logitech.wireless = { + enable = true; + enableGraphical = true; + }; }; } diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index c7481a75..06884d44 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -28,6 +28,7 @@ in { gsconnect battery-health-charging quick-settings-tweaker + solaar-extension ]); dconf.settings = { @@ -59,6 +60,7 @@ in { "caffeine@patapon.info" "GPaste@gnome-shell-extensions.gnome.org" "gsconnect@andyholmes.github.io" + "solaar-extension@sidevesh" ]; }; "ca/desrt/dconf-editor" = { From 7cef3a3d47075fc617bb0cc8df3d8eef1a3730f6 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 13 Oct 2024 14:18:18 +0200 Subject: [PATCH 0172/1295] earlyoom --- modules/desktop/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 2adf62c2..9ff9eefc 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -35,6 +35,11 @@ in { flatpak.enable = true; fstrim.enable = true; + + earlyoom = { + enable = true; + freeMemThreshold = 5; + }; }; # Enable sound with pipewire. From 31e80e74010c948889cd3221ca22ae5ec8dddd5c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 13 Oct 2024 14:19:03 +0200 Subject: [PATCH 0173/1295] add gnome software --- modules/desktop/gnome-home.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/desktop/gnome-home.nix b/modules/desktop/gnome-home.nix index 06884d44..bc61e733 100644 --- a/modules/desktop/gnome-home.nix +++ b/modules/desktop/gnome-home.nix @@ -21,6 +21,9 @@ in { ++ (with gnome; [ dconf-editor gpaste + + # graphical installer for flatpak apps + gnome-software ]) ++ (with gnomeExtensions; [ caffeine From b71f8ee6360610f2077dbee66596051af8e6a86a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Oct 2024 00:04:27 +0200 Subject: [PATCH 0174/1295] first building version of lpt2 as flake --- README.md | 15 -- common/default.nix | 8 ++ {modules => common}/globalinstalls.nix | 0 {modules => common}/i18n.nix | 0 modules/sshd.nix => common/networking.nix | 10 ++ common/nixpkgs.nix | 46 ++++++ flake.lock | 133 ++++++++++++++++++ flake.nix | 32 +++++ home/default.nix | 14 ++ {modules/desktop => home}/gnome-home.nix | 28 ++-- {modules/users => home}/ronja-home.nix | 0 .../shared-modules.nix | 0 {modules/users => home}/vinzenz-home.nix | 2 +- .../desktop-environment.nix | 24 +--- .../desktop-hardware.nix | 8 +- {modules/desktop => hosts}/gaming.nix | 8 +- {modules/desktop => hosts}/gnome.nix | 10 +- hosts/intel-graphics.nix | 28 ++++ hosts/latex.nix | 14 ++ {modules/desktop => hosts}/printing.nix | 8 +- hosts/vinzenz-lpt2/default.nix | 6 + .../vinzenz-lpt2/environment.nix | 40 ++---- hosts/vinzenz-lpt2/hardware.nix | 62 ++++++++ modules/buildtools.nix | 116 --------------- modules/default.nix | 25 ---- modules/desktop/kde-home.nix | 18 --- modules/desktop/kde.nix | 46 ------ modules/desktop/latex.nix | 20 --- modules/hardware/default.nix | 40 ------ modules/hardware/intel.nix | 42 ------ modules/hardware/vinzenz-lpt.nix | 34 ----- modules/hardware/vinzenz-lpt2.nix | 43 ------ modules/nixpkgs.nix | 80 ----------- modules/tailscale.nix | 19 --- modules/users/default.nix | 24 ---- modules/users/home-manager.nix | 25 ---- {modules => modules_bak}/hardware/amd.nix | 0 .../hardware/hetzner-vpn1.nix | 0 .../hardware/vinzenz-pc2.nix | 0 .../hetzner-vpn1.nix | 0 .../vinzenz-pc2.nix | 0 {modules/users => users}/ronja.nix | 11 +- {modules/users => users}/vinzenz.nix | 6 +- vinzenz-lpt.nix | 28 ---- 44 files changed, 396 insertions(+), 677 deletions(-) delete mode 100644 README.md create mode 100644 common/default.nix rename {modules => common}/globalinstalls.nix (100%) rename {modules => common}/i18n.nix (100%) rename modules/sshd.nix => common/networking.nix (60%) create mode 100644 common/nixpkgs.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home/default.nix rename {modules/desktop => home}/gnome-home.nix (85%) rename {modules/users => home}/ronja-home.nix (100%) rename modules/users/home-shared-modules.nix => home/shared-modules.nix (100%) rename {modules/users => home}/vinzenz-home.nix (99%) rename modules/desktop/default.nix => hosts/desktop-environment.nix (86%) rename modules/hardware/common-desktop.nix => hosts/desktop-hardware.nix (86%) rename {modules/desktop => hosts}/gaming.nix (84%) rename {modules/desktop => hosts}/gnome.nix (84%) create mode 100644 hosts/intel-graphics.nix create mode 100644 hosts/latex.nix rename {modules/desktop => hosts}/printing.nix (67%) create mode 100644 hosts/vinzenz-lpt2/default.nix rename vinzenz-lpt2.nix => hosts/vinzenz-lpt2/environment.nix (64%) create mode 100644 hosts/vinzenz-lpt2/hardware.nix delete mode 100644 modules/buildtools.nix delete mode 100644 modules/default.nix delete mode 100644 modules/desktop/kde-home.nix delete mode 100644 modules/desktop/kde.nix delete mode 100644 modules/desktop/latex.nix delete mode 100644 modules/hardware/default.nix delete mode 100644 modules/hardware/intel.nix delete mode 100644 modules/hardware/vinzenz-lpt.nix delete mode 100644 modules/hardware/vinzenz-lpt2.nix delete mode 100644 modules/nixpkgs.nix delete mode 100644 modules/tailscale.nix delete mode 100644 modules/users/default.nix delete mode 100644 modules/users/home-manager.nix rename {modules => modules_bak}/hardware/amd.nix (100%) rename {modules => modules_bak}/hardware/hetzner-vpn1.nix (100%) rename {modules => modules_bak}/hardware/vinzenz-pc2.nix (100%) rename hetzner-vpn1.nix => modules_bak/hetzner-vpn1.nix (100%) rename vinzenz-pc2.nix => modules_bak/vinzenz-pc2.nix (100%) rename {modules/users => users}/ronja.nix (64%) rename {modules/users => users}/vinzenz.nix (74%) delete mode 100644 vinzenz-lpt.nix diff --git a/README.md b/README.md deleted file mode 100644 index 5cee1902..00000000 --- a/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# nixos-configuration - -``` -/ -├── modules -│ ├── desktop -│ ├── hardware (includes hostname.nix) -│ └── users -└── hostname.nix (imports modules) -``` - -When adding a new host: `ln -s ./new-devicename.nix /etc/nixos/configuration.nix` - -Use `sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager` to add home manager support. - diff --git a/common/default.nix b/common/default.nix new file mode 100644 index 00000000..326c69ce --- /dev/null +++ b/common/default.nix @@ -0,0 +1,8 @@ +{...}: { + imports = [ + ./nixpkgs.nix + ./globalinstalls.nix + ./i18n.nix + ./networking.nix + ]; +} diff --git a/modules/globalinstalls.nix b/common/globalinstalls.nix similarity index 100% rename from modules/globalinstalls.nix rename to common/globalinstalls.nix diff --git a/modules/i18n.nix b/common/i18n.nix similarity index 100% rename from modules/i18n.nix rename to common/i18n.nix diff --git a/modules/sshd.nix b/common/networking.nix similarity index 60% rename from modules/sshd.nix rename to common/networking.nix index 747eeaca..94bc82dc 100644 --- a/modules/sshd.nix +++ b/common/networking.nix @@ -9,5 +9,15 @@ KbdInteractiveAuthentication = false; }; }; + + services.tailscale = { + enable = true; + openFirewall = true; + }; + + networking.firewall = { + enable = true; + checkReversePath = "loose"; + }; }; } diff --git a/common/nixpkgs.nix b/common/nixpkgs.nix new file mode 100644 index 00000000..eb546a0a --- /dev/null +++ b/common/nixpkgs.nix @@ -0,0 +1,46 @@ +{ + config, + lib, + ... +}: { + options.my.allowUnfreePackages = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = []; + example = ["steam"]; + }; + config = { + nixpkgs.config = { + # https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085 + allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.my.allowUnfreePackages; + }; + + nix = { + settings = { + substituters = ["https://nix-community.cachix.org" "https://cache.nixos.org/"]; + trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="]; + }; + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + }; + }; + + system = { + stateVersion = "22.11"; + # enable auto updates + autoUpgrade = { + enable = true; + dates = "weekly"; + }; + }; + + documentation = { + enable = true; # documentation of packages + nixos.enable = false; # nixos documentation + man.enable = true; # manual pages and the man command + info.enable = false; # info pages and the info command + doc.enable = false; # documentation distributed in packages' /share/doc + }; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..5881a011 --- /dev/null +++ b/flake.lock @@ -0,0 +1,133 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flakey-profile": { + "locked": { + "lastModified": 1712898590, + "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", + "owner": "lf-", + "repo": "flakey-profile", + "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", + "type": "github" + }, + "original": { + "owner": "lf-", + "repo": "flakey-profile", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1726989464, + "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.05", + "repo": "home-manager", + "type": "github" + } + }, + "lix": { + "flake": false, + "locked": { + "lastModified": 1729298361, + "narHash": "sha256-hiGtfzxFkDc9TSYsb96Whg0vnqBVV7CUxyscZNhed0U=", + "rev": "ad9d06f7838a25beec425ff406fe68721fef73be", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/ad9d06f7838a25beec425ff406fe68721fef73be.tar.gz?rev=ad9d06f7838a25beec425ff406fe68721fef73be" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz" + } + }, + "lix-module": { + "inputs": { + "flake-utils": "flake-utils", + "flakey-profile": "flakey-profile", + "lix": "lix", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729360442, + "narHash": "sha256-6U0CyPycIBc04hbYy2hBINnVso58n/ZyywY2BD3hu+s=", + "rev": "9098ac95768f7006d7e070b88bae76939f6034e6", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/9098ac95768f7006d7e070b88bae76939f6034e6.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1729691686, + "narHash": "sha256-BAuPWW+9fa1moZTU+jFh+1cUtmsuF8asgzFwejM4wac=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "32e940c7c420600ef0d1ef396dc63b04ee9cad37", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "lix-module": "lix-module", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..c5c9d20b --- /dev/null +++ b/flake.nix @@ -0,0 +1,32 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + home-manager = { + url = "github:nix-community/home-manager/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + lix-module = { + url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs @ { + nixpkgs, + home-manager, + lix-module, + ... + }: { + nixosConfigurations = { + vinzenz-lpt2 = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + lix-module.nixosModules.default + home-manager.nixosModules.home-manager + ./common + ./hosts/vinzenz-lpt2 + ]; + }; + }; + }; +} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 00000000..2cf09f9a --- /dev/null +++ b/home/default.nix @@ -0,0 +1,14 @@ +{ + config, + pkgs, + lib, + ... +}: { + config = { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + sharedModules = import ./shared-modules.nix; + }; + }; +} diff --git a/modules/desktop/gnome-home.nix b/home/gnome-home.nix similarity index 85% rename from modules/desktop/gnome-home.nix rename to home/gnome-home.nix index bc61e733..e82151cf 100644 --- a/modules/desktop/gnome-home.nix +++ b/home/gnome-home.nix @@ -3,10 +3,8 @@ config, pkgs, ... -}: let - isEnabled = config.my.desktop.enableGnome; -in { - config = lib.mkIf isEnabled { +}: { + config = { home-manager.sharedModules = [ { home.packages = with pkgs; @@ -87,17 +85,17 @@ in { }; }; } - (lib.mkIf config.my.tailscale.enable - { - home.packages = with pkgs; - [ - trayscale - ] - ++ (with gnomeExtensions; [ - tailscale-qs - ]); - dconf.settings."org/gnome/shell".enabled-extensions = ["tailscale@joaophi.github.com"]; - }) + + { + home.packages = with pkgs; + [ + trayscale + ] + ++ (with gnomeExtensions; [ + tailscale-qs + ]); + dconf.settings."org/gnome/shell".enabled-extensions = ["tailscale@joaophi.github.com"]; + } ]; }; } diff --git a/modules/users/ronja-home.nix b/home/ronja-home.nix similarity index 100% rename from modules/users/ronja-home.nix rename to home/ronja-home.nix diff --git a/modules/users/home-shared-modules.nix b/home/shared-modules.nix similarity index 100% rename from modules/users/home-shared-modules.nix rename to home/shared-modules.nix diff --git a/modules/users/vinzenz-home.nix b/home/vinzenz-home.nix similarity index 99% rename from modules/users/vinzenz-home.nix rename to home/vinzenz-home.nix index d2a95546..883d538e 100644 --- a/modules/users/vinzenz-home.nix +++ b/home/vinzenz-home.nix @@ -150,7 +150,7 @@ in enable = true; git = true; icons = true; - extraOptions = [ + extraOptions = [ "--group-directories-first" "--header" ]; diff --git a/modules/desktop/default.nix b/hosts/desktop-environment.nix similarity index 86% rename from modules/desktop/default.nix rename to hosts/desktop-environment.nix index 9ff9eefc..97fb613a 100644 --- a/modules/desktop/default.nix +++ b/hosts/desktop-environment.nix @@ -1,28 +1,10 @@ -modulesCfg: { +{ config, pkgs, lib, ... -}: let - isEnabled = config.my.desktop.enable; - isHomeManager = modulesCfg.enableHomeManager; -in { - imports = - [ - ./gnome.nix - ./kde.nix - ./gaming.nix - ./printing.nix - ./latex.nix - ] - ++ lib.optionals isHomeManager [ - ./gnome-home.nix - ./kde-home.nix - ]; - - options.my.desktop.enable = lib.mkEnableOption "desktop"; - - config = lib.mkIf isEnabled { +}: { + config = { services = { # Enable the X11 windowing system / wayland depending on DE xserver = { diff --git a/modules/hardware/common-desktop.nix b/hosts/desktop-hardware.nix similarity index 86% rename from modules/hardware/common-desktop.nix rename to hosts/desktop-hardware.nix index 05047a28..ac8be035 100644 --- a/modules/hardware/common-desktop.nix +++ b/hosts/desktop-hardware.nix @@ -3,12 +3,8 @@ pkgs, config, ... -}: let - isEnabled = config.my.hardware.enableCommonDesktopSettings; -in { - options.my.hardware.enableCommonDesktopSettings = lib.mkEnableOption "common hw settings for desktops"; - - config = lib.mkIf isEnabled { +}: { + config = { boot = { kernelPackages = pkgs.linuxPackages_zen; kernelParams = ["quiet" "udev.log_level=3"]; diff --git a/modules/desktop/gaming.nix b/hosts/gaming.nix similarity index 84% rename from modules/desktop/gaming.nix rename to hosts/gaming.nix index 81e4011a..2154d0f0 100644 --- a/modules/desktop/gaming.nix +++ b/hosts/gaming.nix @@ -3,12 +3,8 @@ pkgs, lib, ... -}: let - isEnabled = config.my.desktop.enableGaming; -in { - options.my.desktop.enableGaming = lib.mkEnableOption "gaming with wine"; - - config = lib.mkIf isEnabled { +}: { + config = { hardware = { opengl = { driSupport = true; diff --git a/modules/desktop/gnome.nix b/hosts/gnome.nix similarity index 84% rename from modules/desktop/gnome.nix rename to hosts/gnome.nix index efdf0801..58fe4eeb 100644 --- a/modules/desktop/gnome.nix +++ b/hosts/gnome.nix @@ -3,14 +3,8 @@ pkgs, lib, ... -}: let - isEnabled = config.my.desktop.enableGnome; -in { - options.my.desktop.enableGnome = lib.mkEnableOption "gnome desktop"; - - config = lib.mkIf isEnabled { - my.desktop.enable = true; - +}: { + config = { services = { xserver = { # Enable the GNOME Desktop Environment. diff --git a/hosts/intel-graphics.nix b/hosts/intel-graphics.nix new file mode 100644 index 00000000..35decc06 --- /dev/null +++ b/hosts/intel-graphics.nix @@ -0,0 +1,28 @@ +{ + lib, + config, + pkgs, + ... +}: { + config = { + hardware.opengl = { + extraPackages = with pkgs; [ + intel-media-driver + vaapiIntel + vaapiVdpau + libvdpau-va-gl + intel-ocl + ]; + extraPackages32 = with pkgs.pkgsi686Linux; [ + intel-media-driver + vaapiIntel + vaapiVdpau + libvdpau-va-gl + ]; + }; + environment.systemPackages = with pkgs; [ + nvtopPackages.intel + ]; + my.allowUnfreePackages = ["intel-ocl"]; + }; +} diff --git a/hosts/latex.nix b/hosts/latex.nix new file mode 100644 index 00000000..93384bb8 --- /dev/null +++ b/hosts/latex.nix @@ -0,0 +1,14 @@ +{ + config, + pkgs, + lib, + ... +}: { + config = { + environment.systemPackages = with pkgs; [ + fontconfig + texliveFull + texstudio + ]; + }; +} diff --git a/modules/desktop/printing.nix b/hosts/printing.nix similarity index 67% rename from modules/desktop/printing.nix rename to hosts/printing.nix index ba73ac9d..f60272ee 100644 --- a/modules/desktop/printing.nix +++ b/hosts/printing.nix @@ -3,12 +3,8 @@ pkgs, lib, ... -}: let - isEnabled = config.my.desktop.enablePrinting; -in { - options.my.desktop.enablePrinting = lib.mkEnableOption "printing"; - - config = lib.mkIf isEnabled { +}: { + config = { services = { # Enable CUPS to print documents. printing.enable = true; diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix new file mode 100644 index 00000000..d8c409e3 --- /dev/null +++ b/hosts/vinzenz-lpt2/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./hardware.nix + ./environment.nix + ]; +} diff --git a/vinzenz-lpt2.nix b/hosts/vinzenz-lpt2/environment.nix similarity index 64% rename from vinzenz-lpt2.nix rename to hosts/vinzenz-lpt2/environment.nix index 3dcbed00..8b9e6c11 100644 --- a/vinzenz-lpt2.nix +++ b/hosts/vinzenz-lpt2/environment.nix @@ -1,28 +1,17 @@ {pkgs, ...}: { imports = [ - (import ./modules { - hostName = "vinzenz-lpt2"; - enableHomeManager = true; - }) + ../../home + ../../home/gnome-home.nix + ../../users/vinzenz.nix + ../desktop-environment.nix + ../gnome.nix + ../gaming.nix + ../printing.nix + ../latex.nix ]; config = { - my = { - enabledUsers = ["vinzenz" "ronja"]; - tailscale.enable = true; - desktop = { - enableGnome = true; - enableGaming = true; - enablePrinting = true; - enableLaTeX = true; - }; - - allowUnfreePackages = [ - "rider" - "clion" - "pycharm-professional" - ]; - }; + home-manager.users.vinzenz = import ../../home/vinzenz-home.nix; virtualisation = { containers.enable = true; @@ -38,11 +27,11 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' ]; - - users.users.ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - ]; - + # + #users.users.ronja.openssh.authorizedKeys.keys = [ + # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + #]; + # services.nginx = { enable = true; @@ -67,6 +56,5 @@ allowedTCPPorts = [80 8001 3000]; allowedUDPPorts = [2342]; }; - }; } diff --git a/hosts/vinzenz-lpt2/hardware.nix b/hosts/vinzenz-lpt2/hardware.nix new file mode 100644 index 00000000..610d40f4 --- /dev/null +++ b/hosts/vinzenz-lpt2/hardware.nix @@ -0,0 +1,62 @@ +{ + pkgs, + lib, + ... +}: { + imports = [ + ../desktop-hardware.nix + ../intel-graphics.nix + ]; + config = { + # intel cpu + boot.kernelModules = ["kvm-intel"]; + hardware.cpu.intel.updateMicrocode = true; + + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + + hardware.enableRedistributableFirmware = true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + boot.initrd = { + availableKernelModules = ["xhci_pci" "thunderbolt" "nvme"]; + luks.devices = { + "luks-2c654ff2-3c42-48d3-a1e3-9545679afaa3" = { + device = "/dev/disk/by-uuid/2c654ff2-3c42-48d3-a1e3-9545679afaa3"; + }; + }; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/e4dad0c8-26a1-45e9-bbd9-48565eb6574e"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/E2B7-2BC1"; + fsType = "vfat"; + }; + }; + + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 32 * 1024; + } + ]; + + services.thermald.enable = true; + services.hardware.bolt.enable = true; # thunderbolt security + }; +} diff --git a/modules/buildtools.nix b/modules/buildtools.nix deleted file mode 100644 index bcb260b4..00000000 --- a/modules/buildtools.nix +++ /dev/null @@ -1,116 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: let - cfg = config.my.buildtools; - isDesktop = config.my.desktop.enable; - dotnetPackage = with pkgs.unstable; (dotnetCorePackages.combinePackages [ - dotnet-sdk_8 - ]); -in { - options.my.buildtools = { - native = lib.mkEnableOption "include native build tools"; - dotnet = lib.mkEnableOption "include dotnet build tools"; - rust = lib.mkEnableOption "include rust build tools"; - jetbrains-remote-server = lib.mkEnableOption "setup jetbrais IDE installs so -remote-dev-server can be started"; - objective-c = lib.mkEnableOption "Objective-C with GNUStep"; - js = lib.mkEnableOption "node stuff"; - android = lib.mkEnableOption "android development"; - python = lib.mkEnableOption "generic python 3"; - }; - - config = lib.mkMerge [ - (lib.mkIf cfg.native { - environment.systemPackages = with pkgs; [ - cmake - gnumake - gcc - gdb - ]; - }) - - (lib.mkIf cfg.dotnet { - environment = { - systemPackages = with pkgs; [ - dotnetPackage - - zlib - zlib.dev - openssl - icu - icu.dev - - # native aot - gcc - libunwind - ]; - variables = { - DOTNET_CLI_TELEMETRY_OPTOUT = "1"; - }; - }; - programs.nix-ld.libraries = with pkgs; [ - # native aot - libunwind - icu - zlib - zlib.dev - openssl - icu - icu.dev - dotnetPackage - ]; - }) - - (lib.mkIf cfg.js { - environment.systemPackages = with pkgs; [ - nodejs - ]; - }) - - (lib.mkIf cfg.rust { - environment.systemPackages = with pkgs; [ - rustup - musl - ]; - }) - - (lib.mkIf cfg.jetbrains-remote-server { - my.buildtools.dotnet = true; - my.buildtools.native = true; - my.buildtools.python = true; - }) - - (lib.mkIf cfg.objective-c { - my.buildtools.native = true; - environment.systemPackages = - (with pkgs.gnustep; [ - gui - make - gorm - base - back - system_preferences - projectcenter - libobjc - gworkspace - ]) - ++ (with pkgs; [ - clang-tools - clang - ]); - }) - - (lib.mkIf cfg.android { - environment.systemPackages = with pkgs; [ - android-tools - android-udev-rules - ]; - }) - - (lib.mkIf cfg.python { - environment.systemPackages = with pkgs; [python3 python3Packages.pip]; - }) - ]; -} diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100644 index f794bcf6..00000000 --- a/modules/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -modulesCfg: {lib, ...}: { - imports = - [ - ./i18n.nix - ./nixpkgs.nix - ./globalinstalls.nix - ./sshd.nix - ./tailscale.nix - ./buildtools.nix - ] - ++ (map (path: (import path modulesCfg)) [ - ./hardware - ./users - ./desktop - ]); - - config = { - my.modulesCfg = modulesCfg; - - networking.firewall = { - enable = true; - checkReversePath = "loose"; - }; - }; -} diff --git a/modules/desktop/kde-home.nix b/modules/desktop/kde-home.nix deleted file mode 100644 index 2ece5e07..00000000 --- a/modules/desktop/kde-home.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - lib, - config, - ... -}: let - isEnabled = config.my.desktop.enableKde; -in { - config = lib.mkIf isEnabled { - home-manager.sharedModules = [ - { - services.kdeconnect = { - enable = true; - indicator = true; - }; - } - ]; - }; -} diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix deleted file mode 100644 index c6b6590a..00000000 --- a/modules/desktop/kde.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - isEnabled = config.my.desktop.enableKde; -in { - options.my.desktop.enableKde = lib.mkEnableOption "KDE desktop"; - - config = lib.mkIf isEnabled { - my.desktop.enable = true; - - services = { - # Enable the KDE Plasma Desktop Environment. - xserver = { - desktopManager.plasma5.enable = true; - - displayManager = { - sddm.enable = true; - defaultSession = "plasmawayland"; - }; - }; - }; - - environment = { - systemPackages = with pkgs; [ - libsForQt5.kate - libsForQt5.kalk - ]; - - plasma5.excludePackages = with pkgs.libsForQt5; [ - elisa - gwenview - okular - khelpcenter - ]; - }; - - programs = { - dconf.enable = true; - partition-manager.enable = true; - kdeconnect.enable = true; - }; - }; -} diff --git a/modules/desktop/latex.nix b/modules/desktop/latex.nix deleted file mode 100644 index a0cb9a08..00000000 --- a/modules/desktop/latex.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - isEnabled = config.my.desktop.enableLaTeX; -in { - options.my.desktop.enableLaTeX = lib.mkEnableOption "LaTeX tools and IDE"; - - config = lib.mkIf isEnabled { - my.desktop.enable = true; - - environment.systemPackages = with pkgs; [ - fontconfig - texliveFull - texstudio - ]; - }; -} diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix deleted file mode 100644 index a9a4a841..00000000 --- a/modules/hardware/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -modulesCfg: { - modulesPath, - lib, - ... -}: let - hostName = modulesCfg.hostName; -in { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - (builtins.toString ./. + "/${hostName}.nix") - ./common-desktop.nix - ./amd.nix - ./intel.nix - ]; - - options.my.modulesCfg.hostName = lib.mkOption { - type = lib.types.str; - }; - - config = { - networking.hostName = hostName; - - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - - hardware.enableRedistributableFirmware = true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - }; -} diff --git a/modules/hardware/intel.nix b/modules/hardware/intel.nix deleted file mode 100644 index 271a2850..00000000 --- a/modules/hardware/intel.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - cfg = config.my.hardware.intel; -in { - options.my.hardware.intel = { - cpu = lib.mkEnableOption "intel cpu"; - iGpu = lib.mkEnableOption "intel integrated gpu"; - xe = lib.mkEnableOption "intel xe gpu"; - }; - - config = lib.mkMerge [ - (lib.mkIf cfg.cpu { - boot.kernelModules = ["kvm-intel"]; - hardware.cpu.intel.updateMicrocode = true; - }) - (lib.mkIf (cfg.iGpu || cfg.xe) { - hardware.opengl = { - extraPackages = with pkgs; [ - intel-media-driver - vaapiIntel - vaapiVdpau - libvdpau-va-gl - intel-ocl - ]; - extraPackages32 = with pkgs.pkgsi686Linux; [ - intel-media-driver - vaapiIntel - vaapiVdpau - libvdpau-va-gl - ]; - }; - environment.systemPackages = with pkgs; [ - nvtopPackages.intel - ]; - my.allowUnfreePackages = ["intel-ocl"]; - }) - ]; -} diff --git a/modules/hardware/vinzenz-lpt.nix b/modules/hardware/vinzenz-lpt.nix deleted file mode 100644 index 5f028ef5..00000000 --- a/modules/hardware/vinzenz-lpt.nix +++ /dev/null @@ -1,34 +0,0 @@ -{...}: { - config = { - my.hardware = { - enableCommonDesktopSettings = true; - amd.radeon = true; - intel = { - cpu = true; - iGpu = true; - }; - }; - - boot = { - initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; - loader.efi.efiSysMountPoint = "/boot/efi"; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/boot/efi" = { - device = "/dev/disk/by-uuid/2381-1CD2"; - fsType = "vfat"; - }; - }; - - swapDevices = [ - {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} - ]; - }; -} diff --git a/modules/hardware/vinzenz-lpt2.nix b/modules/hardware/vinzenz-lpt2.nix deleted file mode 100644 index d220276b..00000000 --- a/modules/hardware/vinzenz-lpt2.nix +++ /dev/null @@ -1,43 +0,0 @@ -{...}: { - config = { - my.hardware = { - enableCommonDesktopSettings = true; - intel = { - cpu = true; - xe = true; - }; - }; - - boot.initrd = { - availableKernelModules = ["xhci_pci" "thunderbolt" "nvme"]; - luks.devices = { - "luks-2c654ff2-3c42-48d3-a1e3-9545679afaa3" = { - device = "/dev/disk/by-uuid/2c654ff2-3c42-48d3-a1e3-9545679afaa3"; - }; - }; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/e4dad0c8-26a1-45e9-bbd9-48565eb6574e"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/E2B7-2BC1"; - fsType = "vfat"; - }; - }; - - swapDevices = [ - { - device = "/var/lib/swapfile"; - size = 32 * 1024; - } - ]; - - services.thermald.enable = true; - services.hardware.bolt.enable = true; # thunderbolt security - }; -} diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix deleted file mode 100644 index a1444dfd..00000000 --- a/modules/nixpkgs.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ - config, - lib, - ... -}: let - unstable-commit-sha = "9df3e30ce24fd28c7b3e2de0d986769db5d6225d"; - ultrastable-commit-sha = "2be119add7b37dc535da2dd4cba68e2cf8d1517e"; -in { - options.my.allowUnfreePackages = lib.mkOption { - type = lib.types.listOf lib.types.str; - default = []; - example = ["steam"]; - }; - - imports = [ - # this switches the nix implementation to lix everywhere, but means recompiling lix every build. - # https://lix.systems/add-to-config/ - ( - let - module = fetchTarball { - name = "source"; - url = "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0.tar.gz"; - sha256 = "sha256-yEO2cGNgzm9x/XxiDQI+WckSWnZX63R8aJLBRSXtYNE="; - }; - lixSrc = fetchTarball { - name = "source"; - url = "https://git.lix.systems/lix-project/lix/archive/2.90.0.tar.gz"; - sha256 = "sha256-f8k+BezKdJfmE+k7zgBJiohtS3VkkriycdXYsKOm3sc="; - }; - in - import "${module}/module.nix" {lix = lixSrc;} - ) - ]; - - config = { - nixpkgs.config = { - # make nixos-unstable availiable as 'pkgs.unstable' - packageOverrides = pkgs: { - unstable = import (fetchTarball "https://github.com/nixos/nixpkgs/tarball/${unstable-commit-sha}") { - config = config.nixpkgs.config; - }; - ultrastable = import (fetchTarball "https://github.com/nixos/nixpkgs/tarball/${ultrastable-commit-sha}") { - config = config.nixpkgs.config; - }; - }; - - # https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085 - allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.my.allowUnfreePackages; - }; - - nix = { - settings = { - substituters = ["https://nix-community.cachix.org" "https://cache.nixos.org/"]; - trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="]; - }; - gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 7d"; - }; - }; - - system = { - stateVersion = "22.11"; - # enable auto updates - autoUpgrade = { - enable = true; - dates = "weekly"; - }; - }; - - documentation = { - enable = true; # documentation of packages - nixos.enable = false; # nixos documentation - man.enable = true; # manual pages and the man command - info.enable = false; # info pages and the info command - doc.enable = false; # documentation distributed in packages' /share/doc - }; - }; -} diff --git a/modules/tailscale.nix b/modules/tailscale.nix deleted file mode 100644 index b301dcb8..00000000 --- a/modules/tailscale.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - pkgs, - config, - lib, - ... -}: let - cfg = config.my.tailscale; -in { - options.my.tailscale = { - enable = lib.mkEnableOption "enable tailscale vpn"; - }; - - config = lib.mkIf cfg.enable { - services.tailscale = { - enable = true; - openFirewall = true; - }; - }; -} diff --git a/modules/users/default.nix b/modules/users/default.nix deleted file mode 100644 index 1d84a1d0..00000000 --- a/modules/users/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -modulesCfg: { - config, - pkgs, - lib, - ... -}: let - enableHomeManager = modulesCfg.enableHomeManager; -in { - options.my = { - modulesCfg.enableHomeManager = lib.mkEnableOption "enable home manager"; - enabledUsers = lib.mkOption { - type = lib.types.listOf lib.types.str; - }; - }; - - imports = - [ - ./vinzenz.nix - ./ronja.nix - ] - ++ lib.optionals enableHomeManager [ - ./home-manager.nix - ]; -} diff --git a/modules/users/home-manager.nix b/modules/users/home-manager.nix deleted file mode 100644 index 73adcc6d..00000000 --- a/modules/users/home-manager.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - imports = [ - - ]; - - config = { - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - - # defaults for users - sharedModules = import ./home-shared-modules.nix; - - users = { - ronja = lib.mkIf (builtins.elem "ronja" config.my.enabledUsers) (import ./ronja-home.nix); - vinzenz = lib.mkIf (builtins.elem "vinzenz" config.my.enabledUsers) (import ./vinzenz-home.nix); - }; - }; - }; -} diff --git a/modules/hardware/amd.nix b/modules_bak/hardware/amd.nix similarity index 100% rename from modules/hardware/amd.nix rename to modules_bak/hardware/amd.nix diff --git a/modules/hardware/hetzner-vpn1.nix b/modules_bak/hardware/hetzner-vpn1.nix similarity index 100% rename from modules/hardware/hetzner-vpn1.nix rename to modules_bak/hardware/hetzner-vpn1.nix diff --git a/modules/hardware/vinzenz-pc2.nix b/modules_bak/hardware/vinzenz-pc2.nix similarity index 100% rename from modules/hardware/vinzenz-pc2.nix rename to modules_bak/hardware/vinzenz-pc2.nix diff --git a/hetzner-vpn1.nix b/modules_bak/hetzner-vpn1.nix similarity index 100% rename from hetzner-vpn1.nix rename to modules_bak/hetzner-vpn1.nix diff --git a/vinzenz-pc2.nix b/modules_bak/vinzenz-pc2.nix similarity index 100% rename from vinzenz-pc2.nix rename to modules_bak/vinzenz-pc2.nix diff --git a/modules/users/ronja.nix b/users/ronja.nix similarity index 64% rename from modules/users/ronja.nix rename to users/ronja.nix index 61323ba3..b8a271d7 100644 --- a/modules/users/ronja.nix +++ b/users/ronja.nix @@ -1,12 +1,5 @@ -{ - config, - pkgs, - lib, - ... -}: let - isUserEnabled = builtins.elem "ronja" config.my.enabledUsers; -in { - config = lib.mkIf isUserEnabled { +{pkgs, ...}: { + config = { # Define user account users.users.ronja = { isNormalUser = true; diff --git a/modules/users/vinzenz.nix b/users/vinzenz.nix similarity index 74% rename from modules/users/vinzenz.nix rename to users/vinzenz.nix index 08c30112..e7a38f49 100644 --- a/modules/users/vinzenz.nix +++ b/users/vinzenz.nix @@ -3,10 +3,8 @@ pkgs, lib, ... -}: let - isUserEnabled = builtins.elem "vinzenz" config.my.enabledUsers; -in { - config = lib.mkIf isUserEnabled { +}: { + config = { users.users.vinzenz = { isNormalUser = true; name = "vinzenz"; diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix deleted file mode 100644 index 347fedd9..00000000 --- a/vinzenz-lpt.nix +++ /dev/null @@ -1,28 +0,0 @@ -{...}: { - imports = [ - (import ./modules { - hostName = "vinzenz-lpt"; - enableHomeManager = true; - }) - ]; - - config = { - my = { - enabledUsers = ["vinzenz"]; - tailscale.enable = true; - desktop = { - enableGnome = true; - enableGaming = true; - enablePrinting = true; - }; - buildtools = { - dotnet = true; - }; - }; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ]; - }; -} From 160229278171b46bec07ac1806ba9b766a91e95f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Oct 2024 00:16:05 +0200 Subject: [PATCH 0175/1295] enable experimental features --- common/nixpkgs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/common/nixpkgs.nix b/common/nixpkgs.nix index eb546a0a..8f5a12bd 100644 --- a/common/nixpkgs.nix +++ b/common/nixpkgs.nix @@ -18,6 +18,7 @@ settings = { substituters = ["https://nix-community.cachix.org" "https://cache.nixos.org/"]; trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="]; + experimental-features = ["nix-command" "flakes"]; }; gc = { automatic = true; From 5944fe5cca787f4faeba40b92c199dc91026376b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Oct 2024 12:32:15 +0200 Subject: [PATCH 0176/1295] split config --- flake.nix | 19 +- home/{gnome-home.nix => gnome.nix} | 3 + home/ronja-home.nix | 2 +- home/vinzenz-home.nix | 248 --------------------- home/vinzenz/default.nix | 104 +++++++++ home/vinzenz/git.nix | 16 ++ home/vinzenz/ssh.nix | 47 ++++ home/vinzenz/vscode.nix | 46 ++++ home/vinzenz/zsh.nix | 29 +++ hosts/vinzenz-lpt2/default.nix | 3 + hosts/vinzenz-lpt2/environment.nix | 14 +- hosts/vinzenz-lpt2/hardware.nix | 4 +- {hosts => modules}/desktop-environment.nix | 12 +- {hosts => modules}/desktop-hardware.nix | 0 {hosts => modules}/gaming.nix | 0 {hosts => modules}/gnome.nix | 0 {hosts => modules}/intel-graphics.nix | 0 {hosts => modules}/latex.nix | 0 {hosts => modules}/printing.nix | 0 19 files changed, 271 insertions(+), 276 deletions(-) rename home/{gnome-home.nix => gnome.nix} (98%) delete mode 100644 home/vinzenz-home.nix create mode 100644 home/vinzenz/default.nix create mode 100644 home/vinzenz/git.nix create mode 100644 home/vinzenz/ssh.nix create mode 100644 home/vinzenz/vscode.nix create mode 100644 home/vinzenz/zsh.nix rename {hosts => modules}/desktop-environment.nix (92%) rename {hosts => modules}/desktop-hardware.nix (100%) rename {hosts => modules}/gaming.nix (100%) rename {hosts => modules}/gnome.nix (100%) rename {hosts => modules}/intel-graphics.nix (100%) rename {hosts => modules}/latex.nix (100%) rename {hosts => modules}/printing.nix (100%) diff --git a/flake.nix b/flake.nix index c5c9d20b..d50aed4f 100644 --- a/flake.nix +++ b/flake.nix @@ -16,16 +16,21 @@ home-manager, lix-module, ... - }: { + }: let + common-modules = [ + lix-module.nixosModules.default + home-manager.nixosModules.home-manager + ./common + ]; + in { nixosConfigurations = { vinzenz-lpt2 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = [ - lix-module.nixosModules.default - home-manager.nixosModules.home-manager - ./common - ./hosts/vinzenz-lpt2 - ]; + modules = + common-modules + ++ [ + ./hosts/vinzenz-lpt2 + ]; }; }; }; diff --git a/home/gnome-home.nix b/home/gnome.nix similarity index 98% rename from home/gnome-home.nix rename to home/gnome.nix index e82151cf..828c0cea 100644 --- a/home/gnome-home.nix +++ b/home/gnome.nix @@ -4,6 +4,9 @@ pkgs, ... }: { + imports = [ + ../modules/gnome.nix + ]; config = { home-manager.sharedModules = [ { diff --git a/home/ronja-home.nix b/home/ronja-home.nix index aed4e1e3..04572041 100644 --- a/home/ronja-home.nix +++ b/home/ronja-home.nix @@ -3,7 +3,7 @@ pkgs, ... }: { - home .packages = with pkgs; [ + home.packages = with pkgs; [ ## Apps telegram-desktop kdiff3 diff --git a/home/vinzenz-home.nix b/home/vinzenz-home.nix deleted file mode 100644 index 883d538e..00000000 --- a/home/vinzenz-home.nix +++ /dev/null @@ -1,248 +0,0 @@ -{ - config, - osConfig, - pkgs, - lib, - ... -}: let - isGnomeEnabled = osConfig.my.desktop.enableGnome; -in - lib.mkMerge [ - { - home.packages = with pkgs; [ - keepassxc - insync - - telegram-desktop - element-desktop - - wireguard-tools - wirelesstools - - alejandra # nix formatter - - arduino - uucp - - kdiff3 - jetbrains-toolbox - ]; - - programs = { - home-manager.enable = true; - - fzf.enable = true; - - zsh = { - initExtra = '' - eval "$(direnv hook zsh)"; - export PATH=$PATH:/home/vinzenz/.cargo/bin - ''; - - shellAliases = { - my-apply = "sudo nixos-rebuild boot"; - my-switch = "sudo nixos-rebuild switch"; - my-update = "sudo nixos-rebuild boot --upgrade"; - my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; - my-fmt = "alejandra ."; - my-test = "sudo nixos-rebuild test"; - my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; - my-ip4 = "ip addr show | grep 192"; - }; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "docker" "systemadmin"]; - }; - }; - - git = { - enable = true; - userName = "Vinzenz Schroeter"; - userEmail = "vinzenz.f.s@gmail.com"; - - aliases = { - prettylog = "log --pretty=oneline --graph"; - spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; - }; - - extraConfig = { - pull.ff = "only"; - merge.tool = "kdiff3"; - push.autoSetupRemote = "true"; - }; - }; - - vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - bbenoist.nix - ms-python.python - kamadorueda.alejandra - editorconfig.editorconfig - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - mhutchie.git-graph - rust-lang.rust-analyzer - tamasfe.even-better-toml - llvm-vs-code-extensions.vscode-clangd - mkhl.direnv - vadimcn.vscode-lldb - ms-dotnettools.csharp - ]; - userSettings = { - "git.autofetch" = true; - "update.mode" = "none"; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; - "workbench.startupEditor" = "readme"; - "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; - "rust-analyzer.checkOnSave.command" = "clippy"; - "extensions.autoUpdate" = false; - "extensions.autoCheckUpdates" = false; - "\[makefile\]" = { - "editor.insertSpaces" = false; - "editor.detectIndentation" = false; - }; - }; - }; - - direnv = { - enable = true; - nix-direnv.enable = true; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - - eza = { - enable = true; - git = true; - icons = true; - extraOptions = [ - "--group-directories-first" - "--header" - ]; - }; - - # checked https://rycee.gitlab.io/home-manager/options.html until "programs.notmuch" - - ssh = { - enable = true; - matchBlocks = { - "vpn1" = { - host = "vpn1 hetzner-vpn1"; - hostname = "157.90.146.125"; # 2a01:4f8:c012:7137::/64 - user = "root"; - }; - "vpn1-ts" = { - host = "vpn1-ts hetzner-vpn1.donkey-pentatonic.ts.net"; - hostname = "hetzner-vpn1.donkey-pentatonic.ts.net"; - user = "root"; - }; - "openwrt" = { - host = "openwrt openwrt.lan"; - hostname = "openwrt.lan"; - user = "root"; - }; - "openwrt-ts" = { - hostname = "openwrt.donkey-pentatonic.ts.net"; - port = 2222; - user = "root"; - }; - "openwrt-j" = { - hostname = "openwrt.donkey-pentatonic.ts.net"; - proxyJump = "vpn1"; - port = 2222; - user = "root"; - }; - "pc2-power" = { - hostname = "openwrt.donkey-pentatonic.ts.net"; - proxyJump = "vpn1"; - port = 2222; - user = "pc2-power"; - }; - "avd-power" = { - # hostname = "2001:678:560:23:9833:63ff:fe2d:f477" - # hostname = "195.160.172.25"; - hostname = "avd-jumphost.club.berlin.ccc.de"; - user = "power"; - }; - "avd" = { - hostname = "avd.club.berlin.ccc.de"; - user = "vinzenz"; - }; - }; - }; - }; - - editorconfig = { - enable = true; - settings = { - "*" = { - charset = "utf-8"; - end_of_line = "lf"; - trim_trailing_whitespace = true; - insert_final_newline = true; - max_line_width = 120; - indent_style = "space"; - indent_size = 4; - }; - "*.nix" = { - indent_size = 2; - }; - }; - }; - - home.file."policy.json" = { - target = ".config/containers/policy.json"; - text = '' - { - "default": [ - { - "type": "insecureAcceptAnything" - } - ], - "transports": - { - "docker-daemon": - { - "": [{"type":"insecureAcceptAnything"}] - } - } - } - ''; - }; - } - ] diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix new file mode 100644 index 00000000..a10b7ca5 --- /dev/null +++ b/home/vinzenz/default.nix @@ -0,0 +1,104 @@ +inputs @ { + config, + osConfig, + pkgs, + lib, + ... +}: let + isGnomeEnabled = osConfig.my.desktop.enableGnome; +in { + programs = { + home-manager.enable = true; + fzf.enable = true; + zsh = import ./zsh.nix inputs; + git = import ./git.nix; + vscode = import ./vscode.nix inputs; + ssh = import ./ssh.nix; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + + eza = { + enable = true; + git = true; + icons = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + }; + }; + + home.packages = with pkgs; [ + keepassxc + insync + + telegram-desktop + element-desktop + + wireguard-tools + wirelesstools + + alejandra # nix formatter + + arduino + uucp + + kdiff3 + jetbrains-toolbox + ]; + + editorconfig = { + enable = true; + settings = { + "*" = { + charset = "utf-8"; + end_of_line = "lf"; + trim_trailing_whitespace = true; + insert_final_newline = true; + max_line_width = 120; + indent_style = "space"; + indent_size = 4; + }; + "*.nix" = { + indent_size = 2; + }; + }; + }; + + home.file."policy.json" = { + target = ".config/containers/policy.json"; + text = '' + { + "default": [ + { + "type": "insecureAcceptAnything" + } + ], + "transports": + { + "docker-daemon": + { + "": [{"type":"insecureAcceptAnything"}] + } + } + } + ''; + }; +} diff --git a/home/vinzenz/git.nix b/home/vinzenz/git.nix new file mode 100644 index 00000000..bb64f131 --- /dev/null +++ b/home/vinzenz/git.nix @@ -0,0 +1,16 @@ +{ + enable = true; + userName = "Vinzenz Schroeter"; + userEmail = "vinzenz.f.s@gmail.com"; + + aliases = { + prettylog = "log --pretty=oneline --graph"; + spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; + }; + + extraConfig = { + pull.ff = "only"; + merge.tool = "kdiff3"; + push.autoSetupRemote = "true"; + }; +} diff --git a/home/vinzenz/ssh.nix b/home/vinzenz/ssh.nix new file mode 100644 index 00000000..360958e8 --- /dev/null +++ b/home/vinzenz/ssh.nix @@ -0,0 +1,47 @@ +{ + enable = true; + matchBlocks = { + "vpn1" = { + host = "vpn1 hetzner-vpn1"; + hostname = "157.90.146.125"; # 2a01:4f8:c012:7137::/64 + user = "root"; + }; + "vpn1-ts" = { + host = "vpn1-ts hetzner-vpn1.donkey-pentatonic.ts.net"; + hostname = "hetzner-vpn1.donkey-pentatonic.ts.net"; + user = "root"; + }; + "openwrt" = { + host = "openwrt openwrt.lan"; + hostname = "openwrt.lan"; + user = "root"; + }; + "openwrt-ts" = { + hostname = "openwrt.donkey-pentatonic.ts.net"; + port = 2222; + user = "root"; + }; + "openwrt-j" = { + hostname = "openwrt.donkey-pentatonic.ts.net"; + proxyJump = "vpn1"; + port = 2222; + user = "root"; + }; + "pc2-power" = { + hostname = "openwrt.donkey-pentatonic.ts.net"; + proxyJump = "vpn1"; + port = 2222; + user = "pc2-power"; + }; + "avd-power" = { + # hostname = "2001:678:560:23:9833:63ff:fe2d:f477" + # hostname = "195.160.172.25"; + hostname = "avd-jumphost.club.berlin.ccc.de"; + user = "power"; + }; + "avd" = { + hostname = "avd.club.berlin.ccc.de"; + user = "vinzenz"; + }; + }; +} diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix new file mode 100644 index 00000000..e88cef43 --- /dev/null +++ b/home/vinzenz/vscode.nix @@ -0,0 +1,46 @@ +{pkgs, ...}: { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + bbenoist.nix + ms-python.python + kamadorueda.alejandra + editorconfig.editorconfig + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + mhutchie.git-graph + rust-lang.rust-analyzer + tamasfe.even-better-toml + llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + vadimcn.vscode-lldb + ms-dotnettools.csharp + ]; + userSettings = { + "git.autofetch" = true; + "update.mode" = "none"; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; + "rust-analyzer.checkOnSave.command" = "clippy"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; + "\[makefile\]" = { + "editor.insertSpaces" = false; + "editor.detectIndentation" = false; + }; + }; +} diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix new file mode 100644 index 00000000..c6d011c7 --- /dev/null +++ b/home/vinzenz/zsh.nix @@ -0,0 +1,29 @@ +{config, ...}: { + initExtra = '' + eval "$(direnv hook zsh)"; + export PATH=$PATH:/home/vinzenz/.cargo/bin + ''; + + shellAliases = { + my-apply = "sudo nixos-rebuild boot"; + my-switch = "sudo nixos-rebuild switch"; + my-update = "sudo nixos-rebuild boot --upgrade"; + my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; + my-fmt = "alejandra ."; + my-test = "sudo nixos-rebuild test"; + my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; + my-ip4 = "ip addr show | grep 192"; + }; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "docker" "systemadmin"]; + }; +} diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix index d8c409e3..20b21b33 100644 --- a/hosts/vinzenz-lpt2/default.nix +++ b/hosts/vinzenz-lpt2/default.nix @@ -3,4 +3,7 @@ ./hardware.nix ./environment.nix ]; + config = { + networking.hostName = "vinzenz-lpt2"; + }; } diff --git a/hosts/vinzenz-lpt2/environment.nix b/hosts/vinzenz-lpt2/environment.nix index 8b9e6c11..e85de40d 100644 --- a/hosts/vinzenz-lpt2/environment.nix +++ b/hosts/vinzenz-lpt2/environment.nix @@ -1,17 +1,17 @@ {pkgs, ...}: { imports = [ ../../home - ../../home/gnome-home.nix + ../../home/gnome.nix ../../users/vinzenz.nix - ../desktop-environment.nix - ../gnome.nix - ../gaming.nix - ../printing.nix - ../latex.nix + ../../modules/desktop-environment.nix + ../../modules/gnome.nix + ../../modules/gaming.nix + ../../modules/printing.nix + ../../modules/latex.nix ]; config = { - home-manager.users.vinzenz = import ../../home/vinzenz-home.nix; + home-manager.users.vinzenz = import ../../home/vinzenz; virtualisation = { containers.enable = true; diff --git a/hosts/vinzenz-lpt2/hardware.nix b/hosts/vinzenz-lpt2/hardware.nix index 610d40f4..4e11ab53 100644 --- a/hosts/vinzenz-lpt2/hardware.nix +++ b/hosts/vinzenz-lpt2/hardware.nix @@ -4,8 +4,8 @@ ... }: { imports = [ - ../desktop-hardware.nix - ../intel-graphics.nix + ../../modules/desktop-hardware.nix + ../../modules/intel-graphics.nix ]; config = { # intel cpu diff --git a/hosts/desktop-environment.nix b/modules/desktop-environment.nix similarity index 92% rename from hosts/desktop-environment.nix rename to modules/desktop-environment.nix index 97fb613a..fa0e1b94 100644 --- a/hosts/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -6,18 +6,10 @@ }: { config = { services = { - # Enable the X11 windowing system / wayland depending on DE - xserver = { - enable = true; - }; - + xserver.enable = true; libinput.enable = true; - - # flatpak xdg-portal-kde crashes, otherwise this would be global flatpak.enable = true; - fstrim.enable = true; - earlyoom = { enable = true; freeMemThreshold = 5; @@ -106,8 +98,6 @@ hunspell hunspellDicts.de-de hunspellDicts.en-us-large - - gnumake ]; nixpkgs.config.permittedInsecurePackages = []; diff --git a/hosts/desktop-hardware.nix b/modules/desktop-hardware.nix similarity index 100% rename from hosts/desktop-hardware.nix rename to modules/desktop-hardware.nix diff --git a/hosts/gaming.nix b/modules/gaming.nix similarity index 100% rename from hosts/gaming.nix rename to modules/gaming.nix diff --git a/hosts/gnome.nix b/modules/gnome.nix similarity index 100% rename from hosts/gnome.nix rename to modules/gnome.nix diff --git a/hosts/intel-graphics.nix b/modules/intel-graphics.nix similarity index 100% rename from hosts/intel-graphics.nix rename to modules/intel-graphics.nix diff --git a/hosts/latex.nix b/modules/latex.nix similarity index 100% rename from hosts/latex.nix rename to modules/latex.nix diff --git a/hosts/printing.nix b/modules/printing.nix similarity index 100% rename from hosts/printing.nix rename to modules/printing.nix From f41cd58e54949da6978c8dadf19114c6ebbb6f8e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Oct 2024 14:59:00 +0200 Subject: [PATCH 0177/1295] transform the other hosts to flake --- common/globalinstalls.nix | 5 +- flake.nix | 24 +++++++++- hosts/hetzner-vpn1/default.nix | 9 ++++ .../hetzner-vpn1/environment.nix | 11 +---- .../hetzner-vpn1/hardware.nix | 1 - hosts/vinzenz-lpt2/default.nix | 2 + hosts/vinzenz-lpt2/environment.nix | 4 +- hosts/vinzenz-pc2/default.nix | 9 ++++ .../vinzenz-pc2/environment.nix | 30 +++++------- .../vinzenz-pc2/hardware.nix | 14 +++--- modules/amd-graphics.nix | 24 ++++++++++ modules_bak/hardware/amd.nix | 47 ------------------- 12 files changed, 90 insertions(+), 90 deletions(-) create mode 100644 hosts/hetzner-vpn1/default.nix rename modules_bak/hetzner-vpn1.nix => hosts/hetzner-vpn1/environment.nix (93%) rename modules_bak/hardware/hetzner-vpn1.nix => hosts/hetzner-vpn1/hardware.nix (99%) create mode 100644 hosts/vinzenz-pc2/default.nix rename modules_bak/vinzenz-pc2.nix => hosts/vinzenz-pc2/environment.nix (67%) rename modules_bak/hardware/vinzenz-pc2.nix => hosts/vinzenz-pc2/hardware.nix (87%) create mode 100644 modules/amd-graphics.nix delete mode 100644 modules_bak/hardware/amd.nix diff --git a/common/globalinstalls.nix b/common/globalinstalls.nix index b602f993..20bf11d9 100644 --- a/common/globalinstalls.nix +++ b/common/globalinstalls.nix @@ -22,14 +22,11 @@ zsh.enable = true; htop.enable = true; iotop.enable = true; + git.enable = true; nano = { enable = true; syntaxHighlight = true; }; - git = { - enable = true; - package = pkgs.gitFull; - }; }; }; } diff --git a/flake.nix b/flake.nix index d50aed4f..ffc2c07d 100644 --- a/flake.nix +++ b/flake.nix @@ -19,7 +19,6 @@ }: let common-modules = [ lix-module.nixosModules.default - home-manager.nixosModules.home-manager ./common ]; in { @@ -29,9 +28,32 @@ modules = common-modules ++ [ + home-manager.nixosModules.home-manager ./hosts/vinzenz-lpt2 ]; }; + vinzenz-pc2 = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = + common-modules + ++ [ + home-manager.nixosModules.home-manager + ./hosts/vinzenz-pc2 + ]; + }; + hetzner-vpn1 = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + modules = + common-modules + ++ [ + ./hosts/hetzner-vpn1 + + { + # uncomment for build check on non arm system (requires --impure) + # nixpkgs.buildPlatform = builtins.currentSystem; + } + ]; + }; }; }; } diff --git a/hosts/hetzner-vpn1/default.nix b/hosts/hetzner-vpn1/default.nix new file mode 100644 index 00000000..e2d62fe9 --- /dev/null +++ b/hosts/hetzner-vpn1/default.nix @@ -0,0 +1,9 @@ +{...}: { + imports = [ + ./hardware.nix + ./environment.nix + ]; + config = { + networking.hostName = "hetzner-vpn1"; + }; +} diff --git a/modules_bak/hetzner-vpn1.nix b/hosts/hetzner-vpn1/environment.nix similarity index 93% rename from modules_bak/hetzner-vpn1.nix rename to hosts/hetzner-vpn1/environment.nix index 7a06a079..280d8d77 100644 --- a/modules_bak/hetzner-vpn1.nix +++ b/hosts/hetzner-vpn1/environment.nix @@ -24,18 +24,11 @@ pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; in { imports = [ - (import ./modules { - hostName = "hetzner-vpn1"; - enableHomeManager = false; - }) + ../../users/vinzenz.nix + ../../users/ronja.nix ]; config = { - my = { - enabledUsers = ["ronja" "vinzenz"]; - tailscale.enable = true; - }; - users.users = { root.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' diff --git a/modules_bak/hardware/hetzner-vpn1.nix b/hosts/hetzner-vpn1/hardware.nix similarity index 99% rename from modules_bak/hardware/hetzner-vpn1.nix rename to hosts/hetzner-vpn1/hardware.nix index e1476680..7494a08c 100644 --- a/modules_bak/hardware/hetzner-vpn1.nix +++ b/hosts/hetzner-vpn1/hardware.nix @@ -96,7 +96,6 @@ services.udev.extraRules = '' ATTR{address}=="96:00:02:87:7f:c9", NAME="eth0" - ''; }; } diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix index 20b21b33..987bf075 100644 --- a/hosts/vinzenz-lpt2/default.nix +++ b/hosts/vinzenz-lpt2/default.nix @@ -5,5 +5,7 @@ ]; config = { networking.hostName = "vinzenz-lpt2"; + + nix.settings.extra-platforms = ["aarch64-linux"]; }; } diff --git a/hosts/vinzenz-lpt2/environment.nix b/hosts/vinzenz-lpt2/environment.nix index e85de40d..66e6fe97 100644 --- a/hosts/vinzenz-lpt2/environment.nix +++ b/hosts/vinzenz-lpt2/environment.nix @@ -27,11 +27,11 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' ]; - # + #users.users.ronja.openssh.authorizedKeys.keys = [ # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' #]; - # + services.nginx = { enable = true; diff --git a/hosts/vinzenz-pc2/default.nix b/hosts/vinzenz-pc2/default.nix new file mode 100644 index 00000000..356f331a --- /dev/null +++ b/hosts/vinzenz-pc2/default.nix @@ -0,0 +1,9 @@ +{...}: { + imports = [ + ./hardware.nix + ./environment.nix + ]; + config = { + networking.hostName = "vinzenz-pc2"; + }; +} diff --git a/modules_bak/vinzenz-pc2.nix b/hosts/vinzenz-pc2/environment.nix similarity index 67% rename from modules_bak/vinzenz-pc2.nix rename to hosts/vinzenz-pc2/environment.nix index 82b0dd65..bde8e946 100644 --- a/modules_bak/vinzenz-pc2.nix +++ b/hosts/vinzenz-pc2/environment.nix @@ -1,26 +1,18 @@ {pkgs, ...}: { imports = [ - (import ./modules { - hostName = "vinzenz-pc2"; - enableHomeManager = true; - }) + ../../home + ../../home/gnome.nix + ../../users/vinzenz.nix + ../../modules/desktop-environment.nix + ../../modules/gnome.nix + ../../modules/gaming.nix + ../../modules/printing.nix ]; config = { - my = { - enabledUsers = ["vinzenz" "ronja"]; - tailscale.enable = true; - desktop = { - enableGnome = true; - enableGaming = true; - enablePrinting = true; - }; - buildtools = { - native = true; - dotnet = true; - rust = true; - jetbrains-remote-server = true; - }; + home-manager.users = { + vinzenz = import ../../home/vinzenz; + ronja = import ../../home/ronja; }; users.users.vinzenz.openssh.authorizedKeys.keys = [ @@ -39,7 +31,7 @@ port = 8542; host = "100.125.93.127"; # tailscale withoutConnectionToken = true; - extraPackages = with pkgs; [nodejs gitFull gh direnv]; + extraPackages = with pkgs; [nodejs git gh direnv]; }; virtualisation.podman = { diff --git a/modules_bak/hardware/vinzenz-pc2.nix b/hosts/vinzenz-pc2/hardware.nix similarity index 87% rename from modules_bak/hardware/vinzenz-pc2.nix rename to hosts/vinzenz-pc2/hardware.nix index 3f6ce4aa..65b63d87 100644 --- a/modules_bak/hardware/vinzenz-pc2.nix +++ b/hosts/vinzenz-pc2/hardware.nix @@ -1,12 +1,12 @@ {...}: { + imports = [ + ../../modules/desktop-hardware.nix + ../../modules/amd-graphics.nix + ]; config = { - my.hardware = { - enableCommonDesktopSettings = true; - amd = { - cpu = true; - gpu = true; - }; - }; + # amd cpu + boot.kernelModules = ["kvm-amd"]; + hardware.cpu.amd.updateMicrocode = true; boot = { initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" diff --git a/modules/amd-graphics.nix b/modules/amd-graphics.nix new file mode 100644 index 00000000..426119e6 --- /dev/null +++ b/modules/amd-graphics.nix @@ -0,0 +1,24 @@ +{ + lib, + config, + pkgs, + ... +}: { + config = { + boot.kernelModules = ["amdgpu"]; + services.xserver.videoDrivers = ["amdgpu"]; + + hardware.opengl = { + extraPackages = with pkgs; [ + amdvlk + ]; + extraPackages32 = with pkgs; [ + driversi686Linux.amdvlk + ]; + }; + + environment.systemPackages = with pkgs; [ + nvtopPackages.amd + ]; + }; +} diff --git a/modules_bak/hardware/amd.nix b/modules_bak/hardware/amd.nix deleted file mode 100644 index 06f3a855..00000000 --- a/modules_bak/hardware/amd.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - cfg = config.my.hardware.amd; -in { - options.my.hardware.amd = { - cpu = lib.mkEnableOption "amd cpu"; - gpu = lib.mkEnableOption "amd gpu"; - radeon = lib.mkEnableOption "amd legacy gpu"; # old hardware, dont judge - }; - - config = lib.mkMerge [ - (lib.mkIf cfg.cpu { - boot.kernelModules = ["kvm-amd"]; - hardware.cpu.amd.updateMicrocode = true; - }) - - (lib.mkIf cfg.gpu { - boot.kernelModules = ["amdgpu"]; - services.xserver.videoDrivers = ["amdgpu"]; - - hardware.opengl = { - extraPackages = with pkgs; [ - amdvlk - ]; - extraPackages32 = with pkgs; [ - driversi686Linux.amdvlk - ]; - }; - - environment.systemPackages = with pkgs; [ - nvtopPackages.amd - ]; - }) - - (lib.mkIf cfg.radeon { - boot.kernelModules = ["radeon"]; - services.xserver.videoDrivers = ["radeon"]; - environment.systemPackages = with pkgs; [ - radeontop - ]; - }) - ]; -} From 074ea3bd3b8a1bda201fc9794bbc3b9e6f58d5b9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Oct 2024 16:43:08 +0200 Subject: [PATCH 0178/1295] fixes for pc2, misc changes --- flake.nix | 14 +++++----- home/{ronja-home.nix => ronja.nix} | 0 home/vinzenz/default.nix | 4 +-- hosts/hetzner-vpn1/environment.nix | 44 +++++++++++++++--------------- hosts/vinzenz-pc2/environment.nix | 3 +- users/vinzenz.nix | 7 +---- 6 files changed, 33 insertions(+), 39 deletions(-) rename home/{ronja-home.nix => ronja.nix} (100%) diff --git a/flake.nix b/flake.nix index ffc2c07d..023e2e92 100644 --- a/flake.nix +++ b/flake.nix @@ -16,13 +16,13 @@ home-manager, lix-module, ... - }: let - common-modules = [ - lix-module.nixosModules.default - ./common - ]; - in { - nixosConfigurations = { + }: { + nixosConfigurations = let + common-modules = [ + lix-module.nixosModules.default + ./common + ]; + in { vinzenz-lpt2 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = diff --git a/home/ronja-home.nix b/home/ronja.nix similarity index 100% rename from home/ronja-home.nix rename to home/ronja.nix diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index a10b7ca5..27e4669f 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -4,9 +4,7 @@ inputs @ { pkgs, lib, ... -}: let - isGnomeEnabled = osConfig.my.desktop.enableGnome; -in { +}: { programs = { home-manager.enable = true; fzf.enable = true; diff --git a/hosts/hetzner-vpn1/environment.nix b/hosts/hetzner-vpn1/environment.nix index 280d8d77..9bb013a4 100644 --- a/hosts/hetzner-vpn1/environment.nix +++ b/hosts/hetzner-vpn1/environment.nix @@ -2,27 +2,7 @@ pkgs, lib, ... -}: let - servicesDomain = "services.zerforschen.plus"; - mkServiceConfig = host: port: { - addSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://${host}:${toString port}/"; - extraConfig = '' - # bind to tailscale ip - proxy_bind 100.88.118.60; - # pam auth - limit_except OPTIONS { - auth_pam "Password Required"; - auth_pam_service_name "nginx"; - } - ''; - }; - }; - lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net"; - pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; -in { +}: { imports = [ ../../users/vinzenz.nix ../../users/ronja.nix @@ -66,7 +46,27 @@ in { recommendedGzipSettings = true; recommendedOptimisation = true; - virtualHosts = { + virtualHosts = let + servicesDomain = "services.zerforschen.plus"; + mkServiceConfig = host: port: { + addSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://${host}:${toString port}/"; + extraConfig = '' + # bind to tailscale ip + proxy_bind 100.88.118.60; + # pam auth + limit_except OPTIONS { + auth_pam "Password Required"; + auth_pam_service_name "nginx"; + } + ''; + }; + }; + lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net"; + pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; + in { "vscode.${servicesDomain}" = lib.mkMerge [ (mkServiceConfig pc2 8542) {locations."/" .proxyWebsockets = true;} diff --git a/hosts/vinzenz-pc2/environment.nix b/hosts/vinzenz-pc2/environment.nix index bde8e946..e9392a5a 100644 --- a/hosts/vinzenz-pc2/environment.nix +++ b/hosts/vinzenz-pc2/environment.nix @@ -3,6 +3,7 @@ ../../home ../../home/gnome.nix ../../users/vinzenz.nix + ../../users/ronja.nix ../../modules/desktop-environment.nix ../../modules/gnome.nix ../../modules/gaming.nix @@ -12,7 +13,7 @@ config = { home-manager.users = { vinzenz = import ../../home/vinzenz; - ronja = import ../../home/ronja; + ronja = import ../../home/ronja.nix; }; users.users.vinzenz.openssh.authorizedKeys.keys = [ diff --git a/users/vinzenz.nix b/users/vinzenz.nix index e7a38f49..d4bbde45 100644 --- a/users/vinzenz.nix +++ b/users/vinzenz.nix @@ -1,9 +1,4 @@ -{ - config, - pkgs, - lib, - ... -}: { +{pkgs, ...}: { config = { users.users.vinzenz = { isNormalUser = true; From f673c6ae299c33b5d28f7eee7a29b7abdd5e1c54 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Oct 2024 17:30:11 +0200 Subject: [PATCH 0179/1295] split up modules differently --- flake.nix | 47 +++++-------- hosts/hetzner-vpn1/default.nix | 102 ++++++++++++++++++++++++++--- hosts/hetzner-vpn1/environment.nix | 81 ----------------------- hosts/vinzenz-lpt2/default.nix | 86 +++++++++++++++++++++--- hosts/vinzenz-lpt2/environment.nix | 60 ----------------- hosts/vinzenz-lpt2/hardware.nix | 1 - hosts/vinzenz-pc2/default.nix | 67 ++++++++++++++++--- hosts/vinzenz-pc2/environment.nix | 50 -------------- hosts/vinzenz-pc2/fstab.nix | 37 +++++++++++ hosts/vinzenz-pc2/hardware.nix | 42 +----------- 10 files changed, 286 insertions(+), 287 deletions(-) delete mode 100644 hosts/hetzner-vpn1/environment.nix delete mode 100644 hosts/vinzenz-lpt2/environment.nix delete mode 100644 hosts/vinzenz-pc2/environment.nix create mode 100644 hosts/vinzenz-pc2/fstab.nix diff --git a/flake.nix b/flake.nix index 023e2e92..50da7d9f 100644 --- a/flake.nix +++ b/flake.nix @@ -22,38 +22,23 @@ lix-module.nixosModules.default ./common ]; + desktop-modules = [ + home-manager.nixosModules.home-manager + ./home + ./modules/desktop-environment.nix + ./modules/desktop-hardware.nix + ]; + host-params = { + inherit nixpkgs; + inherit home-manager; + inherit lix-module; + common-modules = common-modules; + desktop-modules = desktop-modules; + }; in { - vinzenz-lpt2 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = - common-modules - ++ [ - home-manager.nixosModules.home-manager - ./hosts/vinzenz-lpt2 - ]; - }; - vinzenz-pc2 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = - common-modules - ++ [ - home-manager.nixosModules.home-manager - ./hosts/vinzenz-pc2 - ]; - }; - hetzner-vpn1 = nixpkgs.lib.nixosSystem { - system = "aarch64-linux"; - modules = - common-modules - ++ [ - ./hosts/hetzner-vpn1 - - { - # uncomment for build check on non arm system (requires --impure) - # nixpkgs.buildPlatform = builtins.currentSystem; - } - ]; - }; + vinzenz-lpt2 = import ./hosts/vinzenz-lpt2 host-params; + vinzenz-pc2 = import ./hosts/vinzenz-pc2 host-params; + hetzner-vpn1 = import ./hosts/hetzner-vpn1 host-params; }; }; } diff --git a/hosts/hetzner-vpn1/default.nix b/hosts/hetzner-vpn1/default.nix index e2d62fe9..35b060f2 100644 --- a/hosts/hetzner-vpn1/default.nix +++ b/hosts/hetzner-vpn1/default.nix @@ -1,9 +1,95 @@ -{...}: { - imports = [ - ./hardware.nix - ./environment.nix - ]; - config = { - networking.hostName = "hetzner-vpn1"; - }; +{ + nixpkgs, + common-modules, + desktop-modules, + ... +}: +nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + modules = + common-modules + ++ [ + ./hardware.nix + ../../users/vinzenz.nix + ../../users/ronja.nix + { + networking.hostName = "hetzner-vpn1"; + } + { + # uncomment for build check on non arm system (requires --impure) + # nixpkgs.buildPlatform = builtins.currentSystem; + } + + { + users.users = { + root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + ]; + }; + } + { + security.acme = { + acceptTerms = true; + defaults.email = "acme@zerforschen.plus"; + }; + + security.pam.services.nginx.setEnvironment = false; + systemd.services.nginx.serviceConfig = { + SupplementaryGroups = ["shadow"]; + }; + + services.nginx = { + enable = true; + additionalModules = [pkgs.nginxModules.pam]; + + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + + virtualHosts = let + servicesDomain = "services.zerforschen.plus"; + mkServiceConfig = host: port: { + addSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://${host}:${toString port}/"; + extraConfig = '' + # bind to tailscale ip + proxy_bind 100.88.118.60; + # pam auth + limit_except OPTIONS { + auth_pam "Password Required"; + auth_pam_service_name "nginx"; + } + ''; + }; + }; + lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net"; + pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; + in { + "vscode.${servicesDomain}" = lib.mkMerge [ + (mkServiceConfig pc2 8542) + {locations."/" .proxyWebsockets = true;} + ]; + "preon-app.${servicesDomain}" = mkServiceConfig pc2 8543; + "preon-api.${servicesDomain}" = mkServiceConfig pc2 8544; + }; + }; + + networking.firewall.allowedTCPPorts = [80 443]; + } + ]; } diff --git a/hosts/hetzner-vpn1/environment.nix b/hosts/hetzner-vpn1/environment.nix deleted file mode 100644 index 9bb013a4..00000000 --- a/hosts/hetzner-vpn1/environment.nix +++ /dev/null @@ -1,81 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - imports = [ - ../../users/vinzenz.nix - ../../users/ronja.nix - ]; - - config = { - users.users = { - root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - ]; - }; - - security.acme = { - acceptTerms = true; - defaults.email = "acme@zerforschen.plus"; - }; - - security.pam.services.nginx.setEnvironment = false; - systemd.services.nginx.serviceConfig = { - SupplementaryGroups = ["shadow"]; - }; - - services.nginx = { - enable = true; - additionalModules = [pkgs.nginxModules.pam]; - - recommendedProxySettings = true; - recommendedTlsSettings = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; - - virtualHosts = let - servicesDomain = "services.zerforschen.plus"; - mkServiceConfig = host: port: { - addSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://${host}:${toString port}/"; - extraConfig = '' - # bind to tailscale ip - proxy_bind 100.88.118.60; - # pam auth - limit_except OPTIONS { - auth_pam "Password Required"; - auth_pam_service_name "nginx"; - } - ''; - }; - }; - lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net"; - pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; - in { - "vscode.${servicesDomain}" = lib.mkMerge [ - (mkServiceConfig pc2 8542) - {locations."/" .proxyWebsockets = true;} - ]; - "preon-app.${servicesDomain}" = mkServiceConfig pc2 8543; - "preon-api.${servicesDomain}" = mkServiceConfig pc2 8544; - }; - }; - - networking.firewall.allowedTCPPorts = [80 443]; - }; -} diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix index 987bf075..02e98abb 100644 --- a/hosts/vinzenz-lpt2/default.nix +++ b/hosts/vinzenz-lpt2/default.nix @@ -1,11 +1,79 @@ -{...}: { - imports = [ - ./hardware.nix - ./environment.nix - ]; - config = { - networking.hostName = "vinzenz-lpt2"; +{ + nixpkgs, + common-modules, + desktop-modules, + ... +}: +nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = + common-modules + ++ desktop-modules + ++ [ + ./hardware.nix - nix.settings.extra-platforms = ["aarch64-linux"]; - }; + ../../home/gnome.nix + ../../users/vinzenz.nix + ../../modules/gnome.nix + ../../modules/gaming.nix + ../../modules/printing.nix + ../../modules/latex.nix + + { + networking.hostName = "vinzenz-lpt2"; + nix.settings.extra-platforms = ["aarch64-linux"]; + } + + { + home-manager.users.vinzenz = import ../../home/vinzenz; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ]; + + #users.users.ronja.openssh.authorizedKeys.keys = [ + # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + #]; + } + + { + virtualisation = { + containers.enable = true; + podman = { + enable = true; + dockerCompat = true; + dockerSocket.enable = true; + autoPrune.enable = true; + }; + }; + } + + { + services.nginx = { + enable = true; + + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + + virtualHosts = { + "vinzenz-lpt2" = { + locations."/" = { + proxyPass = "http://127.0.0.1:3000/"; + proxyWebsockets = true; + }; + + serverAliases = ["172.23.42.96"]; + }; + }; + }; + + networking.firewall = { + allowedTCPPorts = [80 8001 3000]; + allowedUDPPorts = [2342]; + }; + } + ]; } diff --git a/hosts/vinzenz-lpt2/environment.nix b/hosts/vinzenz-lpt2/environment.nix deleted file mode 100644 index 66e6fe97..00000000 --- a/hosts/vinzenz-lpt2/environment.nix +++ /dev/null @@ -1,60 +0,0 @@ -{pkgs, ...}: { - imports = [ - ../../home - ../../home/gnome.nix - ../../users/vinzenz.nix - ../../modules/desktop-environment.nix - ../../modules/gnome.nix - ../../modules/gaming.nix - ../../modules/printing.nix - ../../modules/latex.nix - ]; - - config = { - home-manager.users.vinzenz = import ../../home/vinzenz; - - virtualisation = { - containers.enable = true; - podman = { - enable = true; - dockerCompat = true; - dockerSocket.enable = true; - autoPrune.enable = true; - }; - }; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ]; - - #users.users.ronja.openssh.authorizedKeys.keys = [ - # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - #]; - - services.nginx = { - enable = true; - - recommendedProxySettings = true; - recommendedTlsSettings = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; - - virtualHosts = { - "vinzenz-lpt2" = { - locations."/" = { - proxyPass = "http://127.0.0.1:3000/"; - proxyWebsockets = true; - }; - - serverAliases = ["172.23.42.96"]; - }; - }; - }; - - networking.firewall = { - allowedTCPPorts = [80 8001 3000]; - allowedUDPPorts = [2342]; - }; - }; -} diff --git a/hosts/vinzenz-lpt2/hardware.nix b/hosts/vinzenz-lpt2/hardware.nix index 4e11ab53..a6e5ff59 100644 --- a/hosts/vinzenz-lpt2/hardware.nix +++ b/hosts/vinzenz-lpt2/hardware.nix @@ -4,7 +4,6 @@ ... }: { imports = [ - ../../modules/desktop-hardware.nix ../../modules/intel-graphics.nix ]; config = { diff --git a/hosts/vinzenz-pc2/default.nix b/hosts/vinzenz-pc2/default.nix index 356f331a..8d9ab6f2 100644 --- a/hosts/vinzenz-pc2/default.nix +++ b/hosts/vinzenz-pc2/default.nix @@ -1,9 +1,60 @@ -{...}: { - imports = [ - ./hardware.nix - ./environment.nix - ]; - config = { - networking.hostName = "vinzenz-pc2"; - }; +{ + nixpkgs, + common-modules, + desktop-modules, + ... +}: +nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = + common-modules + ++ desktop-modules + ++ [ + ./hardware.nix + ../../home/gnome.nix + ../../users/vinzenz.nix + ../../users/ronja.nix + ../../modules/gnome.nix + ../../modules/gaming.nix + ../../modules/printing.nix + { + networking.hostName = "vinzenz-pc2"; + } + { + home-manager.users = { + vinzenz = import ../../home/vinzenz; + ronja = import ../../home/ronja.nix; + }; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + + users.users.ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' + ]; + } + { + services.openvscode-server = { + enable = true; + telemetryLevel = "off"; + port = 8542; + host = "100.125.93.127"; # tailscale + withoutConnectionToken = true; + extraPackages = with pkgs; [nodejs git gh direnv]; + }; + + virtualisation.podman = { + enable = true; + }; + + networking = { + firewall = { + allowedTCPPorts = [8542 8543 8544 80]; + }; + }; + } + ]; } diff --git a/hosts/vinzenz-pc2/environment.nix b/hosts/vinzenz-pc2/environment.nix deleted file mode 100644 index e9392a5a..00000000 --- a/hosts/vinzenz-pc2/environment.nix +++ /dev/null @@ -1,50 +0,0 @@ -{pkgs, ...}: { - imports = [ - ../../home - ../../home/gnome.nix - ../../users/vinzenz.nix - ../../users/ronja.nix - ../../modules/desktop-environment.nix - ../../modules/gnome.nix - ../../modules/gaming.nix - ../../modules/printing.nix - ]; - - config = { - home-manager.users = { - vinzenz = import ../../home/vinzenz; - ronja = import ../../home/ronja.nix; - }; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - - users.users.ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' - ]; - - services.openvscode-server = { - enable = true; - telemetryLevel = "off"; - port = 8542; - host = "100.125.93.127"; # tailscale - withoutConnectionToken = true; - extraPackages = with pkgs; [nodejs git gh direnv]; - }; - - virtualisation.podman = { - enable = true; - }; - - networking = { - firewall = { - allowedTCPPorts = [8542 8543 8544 80]; - }; - - interfaces.eno1.wakeOnLan.enable = true; - }; - }; -} diff --git a/hosts/vinzenz-pc2/fstab.nix b/hosts/vinzenz-pc2/fstab.nix new file mode 100644 index 00000000..19fd5ffe --- /dev/null +++ b/hosts/vinzenz-pc2/fstab.nix @@ -0,0 +1,37 @@ +{ + "/" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/home" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@home"]; + }; + + "/games" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@games"]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/AF67-8F16"; + fsType = "vfat"; + }; + + "/mnt/nixos_btrfs_root" = { + # subvolume with id 5 is always the root volume + # this is convenient for managing the flat subvolume hierarchy + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvolid=5"]; + }; + + "/mnt/ssd2" = { + device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; + fsType = "ext4"; + }; +} diff --git a/hosts/vinzenz-pc2/hardware.nix b/hosts/vinzenz-pc2/hardware.nix index 65b63d87..68931948 100644 --- a/hosts/vinzenz-pc2/hardware.nix +++ b/hosts/vinzenz-pc2/hardware.nix @@ -1,6 +1,5 @@ {...}: { imports = [ - ../../modules/desktop-hardware.nix ../../modules/amd-graphics.nix ]; config = { @@ -13,44 +12,9 @@ loader.efi.efiSysMountPoint = "/boot"; }; - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/home" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@home"]; - }; - - "/games" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@games"]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/AF67-8F16"; - fsType = "vfat"; - }; - - "/mnt/nixos_btrfs_root" = { - # subvolume with id 5 is always the root volume - # this is convenient for managing the flat subvolume hierarchy - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvolid=5"]; - }; - - "/mnt/ssd2" = { - device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; - fsType = "ext4"; - }; - }; - + fileSystems = import ./fstab.nix; swapDevices = []; + + interfaces.eno1.wakeOnLan.enable = true; }; } From 8ca186274224a33845b9baec76ce1085952b59f0 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Oct 2024 17:41:46 +0200 Subject: [PATCH 0180/1295] remove unneccessary var --- flake.nix | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 50da7d9f..4402c2e2 100644 --- a/flake.nix +++ b/flake.nix @@ -18,22 +18,20 @@ ... }: { nixosConfigurations = let - common-modules = [ - lix-module.nixosModules.default - ./common - ]; - desktop-modules = [ - home-manager.nixosModules.home-manager - ./home - ./modules/desktop-environment.nix - ./modules/desktop-hardware.nix - ]; host-params = { inherit nixpkgs; inherit home-manager; inherit lix-module; - common-modules = common-modules; - desktop-modules = desktop-modules; + common-modules = [ + lix-module.nixosModules.default + ./common + ]; + desktop-modules = [ + home-manager.nixosModules.home-manager + ./home + ./modules/desktop-environment.nix + ./modules/desktop-hardware.nix + ]; }; in { vinzenz-lpt2 = import ./hosts/vinzenz-lpt2 host-params; From 164795dfd29d40eb19db81baca79da076403f66c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Oct 2024 18:15:50 +0200 Subject: [PATCH 0181/1295] split up files more --- home/gnome-shared-dconf.nix | 42 ++++++++++++++++++++++ home/gnome.nix | 43 +---------------------- home/vinzenz/default.nix | 34 ++---------------- home/vinzenz/editorconfig.nix | 17 +++++++++ hosts/hetzner-vpn1/default.nix | 54 +---------------------------- hosts/hetzner-vpn1/nginx.nix | 52 +++++++++++++++++++++++++++ hosts/vinzenz-lpt2/default.nix | 41 ++-------------------- hosts/vinzenz-lpt2/nginx.nix | 26 ++++++++++++++ hosts/vinzenz-pc2/default.nix | 22 ++---------- hosts/vinzenz-pc2/vscode-server.nix | 16 +++++++++ modules/podman.nix | 11 ++++++ 11 files changed, 172 insertions(+), 186 deletions(-) create mode 100644 home/gnome-shared-dconf.nix create mode 100644 home/vinzenz/editorconfig.nix create mode 100644 hosts/hetzner-vpn1/nginx.nix create mode 100644 hosts/vinzenz-lpt2/nginx.nix create mode 100644 hosts/vinzenz-pc2/vscode-server.nix create mode 100644 modules/podman.nix diff --git a/home/gnome-shared-dconf.nix b/home/gnome-shared-dconf.nix new file mode 100644 index 00000000..58133e71 --- /dev/null +++ b/home/gnome-shared-dconf.nix @@ -0,0 +1,42 @@ +{ + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + clock-show-seconds = true; + show-battery-percentage = true; + }; + "org/gnome/mutter" = { + edge-tiling = true; + dynamic-workspaces = true; + }; + "org/gnome/desktop/peripherals/keyboard" = { + numlock-state = true; + }; + "org/gnome/desktop/peripherals/touchpad" = { + tap-to-click = true; + two-finger-scrolling-enabled = true; + }; + "org/gnome/tweaks" = { + show-extensions-notice = false; + }; + "org/gnome/shell" = { + disable-user-extensions = false; + disabled-extensions = []; + enabled-extensions = [ + "appindicatorsupport@rgcjonas.gmail.com" + "workspace-indicator@gnome-shell-extensions.gcampax.github.com" + "caffeine@patapon.info" + "GPaste@gnome-shell-extensions.gnome.org" + "gsconnect@andyholmes.github.io" + "solaar-extension@sidevesh" + ]; + }; + "ca/desrt/dconf-editor" = { + show-warning = false; + }; + "org/gnome/desktop/wm/keybindings" = { + switch-windows = ["Tab"]; + switch-windows-backward = ["Tab"]; + switch-applications = ["Tab"]; + switch-applications-backward = ["Tab"]; + }; +} diff --git a/home/gnome.nix b/home/gnome.nix index 828c0cea..c85a98d2 100644 --- a/home/gnome.nix +++ b/home/gnome.nix @@ -35,48 +35,7 @@ solaar-extension ]); - dconf.settings = { - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - clock-show-seconds = true; - show-battery-percentage = true; - }; - "org/gnome/mutter" = { - edge-tiling = true; - dynamic-workspaces = true; - }; - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; - "org/gnome/desktop/peripherals/touchpad" = { - tap-to-click = true; - two-finger-scrolling-enabled = true; - }; - "org/gnome/tweaks" = { - show-extensions-notice = false; - }; - "org/gnome/shell" = { - disable-user-extensions = false; - disabled-extensions = []; - enabled-extensions = [ - "appindicatorsupport@rgcjonas.gmail.com" - "workspace-indicator@gnome-shell-extensions.gcampax.github.com" - "caffeine@patapon.info" - "GPaste@gnome-shell-extensions.gnome.org" - "gsconnect@andyholmes.github.io" - "solaar-extension@sidevesh" - ]; - }; - "ca/desrt/dconf-editor" = { - show-warning = false; - }; - "org/gnome/desktop/wm/keybindings" = { - switch-windows = ["Tab"]; - switch-windows-backward = ["Tab"]; - switch-applications = ["Tab"]; - switch-applications-backward = ["Tab"]; - }; - }; + dconf.settings = import ./gnome-shared-dconf.nix; gtk = { enable = true; diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 27e4669f..b88bf1c2 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -18,20 +18,6 @@ inputs @ { nix-direnv.enable = true; }; - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - eza = { enable = true; git = true; @@ -43,6 +29,8 @@ inputs @ { }; }; + editorconfig = import ./editorconfig.nix; + home.packages = with pkgs; [ keepassxc insync @@ -62,24 +50,6 @@ inputs @ { jetbrains-toolbox ]; - editorconfig = { - enable = true; - settings = { - "*" = { - charset = "utf-8"; - end_of_line = "lf"; - trim_trailing_whitespace = true; - insert_final_newline = true; - max_line_width = 120; - indent_style = "space"; - indent_size = 4; - }; - "*.nix" = { - indent_size = 2; - }; - }; - }; - home.file."policy.json" = { target = ".config/containers/policy.json"; text = '' diff --git a/home/vinzenz/editorconfig.nix b/home/vinzenz/editorconfig.nix new file mode 100644 index 00000000..8eb39876 --- /dev/null +++ b/home/vinzenz/editorconfig.nix @@ -0,0 +1,17 @@ +{ + enable = true; + settings = { + "*" = { + charset = "utf-8"; + end_of_line = "lf"; + trim_trailing_whitespace = true; + insert_final_newline = true; + max_line_width = 120; + indent_style = "space"; + indent_size = 4; + }; + "*.nix" = { + indent_size = 2; + }; + }; +} diff --git a/hosts/hetzner-vpn1/default.nix b/hosts/hetzner-vpn1/default.nix index 35b060f2..d69b3c34 100644 --- a/hosts/hetzner-vpn1/default.nix +++ b/hosts/hetzner-vpn1/default.nix @@ -10,6 +10,7 @@ nixpkgs.lib.nixosSystem { common-modules ++ [ ./hardware.nix + ./nginx.nix ../../users/vinzenz.nix ../../users/ronja.nix { @@ -19,7 +20,6 @@ nixpkgs.lib.nixosSystem { # uncomment for build check on non arm system (requires --impure) # nixpkgs.buildPlatform = builtins.currentSystem; } - { users.users = { root.openssh.authorizedKeys.keys = [ @@ -39,57 +39,5 @@ nixpkgs.lib.nixosSystem { ]; }; } - { - security.acme = { - acceptTerms = true; - defaults.email = "acme@zerforschen.plus"; - }; - - security.pam.services.nginx.setEnvironment = false; - systemd.services.nginx.serviceConfig = { - SupplementaryGroups = ["shadow"]; - }; - - services.nginx = { - enable = true; - additionalModules = [pkgs.nginxModules.pam]; - - recommendedProxySettings = true; - recommendedTlsSettings = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; - - virtualHosts = let - servicesDomain = "services.zerforschen.plus"; - mkServiceConfig = host: port: { - addSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://${host}:${toString port}/"; - extraConfig = '' - # bind to tailscale ip - proxy_bind 100.88.118.60; - # pam auth - limit_except OPTIONS { - auth_pam "Password Required"; - auth_pam_service_name "nginx"; - } - ''; - }; - }; - lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net"; - pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; - in { - "vscode.${servicesDomain}" = lib.mkMerge [ - (mkServiceConfig pc2 8542) - {locations."/" .proxyWebsockets = true;} - ]; - "preon-app.${servicesDomain}" = mkServiceConfig pc2 8543; - "preon-api.${servicesDomain}" = mkServiceConfig pc2 8544; - }; - }; - - networking.firewall.allowedTCPPorts = [80 443]; - } ]; } diff --git a/hosts/hetzner-vpn1/nginx.nix b/hosts/hetzner-vpn1/nginx.nix new file mode 100644 index 00000000..e102194d --- /dev/null +++ b/hosts/hetzner-vpn1/nginx.nix @@ -0,0 +1,52 @@ +{pkgs, ...}: { + security.acme = { + acceptTerms = true; + defaults.email = "acme@zerforschen.plus"; + }; + + security.pam.services.nginx.setEnvironment = false; + systemd.services.nginx.serviceConfig = { + SupplementaryGroups = ["shadow"]; + }; + + services.nginx = { + enable = true; + additionalModules = [pkgs.nginxModules.pam]; + + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + + virtualHosts = let + servicesDomain = "services.zerforschen.plus"; + mkServiceConfig = host: port: { + addSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://${host}:${toString port}/"; + extraConfig = '' + # bind to tailscale ip + proxy_bind 100.88.118.60; + # pam auth + limit_except OPTIONS { + auth_pam "Password Required"; + auth_pam_service_name "nginx"; + } + ''; + }; + }; + lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net"; + pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; + in { + "vscode.${servicesDomain}" = lib.mkMerge [ + (mkServiceConfig pc2 8542) + {locations."/" .proxyWebsockets = true;} + ]; + "preon-app.${servicesDomain}" = mkServiceConfig pc2 8543; + "preon-api.${servicesDomain}" = mkServiceConfig pc2 8544; + }; + }; + + networking.firewall.allowedTCPPorts = [80 443]; +} diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix index 02e98abb..b65af8eb 100644 --- a/hosts/vinzenz-lpt2/default.nix +++ b/hosts/vinzenz-lpt2/default.nix @@ -11,6 +11,7 @@ nixpkgs.lib.nixosSystem { ++ desktop-modules ++ [ ./hardware.nix + ./nginx.nix ../../home/gnome.nix ../../users/vinzenz.nix @@ -18,6 +19,7 @@ nixpkgs.lib.nixosSystem { ../../modules/gaming.nix ../../modules/printing.nix ../../modules/latex.nix + ../../modules/podman.nix { networking.hostName = "vinzenz-lpt2"; @@ -36,44 +38,5 @@ nixpkgs.lib.nixosSystem { # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' #]; } - - { - virtualisation = { - containers.enable = true; - podman = { - enable = true; - dockerCompat = true; - dockerSocket.enable = true; - autoPrune.enable = true; - }; - }; - } - - { - services.nginx = { - enable = true; - - recommendedProxySettings = true; - recommendedTlsSettings = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; - - virtualHosts = { - "vinzenz-lpt2" = { - locations."/" = { - proxyPass = "http://127.0.0.1:3000/"; - proxyWebsockets = true; - }; - - serverAliases = ["172.23.42.96"]; - }; - }; - }; - - networking.firewall = { - allowedTCPPorts = [80 8001 3000]; - allowedUDPPorts = [2342]; - }; - } ]; } diff --git a/hosts/vinzenz-lpt2/nginx.nix b/hosts/vinzenz-lpt2/nginx.nix new file mode 100644 index 00000000..74db1c9a --- /dev/null +++ b/hosts/vinzenz-lpt2/nginx.nix @@ -0,0 +1,26 @@ +{...}: { + services.nginx = { + enable = true; + + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + + virtualHosts = { + "vinzenz-lpt2" = { + locations."/" = { + proxyPass = "http://127.0.0.1:3000/"; + proxyWebsockets = true; + }; + + serverAliases = ["172.23.42.96"]; + }; + }; + }; + + networking.firewall = { + allowedTCPPorts = [80 8001 3000]; + allowedUDPPorts = [2342]; + }; +} diff --git a/hosts/vinzenz-pc2/default.nix b/hosts/vinzenz-pc2/default.nix index 8d9ab6f2..827455fe 100644 --- a/hosts/vinzenz-pc2/default.nix +++ b/hosts/vinzenz-pc2/default.nix @@ -11,12 +11,14 @@ nixpkgs.lib.nixosSystem { ++ desktop-modules ++ [ ./hardware.nix + ./vscode-server.nix ../../home/gnome.nix ../../users/vinzenz.nix ../../users/ronja.nix ../../modules/gnome.nix ../../modules/gaming.nix ../../modules/printing.nix + ../../modules/podman.nix { networking.hostName = "vinzenz-pc2"; } @@ -36,25 +38,5 @@ nixpkgs.lib.nixosSystem { ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' ]; } - { - services.openvscode-server = { - enable = true; - telemetryLevel = "off"; - port = 8542; - host = "100.125.93.127"; # tailscale - withoutConnectionToken = true; - extraPackages = with pkgs; [nodejs git gh direnv]; - }; - - virtualisation.podman = { - enable = true; - }; - - networking = { - firewall = { - allowedTCPPorts = [8542 8543 8544 80]; - }; - }; - } ]; } diff --git a/hosts/vinzenz-pc2/vscode-server.nix b/hosts/vinzenz-pc2/vscode-server.nix new file mode 100644 index 00000000..a6645c51 --- /dev/null +++ b/hosts/vinzenz-pc2/vscode-server.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: { + services.openvscode-server = { + enable = true; + telemetryLevel = "off"; + port = 8542; + host = "100.125.93.127"; # tailscale + withoutConnectionToken = true; + extraPackages = with pkgs; [nodejs git gh direnv]; + }; + + networking = { + firewall = { + allowedTCPPorts = [8542 8543 8544 80]; + }; + }; +} diff --git a/modules/podman.nix b/modules/podman.nix new file mode 100644 index 00000000..03532f3d --- /dev/null +++ b/modules/podman.nix @@ -0,0 +1,11 @@ +{...}: { + virtualisation = { + containers.enable = true; + podman = { + enable = true; + dockerCompat = true; + dockerSocket.enable = true; + autoPrune.enable = true; + }; + }; +} From 5b19e487a5e61e1321a0aefa6ae4dd34b122bd3e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Oct 2024 18:27:13 +0200 Subject: [PATCH 0182/1295] fix missing import --- hosts/hetzner-vpn1/nginx.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/hetzner-vpn1/nginx.nix b/hosts/hetzner-vpn1/nginx.nix index e102194d..17b141a5 100644 --- a/hosts/hetzner-vpn1/nginx.nix +++ b/hosts/hetzner-vpn1/nginx.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +{pkgs, lib, ...}: { security.acme = { acceptTerms = true; defaults.email = "acme@zerforschen.plus"; From 8a53ddb890f82f7e2f0e7d2c480d0b2804822a79 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 27 Oct 2024 10:42:23 +0100 Subject: [PATCH 0183/1295] rename unfree option, open firewall for steam local network transfer --- common/nixpkgs.nix | 5 ++-- home/vinzenz/vscode.nix | 1 + hosts/hetzner-vpn1/nginx.nix | 6 ++++- hosts/vinzenz-pc2/hardware.nix | 2 +- modules/desktop-environment.nix | 13 ---------- modules/gaming.nix | 42 +++++++++++++++++++++++++++++---- modules/intel-graphics.nix | 2 +- users/vinzenz.nix | 12 ++++++++++ 8 files changed, 60 insertions(+), 23 deletions(-) diff --git a/common/nixpkgs.nix b/common/nixpkgs.nix index 8f5a12bd..9bb9184f 100644 --- a/common/nixpkgs.nix +++ b/common/nixpkgs.nix @@ -3,7 +3,7 @@ lib, ... }: { - options.my.allowUnfreePackages = lib.mkOption { + options.allowedUnfreePackages = lib.mkOption { type = lib.types.listOf lib.types.str; default = []; example = ["steam"]; @@ -11,7 +11,7 @@ config = { nixpkgs.config = { # https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085 - allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.my.allowUnfreePackages; + allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages; }; nix = { @@ -25,6 +25,7 @@ dates = "daily"; options = "--delete-older-than 7d"; }; + optimise.automatic = true; }; system = { diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index e88cef43..b19d1cc2 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -17,6 +17,7 @@ mkhl.direnv vadimcn.vscode-lldb ms-dotnettools.csharp + ms-vscode-remote.remote-ssh ]; userSettings = { "git.autofetch" = true; diff --git a/hosts/hetzner-vpn1/nginx.nix b/hosts/hetzner-vpn1/nginx.nix index 17b141a5..3db30bfe 100644 --- a/hosts/hetzner-vpn1/nginx.nix +++ b/hosts/hetzner-vpn1/nginx.nix @@ -1,4 +1,8 @@ -{pkgs, lib, ...}: { +{ + pkgs, + lib, + ... +}: { security.acme = { acceptTerms = true; defaults.email = "acme@zerforschen.plus"; diff --git a/hosts/vinzenz-pc2/hardware.nix b/hosts/vinzenz-pc2/hardware.nix index 68931948..30661dc8 100644 --- a/hosts/vinzenz-pc2/hardware.nix +++ b/hosts/vinzenz-pc2/hardware.nix @@ -15,6 +15,6 @@ fileSystems = import ./fstab.nix; swapDevices = []; - interfaces.eno1.wakeOnLan.enable = true; + networking.interfaces.eno1.wakeOnLan.enable = true; }; } diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index fa0e1b94..b0df118f 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -100,19 +100,6 @@ hunspellDicts.en-us-large ]; - nixpkgs.config.permittedInsecurePackages = []; - - my.allowUnfreePackages = [ - "insync" - "insync-pkg" - - "rider" - "pycharm-professional" - "jetbrains-toolbox" - - "anydesk" - ]; - fonts = { enableDefaultPackages = true; fontconfig.defaultFonts.monospace = ["FiraCode Nerd Font"]; diff --git a/modules/gaming.nix b/modules/gaming.nix index 2154d0f0..19f46c30 100644 --- a/modules/gaming.nix +++ b/modules/gaming.nix @@ -34,16 +34,48 @@ enable = true; remotePlay.openFirewall = true; dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + gamescopeSession.enable = true; }; gamemode.enable = true; }; - networking.firewall.allowedUDPPorts = [ - # Factorio - 34197 - ]; + networking.firewall = { + allowedUDPPorts = [ + # Factorio + 34197 - my.allowUnfreePackages = [ + # steam network transfer + 3478 + ]; + + allowedTCPPorts = [ + # steam network transfer + 24070 + ]; + + allowedTCPPortRanges = [ + # steam network transfer + { + from = 27015; + to = 27050; + } + ]; + + allowedUDPPortRanges = [ + # steam network transfer + { + from = 4379; + to = 4380; + } + { + from = 27000; + to = 27100; + } + ]; + }; + + allowedUnfreePackages = [ "steam" "steam-original" "steam-run" diff --git a/modules/intel-graphics.nix b/modules/intel-graphics.nix index 35decc06..4ac5f821 100644 --- a/modules/intel-graphics.nix +++ b/modules/intel-graphics.nix @@ -23,6 +23,6 @@ environment.systemPackages = with pkgs; [ nvtopPackages.intel ]; - my.allowUnfreePackages = ["intel-ocl"]; + allowedUnfreePackages = ["intel-ocl"]; }; } diff --git a/users/vinzenz.nix b/users/vinzenz.nix index d4bbde45..e965602e 100644 --- a/users/vinzenz.nix +++ b/users/vinzenz.nix @@ -9,5 +9,17 @@ shell = pkgs.zsh; autoSubUidGidRange = true; }; + + allowedUnfreePackages = [ + "vscode-extension-ms-vscode-remote-remote-ssh" + "insync" + "insync-pkg" + + "rider" + "pycharm-professional" + "jetbrains-toolbox" + + "anydesk" + ]; }; } From b78e40ad6a1630405688f0c52a4931b2d72b0b35 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 27 Oct 2024 12:26:59 +0100 Subject: [PATCH 0184/1295] remove unused declarations --- flake.nix | 2 +- home/default.nix | 7 +------ home/gnome.nix | 1 - home/vinzenz/default.nix | 8 +------- hosts/hetzner-vpn1/default.nix | 1 - hosts/hetzner-vpn1/nginx.nix | 1 - hosts/vinzenz-lpt2/hardware.nix | 6 +----- modules/amd-graphics.nix | 2 -- modules/desktop-environment.nix | 1 - modules/gaming.nix | 1 - modules/gnome.nix | 1 - modules/intel-graphics.nix | 1 - modules/latex.nix | 7 +------ modules/printing.nix | 7 +------ 14 files changed, 6 insertions(+), 40 deletions(-) diff --git a/flake.nix b/flake.nix index 4402c2e2..56e3db04 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ }; }; - outputs = inputs @ { + outputs = { nixpkgs, home-manager, lix-module, diff --git a/home/default.nix b/home/default.nix index 2cf09f9a..567952f4 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,9 +1,4 @@ -{ - config, - pkgs, - lib, - ... -}: { +{config, ...}: { config = { home-manager = { useGlobalPkgs = true; diff --git a/home/gnome.nix b/home/gnome.nix index c85a98d2..47f10b35 100644 --- a/home/gnome.nix +++ b/home/gnome.nix @@ -1,5 +1,4 @@ { - lib, config, pkgs, ... diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index b88bf1c2..ff80b8e2 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -1,10 +1,4 @@ -inputs @ { - config, - osConfig, - pkgs, - lib, - ... -}: { +inputs @ {pkgs, ...}: { programs = { home-manager.enable = true; fzf.enable = true; diff --git a/hosts/hetzner-vpn1/default.nix b/hosts/hetzner-vpn1/default.nix index d69b3c34..f284bd46 100644 --- a/hosts/hetzner-vpn1/default.nix +++ b/hosts/hetzner-vpn1/default.nix @@ -1,7 +1,6 @@ { nixpkgs, common-modules, - desktop-modules, ... }: nixpkgs.lib.nixosSystem { diff --git a/hosts/hetzner-vpn1/nginx.nix b/hosts/hetzner-vpn1/nginx.nix index 3db30bfe..ca9c938e 100644 --- a/hosts/hetzner-vpn1/nginx.nix +++ b/hosts/hetzner-vpn1/nginx.nix @@ -40,7 +40,6 @@ ''; }; }; - lpt2 = "vinzenz-lpt2.donkey-pentatonic.ts.net"; pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; in { "vscode.${servicesDomain}" = lib.mkMerge [ diff --git a/hosts/vinzenz-lpt2/hardware.nix b/hosts/vinzenz-lpt2/hardware.nix index a6e5ff59..6c53492a 100644 --- a/hosts/vinzenz-lpt2/hardware.nix +++ b/hosts/vinzenz-lpt2/hardware.nix @@ -1,8 +1,4 @@ -{ - pkgs, - lib, - ... -}: { +{lib, ...}: { imports = [ ../../modules/intel-graphics.nix ]; diff --git a/modules/amd-graphics.nix b/modules/amd-graphics.nix index 426119e6..c4c2d00c 100644 --- a/modules/amd-graphics.nix +++ b/modules/amd-graphics.nix @@ -1,6 +1,4 @@ { - lib, - config, pkgs, ... }: { diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index b0df118f..79e4c0fe 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -1,7 +1,6 @@ { config, pkgs, - lib, ... }: { config = { diff --git a/modules/gaming.nix b/modules/gaming.nix index 19f46c30..f66f810f 100644 --- a/modules/gaming.nix +++ b/modules/gaming.nix @@ -1,7 +1,6 @@ { config, pkgs, - lib, ... }: { config = { diff --git a/modules/gnome.nix b/modules/gnome.nix index 58fe4eeb..5aadbcc1 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -1,7 +1,6 @@ { config, pkgs, - lib, ... }: { config = { diff --git a/modules/intel-graphics.nix b/modules/intel-graphics.nix index 4ac5f821..5bbf846b 100644 --- a/modules/intel-graphics.nix +++ b/modules/intel-graphics.nix @@ -1,5 +1,4 @@ { - lib, config, pkgs, ... diff --git a/modules/latex.nix b/modules/latex.nix index 93384bb8..bee5f21e 100644 --- a/modules/latex.nix +++ b/modules/latex.nix @@ -1,9 +1,4 @@ -{ - config, - pkgs, - lib, - ... -}: { +{pkgs, ...}: { config = { environment.systemPackages = with pkgs; [ fontconfig diff --git a/modules/printing.nix b/modules/printing.nix index f60272ee..32f9efc3 100644 --- a/modules/printing.nix +++ b/modules/printing.nix @@ -1,9 +1,4 @@ -{ - config, - pkgs, - lib, - ... -}: { +{...}: { config = { services = { # Enable CUPS to print documents. From b9adba3225d083243f831a58e6b21ad6dc054b0c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 27 Oct 2024 12:33:35 +0100 Subject: [PATCH 0185/1295] nix fmt rcf-style --- common/default.nix | 3 +- common/globalinstalls.nix | 5 ++- common/i18n.nix | 3 +- common/networking.nix | 3 +- common/nixpkgs.nix | 21 +++++---- flake.nix | 61 ++++++++++++++----------- home/default.nix | 3 +- home/gnome-shared-dconf.nix | 10 ++--- home/gnome.nix | 22 +++------ home/ronja.nix | 11 ++--- home/shared-modules.nix | 4 +- home/vinzenz/default.nix | 3 +- home/vinzenz/vscode.nix | 3 +- home/vinzenz/zsh.nix | 10 ++++- hosts/hetzner-vpn1/default.nix | 70 +++++++++++++---------------- hosts/hetzner-vpn1/hardware.nix | 19 ++++---- hosts/hetzner-vpn1/nginx.nix | 66 ++++++++++++++------------- hosts/vinzenz-lpt2/default.nix | 2 +- hosts/vinzenz-lpt2/hardware.nix | 17 ++++--- hosts/vinzenz-lpt2/nginx.nix | 13 ++++-- hosts/vinzenz-pc2/default.nix | 4 +- hosts/vinzenz-pc2/fstab.nix | 8 ++-- hosts/vinzenz-pc2/hardware.nix | 19 +++++--- hosts/vinzenz-pc2/vscode-server.nix | 17 +++++-- modules/amd-graphics.nix | 20 +++------ modules/desktop-environment.nix | 16 +++---- modules/desktop-hardware.nix | 12 +++-- modules/gaming.nix | 9 ++-- modules/gnome.nix | 12 ++--- modules/intel-graphics.nix | 11 ++--- modules/latex.nix | 3 +- modules/podman.nix | 3 +- modules/printing.nix | 3 +- users/ronja.nix | 10 ++++- users/vinzenz.nix | 12 ++++- 35 files changed, 270 insertions(+), 238 deletions(-) diff --git a/common/default.nix b/common/default.nix index 326c69ce..ddbf3bcc 100644 --- a/common/default.nix +++ b/common/default.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ imports = [ ./nixpkgs.nix ./globalinstalls.nix diff --git a/common/globalinstalls.nix b/common/globalinstalls.nix index 20bf11d9..42dd28e3 100644 --- a/common/globalinstalls.nix +++ b/common/globalinstalls.nix @@ -1,7 +1,8 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ config = { environment = { - pathsToLink = ["/share/zsh"]; + pathsToLink = [ "/share/zsh" ]; systemPackages = with pkgs; [ ncdu glances diff --git a/common/i18n.nix b/common/i18n.nix index d3fbebc0..ee498a9e 100644 --- a/common/i18n.nix +++ b/common/i18n.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ config = { time.timeZone = "Europe/Berlin"; i18n = { diff --git a/common/networking.nix b/common/networking.nix index 94bc82dc..05140c20 100644 --- a/common/networking.nix +++ b/common/networking.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ config = { services.openssh = { enable = true; diff --git a/common/nixpkgs.nix b/common/nixpkgs.nix index 9bb9184f..d4456be5 100644 --- a/common/nixpkgs.nix +++ b/common/nixpkgs.nix @@ -1,12 +1,9 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { options.allowedUnfreePackages = lib.mkOption { type = lib.types.listOf lib.types.str; - default = []; - example = ["steam"]; + default = [ ]; + example = [ "steam" ]; }; config = { nixpkgs.config = { @@ -16,9 +13,15 @@ nix = { settings = { - substituters = ["https://nix-community.cachix.org" "https://cache.nixos.org/"]; - trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="]; - experimental-features = ["nix-command" "flakes"]; + substituters = [ + "https://nix-community.cachix.org" + "https://cache.nixos.org/" + ]; + trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; }; gc = { automatic = true; diff --git a/flake.nix b/flake.nix index 56e3db04..2145ecc0 100644 --- a/flake.nix +++ b/flake.nix @@ -11,32 +11,41 @@ }; }; - outputs = { - nixpkgs, - home-manager, - lix-module, - ... - }: { - nixosConfigurations = let - host-params = { - inherit nixpkgs; - inherit home-manager; - inherit lix-module; - common-modules = [ - lix-module.nixosModules.default - ./common - ]; - desktop-modules = [ - home-manager.nixosModules.home-manager - ./home - ./modules/desktop-environment.nix - ./modules/desktop-hardware.nix - ]; + outputs = + { + nixpkgs, + home-manager, + lix-module, + ... + }: + { + nixosConfigurations = + let + host-params = { + inherit nixpkgs; + inherit home-manager; + inherit lix-module; + common-modules = [ + lix-module.nixosModules.default + ./common + ]; + desktop-modules = [ + home-manager.nixosModules.home-manager + ./home + ./modules/desktop-environment.nix + ./modules/desktop-hardware.nix + ]; + }; + in + { + vinzenz-lpt2 = import ./hosts/vinzenz-lpt2 host-params; + vinzenz-pc2 = import ./hosts/vinzenz-pc2 host-params; + hetzner-vpn1 = import ./hosts/hetzner-vpn1 host-params; + }; + + formatter = { + x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; + aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.nixfmt-rfc-style; }; - in { - vinzenz-lpt2 = import ./hosts/vinzenz-lpt2 host-params; - vinzenz-pc2 = import ./hosts/vinzenz-pc2 host-params; - hetzner-vpn1 = import ./hosts/hetzner-vpn1 host-params; }; - }; } diff --git a/home/default.nix b/home/default.nix index 567952f4..d59fbbb8 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,4 +1,5 @@ -{config, ...}: { +{ config, ... }: +{ config = { home-manager = { useGlobalPkgs = true; diff --git a/home/gnome-shared-dconf.nix b/home/gnome-shared-dconf.nix index 58133e71..3ba78943 100644 --- a/home/gnome-shared-dconf.nix +++ b/home/gnome-shared-dconf.nix @@ -20,7 +20,7 @@ }; "org/gnome/shell" = { disable-user-extensions = false; - disabled-extensions = []; + disabled-extensions = [ ]; enabled-extensions = [ "appindicatorsupport@rgcjonas.gmail.com" "workspace-indicator@gnome-shell-extensions.gcampax.github.com" @@ -34,9 +34,9 @@ show-warning = false; }; "org/gnome/desktop/wm/keybindings" = { - switch-windows = ["Tab"]; - switch-windows-backward = ["Tab"]; - switch-applications = ["Tab"]; - switch-applications-backward = ["Tab"]; + switch-windows = [ "Tab" ]; + switch-windows-backward = [ "Tab" ]; + switch-applications = [ "Tab" ]; + switch-applications-backward = [ "Tab" ]; }; } diff --git a/home/gnome.nix b/home/gnome.nix index 47f10b35..019ae648 100644 --- a/home/gnome.nix +++ b/home/gnome.nix @@ -1,15 +1,11 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { - imports = [ - ../modules/gnome.nix - ]; + imports = [ ../modules/gnome.nix ]; config = { home-manager.sharedModules = [ { - home.packages = with pkgs; + home.packages = + with pkgs; [ amberol gitg @@ -48,14 +44,8 @@ } { - home.packages = with pkgs; - [ - trayscale - ] - ++ (with gnomeExtensions; [ - tailscale-qs - ]); - dconf.settings."org/gnome/shell".enabled-extensions = ["tailscale@joaophi.github.com"]; + home.packages = with pkgs; [ trayscale ] ++ (with gnomeExtensions; [ tailscale-qs ]); + dconf.settings."org/gnome/shell".enabled-extensions = [ "tailscale@joaophi.github.com" ]; } ]; }; diff --git a/home/ronja.nix b/home/ronja.nix index 04572041..c0e0f054 100644 --- a/home/ronja.nix +++ b/home/ronja.nix @@ -1,8 +1,5 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { home.packages = with pkgs; [ ## Apps telegram-desktop @@ -22,7 +19,11 @@ oh-my-zsh = { enable = true; theme = "agnoster"; - plugins = ["git" "sudo" "systemadmin"]; + plugins = [ + "git" + "sudo" + "systemadmin" + ]; }; }; diff --git a/home/shared-modules.nix b/home/shared-modules.nix index 3ad3365e..dbc3d590 100644 --- a/home/shared-modules.nix +++ b/home/shared-modules.nix @@ -1,8 +1,6 @@ [ # set stateVersion - { - home.stateVersion = "22.11"; - } + { home.stateVersion = "22.11"; } # make nano the default editor { home = { diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index ff80b8e2..2f8890b7 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -1,4 +1,5 @@ -inputs @ {pkgs, ...}: { +inputs@{ pkgs, ... }: +{ programs = { home-manager.enable = true; fzf.enable = true; diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index b19d1cc2..f44f25b1 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ enable = true; package = pkgs.vscodium; enableUpdateCheck = false; diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index c6d011c7..9b85c052 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -1,4 +1,5 @@ -{config, ...}: { +{ config, ... }: +{ initExtra = '' eval "$(direnv hook zsh)"; export PATH=$PATH:/home/vinzenz/.cargo/bin @@ -24,6 +25,11 @@ oh-my-zsh = { enable = true; theme = "agnoster"; - plugins = ["git" "sudo" "docker" "systemadmin"]; + plugins = [ + "git" + "sudo" + "docker" + "systemadmin" + ]; }; } diff --git a/hosts/hetzner-vpn1/default.nix b/hosts/hetzner-vpn1/default.nix index f284bd46..e384574e 100644 --- a/hosts/hetzner-vpn1/default.nix +++ b/hosts/hetzner-vpn1/default.nix @@ -1,42 +1,34 @@ -{ - nixpkgs, - common-modules, - ... -}: +{ nixpkgs, common-modules, ... }: nixpkgs.lib.nixosSystem { system = "aarch64-linux"; - modules = - common-modules - ++ [ - ./hardware.nix - ./nginx.nix - ../../users/vinzenz.nix - ../../users/ronja.nix - { - networking.hostName = "hetzner-vpn1"; - } - { - # uncomment for build check on non arm system (requires --impure) - # nixpkgs.buildPlatform = builtins.currentSystem; - } - { - users.users = { - root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - ]; - }; - } - ]; + modules = common-modules ++ [ + ./hardware.nix + ./nginx.nix + ../../users/vinzenz.nix + ../../users/ronja.nix + { networking.hostName = "hetzner-vpn1"; } + { + # uncomment for build check on non arm system (requires --impure) + # nixpkgs.buildPlatform = builtins.currentSystem; + } + { + users.users = { + root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + ]; + }; + } + ]; } diff --git a/hosts/hetzner-vpn1/hardware.nix b/hosts/hetzner-vpn1/hardware.nix index 7494a08c..66be3890 100644 --- a/hosts/hetzner-vpn1/hardware.nix +++ b/hosts/hetzner-vpn1/hardware.nix @@ -1,11 +1,6 @@ +{ lib, modulesPath, ... }: { - lib, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; config = { nixpkgs = { @@ -26,8 +21,12 @@ }; }; initrd = { - availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"]; - kernelModules = ["nvme"]; + availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "xen_blkfront" + ]; + kernelModules = [ "nvme" ]; }; }; @@ -48,7 +47,7 @@ # This file was populated at runtime with the networking # details gathered from the active system. networking = { - nameservers = ["8.8.8.8"]; + nameservers = [ "8.8.8.8" ]; defaultGateway = "172.31.1.1"; defaultGateway6 = { address = "fe80::1"; diff --git a/hosts/hetzner-vpn1/nginx.nix b/hosts/hetzner-vpn1/nginx.nix index ca9c938e..f49ff6fb 100644 --- a/hosts/hetzner-vpn1/nginx.nix +++ b/hosts/hetzner-vpn1/nginx.nix @@ -1,8 +1,5 @@ +{ pkgs, lib, ... }: { - pkgs, - lib, - ... -}: { security.acme = { acceptTerms = true; defaults.email = "acme@zerforschen.plus"; @@ -10,46 +7,51 @@ security.pam.services.nginx.setEnvironment = false; systemd.services.nginx.serviceConfig = { - SupplementaryGroups = ["shadow"]; + SupplementaryGroups = [ "shadow" ]; }; services.nginx = { enable = true; - additionalModules = [pkgs.nginxModules.pam]; + additionalModules = [ pkgs.nginxModules.pam ]; recommendedProxySettings = true; recommendedTlsSettings = true; recommendedGzipSettings = true; recommendedOptimisation = true; - virtualHosts = let - servicesDomain = "services.zerforschen.plus"; - mkServiceConfig = host: port: { - addSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://${host}:${toString port}/"; - extraConfig = '' - # bind to tailscale ip - proxy_bind 100.88.118.60; - # pam auth - limit_except OPTIONS { - auth_pam "Password Required"; - auth_pam_service_name "nginx"; - } - ''; + virtualHosts = + let + servicesDomain = "services.zerforschen.plus"; + mkServiceConfig = host: port: { + addSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://${host}:${toString port}/"; + extraConfig = '' + # bind to tailscale ip + proxy_bind 100.88.118.60; + # pam auth + limit_except OPTIONS { + auth_pam "Password Required"; + auth_pam_service_name "nginx"; + } + ''; + }; }; + pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; + in + { + "vscode.${servicesDomain}" = lib.mkMerge [ + (mkServiceConfig pc2 8542) + { locations."/".proxyWebsockets = true; } + ]; + "preon-app.${servicesDomain}" = mkServiceConfig pc2 8543; + "preon-api.${servicesDomain}" = mkServiceConfig pc2 8544; }; - pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; - in { - "vscode.${servicesDomain}" = lib.mkMerge [ - (mkServiceConfig pc2 8542) - {locations."/" .proxyWebsockets = true;} - ]; - "preon-app.${servicesDomain}" = mkServiceConfig pc2 8543; - "preon-api.${servicesDomain}" = mkServiceConfig pc2 8544; - }; }; - networking.firewall.allowedTCPPorts = [80 443]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; } diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix index b65af8eb..ab2b42dc 100644 --- a/hosts/vinzenz-lpt2/default.nix +++ b/hosts/vinzenz-lpt2/default.nix @@ -23,7 +23,7 @@ nixpkgs.lib.nixosSystem { { networking.hostName = "vinzenz-lpt2"; - nix.settings.extra-platforms = ["aarch64-linux"]; + nix.settings.extra-platforms = [ "aarch64-linux" ]; } { diff --git a/hosts/vinzenz-lpt2/hardware.nix b/hosts/vinzenz-lpt2/hardware.nix index 6c53492a..82dd9753 100644 --- a/hosts/vinzenz-lpt2/hardware.nix +++ b/hosts/vinzenz-lpt2/hardware.nix @@ -1,10 +1,9 @@ -{lib, ...}: { - imports = [ - ../../modules/intel-graphics.nix - ]; +{ lib, ... }: +{ + imports = [ ../../modules/intel-graphics.nix ]; config = { # intel cpu - boot.kernelModules = ["kvm-intel"]; + boot.kernelModules = [ "kvm-intel" ]; hardware.cpu.intel.updateMicrocode = true; boot.loader = { @@ -23,7 +22,11 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; boot.initrd = { - availableKernelModules = ["xhci_pci" "thunderbolt" "nvme"]; + availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "nvme" + ]; luks.devices = { "luks-2c654ff2-3c42-48d3-a1e3-9545679afaa3" = { device = "/dev/disk/by-uuid/2c654ff2-3c42-48d3-a1e3-9545679afaa3"; @@ -35,7 +38,7 @@ "/" = { device = "/dev/disk/by-uuid/e4dad0c8-26a1-45e9-bbd9-48565eb6574e"; fsType = "btrfs"; - options = ["subvol=@"]; + options = [ "subvol=@" ]; }; "/boot" = { diff --git a/hosts/vinzenz-lpt2/nginx.nix b/hosts/vinzenz-lpt2/nginx.nix index 74db1c9a..8c82c3f9 100644 --- a/hosts/vinzenz-lpt2/nginx.nix +++ b/hosts/vinzenz-lpt2/nginx.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ services.nginx = { enable = true; @@ -14,13 +15,17 @@ proxyWebsockets = true; }; - serverAliases = ["172.23.42.96"]; + serverAliases = [ "172.23.42.96" ]; }; }; }; networking.firewall = { - allowedTCPPorts = [80 8001 3000]; - allowedUDPPorts = [2342]; + allowedTCPPorts = [ + 80 + 8001 + 3000 + ]; + allowedUDPPorts = [ 2342 ]; }; } diff --git a/hosts/vinzenz-pc2/default.nix b/hosts/vinzenz-pc2/default.nix index 827455fe..318efaba 100644 --- a/hosts/vinzenz-pc2/default.nix +++ b/hosts/vinzenz-pc2/default.nix @@ -19,9 +19,7 @@ nixpkgs.lib.nixosSystem { ../../modules/gaming.nix ../../modules/printing.nix ../../modules/podman.nix - { - networking.hostName = "vinzenz-pc2"; - } + { networking.hostName = "vinzenz-pc2"; } { home-manager.users = { vinzenz = import ../../home/vinzenz; diff --git a/hosts/vinzenz-pc2/fstab.nix b/hosts/vinzenz-pc2/fstab.nix index 19fd5ffe..1c9c7e51 100644 --- a/hosts/vinzenz-pc2/fstab.nix +++ b/hosts/vinzenz-pc2/fstab.nix @@ -2,19 +2,19 @@ "/" = { device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; fsType = "btrfs"; - options = ["subvol=@"]; + options = [ "subvol=@" ]; }; "/home" = { device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; fsType = "btrfs"; - options = ["subvol=@home"]; + options = [ "subvol=@home" ]; }; "/games" = { device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; fsType = "btrfs"; - options = ["subvol=@games"]; + options = [ "subvol=@games" ]; }; "/boot" = { @@ -27,7 +27,7 @@ # this is convenient for managing the flat subvolume hierarchy device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; fsType = "btrfs"; - options = ["subvolid=5"]; + options = [ "subvolid=5" ]; }; "/mnt/ssd2" = { diff --git a/hosts/vinzenz-pc2/hardware.nix b/hosts/vinzenz-pc2/hardware.nix index 30661dc8..316d9a24 100644 --- a/hosts/vinzenz-pc2/hardware.nix +++ b/hosts/vinzenz-pc2/hardware.nix @@ -1,19 +1,24 @@ -{...}: { - imports = [ - ../../modules/amd-graphics.nix - ]; +{ ... }: +{ + imports = [ ../../modules/amd-graphics.nix ]; config = { # amd cpu - boot.kernelModules = ["kvm-amd"]; + boot.kernelModules = [ "kvm-amd" ]; hardware.cpu.amd.updateMicrocode = true; boot = { - initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" + initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "sd_mod" + ]; # "usb_storage" loader.efi.efiSysMountPoint = "/boot"; }; fileSystems = import ./fstab.nix; - swapDevices = []; + swapDevices = [ ]; networking.interfaces.eno1.wakeOnLan.enable = true; }; diff --git a/hosts/vinzenz-pc2/vscode-server.nix b/hosts/vinzenz-pc2/vscode-server.nix index a6645c51..6f8e2d4a 100644 --- a/hosts/vinzenz-pc2/vscode-server.nix +++ b/hosts/vinzenz-pc2/vscode-server.nix @@ -1,16 +1,27 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ services.openvscode-server = { enable = true; telemetryLevel = "off"; port = 8542; host = "100.125.93.127"; # tailscale withoutConnectionToken = true; - extraPackages = with pkgs; [nodejs git gh direnv]; + extraPackages = with pkgs; [ + nodejs + git + gh + direnv + ]; }; networking = { firewall = { - allowedTCPPorts = [8542 8543 8544 80]; + allowedTCPPorts = [ + 8542 + 8543 + 8544 + 80 + ]; }; }; } diff --git a/modules/amd-graphics.nix b/modules/amd-graphics.nix index c4c2d00c..8a621945 100644 --- a/modules/amd-graphics.nix +++ b/modules/amd-graphics.nix @@ -1,22 +1,14 @@ +{ pkgs, ... }: { - pkgs, - ... -}: { config = { - boot.kernelModules = ["amdgpu"]; - services.xserver.videoDrivers = ["amdgpu"]; + boot.kernelModules = [ "amdgpu" ]; + services.xserver.videoDrivers = [ "amdgpu" ]; hardware.opengl = { - extraPackages = with pkgs; [ - amdvlk - ]; - extraPackages32 = with pkgs; [ - driversi686Linux.amdvlk - ]; + extraPackages = with pkgs; [ amdvlk ]; + extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ]; }; - environment.systemPackages = with pkgs; [ - nvtopPackages.amd - ]; + environment.systemPackages = with pkgs; [ nvtopPackages.amd ]; }; } diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index 79e4c0fe..d3a7a105 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -1,8 +1,5 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { config = { services = { xserver.enable = true; @@ -31,7 +28,10 @@ kdeconnect.enable = true; firefox = { enable = true; - languagePacks = ["en-US" "de"]; + languagePacks = [ + "en-US" + "de" + ]; }; nix-ld = { enable = true; @@ -101,10 +101,8 @@ fonts = { enableDefaultPackages = true; - fontconfig.defaultFonts.monospace = ["FiraCode Nerd Font"]; - packages = with pkgs; [ - (nerdfonts.override {fonts = ["FiraCode"];}) - ]; + fontconfig.defaultFonts.monospace = [ "FiraCode Nerd Font" ]; + packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) ]; }; hardware.logitech.wireless = { diff --git a/modules/desktop-hardware.nix b/modules/desktop-hardware.nix index ac8be035..62d0ab9b 100644 --- a/modules/desktop-hardware.nix +++ b/modules/desktop-hardware.nix @@ -3,13 +3,17 @@ pkgs, config, ... -}: { +}: +{ config = { boot = { kernelPackages = pkgs.linuxPackages_zen; - kernelParams = ["quiet" "udev.log_level=3"]; - supportedFilesystems = ["btrfs"]; - initrd.supportedFilesystems = ["btrfs"]; + kernelParams = [ + "quiet" + "udev.log_level=3" + ]; + supportedFilesystems = [ "btrfs" ]; + initrd.supportedFilesystems = [ "btrfs" ]; consoleLogLevel = 0; initrd.verbose = false; plymouth.enable = true; diff --git a/modules/gaming.nix b/modules/gaming.nix index f66f810f..c069b9a7 100644 --- a/modules/gaming.nix +++ b/modules/gaming.nix @@ -1,15 +1,12 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { config = { hardware = { opengl = { driSupport = true; driSupport32Bit = true; - extraPackages = with pkgs; [mangohud]; - extraPackages32 = with pkgs; [mangohud]; + extraPackages = with pkgs; [ mangohud ]; + extraPackages32 = with pkgs; [ mangohud ]; }; steam-hardware.enable = true; diff --git a/modules/gnome.nix b/modules/gnome.nix index 5aadbcc1..49a4d0e4 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -1,8 +1,5 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { config = { services = { xserver = { @@ -41,9 +38,12 @@ pkgs.gnome-tour ]; - environment.systemPackages = with pkgs; [gnome.ghex impression]; + environment.systemPackages = with pkgs; [ + gnome.ghex + impression + ]; # RDP connections - networking.firewall.allowedTCPPorts = [3389]; + networking.firewall.allowedTCPPorts = [ 3389 ]; }; } diff --git a/modules/intel-graphics.nix b/modules/intel-graphics.nix index 5bbf846b..3d5655f9 100644 --- a/modules/intel-graphics.nix +++ b/modules/intel-graphics.nix @@ -1,8 +1,5 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { config = { hardware.opengl = { extraPackages = with pkgs; [ @@ -19,9 +16,7 @@ libvdpau-va-gl ]; }; - environment.systemPackages = with pkgs; [ - nvtopPackages.intel - ]; - allowedUnfreePackages = ["intel-ocl"]; + environment.systemPackages = with pkgs; [ nvtopPackages.intel ]; + allowedUnfreePackages = [ "intel-ocl" ]; }; } diff --git a/modules/latex.nix b/modules/latex.nix index bee5f21e..3d097f8a 100644 --- a/modules/latex.nix +++ b/modules/latex.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ config = { environment.systemPackages = with pkgs; [ fontconfig diff --git a/modules/podman.nix b/modules/podman.nix index 03532f3d..eb1914bc 100644 --- a/modules/podman.nix +++ b/modules/podman.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ virtualisation = { containers.enable = true; podman = { diff --git a/modules/printing.nix b/modules/printing.nix index 32f9efc3..b198d6cb 100644 --- a/modules/printing.nix +++ b/modules/printing.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ config = { services = { # Enable CUPS to print documents. diff --git a/users/ronja.nix b/users/ronja.nix index b8a271d7..547f31bf 100644 --- a/users/ronja.nix +++ b/users/ronja.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ config = { # Define user account users.users.ronja = { @@ -6,7 +7,12 @@ name = "ronja"; description = "Ronja"; home = "/home/ronja"; - extraGroups = ["networkmanager" "wheel" "games" "podman"]; + extraGroups = [ + "networkmanager" + "wheel" + "games" + "podman" + ]; shell = pkgs.zsh; }; }; diff --git a/users/vinzenz.nix b/users/vinzenz.nix index e965602e..77bc2a1d 100644 --- a/users/vinzenz.nix +++ b/users/vinzenz.nix @@ -1,11 +1,19 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ config = { users.users.vinzenz = { isNormalUser = true; name = "vinzenz"; description = "Vinzenz"; home = "/home/vinzenz"; - extraGroups = ["networkmanager" "wheel" "games" "dialout" "podman" "nginx"]; + extraGroups = [ + "networkmanager" + "wheel" + "games" + "dialout" + "podman" + "nginx" + ]; shell = pkgs.zsh; autoSubUidGidRange = true; }; From d0a6abd2d89c48437ed20810322286ec4b80b1d4 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 27 Oct 2024 12:42:26 +0100 Subject: [PATCH 0186/1295] statix fix --- common/i18n.nix | 2 +- common/networking.nix | 2 +- home/vinzenz/zsh.nix | 3 +++ hosts/vinzenz-lpt2/nginx.nix | 2 +- modules/podman.nix | 2 +- modules/printing.nix | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/common/i18n.nix b/common/i18n.nix index ee498a9e..29036489 100644 --- a/common/i18n.nix +++ b/common/i18n.nix @@ -1,4 +1,4 @@ -{ ... }: +_: { config = { time.timeZone = "Europe/Berlin"; diff --git a/common/networking.nix b/common/networking.nix index 05140c20..6bcfb500 100644 --- a/common/networking.nix +++ b/common/networking.nix @@ -1,4 +1,4 @@ -{ ... }: +_: { config = { services.openssh = { diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index 9b85c052..5aa3fcbf 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -14,6 +14,9 @@ my-test = "sudo nixos-rebuild test"; my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; my-ip4 = "ip addr show | grep 192"; + deadnix = "nix run github:astro/deadnix -- "; + statix = "nix run git+https://git.peppe.rs/languages/statix -- "; + my-nix-fixup = "deadnix -e && statix fix"; }; history = { diff --git a/hosts/vinzenz-lpt2/nginx.nix b/hosts/vinzenz-lpt2/nginx.nix index 8c82c3f9..76378f77 100644 --- a/hosts/vinzenz-lpt2/nginx.nix +++ b/hosts/vinzenz-lpt2/nginx.nix @@ -1,4 +1,4 @@ -{ ... }: +_: { services.nginx = { enable = true; diff --git a/modules/podman.nix b/modules/podman.nix index eb1914bc..8d37dd66 100644 --- a/modules/podman.nix +++ b/modules/podman.nix @@ -1,4 +1,4 @@ -{ ... }: +_: { virtualisation = { containers.enable = true; diff --git a/modules/printing.nix b/modules/printing.nix index b198d6cb..b7171ada 100644 --- a/modules/printing.nix +++ b/modules/printing.nix @@ -1,4 +1,4 @@ -{ ... }: +_: { config = { services = { From f3e61c58cc027d6fad1cf16ad81bab58c186fcf1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 31 Oct 2024 13:50:31 +0100 Subject: [PATCH 0187/1295] flake update --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 5881a011..6b14b4c2 100644 --- a/flake.lock +++ b/flake.lock @@ -82,7 +82,7 @@ "narHash": "sha256-6U0CyPycIBc04hbYy2hBINnVso58n/ZyywY2BD3hu+s=", "rev": "9098ac95768f7006d7e070b88bae76939f6034e6", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/9098ac95768f7006d7e070b88bae76939f6034e6.tar.gz" + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/9098ac95768f7006d7e070b88bae76939f6034e6.tar.gz?rev=9098ac95768f7006d7e070b88bae76939f6034e6" }, "original": { "type": "tarball", @@ -91,11 +91,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1729691686, - "narHash": "sha256-BAuPWW+9fa1moZTU+jFh+1cUtmsuF8asgzFwejM4wac=", + "lastModified": 1730137625, + "narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "32e940c7c420600ef0d1ef396dc63b04ee9cad37", + "rev": "64b80bfb316b57cdb8919a9110ef63393d74382a", "type": "github" }, "original": { From 50f8fa7953f9aa72e33a20e0cea3940626f69ca7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Nov 2024 12:51:20 +0100 Subject: [PATCH 0188/1295] update --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 6b14b4c2..dc6b7a5b 100644 --- a/flake.lock +++ b/flake.lock @@ -91,11 +91,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1730137625, - "narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=", + "lastModified": 1731797254, + "narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "64b80bfb316b57cdb8919a9110ef63393d74382a", + "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", "type": "github" }, "original": { From f09ef591c37e408c5c0a828cc344c1b229c2c846 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Nov 2024 13:18:32 +0100 Subject: [PATCH 0189/1295] add extra platforms to be able to compile 32bit libraries and cross-compile for arm --- hosts/vinzenz-lpt2/default.nix | 5 ++++- hosts/vinzenz-pc2/default.nix | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix index ab2b42dc..61dcfc20 100644 --- a/hosts/vinzenz-lpt2/default.nix +++ b/hosts/vinzenz-lpt2/default.nix @@ -23,7 +23,10 @@ nixpkgs.lib.nixosSystem { { networking.hostName = "vinzenz-lpt2"; - nix.settings.extra-platforms = [ "aarch64-linux" ]; + nix.settings.extra-platforms = [ + "aarch64-linux" + "i686-linux" + ]; } { diff --git a/hosts/vinzenz-pc2/default.nix b/hosts/vinzenz-pc2/default.nix index 318efaba..c8535c88 100644 --- a/hosts/vinzenz-pc2/default.nix +++ b/hosts/vinzenz-pc2/default.nix @@ -19,7 +19,13 @@ nixpkgs.lib.nixosSystem { ../../modules/gaming.nix ../../modules/printing.nix ../../modules/podman.nix - { networking.hostName = "vinzenz-pc2"; } + { + networking.hostName = "vinzenz-pc2"; + nix.settings.extra-platforms = [ + "aarch64-linux" + "i686-linux" + ]; + } { home-manager.users = { vinzenz = import ../../home/vinzenz; From 96243b2f0646882560f8fc32536f4c008f39e63c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Nov 2024 13:18:43 +0100 Subject: [PATCH 0190/1295] nix fmt --- common/i18n.nix | 3 +-- common/networking.nix | 3 +-- hosts/vinzenz-lpt2/nginx.nix | 3 +-- modules/podman.nix | 3 +-- modules/printing.nix | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/common/i18n.nix b/common/i18n.nix index 29036489..c9506ad5 100644 --- a/common/i18n.nix +++ b/common/i18n.nix @@ -1,5 +1,4 @@ -_: -{ +_: { config = { time.timeZone = "Europe/Berlin"; i18n = { diff --git a/common/networking.nix b/common/networking.nix index 6bcfb500..a6a8d032 100644 --- a/common/networking.nix +++ b/common/networking.nix @@ -1,5 +1,4 @@ -_: -{ +_: { config = { services.openssh = { enable = true; diff --git a/hosts/vinzenz-lpt2/nginx.nix b/hosts/vinzenz-lpt2/nginx.nix index 76378f77..c0715f0c 100644 --- a/hosts/vinzenz-lpt2/nginx.nix +++ b/hosts/vinzenz-lpt2/nginx.nix @@ -1,5 +1,4 @@ -_: -{ +_: { services.nginx = { enable = true; diff --git a/modules/podman.nix b/modules/podman.nix index 8d37dd66..abecea4f 100644 --- a/modules/podman.nix +++ b/modules/podman.nix @@ -1,5 +1,4 @@ -_: -{ +_: { virtualisation = { containers.enable = true; podman = { diff --git a/modules/printing.nix b/modules/printing.nix index b7171ada..4b74421d 100644 --- a/modules/printing.nix +++ b/modules/printing.nix @@ -1,5 +1,4 @@ -_: -{ +_: { config = { services = { # Enable CUPS to print documents. From 3b10a0f21168eafb6632c0204bdfc95a82d773db Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Nov 2024 15:16:45 +0100 Subject: [PATCH 0191/1295] update to nixos 24.11 --- flake.lock | 16 ++++++++-------- flake.nix | 4 ++-- home/gnome.nix | 4 +--- home/vinzenz/default.nix | 2 +- modules/amd-graphics.nix | 2 +- modules/desktop-environment.nix | 1 - modules/gaming.nix | 6 +++--- modules/gnome.nix | 10 +++++----- modules/intel-graphics.nix | 2 +- 9 files changed, 22 insertions(+), 25 deletions(-) diff --git a/flake.lock b/flake.lock index dc6b7a5b..68823545 100644 --- a/flake.lock +++ b/flake.lock @@ -40,16 +40,16 @@ ] }, "locked": { - "lastModified": 1726989464, - "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", + "lastModified": 1732319136, + "narHash": "sha256-wpmPl6FkAF9Jj5C/rzANgpUjfzQrUYOn267LnzKU2uI=", "owner": "nix-community", "repo": "home-manager", - "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", + "rev": "f8831cc700030e11fc91da9ef6270593e6440edc", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.05", + "ref": "release-24.11", "repo": "home-manager", "type": "github" } @@ -91,16 +91,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1731797254, - "narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=", + "lastModified": 1731755305, + "narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", + "rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.05", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 2145ecc0..d954d1a1 100644 --- a/flake.nix +++ b/flake.nix @@ -1,8 +1,8 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; home-manager = { - url = "github:nix-community/home-manager/release-24.05"; + url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; lix-module = { diff --git a/home/gnome.nix b/home/gnome.nix index 019ae648..253e4d0d 100644 --- a/home/gnome.nix +++ b/home/gnome.nix @@ -13,14 +13,12 @@ meld simple-scan pinta - ] - ++ (with gnome; [ dconf-editor gpaste # graphical installer for flatpak apps gnome-software - ]) + ] ++ (with gnomeExtensions; [ caffeine appindicator diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 2f8890b7..556a6648 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -16,7 +16,7 @@ inputs@{ pkgs, ... }: eza = { enable = true; git = true; - icons = true; + icons = "auto"; extraOptions = [ "--group-directories-first" "--header" diff --git a/modules/amd-graphics.nix b/modules/amd-graphics.nix index 8a621945..ec9ec02e 100644 --- a/modules/amd-graphics.nix +++ b/modules/amd-graphics.nix @@ -4,7 +4,7 @@ boot.kernelModules = [ "amdgpu" ]; services.xserver.videoDrivers = [ "amdgpu" ]; - hardware.opengl = { + hardware.graphics = { extraPackages = with pkgs; [ amdvlk ]; extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ]; }; diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index d3a7a105..e4eb0ed6 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -13,7 +13,6 @@ }; # Enable sound with pipewire. - sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { diff --git a/modules/gaming.nix b/modules/gaming.nix index c069b9a7..4a4bebdc 100644 --- a/modules/gaming.nix +++ b/modules/gaming.nix @@ -2,9 +2,8 @@ { config = { hardware = { - opengl = { - driSupport = true; - driSupport32Bit = true; + graphics = { + enable32Bit = true; extraPackages = with pkgs; [ mangohud ]; extraPackages32 = with pkgs; [ mangohud ]; }; @@ -75,6 +74,7 @@ "steam" "steam-original" "steam-run" + "steam-unwrapped" ]; }; } diff --git a/modules/gnome.nix b/modules/gnome.nix index 49a4d0e4..6689ebc0 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -13,8 +13,8 @@ displayManager.defaultSession = "gnome"; gnome = { - tracker-miners.enable = false; - tracker.enable = false; + tinysparql.enable = false; + localsearch.enable = false; sushi.enable = true; gnome-remote-desktop.enable = true; }; @@ -27,7 +27,7 @@ }; # remove some gnome default apps - environment.gnome.excludePackages = with pkgs.gnome; [ + environment.gnome.excludePackages = with pkgs; [ cheese # photo booth epiphany # web browser evince # document viewer @@ -35,11 +35,11 @@ gnome-maps gnome-weather gnome-music - pkgs.gnome-tour + gnome-tour ]; environment.systemPackages = with pkgs; [ - gnome.ghex + ghex impression ]; diff --git a/modules/intel-graphics.nix b/modules/intel-graphics.nix index 3d5655f9..3e363010 100644 --- a/modules/intel-graphics.nix +++ b/modules/intel-graphics.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { config = { - hardware.opengl = { + hardware.graphics = { extraPackages = with pkgs; [ intel-media-driver vaapiIntel From 44b17a0648c70b1e5cf0c45a303dbc183e7bd12c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 24 Nov 2024 18:10:44 +0100 Subject: [PATCH 0192/1295] add phone config --- flake.lock | 214 +++++++++++++++++++++++++++++++++++++++- flake.nix | 26 ++++- home/vinzenz/git.nix | 6 ++ hosts/droid/default.nix | 14 +++ hosts/droid/sshd.nix | 37 +++++++ hosts/droid/stuff.nix | 23 +++++ 6 files changed, 318 insertions(+), 2 deletions(-) create mode 100644 hosts/droid/default.nix create mode 100644 hosts/droid/sshd.nix create mode 100644 hosts/droid/stuff.nix diff --git a/flake.lock b/flake.lock index 68823545..2f92a2f2 100644 --- a/flake.lock +++ b/flake.lock @@ -54,6 +54,48 @@ "type": "github" } }, + "home-manager-droid": { + "inputs": { + "nixpkgs": [ + "nixpkgs-droid" + ] + }, + "locked": { + "lastModified": 1726989464, + "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.05", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709445365, + "narHash": "sha256-DVv6nd9FQBbMWbOmhq0KVqmlc3y3FMSYl49UXmMcO+0=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "4de84265d7ec7634a69ba75028696d74de9a44a7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "lix": { "flake": false, "locked": { @@ -89,6 +131,55 @@ "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz" } }, + "nix-formatter-pack": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs" + ], + "nmd": "nmd", + "nmt": "nmt" + }, + "locked": { + "lastModified": 1705252799, + "narHash": "sha256-HgSTREh7VoXjGgNDwKQUYcYo13rPkltW7IitHrTPA5c=", + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "rev": "2de39dedd79aab14c01b9e2934842051a160ffa5", + "type": "github" + }, + "original": { + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "type": "github" + } + }, + "nix-on-droid": { + "inputs": { + "home-manager": "home-manager_2", + "nix-formatter-pack": "nix-formatter-pack", + "nixpkgs": [ + "nixpkgs-droid" + ], + "nixpkgs-docs": "nixpkgs-docs", + "nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap", + "nmd": "nmd_2" + }, + "locked": { + "lastModified": 1720396533, + "narHash": "sha256-UFzk/hZWO1VkciIO5UPaSpJN8s765wsngUSvtJM6d5Q=", + "owner": "nix-community", + "repo": "nix-on-droid", + "rev": "f3d3b8294039f2f9a8fb7ea82c320f29c6b0fe25", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.05", + "repo": "nix-on-droid", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1731755305, @@ -105,11 +196,132 @@ "type": "github" } }, + "nixpkgs-docs": { + "locked": { + "lastModified": 1705957679, + "narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9a333eaa80901efe01df07eade2c16d183761fa3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-droid": { + "locked": { + "lastModified": 1731797254, + "narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-for-bootstrap": { + "locked": { + "lastModified": 1720244366, + "narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", + "type": "github" + } + }, + "nmd": { + "flake": false, + "locked": { + "lastModified": 1666190571, + "narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=", + "owner": "rycee", + "repo": "nmd", + "rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmd", + "type": "gitlab" + } + }, + "nmd_2": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs-docs" + ], + "scss-reset": "scss-reset" + }, + "locked": { + "lastModified": 1705050560, + "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", + "owner": "~rycee", + "repo": "nmd", + "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", + "type": "sourcehut" + }, + "original": { + "owner": "~rycee", + "repo": "nmd", + "type": "sourcehut" + } + }, + "nmt": { + "flake": false, + "locked": { + "lastModified": 1648075362, + "narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=", + "owner": "rycee", + "repo": "nmt", + "rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmt", + "type": "gitlab" + } + }, "root": { "inputs": { "home-manager": "home-manager", + "home-manager-droid": "home-manager-droid", "lix-module": "lix-module", - "nixpkgs": "nixpkgs" + "nix-on-droid": "nix-on-droid", + "nixpkgs": "nixpkgs", + "nixpkgs-droid": "nixpkgs-droid" + } + }, + "scss-reset": { + "flake": false, + "locked": { + "lastModified": 1631450058, + "narHash": "sha256-muDlZJPtXDIGevSEWkicPP0HQ6VtucbkMNygpGlBEUM=", + "owner": "andreymatin", + "repo": "scss-reset", + "rev": "0cf50e27a4e95e9bb5b1715eedf9c54dee1a5a91", + "type": "github" + }, + "original": { + "owner": "andreymatin", + "repo": "scss-reset", + "type": "github" } }, "systems": { diff --git a/flake.nix b/flake.nix index d954d1a1..d730c86e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,22 +1,40 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + home-manager = { url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + lix-module = { url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; }; + + nixpkgs-droid.url = "github:NixOS/nixpkgs/nixos-24.05"; + + nix-on-droid = { + url = "github:nix-community/nix-on-droid/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs-droid"; + }; + + home-manager-droid = { + url = "github:nix-community/home-manager/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs-droid"; + }; + }; outputs = { + self, nixpkgs, home-manager, lix-module, - ... + nixpkgs-droid, + nix-on-droid, + home-manager-droid, }: { nixosConfigurations = @@ -43,6 +61,12 @@ hetzner-vpn1 = import ./hosts/hetzner-vpn1 host-params; }; + nixOnDroidConfigurations.default = import ./hosts/droid { + inherit nix-on-droid; + nixpkgs = nixpkgs-droid; + home-manager = home-manager-droid; + }; + formatter = { x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.nixfmt-rfc-style; diff --git a/home/vinzenz/git.nix b/home/vinzenz/git.nix index bb64f131..f219d60f 100644 --- a/home/vinzenz/git.nix +++ b/home/vinzenz/git.nix @@ -13,4 +13,10 @@ merge.tool = "kdiff3"; push.autoSetupRemote = "true"; }; + + ignores = [ + ".direnv" + ".idea" + ".envrc" + ]; } diff --git a/hosts/droid/default.nix b/hosts/droid/default.nix new file mode 100644 index 00000000..93844570 --- /dev/null +++ b/hosts/droid/default.nix @@ -0,0 +1,14 @@ +{ + nixpkgs, + nix-on-droid, + home-manager, + ... +}: +nix-on-droid.lib.nixOnDroidConfiguration { + pkgs = import nixpkgs { system = "aarch64-linux"; }; + modules = [ + home-manager.nixosModules.home-manager + ./sshd.nix + ./stuff.nix + ]; +} diff --git a/hosts/droid/sshd.nix b/hosts/droid/sshd.nix new file mode 100644 index 00000000..4ab5207e --- /dev/null +++ b/hosts/droid/sshd.nix @@ -0,0 +1,37 @@ +{ config, pkgs, ... }: +let + sshdTmpDirectory = "${config.user.home}/sshd-tmp"; + sshdDirectory = "${config.user.home}/sshd"; + pubKeys = '' + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming + ''; + port = 8022; +in +{ + build.activation.sshd = '' + $DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${config.user.home}/.ssh" + $DRY_RUN_CMD echo "${pubKeys}" > "${config.user.home}/.ssh/authorized_keys" + + if [[ ! -d "${sshdDirectory}" ]]; then + $DRY_RUN_CMD rm $VERBOSE_ARG --recursive --force "${sshdTmpDirectory}" + $DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${sshdTmpDirectory}" + + $VERBOSE_ECHO "Generating host keys..." + $DRY_RUN_CMD ${pkgs.openssh}/bin/ssh-keygen -t rsa -b 4096 -f "${sshdTmpDirectory}/ssh_host_rsa_key" -N "" + + $VERBOSE_ECHO "Writing sshd_config..." + $DRY_RUN_CMD echo -e "HostKey ${sshdDirectory}/ssh_host_rsa_key\nPort ${toString port}\n" > "${sshdTmpDirectory}/sshd_config" + + $DRY_RUN_CMD mv $VERBOSE_ARG "${sshdTmpDirectory}" "${sshdDirectory}" + fi + ''; + + environment.packages = [ + (pkgs.writeScriptBin "sshd-start" '' + #!${pkgs.runtimeShell} + + echo "Starting sshd in non-daemonized way on port ${toString port}" + ${pkgs.openssh}/bin/sshd -f "${sshdDirectory}/sshd_config" -D + '') + ]; +} diff --git a/hosts/droid/stuff.nix b/hosts/droid/stuff.nix new file mode 100644 index 00000000..c13094ad --- /dev/null +++ b/hosts/droid/stuff.nix @@ -0,0 +1,23 @@ +{ + pkgs, + ... +}: +{ + environment.packages = with pkgs; [ + nano + hostname + zsh + openssh + which + curl + ]; + + # Backup etc files instead of failing to activate generation if a file already exists in /etc + environment.etcBackupExtension = ".bak"; + + system.stateVersion = "24.05"; + nix.extraOptions = '' + experimental-features = nix-command flakes + ''; + time.timeZone = "Europe/Berlin"; +} From 04ef22593a5d062b5da4985fec49d42dccb6647e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 1 Dec 2024 10:03:30 +0100 Subject: [PATCH 0193/1295] update intel graphics config --- flake.lock | 18 +++++++++--------- home/vinzenz/zsh.nix | 7 +++---- hosts/vinzenz-lpt2/hardware.nix | 5 ++++- modules/intel-graphics.nix | 12 +++++------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index 2f92a2f2..a196a084 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1732319136, - "narHash": "sha256-wpmPl6FkAF9Jj5C/rzANgpUjfzQrUYOn267LnzKU2uI=", + "lastModified": 1732466619, + "narHash": "sha256-T1e5oceypZu3Q8vzICjv1X/sGs9XfJRMW5OuXHgpB3c=", "owner": "nix-community", "repo": "home-manager", - "rev": "f8831cc700030e11fc91da9ef6270593e6440edc", + "rev": "f3111f62a23451114433888902a55cf0692b408d", "type": "github" }, "original": { @@ -182,11 +182,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1731755305, - "narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=", + "lastModified": 1732350895, + "narHash": "sha256-GcOQbOgmwlsRhpLGSwZJwLbo3pu9ochMETuRSS1xpz4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4", + "rev": "0c582677378f2d9ffcb01490af2f2c678dcb29d3", "type": "github" }, "original": { @@ -214,11 +214,11 @@ }, "nixpkgs-droid": { "locked": { - "lastModified": 1731797254, - "narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=", + "lastModified": 1732749044, + "narHash": "sha256-T38FQOg0BV5M8FN1712fovzNakSOENEYs+CSkg31C9Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", + "rev": "0c5b4ecbed5b155b705336aa96d878e55acd8685", "type": "github" }, "original": { diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index 5aa3fcbf..fd252a2f 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -6,9 +6,9 @@ ''; shellAliases = { - my-apply = "sudo nixos-rebuild boot"; - my-switch = "sudo nixos-rebuild switch"; - my-update = "sudo nixos-rebuild boot --upgrade"; + my-apply = "sudo nixos-rebuild boot --flake"; + my-switch = "sudo nixos-rebuild switch --flake"; + my-update = "sudo nixos-rebuild boot --upgrade --flake"; my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; my-fmt = "alejandra ."; my-test = "sudo nixos-rebuild test"; @@ -16,7 +16,6 @@ my-ip4 = "ip addr show | grep 192"; deadnix = "nix run github:astro/deadnix -- "; statix = "nix run git+https://git.peppe.rs/languages/statix -- "; - my-nix-fixup = "deadnix -e && statix fix"; }; history = { diff --git a/hosts/vinzenz-lpt2/hardware.nix b/hosts/vinzenz-lpt2/hardware.nix index 82dd9753..f51ccd1f 100644 --- a/hosts/vinzenz-lpt2/hardware.nix +++ b/hosts/vinzenz-lpt2/hardware.nix @@ -3,7 +3,10 @@ imports = [ ../../modules/intel-graphics.nix ]; config = { # intel cpu - boot.kernelModules = [ "kvm-intel" ]; + boot.kernelModules = [ + "kvm-intel" + "xe" + ]; hardware.cpu.intel.updateMicrocode = true; boot.loader = { diff --git a/modules/intel-graphics.nix b/modules/intel-graphics.nix index 3e363010..f23b3571 100644 --- a/modules/intel-graphics.nix +++ b/modules/intel-graphics.nix @@ -4,16 +4,14 @@ hardware.graphics = { extraPackages = with pkgs; [ intel-media-driver - vaapiIntel - vaapiVdpau - libvdpau-va-gl + intel-vaapi-driver intel-ocl + intel-compute-runtime + vpl-gpu-rt ]; - extraPackages32 = with pkgs.pkgsi686Linux; [ + extraPackages32 = with pkgs.driversi686Linux; [ + intel-vaapi-driver intel-media-driver - vaapiIntel - vaapiVdpau - libvdpau-va-gl ]; }; environment.systemPackages = with pkgs; [ nvtopPackages.intel ]; From 582d0094e78e37a58f707cf6c4485738e6dda2d2 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 1 Dec 2024 11:29:24 +0100 Subject: [PATCH 0194/1295] remove more gnome default apps --- home/gnome-shared-dconf.nix | 8 ++++++++ home/gnome.nix | 5 ++--- home/vinzenz/default.nix | 3 --- hosts/vinzenz-lpt2/default.nix | 1 - modules/gnome.nix | 20 ++++++++++++++++---- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/home/gnome-shared-dconf.nix b/home/gnome-shared-dconf.nix index 3ba78943..32b7657b 100644 --- a/home/gnome-shared-dconf.nix +++ b/home/gnome-shared-dconf.nix @@ -22,12 +22,14 @@ disable-user-extensions = false; disabled-extensions = [ ]; enabled-extensions = [ + "tailscale@joaophi.github.com" "appindicatorsupport@rgcjonas.gmail.com" "workspace-indicator@gnome-shell-extensions.gcampax.github.com" "caffeine@patapon.info" "GPaste@gnome-shell-extensions.gnome.org" "gsconnect@andyholmes.github.io" "solaar-extension@sidevesh" + "AlphabeticalAppGrid@stuarthayhurst" ]; }; "ca/desrt/dconf-editor" = { @@ -39,4 +41,10 @@ switch-applications = [ "Tab" ]; switch-applications-backward = [ "Tab" ]; }; + "org/gnome/shell/extensions/alphabetical-app-grid" = { + folder-order-position = "start"; + }; + "org/gnome/shell/extensions/gsconnect" = { + enabled = true; + }; } diff --git a/home/gnome.nix b/home/gnome.nix index 253e4d0d..2b092b8f 100644 --- a/home/gnome.nix +++ b/home/gnome.nix @@ -7,9 +7,7 @@ home.packages = with pkgs; [ - amberol gitg - gnome-builder meld simple-scan pinta @@ -23,9 +21,10 @@ caffeine appindicator gsconnect - battery-health-charging + # battery-health-charging quick-settings-tweaker solaar-extension + alphabetical-app-grid ]); dconf.settings = import ./gnome-shared-dconf.nix; diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 556a6648..cac2a69b 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -38,9 +38,6 @@ inputs@{ pkgs, ... }: alejandra # nix formatter - arduino - uucp - kdiff3 jetbrains-toolbox ]; diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix index 61dcfc20..8958baaf 100644 --- a/hosts/vinzenz-lpt2/default.nix +++ b/hosts/vinzenz-lpt2/default.nix @@ -18,7 +18,6 @@ nixpkgs.lib.nixosSystem { ../../modules/gnome.nix ../../modules/gaming.nix ../../modules/printing.nix - ../../modules/latex.nix ../../modules/podman.nix { diff --git a/modules/gnome.nix b/modules/gnome.nix index 6689ebc0..c1d67c63 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -5,9 +5,8 @@ xserver = { # Enable the GNOME Desktop Environment. desktopManager.gnome.enable = true; - displayManager = { - gdm.enable = true; - }; + displayManager.gdm.enable = true; + excludePackages = with pkgs; [ xterm ]; }; displayManager.defaultSession = "gnome"; @@ -34,8 +33,21 @@ geary # email client gnome-maps gnome-weather - gnome-music gnome-tour + gnome-contacts + sysprof + orca # screen reader + gnome-disk-utility + gnome-system-monitor + gnome-weather + gnome-backgrounds + gnome-user-docs + gnome-calendar + yelp # help app + # gnome-music + # totem # video player + # snapshot # camera + # baobab # disk usage ]; environment.systemPackages = with pkgs; [ From b41bfc935c62e6cdbd0db0582a363f85b3c02224 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 1 Dec 2024 12:06:11 +0100 Subject: [PATCH 0195/1295] wip add hetzner-vpn2 --- hosts/hetzner-vpn2/default.nix | 34 ++++++++++++ hosts/hetzner-vpn2/hardware.nix | 94 +++++++++++++++++++++++++++++++++ hosts/hetzner-vpn2/nginx.nix | 57 ++++++++++++++++++++ 3 files changed, 185 insertions(+) create mode 100644 hosts/hetzner-vpn2/default.nix create mode 100644 hosts/hetzner-vpn2/hardware.nix create mode 100644 hosts/hetzner-vpn2/nginx.nix diff --git a/hosts/hetzner-vpn2/default.nix b/hosts/hetzner-vpn2/default.nix new file mode 100644 index 00000000..f808faa0 --- /dev/null +++ b/hosts/hetzner-vpn2/default.nix @@ -0,0 +1,34 @@ +{ nixpkgs, common-modules, ... }: +nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + modules = common-modules ++ [ + ./hardware.nix + ./nginx.nix + ../../users/vinzenz.nix + ../../users/ronja.nix + { networking.hostName = "hetzner-vpn2"; } + { + # uncomment for build check on non arm system (requires --impure) + # nixpkgs.buildPlatform = builtins.currentSystem; + } + { + users.users = { + root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + ]; + }; + } + ]; +} diff --git a/hosts/hetzner-vpn2/hardware.nix b/hosts/hetzner-vpn2/hardware.nix new file mode 100644 index 00000000..e3f308b6 --- /dev/null +++ b/hosts/hetzner-vpn2/hardware.nix @@ -0,0 +1,94 @@ +{ lib, modulesPath, ... }: +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + + config = { + nixpkgs = { + hostPlatform = "aarch64-linux"; + system = "aarch64-linux"; + }; + + boot = { + tmp.cleanOnBoot = true; + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + initrd = { + availableKernelModules = [ + "xhci_pci" + "virtio_scsi" + "sr_mod" + ]; + kernelModules = [ ]; + }; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/24c2f986-1e88-4c26-87eb-0f92aecd6f56"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/AZ0B-81C3"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/2531d357-dea5-4212-97e3-d727f7bdbd16"; } + ]; + + # This file was populated at runtime with the networking + # details gathered from the active system. + networking = { + useDHCP = true; + domain = ""; + nameservers = [ "8.8.8.8" ]; + defaultGateway6 = { + address = "fe80::1"; + interface = "enp1s0"; + }; + interfaces = { + enp1s0 = { + #ipv4 = { + # addresses = [ + # { + # address = "157.90.146.125"; + # prefixLength = 32; + # } + # ]; + # routes = [ + # { + # address = "172.31.1.1"; + # prefixLength = 32; + # } + # ]; + #}; + ipv6 = { + addresses = [ + { + address = "2a01:4f8:c013:65dd::"; + prefixLength = 64; + } + ]; + routes = [ + { + address = "fe80::1"; + prefixLength = 128; + } + ]; + }; + }; + }; + }; + + #services.udev.extraRules = '' + # ATTR{address}=="96:00:02:87:7f:c9", NAME="eth0" + #''; + }; +} diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix new file mode 100644 index 00000000..f49ff6fb --- /dev/null +++ b/hosts/hetzner-vpn2/nginx.nix @@ -0,0 +1,57 @@ +{ pkgs, lib, ... }: +{ + security.acme = { + acceptTerms = true; + defaults.email = "acme@zerforschen.plus"; + }; + + security.pam.services.nginx.setEnvironment = false; + systemd.services.nginx.serviceConfig = { + SupplementaryGroups = [ "shadow" ]; + }; + + services.nginx = { + enable = true; + additionalModules = [ pkgs.nginxModules.pam ]; + + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + + virtualHosts = + let + servicesDomain = "services.zerforschen.plus"; + mkServiceConfig = host: port: { + addSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://${host}:${toString port}/"; + extraConfig = '' + # bind to tailscale ip + proxy_bind 100.88.118.60; + # pam auth + limit_except OPTIONS { + auth_pam "Password Required"; + auth_pam_service_name "nginx"; + } + ''; + }; + }; + pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; + in + { + "vscode.${servicesDomain}" = lib.mkMerge [ + (mkServiceConfig pc2 8542) + { locations."/".proxyWebsockets = true; } + ]; + "preon-app.${servicesDomain}" = mkServiceConfig pc2 8543; + "preon-api.${servicesDomain}" = mkServiceConfig pc2 8544; + }; + }; + + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; +} From 6bf599f486815f474d4e8f7a7bdad7b24e865bb2 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 1 Dec 2024 12:07:45 +0100 Subject: [PATCH 0196/1295] wip hetzner-vpn2 --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index d730c86e..3ba6c8e0 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,7 @@ vinzenz-lpt2 = import ./hosts/vinzenz-lpt2 host-params; vinzenz-pc2 = import ./hosts/vinzenz-pc2 host-params; hetzner-vpn1 = import ./hosts/hetzner-vpn1 host-params; + hetzner-vpn2 = import ./hosts/hetzner-vpn2 host-params; }; nixOnDroidConfigurations.default = import ./hosts/droid { From 8ec2e6beaa8c263a39f1f9f2e1345828fb5ac8d5 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 1 Dec 2024 13:41:12 +0100 Subject: [PATCH 0197/1295] second try --- hosts/hetzner-vpn2/hardware.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts/hetzner-vpn2/hardware.nix b/hosts/hetzner-vpn2/hardware.nix index e3f308b6..2a83a67c 100644 --- a/hosts/hetzner-vpn2/hardware.nix +++ b/hosts/hetzner-vpn2/hardware.nix @@ -26,11 +26,11 @@ fileSystems = { "/" = { - device = "/dev/disk/by-uuid/24c2f986-1e88-4c26-87eb-0f92aecd6f56"; + device = "/dev/disk/by-uuid/3263489d-9819-433c-b198-9d2e732a94e4"; fsType = "ext4"; }; "/boot" = { - device = "/dev/disk/by-uuid/AZ0B-81C3"; + device = "/dev/disk/by-uuid/6C25-6BDC"; fsType = "vfat"; options = [ "fmask=0077" @@ -40,7 +40,7 @@ }; swapDevices = [ - { device = "/dev/disk/by-uuid/2531d357-dea5-4212-97e3-d727f7bdbd16"; } + { device = "/dev/disk/by-uuid/e147721d-86b5-40d7-a231-c6ea391c563d"; } ]; # This file was populated at runtime with the networking From c1f1f7d3ac2935043a75aa38cd7063b40a167711 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 1 Dec 2024 16:23:37 +0100 Subject: [PATCH 0198/1295] remove old proxy config --- hosts/hetzner-vpn2/nginx.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix index f49ff6fb..a9bc5835 100644 --- a/hosts/hetzner-vpn2/nginx.nix +++ b/hosts/hetzner-vpn2/nginx.nix @@ -41,12 +41,10 @@ pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; in { - "vscode.${servicesDomain}" = lib.mkMerge [ - (mkServiceConfig pc2 8542) - { locations."/".proxyWebsockets = true; } - ]; - "preon-app.${servicesDomain}" = mkServiceConfig pc2 8543; - "preon-api.${servicesDomain}" = mkServiceConfig pc2 8544; + #"vscode.${servicesDomain}" = lib.mkMerge [ + # (mkServiceConfig pc2 8542) + # { locations."/".proxyWebsockets = true; } + #]; }; }; From c446e6c3f4259a21df98da30e117bee60969cd3f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 1 Dec 2024 16:39:35 +0100 Subject: [PATCH 0199/1295] hopefully fix networking --- home/vinzenz/ssh.nix | 5 +++ hosts/hetzner-vpn2/default.nix | 3 ++ hosts/hetzner-vpn2/hardware.nix | 59 ++++++++------------------------- 3 files changed, 22 insertions(+), 45 deletions(-) diff --git a/home/vinzenz/ssh.nix b/home/vinzenz/ssh.nix index 360958e8..ae250997 100644 --- a/home/vinzenz/ssh.nix +++ b/home/vinzenz/ssh.nix @@ -6,6 +6,11 @@ hostname = "157.90.146.125"; # 2a01:4f8:c012:7137::/64 user = "root"; }; + "vpn2" = { + host = "vpn2 hetzner-vpn2"; + hostname = "2a01:4f8:c013:65dd::1"; + user = "root"; + }; "vpn1-ts" = { host = "vpn1-ts hetzner-vpn1.donkey-pentatonic.ts.net"; hostname = "hetzner-vpn1.donkey-pentatonic.ts.net"; diff --git a/hosts/hetzner-vpn2/default.nix b/hosts/hetzner-vpn2/default.nix index f808faa0..8cf041f9 100644 --- a/hosts/hetzner-vpn2/default.nix +++ b/hosts/hetzner-vpn2/default.nix @@ -11,6 +11,9 @@ nixpkgs.lib.nixosSystem { # uncomment for build check on non arm system (requires --impure) # nixpkgs.buildPlatform = builtins.currentSystem; } + { + services.tailscale.useRoutingFeatures = "both"; + } { users.users = { root.openssh.authorizedKeys.keys = [ diff --git a/hosts/hetzner-vpn2/hardware.nix b/hosts/hetzner-vpn2/hardware.nix index 2a83a67c..7cf5ce7c 100644 --- a/hosts/hetzner-vpn2/hardware.nix +++ b/hosts/hetzner-vpn2/hardware.nix @@ -10,6 +10,7 @@ boot = { tmp.cleanOnBoot = true; + kernelParams = [ "console=tty" ]; loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; @@ -19,6 +20,7 @@ "xhci_pci" "virtio_scsi" "sr_mod" + "virtio_gpu" ]; kernelModules = [ ]; }; @@ -43,52 +45,19 @@ { device = "/dev/disk/by-uuid/e147721d-86b5-40d7-a231-c6ea391c563d"; } ]; - # This file was populated at runtime with the networking - # details gathered from the active system. - networking = { - useDHCP = true; - domain = ""; - nameservers = [ "8.8.8.8" ]; - defaultGateway6 = { - address = "fe80::1"; - interface = "enp1s0"; - }; - interfaces = { - enp1s0 = { - #ipv4 = { - # addresses = [ - # { - # address = "157.90.146.125"; - # prefixLength = 32; - # } - # ]; - # routes = [ - # { - # address = "172.31.1.1"; - # prefixLength = 32; - # } - # ]; - #}; - ipv6 = { - addresses = [ - { - address = "2a01:4f8:c013:65dd::"; - prefixLength = 64; - } - ]; - routes = [ - { - address = "fe80::1"; - prefixLength = 128; - } - ]; - }; - }; + networking.useNetworkd = true; + systemd.network = { + enable = true; + networks."10-wan" = { + matchConfig.Name = "enp1s0"; + networkConfig.DHCP = "ipv4"; + address = [ + "2a01:4f8:c013:65dd::1/64" + ]; + routes = [ + { Gateway = "fe80::1"; } + ]; }; }; - - #services.udev.extraRules = '' - # ATTR{address}=="96:00:02:87:7f:c9", NAME="eth0" - #''; }; } From eef6834d9d24fefd48fcad59afe39efad6a7a735 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 14 Dec 2024 10:53:08 +0100 Subject: [PATCH 0200/1295] remove vpn1 --- flake.nix | 1 - hosts/hetzner-vpn1/default.nix | 34 ----------- hosts/hetzner-vpn1/hardware.nix | 100 -------------------------------- hosts/hetzner-vpn1/nginx.nix | 57 ------------------ 4 files changed, 192 deletions(-) delete mode 100644 hosts/hetzner-vpn1/default.nix delete mode 100644 hosts/hetzner-vpn1/hardware.nix delete mode 100644 hosts/hetzner-vpn1/nginx.nix diff --git a/flake.nix b/flake.nix index 3ba6c8e0..279d4786 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,6 @@ { vinzenz-lpt2 = import ./hosts/vinzenz-lpt2 host-params; vinzenz-pc2 = import ./hosts/vinzenz-pc2 host-params; - hetzner-vpn1 = import ./hosts/hetzner-vpn1 host-params; hetzner-vpn2 = import ./hosts/hetzner-vpn2 host-params; }; diff --git a/hosts/hetzner-vpn1/default.nix b/hosts/hetzner-vpn1/default.nix deleted file mode 100644 index e384574e..00000000 --- a/hosts/hetzner-vpn1/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ nixpkgs, common-modules, ... }: -nixpkgs.lib.nixosSystem { - system = "aarch64-linux"; - modules = common-modules ++ [ - ./hardware.nix - ./nginx.nix - ../../users/vinzenz.nix - ../../users/ronja.nix - { networking.hostName = "hetzner-vpn1"; } - { - # uncomment for build check on non arm system (requires --impure) - # nixpkgs.buildPlatform = builtins.currentSystem; - } - { - users.users = { - root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - ]; - }; - } - ]; -} diff --git a/hosts/hetzner-vpn1/hardware.nix b/hosts/hetzner-vpn1/hardware.nix deleted file mode 100644 index 66be3890..00000000 --- a/hosts/hetzner-vpn1/hardware.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ lib, modulesPath, ... }: -{ - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - - config = { - nixpkgs = { - hostPlatform = "aarch64-linux"; - system = "aarch64-linux"; - }; - - boot = { - tmp.cleanOnBoot = true; - loader = { - systemd-boot.enable = lib.mkForce false; - efi.canTouchEfiVariables = lib.mkForce false; - grub = { - enable = true; - efiSupport = true; - efiInstallAsRemovable = true; - device = "nodev"; - }; - }; - initrd = { - availableKernelModules = [ - "ata_piix" - "uhci_hcd" - "xen_blkfront" - ]; - kernelModules = [ "nvme" ]; - }; - }; - - zramSwap.enable = true; - networking.domain = ""; - - fileSystems = { - "/boot" = { - device = "/dev/disk/by-uuid/77CF-345D"; - fsType = "vfat"; - }; - "/" = { - device = "/dev/sda1"; - fsType = "ext4"; - }; - }; - - # This file was populated at runtime with the networking - # details gathered from the active system. - networking = { - nameservers = [ "8.8.8.8" ]; - defaultGateway = "172.31.1.1"; - defaultGateway6 = { - address = "fe80::1"; - interface = "eth0"; - }; - dhcpcd.enable = false; - usePredictableInterfaceNames = lib.mkForce false; - interfaces = { - eth0 = { - ipv4 = { - addresses = [ - { - address = "157.90.146.125"; - prefixLength = 32; - } - ]; - routes = [ - { - address = "172.31.1.1"; - prefixLength = 32; - } - ]; - }; - ipv6 = { - addresses = [ - { - address = "2a01:4f8:c012:7137::1"; - prefixLength = 64; - } - { - address = "fe80::9400:2ff:fe87:7fc9"; - prefixLength = 64; - } - ]; - routes = [ - { - address = "fe80::1"; - prefixLength = 128; - } - ]; - }; - }; - }; - }; - - services.udev.extraRules = '' - ATTR{address}=="96:00:02:87:7f:c9", NAME="eth0" - ''; - }; -} diff --git a/hosts/hetzner-vpn1/nginx.nix b/hosts/hetzner-vpn1/nginx.nix deleted file mode 100644 index f49ff6fb..00000000 --- a/hosts/hetzner-vpn1/nginx.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ pkgs, lib, ... }: -{ - security.acme = { - acceptTerms = true; - defaults.email = "acme@zerforschen.plus"; - }; - - security.pam.services.nginx.setEnvironment = false; - systemd.services.nginx.serviceConfig = { - SupplementaryGroups = [ "shadow" ]; - }; - - services.nginx = { - enable = true; - additionalModules = [ pkgs.nginxModules.pam ]; - - recommendedProxySettings = true; - recommendedTlsSettings = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; - - virtualHosts = - let - servicesDomain = "services.zerforschen.plus"; - mkServiceConfig = host: port: { - addSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://${host}:${toString port}/"; - extraConfig = '' - # bind to tailscale ip - proxy_bind 100.88.118.60; - # pam auth - limit_except OPTIONS { - auth_pam "Password Required"; - auth_pam_service_name "nginx"; - } - ''; - }; - }; - pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; - in - { - "vscode.${servicesDomain}" = lib.mkMerge [ - (mkServiceConfig pc2 8542) - { locations."/".proxyWebsockets = true; } - ]; - "preon-app.${servicesDomain}" = mkServiceConfig pc2 8543; - "preon-api.${servicesDomain}" = mkServiceConfig pc2 8544; - }; - }; - - networking.firewall.allowedTCPPorts = [ - 80 - 443 - ]; -} From 24f1cb38480be92c60f5a00c1e5526a1f6c449c9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 14 Dec 2024 10:57:17 +0100 Subject: [PATCH 0201/1295] add lix binary cache --- common/nixpkgs.nix | 9 +++++++-- flake.lock | 18 +++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/common/nixpkgs.nix b/common/nixpkgs.nix index d4456be5..4705ad51 100644 --- a/common/nixpkgs.nix +++ b/common/nixpkgs.nix @@ -14,10 +14,15 @@ nix = { settings = { substituters = [ - "https://nix-community.cachix.org" "https://cache.nixos.org/" + "https://nix-community.cachix.org" + "https://cache.lix.systems" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" ]; - trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; experimental-features = [ "nix-command" "flakes" diff --git a/flake.lock b/flake.lock index a196a084..d3119579 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1732466619, - "narHash": "sha256-T1e5oceypZu3Q8vzICjv1X/sGs9XfJRMW5OuXHgpB3c=", + "lastModified": 1733951536, + "narHash": "sha256-Zb5ZCa7Xj+0gy5XVXINTSr71fCfAv+IKtmIXNrykT54=", "owner": "nix-community", "repo": "home-manager", - "rev": "f3111f62a23451114433888902a55cf0692b408d", + "rev": "1318c3f3b068cdcea922fa7c1a0a1f0c96c22f5f", "type": "github" }, "original": { @@ -182,11 +182,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732350895, - "narHash": "sha256-GcOQbOgmwlsRhpLGSwZJwLbo3pu9ochMETuRSS1xpz4=", + "lastModified": 1733808091, + "narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0c582677378f2d9ffcb01490af2f2c678dcb29d3", + "rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e", "type": "github" }, "original": { @@ -214,11 +214,11 @@ }, "nixpkgs-droid": { "locked": { - "lastModified": 1732749044, - "narHash": "sha256-T38FQOg0BV5M8FN1712fovzNakSOENEYs+CSkg31C9Y=", + "lastModified": 1734017764, + "narHash": "sha256-msOfmyJSjAHgIygI/JD0Ae3JsDv4rT54Nlfr5t6MQMQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0c5b4ecbed5b155b705336aa96d878e55acd8685", + "rev": "64e9404f308e0f0a0d8cdd7c358f74e34802494b", "type": "github" }, "original": { From 7891b4ebaedf2cfea12497b689d404efb7660c5a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 14 Dec 2024 11:06:37 +0100 Subject: [PATCH 0202/1295] add adb to lpt2 --- hosts/vinzenz-lpt2/default.nix | 4 ++++ users/vinzenz.nix | 1 + 2 files changed, 5 insertions(+) diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix index 8958baaf..f9d0276c 100644 --- a/hosts/vinzenz-lpt2/default.nix +++ b/hosts/vinzenz-lpt2/default.nix @@ -40,5 +40,9 @@ nixpkgs.lib.nixosSystem { # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' #]; } + + { + programs.adb.enable = true; + } ]; } diff --git a/users/vinzenz.nix b/users/vinzenz.nix index 77bc2a1d..b4e6aa0b 100644 --- a/users/vinzenz.nix +++ b/users/vinzenz.nix @@ -13,6 +13,7 @@ "dialout" "podman" "nginx" + "adbusers" ]; shell = pkgs.zsh; autoSubUidGidRange = true; From f5b0ca48a7b18100ba96473b4cb523a298520405 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 14 Dec 2024 11:18:20 +0100 Subject: [PATCH 0203/1295] tweak vscode settings, remove git graph as it is not maintained anymore --- home/vinzenz/vscode.nix | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index f44f25b1..29f5046e 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -11,7 +11,6 @@ yzhang.markdown-all-in-one redhat.vscode-yaml pkief.material-icon-theme - mhutchie.git-graph rust-lang.rust-analyzer tamasfe.even-better-toml llvm-vs-code-extensions.vscode-clangd @@ -21,25 +20,34 @@ ms-vscode-remote.remote-ssh ]; userSettings = { - "git.autofetch" = true; - "update.mode" = "none"; + "files.autoSave" = "afterDelay"; + "files.autoSaveWhenNoErrors" = true; + "files.autoSaveWorkspaceFilesOnly" = true; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; "editor.fontLigatures" = true; "editor.formatOnSave" = true; "editor.formatOnSaveMode" = "modificationsIfAvailable"; "editor.minimap.autohide" = true; + + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; + + "update.mode" = "none"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; + + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; + + "git.autofetch" = true; "diffEditor.diffAlgorithm" = "advanced"; "explorer.excludeGitIgnore" = true; "markdown.extension.tableFormatter.normalizeIndentation" = true; "markdown.extension.toc.orderedList" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; - "workbench.startupEditor" = "readme"; - "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; "rust-analyzer.checkOnSave.command" = "clippy"; - "extensions.autoUpdate" = false; - "extensions.autoCheckUpdates" = false; + "\[makefile\]" = { "editor.insertSpaces" = false; "editor.detectIndentation" = false; From 95f3a43622510b4c70f036c897edbacf1a1fcd75 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 14 Dec 2024 11:44:31 +0100 Subject: [PATCH 0204/1295] remove explicit pathsToLink --- common/globalinstalls.nix | 1 - home/vinzenz/zsh.nix | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/globalinstalls.nix b/common/globalinstalls.nix index 42dd28e3..9afad7d6 100644 --- a/common/globalinstalls.nix +++ b/common/globalinstalls.nix @@ -2,7 +2,6 @@ { config = { environment = { - pathsToLink = [ "/share/zsh" ]; systemPackages = with pkgs; [ ncdu glances diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index fd252a2f..9a9f6332 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -5,6 +5,8 @@ export PATH=$PATH:/home/vinzenz/.cargo/bin ''; + enableCompletion = true; + shellAliases = { my-apply = "sudo nixos-rebuild boot --flake"; my-switch = "sudo nixos-rebuild switch --flake"; From 392711e853dd52f74345355eb960e9bfbba2e052 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 14 Dec 2024 13:25:34 +0100 Subject: [PATCH 0205/1295] move droid to own repo --- flake.lock | 214 +--------------------------------------- flake.nix | 24 +---- hosts/droid/default.nix | 14 --- hosts/droid/sshd.nix | 37 ------- hosts/droid/stuff.nix | 23 ----- 5 files changed, 2 insertions(+), 310 deletions(-) delete mode 100644 hosts/droid/default.nix delete mode 100644 hosts/droid/sshd.nix delete mode 100644 hosts/droid/stuff.nix diff --git a/flake.lock b/flake.lock index d3119579..6683f13f 100644 --- a/flake.lock +++ b/flake.lock @@ -54,48 +54,6 @@ "type": "github" } }, - "home-manager-droid": { - "inputs": { - "nixpkgs": [ - "nixpkgs-droid" - ] - }, - "locked": { - "lastModified": 1726989464, - "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-24.05", - "repo": "home-manager", - "type": "github" - } - }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "nix-on-droid", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709445365, - "narHash": "sha256-DVv6nd9FQBbMWbOmhq0KVqmlc3y3FMSYl49UXmMcO+0=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "4de84265d7ec7634a69ba75028696d74de9a44a7", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "lix": { "flake": false, "locked": { @@ -131,55 +89,6 @@ "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz" } }, - "nix-formatter-pack": { - "inputs": { - "nixpkgs": [ - "nix-on-droid", - "nixpkgs" - ], - "nmd": "nmd", - "nmt": "nmt" - }, - "locked": { - "lastModified": 1705252799, - "narHash": "sha256-HgSTREh7VoXjGgNDwKQUYcYo13rPkltW7IitHrTPA5c=", - "owner": "Gerschtli", - "repo": "nix-formatter-pack", - "rev": "2de39dedd79aab14c01b9e2934842051a160ffa5", - "type": "github" - }, - "original": { - "owner": "Gerschtli", - "repo": "nix-formatter-pack", - "type": "github" - } - }, - "nix-on-droid": { - "inputs": { - "home-manager": "home-manager_2", - "nix-formatter-pack": "nix-formatter-pack", - "nixpkgs": [ - "nixpkgs-droid" - ], - "nixpkgs-docs": "nixpkgs-docs", - "nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap", - "nmd": "nmd_2" - }, - "locked": { - "lastModified": 1720396533, - "narHash": "sha256-UFzk/hZWO1VkciIO5UPaSpJN8s765wsngUSvtJM6d5Q=", - "owner": "nix-community", - "repo": "nix-on-droid", - "rev": "f3d3b8294039f2f9a8fb7ea82c320f29c6b0fe25", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-24.05", - "repo": "nix-on-droid", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1733808091, @@ -196,132 +105,11 @@ "type": "github" } }, - "nixpkgs-docs": { - "locked": { - "lastModified": 1705957679, - "narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9a333eaa80901efe01df07eade2c16d183761fa3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-droid": { - "locked": { - "lastModified": 1734017764, - "narHash": "sha256-msOfmyJSjAHgIygI/JD0Ae3JsDv4rT54Nlfr5t6MQMQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "64e9404f308e0f0a0d8cdd7c358f74e34802494b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-for-bootstrap": { - "locked": { - "lastModified": 1720244366, - "narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", - "type": "github" - } - }, - "nmd": { - "flake": false, - "locked": { - "lastModified": 1666190571, - "narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=", - "owner": "rycee", - "repo": "nmd", - "rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169", - "type": "gitlab" - }, - "original": { - "owner": "rycee", - "repo": "nmd", - "type": "gitlab" - } - }, - "nmd_2": { - "inputs": { - "nixpkgs": [ - "nix-on-droid", - "nixpkgs-docs" - ], - "scss-reset": "scss-reset" - }, - "locked": { - "lastModified": 1705050560, - "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", - "owner": "~rycee", - "repo": "nmd", - "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", - "type": "sourcehut" - }, - "original": { - "owner": "~rycee", - "repo": "nmd", - "type": "sourcehut" - } - }, - "nmt": { - "flake": false, - "locked": { - "lastModified": 1648075362, - "narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=", - "owner": "rycee", - "repo": "nmt", - "rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae", - "type": "gitlab" - }, - "original": { - "owner": "rycee", - "repo": "nmt", - "type": "gitlab" - } - }, "root": { "inputs": { "home-manager": "home-manager", - "home-manager-droid": "home-manager-droid", "lix-module": "lix-module", - "nix-on-droid": "nix-on-droid", - "nixpkgs": "nixpkgs", - "nixpkgs-droid": "nixpkgs-droid" - } - }, - "scss-reset": { - "flake": false, - "locked": { - "lastModified": 1631450058, - "narHash": "sha256-muDlZJPtXDIGevSEWkicPP0HQ6VtucbkMNygpGlBEUM=", - "owner": "andreymatin", - "repo": "scss-reset", - "rev": "0cf50e27a4e95e9bb5b1715eedf9c54dee1a5a91", - "type": "github" - }, - "original": { - "owner": "andreymatin", - "repo": "scss-reset", - "type": "github" + "nixpkgs": "nixpkgs" } }, "systems": { diff --git a/flake.nix b/flake.nix index 279d4786..0968c4ac 100644 --- a/flake.nix +++ b/flake.nix @@ -11,19 +11,6 @@ url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; }; - - nixpkgs-droid.url = "github:NixOS/nixpkgs/nixos-24.05"; - - nix-on-droid = { - url = "github:nix-community/nix-on-droid/release-24.05"; - inputs.nixpkgs.follows = "nixpkgs-droid"; - }; - - home-manager-droid = { - url = "github:nix-community/home-manager/release-24.05"; - inputs.nixpkgs.follows = "nixpkgs-droid"; - }; - }; outputs = @@ -31,10 +18,7 @@ self, nixpkgs, home-manager, - lix-module, - nixpkgs-droid, - nix-on-droid, - home-manager-droid, + lix-module }: { nixosConfigurations = @@ -61,12 +45,6 @@ hetzner-vpn2 = import ./hosts/hetzner-vpn2 host-params; }; - nixOnDroidConfigurations.default = import ./hosts/droid { - inherit nix-on-droid; - nixpkgs = nixpkgs-droid; - home-manager = home-manager-droid; - }; - formatter = { x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.nixfmt-rfc-style; diff --git a/hosts/droid/default.nix b/hosts/droid/default.nix deleted file mode 100644 index 93844570..00000000 --- a/hosts/droid/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - nixpkgs, - nix-on-droid, - home-manager, - ... -}: -nix-on-droid.lib.nixOnDroidConfiguration { - pkgs = import nixpkgs { system = "aarch64-linux"; }; - modules = [ - home-manager.nixosModules.home-manager - ./sshd.nix - ./stuff.nix - ]; -} diff --git a/hosts/droid/sshd.nix b/hosts/droid/sshd.nix deleted file mode 100644 index 4ab5207e..00000000 --- a/hosts/droid/sshd.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ config, pkgs, ... }: -let - sshdTmpDirectory = "${config.user.home}/sshd-tmp"; - sshdDirectory = "${config.user.home}/sshd"; - pubKeys = '' - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming - ''; - port = 8022; -in -{ - build.activation.sshd = '' - $DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${config.user.home}/.ssh" - $DRY_RUN_CMD echo "${pubKeys}" > "${config.user.home}/.ssh/authorized_keys" - - if [[ ! -d "${sshdDirectory}" ]]; then - $DRY_RUN_CMD rm $VERBOSE_ARG --recursive --force "${sshdTmpDirectory}" - $DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${sshdTmpDirectory}" - - $VERBOSE_ECHO "Generating host keys..." - $DRY_RUN_CMD ${pkgs.openssh}/bin/ssh-keygen -t rsa -b 4096 -f "${sshdTmpDirectory}/ssh_host_rsa_key" -N "" - - $VERBOSE_ECHO "Writing sshd_config..." - $DRY_RUN_CMD echo -e "HostKey ${sshdDirectory}/ssh_host_rsa_key\nPort ${toString port}\n" > "${sshdTmpDirectory}/sshd_config" - - $DRY_RUN_CMD mv $VERBOSE_ARG "${sshdTmpDirectory}" "${sshdDirectory}" - fi - ''; - - environment.packages = [ - (pkgs.writeScriptBin "sshd-start" '' - #!${pkgs.runtimeShell} - - echo "Starting sshd in non-daemonized way on port ${toString port}" - ${pkgs.openssh}/bin/sshd -f "${sshdDirectory}/sshd_config" -D - '') - ]; -} diff --git a/hosts/droid/stuff.nix b/hosts/droid/stuff.nix deleted file mode 100644 index c13094ad..00000000 --- a/hosts/droid/stuff.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - pkgs, - ... -}: -{ - environment.packages = with pkgs; [ - nano - hostname - zsh - openssh - which - curl - ]; - - # Backup etc files instead of failing to activate generation if a file already exists in /etc - environment.etcBackupExtension = ".bak"; - - system.stateVersion = "24.05"; - nix.extraOptions = '' - experimental-features = nix-command flakes - ''; - time.timeZone = "Europe/Berlin"; -} From 906a264118728cd3868216398e15a2669f1c18d6 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 21 Dec 2024 14:13:01 +0100 Subject: [PATCH 0206/1295] disable amdvlk because of gnome bug, update config --- modules/amd-graphics.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/amd-graphics.nix b/modules/amd-graphics.nix index ec9ec02e..4ae15acb 100644 --- a/modules/amd-graphics.nix +++ b/modules/amd-graphics.nix @@ -1,12 +1,19 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { config = { boot.kernelModules = [ "amdgpu" ]; services.xserver.videoDrivers = [ "amdgpu" ]; - hardware.graphics = { - extraPackages = with pkgs; [ amdvlk ]; - extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ]; + hardware = { + graphics.enable = true; + amdgpu = { + opencl.enable = true; + amdvlk = { + # TODO: this creates black borders around GNOME apps + # enable = true; + support32Bit.enable = config.hardware.graphics.enable32Bit; + }; + }; }; environment.systemPackages = with pkgs; [ nvtopPackages.amd ]; From d65d5851366f6b7ecbdfedc14be7c31e2a9bd15e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 21 Dec 2024 14:38:16 +0100 Subject: [PATCH 0207/1295] tweak update settings, update flake.lock --- common/nixpkgs.nix | 3 ++- flake.lock | 12 ++++++------ flake.nix | 2 +- hosts/hetzner-vpn2/default.nix | 3 +++ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/common/nixpkgs.nix b/common/nixpkgs.nix index 4705ad51..42d7c033 100644 --- a/common/nixpkgs.nix +++ b/common/nixpkgs.nix @@ -41,7 +41,8 @@ # enable auto updates autoUpgrade = { enable = true; - dates = "weekly"; + dates = "daily"; + flake = "github:kaesaecracker/nixos-configuration"; }; }; diff --git a/flake.lock b/flake.lock index 6683f13f..705d9813 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1733951536, - "narHash": "sha256-Zb5ZCa7Xj+0gy5XVXINTSr71fCfAv+IKtmIXNrykT54=", + "lastModified": 1734366194, + "narHash": "sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw=", "owner": "nix-community", "repo": "home-manager", - "rev": "1318c3f3b068cdcea922fa7c1a0a1f0c96c22f5f", + "rev": "80b0fdf483c5d1cb75aaad909bd390d48673857f", "type": "github" }, "original": { @@ -91,11 +91,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1733808091, - "narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=", + "lastModified": 1734600368, + "narHash": "sha256-nbG9TijTMcfr+au7ZVbKpAhMJzzE2nQBYmRvSdXUD8g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e", + "rev": "b47fd6fa00c6afca88b8ee46cfdb00e104f50bca", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0968c4ac..388dc451 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ self, nixpkgs, home-manager, - lix-module + lix-module, }: { nixosConfigurations = diff --git a/hosts/hetzner-vpn2/default.nix b/hosts/hetzner-vpn2/default.nix index 8cf041f9..288cd462 100644 --- a/hosts/hetzner-vpn2/default.nix +++ b/hosts/hetzner-vpn2/default.nix @@ -33,5 +33,8 @@ nixpkgs.lib.nixosSystem { ]; }; } + { + system.autoUpgrade.allowReboot = true; + } ]; } From 0e3c3b8971e6991ab5f048d1db3967b40f4e62a9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 21 Dec 2024 14:43:08 +0100 Subject: [PATCH 0208/1295] tweak update settings --- modules/desktop-environment.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index e4eb0ed6..7ac36ae6 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -84,7 +84,7 @@ # prevent stuck units from preventing shutdown (default is 120s) extraConfig = '' - DefaultTimeoutStopSec=12s + DefaultTimeoutStopSec=10s ''; }; @@ -108,5 +108,10 @@ enable = true; enableGraphical = true; }; + + system.autoUpgrade = { + allowReboot = false; + operation = "boot"; + }; }; } From 7ed15d5b1bb29cc2fe11cec882619feb917562a9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 1 Jan 2025 16:35:42 +0100 Subject: [PATCH 0209/1295] update flake --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 705d9813..86e63cb0 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1734366194, - "narHash": "sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw=", + "lastModified": 1735344290, + "narHash": "sha256-oJDtWPH1oJT34RJK1FSWjwX4qcGOBRkcNQPD0EbSfNM=", "owner": "nix-community", "repo": "home-manager", - "rev": "80b0fdf483c5d1cb75aaad909bd390d48673857f", + "rev": "613691f285dad87694c2ba1c9e6298d04736292d", "type": "github" }, "original": { @@ -91,11 +91,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1734600368, - "narHash": "sha256-nbG9TijTMcfr+au7ZVbKpAhMJzzE2nQBYmRvSdXUD8g=", + "lastModified": 1735531152, + "narHash": "sha256-As8I+ebItDKtboWgDXYZSIjGlKeqiLBvjxsQHUmAf1Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b47fd6fa00c6afca88b8ee46cfdb00e104f50bca", + "rev": "3ffbbdbac0566a0977da3d2657b89cbcfe9a173b", "type": "github" }, "original": { From 29ea7db3aa4c1f5c1af9a144f942e4fbad9b6b61 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 2 Jan 2025 01:14:41 +0100 Subject: [PATCH 0210/1295] add ona-book --- common/i18n.nix | 9 ------ flake.nix | 1 + hosts/ona-book/default.nix | 37 ++++++++++++++++++++++ hosts/ona-book/hardware.nix | 57 ++++++++++++++++++++++++++++++++++ hosts/vinzenz-lpt2/default.nix | 9 ++++++ hosts/vinzenz-pc2/default.nix | 9 ++++++ 6 files changed, 113 insertions(+), 9 deletions(-) create mode 100644 hosts/ona-book/default.nix create mode 100644 hosts/ona-book/hardware.nix diff --git a/common/i18n.nix b/common/i18n.nix index c9506ad5..3d789f0f 100644 --- a/common/i18n.nix +++ b/common/i18n.nix @@ -15,14 +15,5 @@ _: { LC_TIME = "de_DE.UTF-8"; }; }; - - services.xserver.xkb = { - # Configure keymap in X11 - layout = "de"; - variant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; }; } diff --git a/flake.nix b/flake.nix index 388dc451..4b4200ed 100644 --- a/flake.nix +++ b/flake.nix @@ -43,6 +43,7 @@ vinzenz-lpt2 = import ./hosts/vinzenz-lpt2 host-params; vinzenz-pc2 = import ./hosts/vinzenz-pc2 host-params; hetzner-vpn2 = import ./hosts/hetzner-vpn2 host-params; + ona-book = import ./hosts/ona-book host-params; }; formatter = { diff --git a/hosts/ona-book/default.nix b/hosts/ona-book/default.nix new file mode 100644 index 00000000..bdc89522 --- /dev/null +++ b/hosts/ona-book/default.nix @@ -0,0 +1,37 @@ +{ + nixpkgs, + common-modules, + desktop-modules, + ... +}: +nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = + common-modules + ++ desktop-modules + ++ [ + ./hardware.nix + ../../home/gnome.nix + ../../users/ronja.nix + ../../modules/gnome.nix + + { + networking.hostName = "ona-book"; + services.xserver.xkb = { + layout = "us"; + options = "eurosign:e,caps:escape"; + }; + } + + { + home-manager.users.ronja = import ../../home/ronja.nix; + + users.users.ronja.openssh.authorizedKeys.keys = [ + ]; + } + + { + + } + ]; +} diff --git a/hosts/ona-book/hardware.nix b/hosts/ona-book/hardware.nix new file mode 100644 index 00000000..3a1601b0 --- /dev/null +++ b/hosts/ona-book/hardware.nix @@ -0,0 +1,57 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ + (modulesPath + "/hardware/network/broadcom-43xx.nix") + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + config = { + boot = { + initrd.availableKernelModules = [ + "xhci_pci" + "nvme" + "usb_storage" + "sd_mod" + ]; + initrd.kernelModules = [ ]; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/15220182-5617-4963-814e-19ff29b7db8c"; + fsType = "btrfs"; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/1C7D-07C1"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/e4c91c7e-8b62-48e4-923d-4d750ebbc7db"; } + ]; + + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix index f9d0276c..7114544c 100644 --- a/hosts/vinzenz-lpt2/default.nix +++ b/hosts/vinzenz-lpt2/default.nix @@ -26,6 +26,15 @@ nixpkgs.lib.nixosSystem { "aarch64-linux" "i686-linux" ]; + + services.xserver.xkb = { + # Configure keymap in X11 + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; } { diff --git a/hosts/vinzenz-pc2/default.nix b/hosts/vinzenz-pc2/default.nix index c8535c88..3fdcb706 100644 --- a/hosts/vinzenz-pc2/default.nix +++ b/hosts/vinzenz-pc2/default.nix @@ -25,6 +25,15 @@ nixpkgs.lib.nixosSystem { "aarch64-linux" "i686-linux" ]; + + services.xserver.xkb = { + # Configure keymap in X11 + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; } { home-manager.users = { From 72c6b8bd3491aa672e432cb5b483381255a25ae7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 2 Jan 2025 02:05:36 +0100 Subject: [PATCH 0211/1295] copy vscode config to other user --- home/{ronja.nix => ronja/default.nix} | 3 +- home/ronja/vscode.nix | 56 +++++++++++++++++++++++++++ hosts/ona-book/default.nix | 2 +- hosts/vinzenz-pc2/default.nix | 2 +- users/ronja.nix | 4 ++ 5 files changed, 64 insertions(+), 3 deletions(-) rename home/{ronja.nix => ronja/default.nix} (93%) create mode 100644 home/ronja/vscode.nix diff --git a/home/ronja.nix b/home/ronja/default.nix similarity index 93% rename from home/ronja.nix rename to home/ronja/default.nix index c0e0f054..35fa2d9f 100644 --- a/home/ronja.nix +++ b/home/ronja/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +inputs@{ config, pkgs, ... }: { home.packages = with pkgs; [ ## Apps @@ -8,6 +8,7 @@ programs = { home-manager.enable = true; + vscode = import ./vscode.nix inputs; zsh = { history = { diff --git a/home/ronja/vscode.nix b/home/ronja/vscode.nix new file mode 100644 index 00000000..29f5046e --- /dev/null +++ b/home/ronja/vscode.nix @@ -0,0 +1,56 @@ +{ pkgs, ... }: +{ + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + bbenoist.nix + ms-python.python + kamadorueda.alejandra + editorconfig.editorconfig + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + rust-lang.rust-analyzer + tamasfe.even-better-toml + llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + vadimcn.vscode-lldb + ms-dotnettools.csharp + ms-vscode-remote.remote-ssh + ]; + userSettings = { + "files.autoSave" = "afterDelay"; + "files.autoSaveWhenNoErrors" = true; + "files.autoSaveWorkspaceFilesOnly" = true; + + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; + + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; + + "update.mode" = "none"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; + + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; + + "git.autofetch" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "rust-analyzer.checkOnSave.command" = "clippy"; + + "\[makefile\]" = { + "editor.insertSpaces" = false; + "editor.detectIndentation" = false; + }; + }; +} diff --git a/hosts/ona-book/default.nix b/hosts/ona-book/default.nix index bdc89522..36a2a5c0 100644 --- a/hosts/ona-book/default.nix +++ b/hosts/ona-book/default.nix @@ -24,7 +24,7 @@ nixpkgs.lib.nixosSystem { } { - home-manager.users.ronja = import ../../home/ronja.nix; + home-manager.users.ronja = import ../../home/ronja; users.users.ronja.openssh.authorizedKeys.keys = [ ]; diff --git a/hosts/vinzenz-pc2/default.nix b/hosts/vinzenz-pc2/default.nix index 3fdcb706..c90e3ec9 100644 --- a/hosts/vinzenz-pc2/default.nix +++ b/hosts/vinzenz-pc2/default.nix @@ -38,7 +38,7 @@ nixpkgs.lib.nixosSystem { { home-manager.users = { vinzenz = import ../../home/vinzenz; - ronja = import ../../home/ronja.nix; + ronja = import ../../home/ronja; }; users.users.vinzenz.openssh.authorizedKeys.keys = [ diff --git a/users/ronja.nix b/users/ronja.nix index 547f31bf..3ed2b8a9 100644 --- a/users/ronja.nix +++ b/users/ronja.nix @@ -15,5 +15,9 @@ ]; shell = pkgs.zsh; }; + + allowedUnfreePackages = [ + "vscode-extension-ms-vscode-remote-remote-ssh" + ]; }; } From 8b48c54f48f3edd3c588b19a1a15c5d12b1de6c2 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 2 Jan 2025 17:56:33 +0100 Subject: [PATCH 0212/1295] enable fractional scaling for gnome --- modules/gnome.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/gnome.nix b/modules/gnome.nix index c1d67c63..4b0d1ff0 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -4,7 +4,14 @@ services = { xserver = { # Enable the GNOME Desktop Environment. - desktopManager.gnome.enable = true; + desktopManager.gnome = { + enable = true; + extraGSettingsOverridePackages = [ pkgs.mutter ]; + extraGSettingsOverrides = '' + [org.gnome.mutter] + experimental-features=['scale-monitor-framebuffer'] + ''; + }; displayManager.gdm.enable = true; excludePackages = with pkgs; [ xterm ]; }; From 161d78902ee583c898e6108af94a62fe3c5759d9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 2 Jan 2025 18:17:23 +0100 Subject: [PATCH 0213/1295] move some extensions from shared module to user module --- home/gnome-shared-dconf.nix | 4 -- home/gnome.nix | 5 -- home/vinzenz/default.nix | 116 +++++++++++++++++++----------------- home/vinzenz/gnome.nix | 23 +++++++ 4 files changed, 83 insertions(+), 65 deletions(-) create mode 100644 home/vinzenz/gnome.nix diff --git a/home/gnome-shared-dconf.nix b/home/gnome-shared-dconf.nix index 32b7657b..b9b3716f 100644 --- a/home/gnome-shared-dconf.nix +++ b/home/gnome-shared-dconf.nix @@ -26,10 +26,6 @@ "appindicatorsupport@rgcjonas.gmail.com" "workspace-indicator@gnome-shell-extensions.gcampax.github.com" "caffeine@patapon.info" - "GPaste@gnome-shell-extensions.gnome.org" - "gsconnect@andyholmes.github.io" - "solaar-extension@sidevesh" - "AlphabeticalAppGrid@stuarthayhurst" ]; }; "ca/desrt/dconf-editor" = { diff --git a/home/gnome.nix b/home/gnome.nix index 2b092b8f..0310a7ea 100644 --- a/home/gnome.nix +++ b/home/gnome.nix @@ -20,11 +20,6 @@ ++ (with gnomeExtensions; [ caffeine appindicator - gsconnect - # battery-health-charging - quick-settings-tweaker - solaar-extension - alphabetical-app-grid ]); dconf.settings = import ./gnome-shared-dconf.nix; diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index cac2a69b..d2bca384 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -1,64 +1,68 @@ inputs@{ pkgs, ... }: { - programs = { - home-manager.enable = true; - fzf.enable = true; - zsh = import ./zsh.nix inputs; - git = import ./git.nix; - vscode = import ./vscode.nix inputs; - ssh = import ./ssh.nix; + imports = [ ./gnome.nix ]; - direnv = { - enable = true; - nix-direnv.enable = true; + config = { + programs = { + home-manager.enable = true; + fzf.enable = true; + zsh = import ./zsh.nix inputs; + git = import ./git.nix; + vscode = import ./vscode.nix inputs; + ssh = import ./ssh.nix; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + eza = { + enable = true; + git = true; + icons = "auto"; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + }; }; - eza = { - enable = true; - git = true; - icons = "auto"; - extraOptions = [ - "--group-directories-first" - "--header" - ]; + editorconfig = import ./editorconfig.nix; + + home.packages = with pkgs; [ + keepassxc + insync + + telegram-desktop + element-desktop + + wireguard-tools + wirelesstools + + alejandra # nix formatter + + kdiff3 + jetbrains-toolbox + ]; + + home.file."policy.json" = { + target = ".config/containers/policy.json"; + text = '' + { + "default": [ + { + "type": "insecureAcceptAnything" + } + ], + "transports": + { + "docker-daemon": + { + "": [{"type":"insecureAcceptAnything"}] + } + } + } + ''; }; }; - - editorconfig = import ./editorconfig.nix; - - home.packages = with pkgs; [ - keepassxc - insync - - telegram-desktop - element-desktop - - wireguard-tools - wirelesstools - - alejandra # nix formatter - - kdiff3 - jetbrains-toolbox - ]; - - home.file."policy.json" = { - target = ".config/containers/policy.json"; - text = '' - { - "default": [ - { - "type": "insecureAcceptAnything" - } - ], - "transports": - { - "docker-daemon": - { - "": [{"type":"insecureAcceptAnything"}] - } - } - } - ''; - }; } diff --git a/home/vinzenz/gnome.nix b/home/vinzenz/gnome.nix new file mode 100644 index 00000000..4e706186 --- /dev/null +++ b/home/vinzenz/gnome.nix @@ -0,0 +1,23 @@ +inputs@{ pkgs, ... }: +{ + config = { + home.packages = with pkgs.gnomeExtensions; [ + gsconnect + # battery-health-charging + quick-settings-tweaker + solaar-extension + alphabetical-app-grid + ]; + + dconf.settings = { + "org/gnome/shell" = { + enabled-extensions = [ + "GPaste@gnome-shell-extensions.gnome.org" + "gsconnect@andyholmes.github.io" + "solaar-extension@sidevesh" + "AlphabeticalAppGrid@stuarthayhurst" + ]; + }; + }; + }; +} From aee35ecfa3a129596b69f3a7f349381116ae916f Mon Sep 17 00:00:00 2001 From: Ronja Spiegelberg Date: Sun, 5 Jan 2025 17:46:32 +0100 Subject: [PATCH 0214/1295] wip mbp hw config --- flake.lock | 23 ++++++++++++-- flake.nix | 3 ++ hosts/ona-book/default.nix | 55 +++++++++++++++++++-------------- hosts/ona-book/hardware.nix | 24 +++++++++++++- hosts/vinzenz-lpt2/default.nix | 5 ++- hosts/vinzenz-pc2/default.nix | 5 ++- modules/desktop-environment.nix | 2 -- 7 files changed, 86 insertions(+), 31 deletions(-) diff --git a/flake.lock b/flake.lock index 86e63cb0..c38e8377 100644 --- a/flake.lock +++ b/flake.lock @@ -89,13 +89,29 @@ "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1735388221, + "narHash": "sha256-e5IOgjQf0SZcFCEV/gMGrsI0gCJyqOKShBQU0iiM3Kg=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "7c674c6734f61157e321db595dbfcd8523e04e19", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1735531152, - "narHash": "sha256-As8I+ebItDKtboWgDXYZSIjGlKeqiLBvjxsQHUmAf1Q=", + "lastModified": 1735922141, + "narHash": "sha256-vk0xwGZSlvZ/596yxOtsk4gxsIx2VemzdjiU8zhjgWw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3ffbbdbac0566a0977da3d2657b89cbcfe9a173b", + "rev": "d29ab98cd4a70a387b8ceea3e930b3340d41ac5a", "type": "github" }, "original": { @@ -109,6 +125,7 @@ "inputs": { "home-manager": "home-manager", "lix-module": "lix-module", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs" } }, diff --git a/flake.nix b/flake.nix index 4b4200ed..80868dea 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,7 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; home-manager = { url = "github:nix-community/home-manager/release-24.11"; @@ -19,6 +20,7 @@ nixpkgs, home-manager, lix-module, + nixos-hardware, }: { nixosConfigurations = @@ -27,6 +29,7 @@ inherit nixpkgs; inherit home-manager; inherit lix-module; + inherit nixos-hardware; common-modules = [ lix-module.nixosModules.default ./common diff --git a/hosts/ona-book/default.nix b/hosts/ona-book/default.nix index 36a2a5c0..22314947 100644 --- a/hosts/ona-book/default.nix +++ b/hosts/ona-book/default.nix @@ -2,36 +2,45 @@ nixpkgs, common-modules, desktop-modules, + nixos-hardware, + home-manager, ... }: nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - modules = - common-modules - ++ desktop-modules - ++ [ - ./hardware.nix - ../../home/gnome.nix - ../../users/ronja.nix - ../../modules/gnome.nix + modules = common-modules ++ [ + home-manager.nixosModules.home-manager + ../../home + ../../modules/desktop-environment.nix - { - networking.hostName = "ona-book"; - services.xserver.xkb = { - layout = "us"; - options = "eurosign:e,caps:escape"; - }; - } + nixos-hardware.nixosModules.apple-macbook-pro-14-1 + { allowedUnfreePackages = [ "b43-firmware" ]; } - { - home-manager.users.ronja = import ../../home/ronja; + ./hardware.nix + ../../home/gnome.nix + ../../users/ronja.nix + ../../modules/gnome.nix - users.users.ronja.openssh.authorizedKeys.keys = [ - ]; - } + { + networking = { + hostName = "ona-book"; + networkmanager.enable = true; + }; + services.xserver.xkb = { + layout = "us"; + options = "eurosign:e,caps:escape"; + }; + } - { + { + home-manager.users.ronja = import ../../home/ronja; - } - ]; + users.users.ronja.openssh.authorizedKeys.keys = [ + ]; + } + + { + + } + ]; } diff --git a/hosts/ona-book/hardware.nix b/hosts/ona-book/hardware.nix index 3a1601b0..bf4fdc49 100644 --- a/hosts/ona-book/hardware.nix +++ b/hosts/ona-book/hardware.nix @@ -20,8 +20,24 @@ "sd_mod" ]; initrd.kernelModules = [ ]; - kernelModules = [ "kvm-intel" ]; + kernelModules = [ + "kvm-intel" + "snd_hda_codec_cs8409" + "hci_uart" + "bluetooth" + "btbcm" + ]; extraModulePackages = [ ]; + blacklistedKernelModules = [ ]; + kernelParams = []; + loader = { + efi.canTouchEfiVariables = true; + systemd-boot = { + enable = true; + editor = false; # do not allow changing kernel parameters + consoleMode = "max"; + }; + }; }; fileSystems = { @@ -53,5 +69,11 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + hardware.enableAllFirmware = true; + nixpkgs.config.allowUnfree = true; + hardware.enableRedistributableFirmware = true; + + hardware.facetimehd.enable = true; }; } diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix index 7114544c..c2944b1e 100644 --- a/hosts/vinzenz-lpt2/default.nix +++ b/hosts/vinzenz-lpt2/default.nix @@ -21,7 +21,10 @@ nixpkgs.lib.nixosSystem { ../../modules/podman.nix { - networking.hostName = "vinzenz-lpt2"; + networking = { + hostName = "vinzenz-lpt2"; + networkmanager.enable = true; + }; nix.settings.extra-platforms = [ "aarch64-linux" "i686-linux" diff --git a/hosts/vinzenz-pc2/default.nix b/hosts/vinzenz-pc2/default.nix index c90e3ec9..707457a9 100644 --- a/hosts/vinzenz-pc2/default.nix +++ b/hosts/vinzenz-pc2/default.nix @@ -20,7 +20,10 @@ nixpkgs.lib.nixosSystem { ../../modules/printing.nix ../../modules/podman.nix { - networking.hostName = "vinzenz-pc2"; + networking = { + hostName = "vinzenz-pc2"; + networkmanager.enable = true; + }; nix.settings.extra-platforms = [ "aarch64-linux" "i686-linux" diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index 7ac36ae6..cf860e51 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -58,8 +58,6 @@ }; networking = { - networkmanager.enable = true; - firewall = { allowedTCPPortRanges = [ { From 85b4ea58801233e9d6d3a64f63b10a42fae27f01 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 26 Jan 2025 16:19:59 +0100 Subject: [PATCH 0215/1295] minor home tweaks --- home/vinzenz/default.nix | 5 +++-- home/vinzenz/zsh.nix | 3 +-- modules/desktop-environment.nix | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index d2bca384..6cd8b3a0 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -39,10 +39,11 @@ inputs@{ pkgs, ... }: wireguard-tools wirelesstools - alejandra # nix formatter - kdiff3 jetbrains-toolbox + + blanket + vlc ]; home.file."policy.json" = { diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index 9a9f6332..13ff5612 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -11,8 +11,7 @@ my-apply = "sudo nixos-rebuild boot --flake"; my-switch = "sudo nixos-rebuild switch --flake"; my-update = "sudo nixos-rebuild boot --upgrade --flake"; - my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; - my-fmt = "alejandra ."; + my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; my-test = "sudo nixos-rebuild test"; my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; my-ip4 = "ip addr show | grep 192"; diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index cf860e51..b480f672 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -99,7 +99,7 @@ fonts = { enableDefaultPackages = true; fontconfig.defaultFonts.monospace = [ "FiraCode Nerd Font" ]; - packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) ]; + packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) roboto-mono ]; }; hardware.logitech.wireless = { From 5250e8552ec3103f81480ff72f2a97e4479ddc46 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 26 Jan 2025 16:23:22 +0100 Subject: [PATCH 0216/1295] add forgejo-runner-1 --- hosts/forgejo-runner-1/default.nix | 28 +++++++++++++ hosts/forgejo-runner-1/hardware.nix | 63 +++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 hosts/forgejo-runner-1/default.nix create mode 100644 hosts/forgejo-runner-1/hardware.nix diff --git a/hosts/forgejo-runner-1/default.nix b/hosts/forgejo-runner-1/default.nix new file mode 100644 index 00000000..4c2666eb --- /dev/null +++ b/hosts/forgejo-runner-1/default.nix @@ -0,0 +1,28 @@ +{ nixpkgs, common-modules, ... }: +nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + modules = common-modules ++ [ + ./hardware.nix + ../../users/vinzenz.nix + { networking.hostName = "forgejo-runner-1"; } + { + # uncomment for build check on non arm system (requires --impure) + # nixpkgs.buildPlatform = builtins.currentSystem; + } + { + services.tailscale.useRoutingFeatures = "both"; + } + { + users.users = { + root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + }; + } + { + system.autoUpgrade.allowReboot = true; + } + ]; +} diff --git a/hosts/forgejo-runner-1/hardware.nix b/hosts/forgejo-runner-1/hardware.nix new file mode 100644 index 00000000..034ed888 --- /dev/null +++ b/hosts/forgejo-runner-1/hardware.nix @@ -0,0 +1,63 @@ +{ lib, modulesPath, ... }: +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + + config = { + nixpkgs = { + hostPlatform = "aarch64-linux"; + system = "aarch64-linux"; + }; + + boot = { + tmp.cleanOnBoot = true; + kernelParams = [ "console=tty" ]; + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + initrd = { + availableKernelModules = [ + "xhci_pci" + "virtio_scsi" + "sr_mod" + "virtio_gpu" + ]; + kernelModules = [ ]; + }; + }; + + # fileSystems = { + # "/" = { + # device = "/dev/disk/by-uuid/3263489d-9819-433c-b198-9d2e732a94e4"; + # fsType = "ext4"; + # }; + # "/boot" = { + # device = "/dev/disk/by-uuid/6C25-6BDC"; + # fsType = "vfat"; + # options = [ + # "fmask=0077" + # "dmask=0077" + # ]; + # }; + # }; + + # swapDevices = [ + # { device = "/dev/disk/by-uuid/e147721d-86b5-40d7-a231-c6ea391c563d"; } + # ]; + + # networking.useNetworkd = true; + # systemd.network = { + # enable = true; + # networks."10-wan" = { + # matchConfig.Name = "enp1s0"; + # networkConfig.DHCP = "ipv4"; + # address = [ + # "2a01:4f8:c013:65dd::1/64" + # ]; + # routes = [ + # { Gateway = "fe80::1"; } + # ]; + # }; + # }; + }; +} From bca52c8bf68af556823dcfc52f6fd38896411db3 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 26 Jan 2025 17:23:36 +0100 Subject: [PATCH 0217/1295] hw config for forgejo-runner-1 --- hosts/forgejo-runner-1/hardware.nix | 62 ++++++++++++++--------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/hosts/forgejo-runner-1/hardware.nix b/hosts/forgejo-runner-1/hardware.nix index 034ed888..976b998a 100644 --- a/hosts/forgejo-runner-1/hardware.nix +++ b/hosts/forgejo-runner-1/hardware.nix @@ -26,38 +26,38 @@ }; }; - # fileSystems = { - # "/" = { - # device = "/dev/disk/by-uuid/3263489d-9819-433c-b198-9d2e732a94e4"; - # fsType = "ext4"; - # }; - # "/boot" = { - # device = "/dev/disk/by-uuid/6C25-6BDC"; - # fsType = "vfat"; - # options = [ - # "fmask=0077" - # "dmask=0077" - # ]; - # }; - # }; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/47bc77ff-12e1-4d39-bb5c-fb100ccd3aab"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/05F2-8F9A"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + }; - # swapDevices = [ - # { device = "/dev/disk/by-uuid/e147721d-86b5-40d7-a231-c6ea391c563d"; } - # ]; + swapDevices = [ + { device = "/dev/disk/by-uuid/bbd18a70-b0bb-4e1a-b45b-3c1f8eccc0c10"; } + ]; - # networking.useNetworkd = true; - # systemd.network = { - # enable = true; - # networks."10-wan" = { - # matchConfig.Name = "enp1s0"; - # networkConfig.DHCP = "ipv4"; - # address = [ - # "2a01:4f8:c013:65dd::1/64" - # ]; - # routes = [ - # { Gateway = "fe80::1"; } - # ]; - # }; - # }; + networking.useNetworkd = true; + systemd.network = { + enable = true; + networks."10-wan" = { + matchConfig.Name = "enp1s0"; + networkConfig.DHCP = "ipv4"; + address = [ + "2a01:4f8:c013:a524::1/64" + ]; + routes = [ + { Gateway = "fe80::1"; } + ]; + }; + }; }; } From 9bc1566e8c6041d42f232e8a860c6134832d287b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 26 Jan 2025 17:25:28 +0100 Subject: [PATCH 0218/1295] add host to flake --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 80868dea..195e98af 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,7 @@ vinzenz-lpt2 = import ./hosts/vinzenz-lpt2 host-params; vinzenz-pc2 = import ./hosts/vinzenz-pc2 host-params; hetzner-vpn2 = import ./hosts/hetzner-vpn2 host-params; + forgejo-runner-1 = import ./hosts/forgejo-runner-1 host-params; ona-book = import ./hosts/ona-book host-params; }; From b143437c8942430494bfad2fafc29c4118de0426 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 26 Jan 2025 19:48:22 +0100 Subject: [PATCH 0219/1295] fix typo in uuid --- hosts/forgejo-runner-1/hardware.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/forgejo-runner-1/hardware.nix b/hosts/forgejo-runner-1/hardware.nix index 976b998a..f7cb0837 100644 --- a/hosts/forgejo-runner-1/hardware.nix +++ b/hosts/forgejo-runner-1/hardware.nix @@ -42,7 +42,7 @@ }; swapDevices = [ - { device = "/dev/disk/by-uuid/bbd18a70-b0bb-4e1a-b45b-3c1f8eccc0c10"; } + { device = "/dev/disk/by-uuid/bbd18a70-b0bb-4e1a-b45b-3c1f8ecc0c10"; } ]; networking.useNetworkd = true; From 87b5b7ab00f41f9d5fdfceaa86631024a2cd94e1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 1 Feb 2025 16:02:27 +0100 Subject: [PATCH 0220/1295] policy.json in extra file, default to reject --- home/vinzenz/.config/containers/policy.json | 16 ++++++++++++++++ home/vinzenz/default.nix | 17 +---------------- 2 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 home/vinzenz/.config/containers/policy.json diff --git a/home/vinzenz/.config/containers/policy.json b/home/vinzenz/.config/containers/policy.json new file mode 100644 index 00000000..d13844e4 --- /dev/null +++ b/home/vinzenz/.config/containers/policy.json @@ -0,0 +1,16 @@ +{ + "default": [ + { + "type": "reject" + } + ], + "transports": { + "docker-daemon": { + "": [ + { + "type": "insecureAcceptAnything" + } + ] + } + } +} \ No newline at end of file diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 6cd8b3a0..0b06468f 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -48,22 +48,7 @@ inputs@{ pkgs, ... }: home.file."policy.json" = { target = ".config/containers/policy.json"; - text = '' - { - "default": [ - { - "type": "insecureAcceptAnything" - } - ], - "transports": - { - "docker-daemon": - { - "": [{"type":"insecureAcceptAnything"}] - } - } - } - ''; + text = builtins.readFile ./.config/containers/policy.json; }; }; } From 28f2315edee4232e5816fec954cae025daae23d9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 1 Feb 2025 16:02:33 +0100 Subject: [PATCH 0221/1295] update flake --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index c38e8377..e6169731 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1735344290, - "narHash": "sha256-oJDtWPH1oJT34RJK1FSWjwX4qcGOBRkcNQPD0EbSfNM=", + "lastModified": 1736373539, + "narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=", "owner": "nix-community", "repo": "home-manager", - "rev": "613691f285dad87694c2ba1c9e6298d04736292d", + "rev": "bd65bc3cde04c16755955630b344bc9e35272c56", "type": "github" }, "original": { @@ -91,11 +91,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1735388221, - "narHash": "sha256-e5IOgjQf0SZcFCEV/gMGrsI0gCJyqOKShBQU0iiM3Kg=", + "lastModified": 1738391520, + "narHash": "sha256-6HI58PKjddsC0RA0gBQlt6ox47oH//jLUHwx05RO8g0=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "7c674c6734f61157e321db595dbfcd8523e04e19", + "rev": "34b64e4e1ddb14e3ffc7db8d4a781396dbbab773", "type": "github" }, "original": { @@ -107,11 +107,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1735922141, - "narHash": "sha256-vk0xwGZSlvZ/596yxOtsk4gxsIx2VemzdjiU8zhjgWw=", + "lastModified": 1738277201, + "narHash": "sha256-6L+WXKCw5mqnUIExvqkD99pJQ41xgyCk6z/H9snClwk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d29ab98cd4a70a387b8ceea3e930b3340d41ac5a", + "rev": "666e1b3f09c267afd66addebe80fb05a5ef2b554", "type": "github" }, "original": { From 5ed5698587e1918505ebda1c4281fdfdee063aa4 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 1 Feb 2025 16:06:36 +0100 Subject: [PATCH 0222/1295] add forgejo-runner on forgejo vm --- hosts/forgejo-runner-1/default.nix | 9 ++++---- hosts/forgejo-runner-1/forgejo-runner.nix | 28 +++++++++++++++++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 hosts/forgejo-runner-1/forgejo-runner.nix diff --git a/hosts/forgejo-runner-1/default.nix b/hosts/forgejo-runner-1/default.nix index 4c2666eb..fb7d547f 100644 --- a/hosts/forgejo-runner-1/default.nix +++ b/hosts/forgejo-runner-1/default.nix @@ -4,6 +4,8 @@ nixpkgs.lib.nixosSystem { modules = common-modules ++ [ ./hardware.nix ../../users/vinzenz.nix + ../../modules/podman.nix + ./forgejo-runner.nix { networking.hostName = "forgejo-runner-1"; } { # uncomment for build check on non arm system (requires --impure) @@ -11,8 +13,8 @@ nixpkgs.lib.nixosSystem { } { services.tailscale.useRoutingFeatures = "both"; - } - { + system.autoUpgrade.allowReboot = true; + users.users = { root.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' @@ -21,8 +23,5 @@ nixpkgs.lib.nixosSystem { ]; }; } - { - system.autoUpgrade.allowReboot = true; - } ]; } diff --git a/hosts/forgejo-runner-1/forgejo-runner.nix b/hosts/forgejo-runner-1/forgejo-runner.nix new file mode 100644 index 00000000..e9f634e8 --- /dev/null +++ b/hosts/forgejo-runner-1/forgejo-runner.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: +{ + config = { + environment.systemPackages = with pkgs; [ + forgejo-runner + ]; + + # https://wiki.nixos.org/wiki/Forgejo + + services.gitea-actions-runner = { + package = pkgs.forgejo-actions-runner; + instances.default = { + enable = true; + name = "cccb"; + url = "https://git.berlin.ccc.de"; + # Obtaining the path to the runner token file may differ + # tokenFile should be in format TOKEN=, since it's EnvironmentFile for systemd + tokenFile = "/etc/forgejo-runner/registration_token"; + labels = [ + "ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:rust-latest" + ]; + settings = { + container.network = "bridge"; + }; + }; + }; + }; +} From f8b1e0ca3b6bebf4a9f35fdc565725ae91765820 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 8 Feb 2025 18:50:10 +0100 Subject: [PATCH 0223/1295] add recursive font --- modules/desktop-environment.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index b480f672..9d4fcd8c 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -99,7 +99,11 @@ fonts = { enableDefaultPackages = true; fontconfig.defaultFonts.monospace = [ "FiraCode Nerd Font" ]; - packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) roboto-mono ]; + packages = with pkgs; [ + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + roboto-mono + recursive + ]; }; hardware.logitech.wireless = { From 3acaf5d98a12b73fe5ca57643dcff6350a85eb63 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 13 Feb 2025 19:03:52 +0100 Subject: [PATCH 0224/1295] set ubuntu-latest to mean 24.04 instead of ancient 22.04 --- hosts/forgejo-runner-1/forgejo-runner.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/forgejo-runner-1/forgejo-runner.nix b/hosts/forgejo-runner-1/forgejo-runner.nix index e9f634e8..4edc17e1 100644 --- a/hosts/forgejo-runner-1/forgejo-runner.nix +++ b/hosts/forgejo-runner-1/forgejo-runner.nix @@ -17,7 +17,8 @@ # tokenFile should be in format TOKEN=, since it's EnvironmentFile for systemd tokenFile = "/etc/forgejo-runner/registration_token"; labels = [ - "ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:rust-latest" + "ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:rust-24.04" + "ubuntu-24.04:docker://ghcr.io/catthehacker/ubuntu:rust-24.04" ]; settings = { container.network = "bridge"; From 2f19ef4f5f3d5209b5344f4d4558aa408d7c983f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 13 Feb 2025 19:04:14 +0100 Subject: [PATCH 0225/1295] add git oauth and cache --- home/vinzenz/default.nix | 1 + home/vinzenz/git.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 0b06468f..5352918a 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -10,6 +10,7 @@ inputs@{ pkgs, ... }: git = import ./git.nix; vscode = import ./vscode.nix inputs; ssh = import ./ssh.nix; + git-credential-oauth.enable = true; direnv = { enable = true; diff --git a/home/vinzenz/git.nix b/home/vinzenz/git.nix index f219d60f..3aee6dab 100644 --- a/home/vinzenz/git.nix +++ b/home/vinzenz/git.nix @@ -12,6 +12,7 @@ pull.ff = "only"; merge.tool = "kdiff3"; push.autoSetupRemote = "true"; + credential.credentialStore = "cache"; }; ignores = [ From 852e9fbf9b551574683410847ef77da3bc036649 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 13 Feb 2025 19:27:17 +0100 Subject: [PATCH 0226/1295] update flake --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index e6169731..330dced3 100644 --- a/flake.lock +++ b/flake.lock @@ -91,11 +91,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1738391520, - "narHash": "sha256-6HI58PKjddsC0RA0gBQlt6ox47oH//jLUHwx05RO8g0=", + "lastModified": 1738816619, + "narHash": "sha256-5yRlg48XmpcX5b5HesdGMOte+YuCy9rzQkJz+imcu6I=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "34b64e4e1ddb14e3ffc7db8d4a781396dbbab773", + "rev": "2eccff41bab80839b1d25b303b53d339fbb07087", "type": "github" }, "original": { @@ -107,11 +107,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738277201, - "narHash": "sha256-6L+WXKCw5mqnUIExvqkD99pJQ41xgyCk6z/H9snClwk=", + "lastModified": 1739357830, + "narHash": "sha256-9xim3nJJUFbVbJCz48UP4fGRStVW5nv4VdbimbKxJ3I=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "666e1b3f09c267afd66addebe80fb05a5ef2b554", + "rev": "0ff09db9d034a04acd4e8908820ba0b410d7a33a", "type": "github" }, "original": { From d1863fb799cee95bbbc84031b11ddc1390688117 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Feb 2025 11:57:49 +0100 Subject: [PATCH 0227/1295] add key --- hosts/vinzenz-pc2/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/vinzenz-pc2/default.nix b/hosts/vinzenz-pc2/default.nix index 707457a9..e0bbd9de 100644 --- a/hosts/vinzenz-pc2/default.nix +++ b/hosts/vinzenz-pc2/default.nix @@ -52,6 +52,7 @@ nixpkgs.lib.nixosSystem { users.users.ronja.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' ]; } ]; From f94daa76ea589a06ed2a635459e16c78f7bc8369 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Feb 2025 11:58:12 +0100 Subject: [PATCH 0228/1295] add wikitext vscode extension --- home/vinzenz/vscode.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index 29f5046e..d04139c1 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -18,6 +18,7 @@ vadimcn.vscode-lldb ms-dotnettools.csharp ms-vscode-remote.remote-ssh + RoweWilsonFrederiskHolme.wikitext ]; userSettings = { "files.autoSave" = "afterDelay"; From e44a1d3b08b4042f98a33ebd818ad2d92aadea57 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Feb 2025 12:05:37 +0100 Subject: [PATCH 0229/1295] gaming tweaks, vscode explicit git path --- home/vinzenz/vscode.nix | 3 ++- modules/amd-graphics.nix | 2 +- modules/gaming.nix | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index d04139c1..0faf92ec 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { enable = true; package = pkgs.vscodium; @@ -43,6 +43,7 @@ "redhat.telemetry.enabled" = false; "git.autofetch" = true; + "git.path" = "${lib.getBin pkgs.git}/bin/git"; "diffEditor.diffAlgorithm" = "advanced"; "explorer.excludeGitIgnore" = true; "markdown.extension.tableFormatter.normalizeIndentation" = true; diff --git a/modules/amd-graphics.nix b/modules/amd-graphics.nix index 4ae15acb..9ec5f755 100644 --- a/modules/amd-graphics.nix +++ b/modules/amd-graphics.nix @@ -10,7 +10,7 @@ opencl.enable = true; amdvlk = { # TODO: this creates black borders around GNOME apps - # enable = true; + enable = true; support32Bit.enable = config.hardware.graphics.enable32Bit; }; }; diff --git a/modules/gaming.nix b/modules/gaming.nix index 4a4bebdc..03499cc7 100644 --- a/modules/gaming.nix +++ b/modules/gaming.nix @@ -30,7 +30,7 @@ remotePlay.openFirewall = true; dedicatedServer.openFirewall = true; localNetworkGameTransfers.openFirewall = true; - gamescopeSession.enable = true; + gamescopeSession.enable = false; }; gamemode.enable = true; }; From cbce2da2cc1444fb5c3d556cca4fc285db1e32cf Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 19 Feb 2025 21:30:06 +0100 Subject: [PATCH 0230/1295] (insecurely) allow docker.io/library/debian --- home/vinzenz/.config/containers/policy.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/home/vinzenz/.config/containers/policy.json b/home/vinzenz/.config/containers/policy.json index d13844e4..d1f9b603 100644 --- a/home/vinzenz/.config/containers/policy.json +++ b/home/vinzenz/.config/containers/policy.json @@ -11,6 +11,13 @@ "type": "insecureAcceptAnything" } ] + }, + "docker": { + "docker.io/library/debian": [ + { + "type": "insecureAcceptAnything" + } + ] } } -} \ No newline at end of file +} From f44484b8f7169db409f99495a246d6169890851f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 9 Mar 2025 10:52:29 +0100 Subject: [PATCH 0231/1295] update flake --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 330dced3..a11515ed 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1736373539, - "narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=", + "lastModified": 1739757849, + "narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=", "owner": "nix-community", "repo": "home-manager", - "rev": "bd65bc3cde04c16755955630b344bc9e35272c56", + "rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe", "type": "github" }, "original": { @@ -91,11 +91,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1738816619, - "narHash": "sha256-5yRlg48XmpcX5b5HesdGMOte+YuCy9rzQkJz+imcu6I=", + "lastModified": 1741325094, + "narHash": "sha256-RUAdT8dZ6k/486vnu3tiNRrNW6+Q8uSD2Mq7gTX4jlo=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "2eccff41bab80839b1d25b303b53d339fbb07087", + "rev": "b48cc4dab0f9711af296fc367b6108cf7b8ccb16", "type": "github" }, "original": { @@ -107,11 +107,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739357830, - "narHash": "sha256-9xim3nJJUFbVbJCz48UP4fGRStVW5nv4VdbimbKxJ3I=", + "lastModified": 1741332913, + "narHash": "sha256-ri1e8ZliWS3Jnp9yqpKApHaOo7KBN33W8ECAKA4teAQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0ff09db9d034a04acd4e8908820ba0b410d7a33a", + "rev": "20755fa05115c84be00b04690630cb38f0a203ad", "type": "github" }, "original": { From a620f86204722d88a2bfb314a4b3d42e151a58fb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Mar 2025 10:25:44 +0100 Subject: [PATCH 0232/1295] update zsh plugin list --- home/vinzenz/zsh.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index 13ff5612..8290bf26 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -11,7 +11,7 @@ my-apply = "sudo nixos-rebuild boot --flake"; my-switch = "sudo nixos-rebuild switch --flake"; my-update = "sudo nixos-rebuild boot --upgrade --flake"; - my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; + my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; my-test = "sudo nixos-rebuild test"; my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; my-ip4 = "ip addr show | grep 192"; @@ -31,8 +31,12 @@ plugins = [ "git" "sudo" - "docker" "systemadmin" + "battery" + "dotnet" + "rust" + "tailscale" + "thefuck" ]; }; } From 7153f0836affea0ac95c21ed38a59203d6e1af6a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Mar 2025 11:03:03 +0100 Subject: [PATCH 0233/1295] restructure flake, remove ona-book partially based on https://codeberg.org/kiara/cfg --- flake.nix | 53 ++++++++-------- hosts/forgejo-runner-1/configuration.nix | 15 +++++ hosts/forgejo-runner-1/default.nix | 27 -------- hosts/forgejo-runner-1/imports.nix | 7 +++ hosts/hetzner-vpn2/configuration.nix | 27 ++++++++ hosts/hetzner-vpn2/default.nix | 40 ------------ hosts/hetzner-vpn2/imports.nix | 7 +++ hosts/ona-book/default.nix | 46 -------------- hosts/ona-book/hardware.nix | 79 ------------------------ hosts/vinzenz-lpt2/configuration.nix | 34 ++++++++++ hosts/vinzenz-lpt2/default.nix | 60 ------------------ hosts/vinzenz-lpt2/imports.nix | 15 +++++ hosts/vinzenz-pc2/configuration.nix | 40 ++++++++++++ hosts/vinzenz-pc2/default.nix | 59 ------------------ hosts/vinzenz-pc2/imports.nix | 15 +++++ modules/gaming.nix | 1 + users/vinzenz.nix | 1 + 17 files changed, 189 insertions(+), 337 deletions(-) create mode 100644 hosts/forgejo-runner-1/configuration.nix delete mode 100644 hosts/forgejo-runner-1/default.nix create mode 100644 hosts/forgejo-runner-1/imports.nix create mode 100644 hosts/hetzner-vpn2/configuration.nix delete mode 100644 hosts/hetzner-vpn2/default.nix create mode 100644 hosts/hetzner-vpn2/imports.nix delete mode 100644 hosts/ona-book/default.nix delete mode 100644 hosts/ona-book/hardware.nix create mode 100644 hosts/vinzenz-lpt2/configuration.nix delete mode 100644 hosts/vinzenz-lpt2/default.nix create mode 100644 hosts/vinzenz-lpt2/imports.nix create mode 100644 hosts/vinzenz-pc2/configuration.nix delete mode 100644 hosts/vinzenz-pc2/default.nix create mode 100644 hosts/vinzenz-pc2/imports.nix diff --git a/flake.nix b/flake.nix index 195e98af..da0baf62 100644 --- a/flake.nix +++ b/flake.nix @@ -22,33 +22,34 @@ lix-module, nixos-hardware, }: + let + devices = { + vinzenz-lpt2 = "x86_64-linux"; + vinzenz-pc2 = "x86_64-linux"; + hetzner-vpn2 = "aarch64-linux"; + forgejo-runner-1 = "aarch64-linux"; + }; + forDevice = f: nixpkgs.lib.mapAttrs f devices; + in { - nixosConfigurations = - let - host-params = { - inherit nixpkgs; - inherit home-manager; - inherit lix-module; - inherit nixos-hardware; - common-modules = [ - lix-module.nixosModules.default - ./common - ]; - desktop-modules = [ - home-manager.nixosModules.home-manager - ./home - ./modules/desktop-environment.nix - ./modules/desktop-hardware.nix - ]; - }; - in - { - vinzenz-lpt2 = import ./hosts/vinzenz-lpt2 host-params; - vinzenz-pc2 = import ./hosts/vinzenz-pc2 host-params; - hetzner-vpn2 = import ./hosts/hetzner-vpn2 host-params; - forgejo-runner-1 = import ./hosts/forgejo-runner-1 host-params; - ona-book = import ./hosts/ona-book host-params; - }; + nixosConfigurations = forDevice ( + device: system: + nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + lix-module.nixosModules.default + home-manager.nixosModules.home-manager + + { networking.hostName = device; } + + ./common + + ./hosts/${device}/hardware.nix + ./hosts/${device}/imports.nix + ./hosts/${device}/configuration.nix + ]; + } + ); formatter = { x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; diff --git a/hosts/forgejo-runner-1/configuration.nix b/hosts/forgejo-runner-1/configuration.nix new file mode 100644 index 00000000..81b5be86 --- /dev/null +++ b/hosts/forgejo-runner-1/configuration.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: +{ + # uncomment for build check on non arm system (requires --impure) + # nixpkgs.buildPlatform = builtins.currentSystem; + services.tailscale.useRoutingFeatures = "both"; + system.autoUpgrade.allowReboot = true; + + users.users = { + root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + }; +} diff --git a/hosts/forgejo-runner-1/default.nix b/hosts/forgejo-runner-1/default.nix deleted file mode 100644 index fb7d547f..00000000 --- a/hosts/forgejo-runner-1/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ nixpkgs, common-modules, ... }: -nixpkgs.lib.nixosSystem { - system = "aarch64-linux"; - modules = common-modules ++ [ - ./hardware.nix - ../../users/vinzenz.nix - ../../modules/podman.nix - ./forgejo-runner.nix - { networking.hostName = "forgejo-runner-1"; } - { - # uncomment for build check on non arm system (requires --impure) - # nixpkgs.buildPlatform = builtins.currentSystem; - } - { - services.tailscale.useRoutingFeatures = "both"; - system.autoUpgrade.allowReboot = true; - - users.users = { - root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - }; - } - ]; -} diff --git a/hosts/forgejo-runner-1/imports.nix b/hosts/forgejo-runner-1/imports.nix new file mode 100644 index 00000000..f63120ef --- /dev/null +++ b/hosts/forgejo-runner-1/imports.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ../../users/vinzenz.nix + ../../modules/podman.nix + ./forgejo-runner.nix + ]; +} diff --git a/hosts/hetzner-vpn2/configuration.nix b/hosts/hetzner-vpn2/configuration.nix new file mode 100644 index 00000000..c4b747d4 --- /dev/null +++ b/hosts/hetzner-vpn2/configuration.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: +{ + # uncomment for build check on non arm system (requires --impure) + # nixpkgs.buildPlatform = builtins.currentSystem; + + services.tailscale.useRoutingFeatures = "both"; + + users.users = { + root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + ]; + }; + + system.autoUpgrade.allowReboot = true; +} diff --git a/hosts/hetzner-vpn2/default.nix b/hosts/hetzner-vpn2/default.nix deleted file mode 100644 index 288cd462..00000000 --- a/hosts/hetzner-vpn2/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ nixpkgs, common-modules, ... }: -nixpkgs.lib.nixosSystem { - system = "aarch64-linux"; - modules = common-modules ++ [ - ./hardware.nix - ./nginx.nix - ../../users/vinzenz.nix - ../../users/ronja.nix - { networking.hostName = "hetzner-vpn2"; } - { - # uncomment for build check on non arm system (requires --impure) - # nixpkgs.buildPlatform = builtins.currentSystem; - } - { - services.tailscale.useRoutingFeatures = "both"; - } - { - users.users = { - root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - ]; - }; - } - { - system.autoUpgrade.allowReboot = true; - } - ]; -} diff --git a/hosts/hetzner-vpn2/imports.nix b/hosts/hetzner-vpn2/imports.nix new file mode 100644 index 00000000..b17a1c81 --- /dev/null +++ b/hosts/hetzner-vpn2/imports.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./nginx.nix + ../../users/vinzenz.nix + ../../users/ronja.nix + ]; +} diff --git a/hosts/ona-book/default.nix b/hosts/ona-book/default.nix deleted file mode 100644 index 22314947..00000000 --- a/hosts/ona-book/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - nixpkgs, - common-modules, - desktop-modules, - nixos-hardware, - home-manager, - ... -}: -nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = common-modules ++ [ - home-manager.nixosModules.home-manager - ../../home - ../../modules/desktop-environment.nix - - nixos-hardware.nixosModules.apple-macbook-pro-14-1 - { allowedUnfreePackages = [ "b43-firmware" ]; } - - ./hardware.nix - ../../home/gnome.nix - ../../users/ronja.nix - ../../modules/gnome.nix - - { - networking = { - hostName = "ona-book"; - networkmanager.enable = true; - }; - services.xserver.xkb = { - layout = "us"; - options = "eurosign:e,caps:escape"; - }; - } - - { - home-manager.users.ronja = import ../../home/ronja; - - users.users.ronja.openssh.authorizedKeys.keys = [ - ]; - } - - { - - } - ]; -} diff --git a/hosts/ona-book/hardware.nix b/hosts/ona-book/hardware.nix deleted file mode 100644 index bf4fdc49..00000000 --- a/hosts/ona-book/hardware.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: -{ - imports = [ - (modulesPath + "/hardware/network/broadcom-43xx.nix") - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - config = { - boot = { - initrd.availableKernelModules = [ - "xhci_pci" - "nvme" - "usb_storage" - "sd_mod" - ]; - initrd.kernelModules = [ ]; - kernelModules = [ - "kvm-intel" - "snd_hda_codec_cs8409" - "hci_uart" - "bluetooth" - "btbcm" - ]; - extraModulePackages = [ ]; - blacklistedKernelModules = [ ]; - kernelParams = []; - loader = { - efi.canTouchEfiVariables = true; - systemd-boot = { - enable = true; - editor = false; # do not allow changing kernel parameters - consoleMode = "max"; - }; - }; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/15220182-5617-4963-814e-19ff29b7db8c"; - fsType = "btrfs"; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/1C7D-07C1"; - fsType = "vfat"; - options = [ - "fmask=0077" - "dmask=0077" - ]; - }; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/e4c91c7e-8b62-48e4-923d-4d750ebbc7db"; } - ]; - - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - - hardware.enableAllFirmware = true; - nixpkgs.config.allowUnfree = true; - hardware.enableRedistributableFirmware = true; - - hardware.facetimehd.enable = true; - }; -} diff --git a/hosts/vinzenz-lpt2/configuration.nix b/hosts/vinzenz-lpt2/configuration.nix new file mode 100644 index 00000000..0e4a769b --- /dev/null +++ b/hosts/vinzenz-lpt2/configuration.nix @@ -0,0 +1,34 @@ +{ + pkgs, + ... +}: +{ + imports = [ ./nginx.nix ]; + networking.networkmanager.enable = true; + nix.settings.extra-platforms = [ + "aarch64-linux" + "i686-linux" + ]; + + services.xserver.xkb = { + # Configure keymap in X11 + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + home-manager.users.vinzenz = import ../../home/vinzenz; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ]; + + #users.users.ronja.openssh.authorizedKeys.keys = [ + # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + #]; + + programs.adb.enable = true; +} diff --git a/hosts/vinzenz-lpt2/default.nix b/hosts/vinzenz-lpt2/default.nix deleted file mode 100644 index c2944b1e..00000000 --- a/hosts/vinzenz-lpt2/default.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ - nixpkgs, - common-modules, - desktop-modules, - ... -}: -nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = - common-modules - ++ desktop-modules - ++ [ - ./hardware.nix - ./nginx.nix - - ../../home/gnome.nix - ../../users/vinzenz.nix - ../../modules/gnome.nix - ../../modules/gaming.nix - ../../modules/printing.nix - ../../modules/podman.nix - - { - networking = { - hostName = "vinzenz-lpt2"; - networkmanager.enable = true; - }; - nix.settings.extra-platforms = [ - "aarch64-linux" - "i686-linux" - ]; - - services.xserver.xkb = { - # Configure keymap in X11 - layout = "de"; - variant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; - } - - { - home-manager.users.vinzenz = import ../../home/vinzenz; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ]; - - #users.users.ronja.openssh.authorizedKeys.keys = [ - # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - #]; - } - - { - programs.adb.enable = true; - } - ]; -} diff --git a/hosts/vinzenz-lpt2/imports.nix b/hosts/vinzenz-lpt2/imports.nix new file mode 100644 index 00000000..7f184176 --- /dev/null +++ b/hosts/vinzenz-lpt2/imports.nix @@ -0,0 +1,15 @@ +{ + imports = [ + ../../home/gnome.nix + ../../users/vinzenz.nix + ../../modules/gnome.nix + ../../modules/gaming.nix + ../../modules/printing.nix + ../../modules/podman.nix + + ../../home + ../../modules/desktop-environment.nix + ../../modules/desktop-hardware.nix + + ]; +} diff --git a/hosts/vinzenz-pc2/configuration.nix b/hosts/vinzenz-pc2/configuration.nix new file mode 100644 index 00000000..a163141a --- /dev/null +++ b/hosts/vinzenz-pc2/configuration.nix @@ -0,0 +1,40 @@ +{ + pkgs, + ... +}: +{ + imports = [ + ./hardware.nix + ./vscode-server.nix + ]; + networking.networkmanager.enable = true; + nix.settings.extra-platforms = [ + "aarch64-linux" + "i686-linux" + ]; + + services.xserver.xkb = { + # Configure keymap in X11 + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + home-manager.users = { + vinzenz = import ../../home/vinzenz; + ronja = import ../../home/ronja; + }; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + + users.users.ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' + ]; +} diff --git a/hosts/vinzenz-pc2/default.nix b/hosts/vinzenz-pc2/default.nix deleted file mode 100644 index e0bbd9de..00000000 --- a/hosts/vinzenz-pc2/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - nixpkgs, - common-modules, - desktop-modules, - ... -}: -nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = - common-modules - ++ desktop-modules - ++ [ - ./hardware.nix - ./vscode-server.nix - ../../home/gnome.nix - ../../users/vinzenz.nix - ../../users/ronja.nix - ../../modules/gnome.nix - ../../modules/gaming.nix - ../../modules/printing.nix - ../../modules/podman.nix - { - networking = { - hostName = "vinzenz-pc2"; - networkmanager.enable = true; - }; - nix.settings.extra-platforms = [ - "aarch64-linux" - "i686-linux" - ]; - - services.xserver.xkb = { - # Configure keymap in X11 - layout = "de"; - variant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; - } - { - home-manager.users = { - vinzenz = import ../../home/vinzenz; - ronja = import ../../home/ronja; - }; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - - users.users.ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' - ]; - } - ]; -} diff --git a/hosts/vinzenz-pc2/imports.nix b/hosts/vinzenz-pc2/imports.nix new file mode 100644 index 00000000..ff296b93 --- /dev/null +++ b/hosts/vinzenz-pc2/imports.nix @@ -0,0 +1,15 @@ +{ + imports = [ + ../../home/gnome.nix + ../../users/vinzenz.nix + ../../users/ronja.nix + ../../modules/gnome.nix + ../../modules/gaming.nix + ../../modules/printing.nix + ../../modules/podman.nix + + ../../home + ../../modules/desktop-environment.nix + ../../modules/desktop-hardware.nix + ]; +} diff --git a/modules/gaming.nix b/modules/gaming.nix index 03499cc7..6cb625f9 100644 --- a/modules/gaming.nix +++ b/modules/gaming.nix @@ -75,6 +75,7 @@ "steam-original" "steam-run" "steam-unwrapped" + "ut1999" ]; }; } diff --git a/users/vinzenz.nix b/users/vinzenz.nix index b4e6aa0b..5a2d4224 100644 --- a/users/vinzenz.nix +++ b/users/vinzenz.nix @@ -14,6 +14,7 @@ "podman" "nginx" "adbusers" + "kvm" ]; shell = pkgs.zsh; autoSubUidGidRange = true; From f343ae11705e44d037cd654f6afcd427df74ef0a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Mar 2025 11:27:22 +0100 Subject: [PATCH 0234/1295] fix thefuck --- home/vinzenz/default.nix | 5 +++++ home/vinzenz/zsh.nix | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 5352918a..1ff08c46 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -26,6 +26,11 @@ inputs@{ pkgs, ... }: "--header" ]; }; + + thefuck = { + enable = true; + enableZshIntegration = true; + }; }; editorconfig = import ./editorconfig.nix; diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index 8290bf26..5ec9e83c 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -36,7 +36,6 @@ "dotnet" "rust" "tailscale" - "thefuck" ]; }; } From e75cd528d082d85d0dd94a140e23b508f3d42102 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Mar 2025 19:05:34 +0100 Subject: [PATCH 0235/1295] less import usage --- common/nixpkgs.nix | 2 +- home/ronja/default.nix | 88 +++++++++++----------- home/ronja/vscode.nix | 92 ++++++++++++----------- home/vinzenz/default.nix | 108 ++++++++++++++------------- home/vinzenz/editorconfig.nix | 29 +++---- home/vinzenz/git.nix | 41 +++++----- home/vinzenz/gnome.nix | 2 +- home/vinzenz/ssh.nix | 99 ++++++++++++------------ home/vinzenz/vscode.nix | 96 ++++++++++++------------ home/vinzenz/zsh.nix | 68 +++++++++-------- hosts/vinzenz-lpt2/configuration.nix | 56 +++++++------- hosts/vinzenz-lpt2/imports.nix | 1 + hosts/vinzenz-pc2/configuration.nix | 58 +++++++------- hosts/vinzenz-pc2/imports.nix | 2 + 14 files changed, 380 insertions(+), 362 deletions(-) diff --git a/common/nixpkgs.nix b/common/nixpkgs.nix index 42d7c033..03c9c0c2 100644 --- a/common/nixpkgs.nix +++ b/common/nixpkgs.nix @@ -42,7 +42,7 @@ autoUpgrade = { enable = true; dates = "daily"; - flake = "github:kaesaecracker/nixos-configuration"; + flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; }; }; diff --git a/home/ronja/default.nix b/home/ronja/default.nix index 35fa2d9f..b4bebd08 100644 --- a/home/ronja/default.nix +++ b/home/ronja/default.nix @@ -1,55 +1,57 @@ inputs@{ config, pkgs, ... }: { - home.packages = with pkgs; [ - ## Apps - telegram-desktop - kdiff3 - ]; + imports = [ ./vscode.nix ]; + config.home-manager.users.ronja = { + home.packages = with pkgs; [ + ## Apps + telegram-desktop + kdiff3 + ]; - programs = { - home-manager.enable = true; - vscode = import ./vscode.nix inputs; + programs = { + home-manager.enable = true; - zsh = { - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; + zsh = { + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = [ + "git" + "sudo" + "systemadmin" + ]; + }; }; - oh-my-zsh = { + git = { + userName = "Ronja Spiegelberg"; + userEmail = "ronja.spiegelberg@gmail.com"; + + extraConfig = { + pull.ff = "only"; + merge.tool = "kdiff3"; + }; + }; + + chromium = { enable = true; - theme = "agnoster"; - plugins = [ - "git" - "sudo" - "systemadmin" + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } ]; }; }; - - git = { - userName = "Ronja Spiegelberg"; - userEmail = "ronja.spiegelberg@gmail.com"; - - extraConfig = { - pull.ff = "only"; - merge.tool = "kdiff3"; - }; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; }; } diff --git a/home/ronja/vscode.nix b/home/ronja/vscode.nix index 29f5046e..79ab666d 100644 --- a/home/ronja/vscode.nix +++ b/home/ronja/vscode.nix @@ -1,56 +1,58 @@ { pkgs, ... }: { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - bbenoist.nix - ms-python.python - kamadorueda.alejandra - editorconfig.editorconfig - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - rust-lang.rust-analyzer - tamasfe.even-better-toml - llvm-vs-code-extensions.vscode-clangd - mkhl.direnv - vadimcn.vscode-lldb - ms-dotnettools.csharp - ms-vscode-remote.remote-ssh - ]; - userSettings = { - "files.autoSave" = "afterDelay"; - "files.autoSaveWhenNoErrors" = true; - "files.autoSaveWorkspaceFilesOnly" = true; + config.programs.vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + bbenoist.nix + ms-python.python + kamadorueda.alejandra + editorconfig.editorconfig + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + rust-lang.rust-analyzer + tamasfe.even-better-toml + llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + vadimcn.vscode-lldb + ms-dotnettools.csharp + ms-vscode-remote.remote-ssh + ]; + userSettings = { + "files.autoSave" = "afterDelay"; + "files.autoSaveWhenNoErrors" = true; + "files.autoSaveWorkspaceFilesOnly" = true; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; - "workbench.startupEditor" = "readme"; - "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; - "update.mode" = "none"; - "extensions.autoUpdate" = false; - "extensions.autoCheckUpdates" = false; + "update.mode" = "none"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; - "git.autofetch" = true; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "rust-analyzer.checkOnSave.command" = "clippy"; + "git.autofetch" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "rust-analyzer.checkOnSave.command" = "clippy"; - "\[makefile\]" = { - "editor.insertSpaces" = false; - "editor.detectIndentation" = false; + "\[makefile\]" = { + "editor.insertSpaces" = false; + "editor.detectIndentation" = false; + }; }; }; } diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 1ff08c46..1f2ff01d 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -1,60 +1,66 @@ -inputs@{ pkgs, ... }: +{ ... }: { - imports = [ ./gnome.nix ]; + config.home-manager.users.vinzenz = + { pkgs, ... }: + { + imports = [ + ./editorconfig.nix + ./git.nix + ./gnome.nix + ./ssh.nix + ./vscode.nix + ./zsh.nix + ]; - config = { - programs = { - home-manager.enable = true; - fzf.enable = true; - zsh = import ./zsh.nix inputs; - git = import ./git.nix; - vscode = import ./vscode.nix inputs; - ssh = import ./ssh.nix; - git-credential-oauth.enable = true; + config = { - direnv = { - enable = true; - nix-direnv.enable = true; - }; + programs = { + home-manager.enable = true; + fzf.enable = true; + git-credential-oauth.enable = true; - eza = { - enable = true; - git = true; - icons = "auto"; - extraOptions = [ - "--group-directories-first" - "--header" + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + eza = { + enable = true; + git = true; + icons = "auto"; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + }; + + thefuck = { + enable = true; + enableZshIntegration = true; + }; + }; + + home.packages = with pkgs; [ + keepassxc + insync + + telegram-desktop + element-desktop + + wireguard-tools + wirelesstools + + kdiff3 + jetbrains-toolbox + + blanket + vlc ]; - }; - thefuck = { - enable = true; - enableZshIntegration = true; + home.file."policy.json" = { + target = ".config/containers/policy.json"; + text = builtins.readFile ./.config/containers/policy.json; + }; }; }; - - editorconfig = import ./editorconfig.nix; - - home.packages = with pkgs; [ - keepassxc - insync - - telegram-desktop - element-desktop - - wireguard-tools - wirelesstools - - kdiff3 - jetbrains-toolbox - - blanket - vlc - ]; - - home.file."policy.json" = { - target = ".config/containers/policy.json"; - text = builtins.readFile ./.config/containers/policy.json; - }; - }; } diff --git a/home/vinzenz/editorconfig.nix b/home/vinzenz/editorconfig.nix index 8eb39876..496c7142 100644 --- a/home/vinzenz/editorconfig.nix +++ b/home/vinzenz/editorconfig.nix @@ -1,17 +1,20 @@ +{ ... }: { - enable = true; - settings = { - "*" = { - charset = "utf-8"; - end_of_line = "lf"; - trim_trailing_whitespace = true; - insert_final_newline = true; - max_line_width = 120; - indent_style = "space"; - indent_size = 4; - }; - "*.nix" = { - indent_size = 2; + config.editorconfig = { + enable = true; + settings = { + "*" = { + charset = "utf-8"; + end_of_line = "lf"; + trim_trailing_whitespace = true; + insert_final_newline = true; + max_line_width = 120; + indent_style = "space"; + indent_size = 4; + }; + "*.nix" = { + indent_size = 2; + }; }; }; } diff --git a/home/vinzenz/git.nix b/home/vinzenz/git.nix index 3aee6dab..ddaa8903 100644 --- a/home/vinzenz/git.nix +++ b/home/vinzenz/git.nix @@ -1,23 +1,26 @@ +{ ... }: { - enable = true; - userName = "Vinzenz Schroeter"; - userEmail = "vinzenz.f.s@gmail.com"; + config.programs.git = { + enable = true; + userName = "Vinzenz Schroeter"; + userEmail = "vinzenz.f.s@gmail.com"; - aliases = { - prettylog = "log --pretty=oneline --graph"; - spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; + aliases = { + prettylog = "log --pretty=oneline --graph"; + spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; + }; + + extraConfig = { + pull.ff = "only"; + merge.tool = "kdiff3"; + push.autoSetupRemote = "true"; + credential.credentialStore = "cache"; + }; + + ignores = [ + ".direnv" + ".idea" + ".envrc" + ]; }; - - extraConfig = { - pull.ff = "only"; - merge.tool = "kdiff3"; - push.autoSetupRemote = "true"; - credential.credentialStore = "cache"; - }; - - ignores = [ - ".direnv" - ".idea" - ".envrc" - ]; } diff --git a/home/vinzenz/gnome.nix b/home/vinzenz/gnome.nix index 4e706186..b0f6e3dc 100644 --- a/home/vinzenz/gnome.nix +++ b/home/vinzenz/gnome.nix @@ -1,4 +1,4 @@ -inputs@{ pkgs, ... }: +{ pkgs, ... }: { config = { home.packages = with pkgs.gnomeExtensions; [ diff --git a/home/vinzenz/ssh.nix b/home/vinzenz/ssh.nix index ae250997..260185fc 100644 --- a/home/vinzenz/ssh.nix +++ b/home/vinzenz/ssh.nix @@ -1,52 +1,55 @@ +{ ... }: { - enable = true; - matchBlocks = { - "vpn1" = { - host = "vpn1 hetzner-vpn1"; - hostname = "157.90.146.125"; # 2a01:4f8:c012:7137::/64 - user = "root"; - }; - "vpn2" = { - host = "vpn2 hetzner-vpn2"; - hostname = "2a01:4f8:c013:65dd::1"; - user = "root"; - }; - "vpn1-ts" = { - host = "vpn1-ts hetzner-vpn1.donkey-pentatonic.ts.net"; - hostname = "hetzner-vpn1.donkey-pentatonic.ts.net"; - user = "root"; - }; - "openwrt" = { - host = "openwrt openwrt.lan"; - hostname = "openwrt.lan"; - user = "root"; - }; - "openwrt-ts" = { - hostname = "openwrt.donkey-pentatonic.ts.net"; - port = 2222; - user = "root"; - }; - "openwrt-j" = { - hostname = "openwrt.donkey-pentatonic.ts.net"; - proxyJump = "vpn1"; - port = 2222; - user = "root"; - }; - "pc2-power" = { - hostname = "openwrt.donkey-pentatonic.ts.net"; - proxyJump = "vpn1"; - port = 2222; - user = "pc2-power"; - }; - "avd-power" = { - # hostname = "2001:678:560:23:9833:63ff:fe2d:f477" - # hostname = "195.160.172.25"; - hostname = "avd-jumphost.club.berlin.ccc.de"; - user = "power"; - }; - "avd" = { - hostname = "avd.club.berlin.ccc.de"; - user = "vinzenz"; + config.programs.ssh = { + enable = true; + matchBlocks = { + "vpn1" = { + host = "vpn1 hetzner-vpn1"; + hostname = "157.90.146.125"; # 2a01:4f8:c012:7137::/64 + user = "root"; + }; + "vpn2" = { + host = "vpn2 hetzner-vpn2"; + hostname = "2a01:4f8:c013:65dd::1"; + user = "root"; + }; + "vpn1-ts" = { + host = "vpn1-ts hetzner-vpn1.donkey-pentatonic.ts.net"; + hostname = "hetzner-vpn1.donkey-pentatonic.ts.net"; + user = "root"; + }; + "openwrt" = { + host = "openwrt openwrt.lan"; + hostname = "openwrt.lan"; + user = "root"; + }; + "openwrt-ts" = { + hostname = "openwrt.donkey-pentatonic.ts.net"; + port = 2222; + user = "root"; + }; + "openwrt-j" = { + hostname = "openwrt.donkey-pentatonic.ts.net"; + proxyJump = "vpn1"; + port = 2222; + user = "root"; + }; + "pc2-power" = { + hostname = "openwrt.donkey-pentatonic.ts.net"; + proxyJump = "vpn1"; + port = 2222; + user = "pc2-power"; + }; + "avd-power" = { + # hostname = "2001:678:560:23:9833:63ff:fe2d:f477" + # hostname = "195.160.172.25"; + hostname = "avd-jumphost.club.berlin.ccc.de"; + user = "power"; + }; + "avd" = { + hostname = "avd.club.berlin.ccc.de"; + user = "vinzenz"; + }; }; }; } diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index 0faf92ec..098fc4ae 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -1,58 +1,60 @@ { pkgs, lib, ... }: { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - bbenoist.nix - ms-python.python - kamadorueda.alejandra - editorconfig.editorconfig - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - rust-lang.rust-analyzer - tamasfe.even-better-toml - llvm-vs-code-extensions.vscode-clangd - mkhl.direnv - vadimcn.vscode-lldb - ms-dotnettools.csharp - ms-vscode-remote.remote-ssh - RoweWilsonFrederiskHolme.wikitext - ]; - userSettings = { - "files.autoSave" = "afterDelay"; - "files.autoSaveWhenNoErrors" = true; - "files.autoSaveWorkspaceFilesOnly" = true; + config.programs.vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + bbenoist.nix + ms-python.python + kamadorueda.alejandra + editorconfig.editorconfig + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + rust-lang.rust-analyzer + tamasfe.even-better-toml + llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + vadimcn.vscode-lldb + ms-dotnettools.csharp + ms-vscode-remote.remote-ssh + RoweWilsonFrederiskHolme.wikitext + ]; + userSettings = { + "files.autoSave" = "afterDelay"; + "files.autoSaveWhenNoErrors" = true; + "files.autoSaveWorkspaceFilesOnly" = true; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; - "workbench.startupEditor" = "readme"; - "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; - "update.mode" = "none"; - "extensions.autoUpdate" = false; - "extensions.autoCheckUpdates" = false; + "update.mode" = "none"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; - "git.autofetch" = true; - "git.path" = "${lib.getBin pkgs.git}/bin/git"; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "rust-analyzer.checkOnSave.command" = "clippy"; + "git.autofetch" = true; + "git.path" = "${lib.getBin pkgs.git}/bin/git"; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "rust-analyzer.checkOnSave.command" = "clippy"; - "\[makefile\]" = { - "editor.insertSpaces" = false; - "editor.detectIndentation" = false; + "\[makefile\]" = { + "editor.insertSpaces" = false; + "editor.detectIndentation" = false; + }; }; }; } diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index 5ec9e83c..0b5ed96c 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -1,41 +1,43 @@ { config, ... }: { - initExtra = '' - eval "$(direnv hook zsh)"; - export PATH=$PATH:/home/vinzenz/.cargo/bin - ''; + config.programs.zsh = { + initExtra = '' + eval "$(direnv hook zsh)"; + export PATH=$PATH:/home/vinzenz/.cargo/bin + ''; - enableCompletion = true; + enableCompletion = true; - shellAliases = { - my-apply = "sudo nixos-rebuild boot --flake"; - my-switch = "sudo nixos-rebuild switch --flake"; - my-update = "sudo nixos-rebuild boot --upgrade --flake"; - my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; - my-test = "sudo nixos-rebuild test"; - my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; - my-ip4 = "ip addr show | grep 192"; - deadnix = "nix run github:astro/deadnix -- "; - statix = "nix run git+https://git.peppe.rs/languages/statix -- "; - }; + shellAliases = { + my-apply = "sudo nixos-rebuild boot --flake"; + my-switch = "sudo nixos-rebuild switch --flake"; + my-update = "sudo nixos-rebuild boot --upgrade --flake"; + my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; + my-test = "sudo nixos-rebuild test"; + my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; + my-ip4 = "ip addr show | grep 192"; + deadnix = "nix run github:astro/deadnix -- "; + statix = "nix run git+https://git.peppe.rs/languages/statix -- "; + }; - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = [ - "git" - "sudo" - "systemadmin" - "battery" - "dotnet" - "rust" - "tailscale" - ]; + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = [ + "git" + "sudo" + "systemadmin" + "battery" + "dotnet" + "rust" + "tailscale" + ]; + }; }; } diff --git a/hosts/vinzenz-lpt2/configuration.nix b/hosts/vinzenz-lpt2/configuration.nix index 0e4a769b..7ad1351b 100644 --- a/hosts/vinzenz-lpt2/configuration.nix +++ b/hosts/vinzenz-lpt2/configuration.nix @@ -1,34 +1,32 @@ -{ - pkgs, - ... -}: +{ pkgs, ... }: { imports = [ ./nginx.nix ]; - networking.networkmanager.enable = true; - nix.settings.extra-platforms = [ - "aarch64-linux" - "i686-linux" - ]; - services.xserver.xkb = { - # Configure keymap in X11 - layout = "de"; - variant = ""; + config = { + networking.networkmanager.enable = true; + nix.settings.extra-platforms = [ + "aarch64-linux" + "i686-linux" + ]; + + services.xserver.xkb = { + # Configure keymap in X11 + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ]; + + #users.users.ronja.openssh.authorizedKeys.keys = [ + # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + #]; + + programs.adb.enable = true; }; - - # Configure console keymap - console.keyMap = "de"; - - home-manager.users.vinzenz = import ../../home/vinzenz; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ]; - - #users.users.ronja.openssh.authorizedKeys.keys = [ - # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - #]; - - programs.adb.enable = true; } diff --git a/hosts/vinzenz-lpt2/imports.nix b/hosts/vinzenz-lpt2/imports.nix index 7f184176..a37f1ffb 100644 --- a/hosts/vinzenz-lpt2/imports.nix +++ b/hosts/vinzenz-lpt2/imports.nix @@ -11,5 +11,6 @@ ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix + ../../home/vinzenz ]; } diff --git a/hosts/vinzenz-pc2/configuration.nix b/hosts/vinzenz-pc2/configuration.nix index a163141a..ea297352 100644 --- a/hosts/vinzenz-pc2/configuration.nix +++ b/hosts/vinzenz-pc2/configuration.nix @@ -1,40 +1,34 @@ -{ - pkgs, - ... -}: +{ pkgs, ... }: { imports = [ ./hardware.nix ./vscode-server.nix ]; - networking.networkmanager.enable = true; - nix.settings.extra-platforms = [ - "aarch64-linux" - "i686-linux" - ]; + config = { + networking.networkmanager.enable = true; + nix.settings.extra-platforms = [ + "aarch64-linux" + "i686-linux" + ]; - services.xserver.xkb = { - # Configure keymap in X11 - layout = "de"; - variant = ""; + services.xserver.xkb = { + # Configure keymap in X11 + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + + users.users.ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' + ]; }; - - # Configure console keymap - console.keyMap = "de"; - - home-manager.users = { - vinzenz = import ../../home/vinzenz; - ronja = import ../../home/ronja; - }; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - - users.users.ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' - ]; } diff --git a/hosts/vinzenz-pc2/imports.nix b/hosts/vinzenz-pc2/imports.nix index ff296b93..1834b06c 100644 --- a/hosts/vinzenz-pc2/imports.nix +++ b/hosts/vinzenz-pc2/imports.nix @@ -11,5 +11,7 @@ ../../home ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix + + ../../home/vinzenz ]; } From 8b79ccd4116b2fe380df31cfb2e2444bc1e0702c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 16 Mar 2025 10:25:59 +0100 Subject: [PATCH 0236/1295] add niri wm --- common/default.nix | 9 - flake.lock | 94 ++++++++ flake.nix | 41 +++- home/default.nix | 10 - home/gnome.nix | 44 ---- home/shared-modules.nix | 55 ----- home/vinzenz/configuration.nix | 50 ++++ home/vinzenz/default.nix | 76 +----- home/vinzenz/niri.nix | 290 +++++++++++++++++++++++ home/vinzenz/waybar.nix | 120 ++++++++++ hosts/vinzenz-lpt2/configuration.nix | 2 + hosts/vinzenz-lpt2/imports.nix | 7 +- hosts/vinzenz-pc2/configuration.nix | 5 + hosts/vinzenz-pc2/imports.nix | 8 +- {common => modules}/globalinstalls.nix | 0 {home => modules}/gnome-shared-dconf.nix | 0 modules/gnome.nix | 39 +++ modules/home-manager.nix | 61 +++++ {common => modules}/i18n.nix | 0 {common => modules}/networking.nix | 0 modules/niri.nix | 7 + {common => modules}/nixpkgs.nix | 2 + users/vinzenz.nix | 1 + 23 files changed, 719 insertions(+), 202 deletions(-) delete mode 100644 common/default.nix delete mode 100644 home/default.nix delete mode 100644 home/gnome.nix delete mode 100644 home/shared-modules.nix create mode 100644 home/vinzenz/configuration.nix create mode 100644 home/vinzenz/niri.nix create mode 100644 home/vinzenz/waybar.nix rename {common => modules}/globalinstalls.nix (100%) rename {home => modules}/gnome-shared-dconf.nix (100%) create mode 100644 modules/home-manager.nix rename {common => modules}/i18n.nix (100%) rename {common => modules}/networking.nix (100%) create mode 100644 modules/niri.nix rename {common => modules}/nixpkgs.nix (93%) diff --git a/common/default.nix b/common/default.nix deleted file mode 100644 index ddbf3bcc..00000000 --- a/common/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - imports = [ - ./nixpkgs.nix - ./globalinstalls.nix - ./i18n.nix - ./networking.nix - ]; -} diff --git a/flake.lock b/flake.lock index a11515ed..c4b18585 100644 --- a/flake.lock +++ b/flake.lock @@ -89,6 +89,66 @@ "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz" } }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixpkgs" + ], + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1742032096, + "narHash": "sha256-/vWpgh3DCdoREIoydTfUnZLYSxKa0yRczOJaT0dDT0o=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "e2614d598a86eb892e4d98d18458ee2633285c00", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1740117926, + "narHash": "sha256-mTTHA0RAaQcdYe+9A3Jx77cmmyLFHmRoZdd8RpWa+m8=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "b94a5db8790339cf9134873d8b490be69e02ac71", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.02", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1742026950, + "narHash": "sha256-pd00WzjmAxxS3Da0e4eEzfgauAfX5HwMGfs3nm2hwwA=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "9e560e7e607638da4f47b6dfef5a83b18711f75d", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1741325094, @@ -125,6 +185,7 @@ "inputs": { "home-manager": "home-manager", "lix-module": "lix-module", + "niri": "niri", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs" } @@ -143,6 +204,39 @@ "repo": "default", "type": "github" } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1739246919, + "narHash": "sha256-/hBM43/Gd0/tW+egrhlWgOIISeJxEs2uAOIYVpfDKeU=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "44590a416d4a3e8220e19e29e0b6efe64a80315d", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.5.1", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1741910413, + "narHash": "sha256-z9bvteu0rf+xmUDj4VifN06XAFJZQGRSOvdN7rn/oDs=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "0325cb1f48a292d873a6844772cca00251cbf945", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index da0baf62..9b21548a 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,12 @@ url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; }; + + niri = { + url = "github:sodiboo/niri-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.nixpkgs-stable.follows = "nixpkgs"; + }; }; outputs = @@ -21,6 +27,7 @@ home-manager, lix-module, nixos-hardware, + niri, }: let devices = { @@ -29,6 +36,10 @@ hetzner-vpn2 = "aarch64-linux"; forgejo-runner-1 = "aarch64-linux"; }; + homeDevices = [ + "vinzenz-lpt2" + "vinzenz-pc2" + ]; forDevice = f: nixpkgs.lib.mapAttrs f devices; in { @@ -36,18 +47,30 @@ device: system: nixpkgs.lib.nixosSystem { inherit system; - modules = [ - lix-module.nixosModules.default - home-manager.nixosModules.home-manager + modules = + [ + lix-module.nixosModules.default - { networking.hostName = device; } + { networking.hostName = device; } - ./common + ./modules/globalinstalls.nix + ./modules/networking.nix + ./modules/nixpkgs.nix - ./hosts/${device}/hardware.nix - ./hosts/${device}/imports.nix - ./hosts/${device}/configuration.nix - ]; + ./hosts/${device}/hardware.nix + ./hosts/${device}/imports.nix + ./hosts/${device}/configuration.nix + ] + ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ + home-manager.nixosModules.home-manager + { home-manager.extraSpecialArgs = { inherit device; }; } + ./modules/home-manager.nix + + ./modules/i18n.nix + + niri.nixosModules.niri + { nixpkgs.overlays = [ niri.overlays.niri ]; } + ]); } ); diff --git a/home/default.nix b/home/default.nix deleted file mode 100644 index d59fbbb8..00000000 --- a/home/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, ... }: -{ - config = { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - sharedModules = import ./shared-modules.nix; - }; - }; -} diff --git a/home/gnome.nix b/home/gnome.nix deleted file mode 100644 index 0310a7ea..00000000 --- a/home/gnome.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ config, pkgs, ... }: -{ - imports = [ ../modules/gnome.nix ]; - config = { - home-manager.sharedModules = [ - { - home.packages = - with pkgs; - [ - gitg - meld - simple-scan - pinta - dconf-editor - gpaste - - # graphical installer for flatpak apps - gnome-software - ] - ++ (with gnomeExtensions; [ - caffeine - appindicator - ]); - - dconf.settings = import ./gnome-shared-dconf.nix; - - gtk = { - enable = true; - iconTheme.name = "Adwaita"; - cursorTheme.name = "Adwaita"; - theme = { - name = "adw-gtk3-dark"; - package = pkgs.adw-gtk3; - }; - }; - } - - { - home.packages = with pkgs; [ trayscale ] ++ (with gnomeExtensions; [ tailscale-qs ]); - dconf.settings."org/gnome/shell".enabled-extensions = [ "tailscale@joaophi.github.com" ]; - } - ]; - }; -} diff --git a/home/shared-modules.nix b/home/shared-modules.nix deleted file mode 100644 index dbc3d590..00000000 --- a/home/shared-modules.nix +++ /dev/null @@ -1,55 +0,0 @@ -[ - # set stateVersion - { home.stateVersion = "22.11"; } - # make nano the default editor - { - home = { - sessionVariables.EDITOR = "nano"; - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - } - # command line niceness - { - programs = { - command-not-found.enable = true; - dircolors.enable = true; - - zsh = { - enable = true; - syntaxHighlighting.enable = true; - autosuggestion.enable = true; - enableVteIntegration = true; - }; - }; - } - # common git config - { - programs = { - git = { - enable = true; - extraConfig.init.defaultBranch = "main"; - }; - - gh = { - enable = true; - gitCredentialHelper.enable = true; - }; - }; - } - # Templates - { - home.file = { - "Templates/Empty file".text = ""; - "Templates/Empty bash script".text = '' - #!/usr/bin/env bash - # abort on error, undefined variables - set -eu - # print commands before execution - set -x - ''; - }; - } -] diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix new file mode 100644 index 00000000..19277807 --- /dev/null +++ b/home/vinzenz/configuration.nix @@ -0,0 +1,50 @@ +{ pkgs, ... }: +{ + programs = { + home-manager.enable = true; + fzf.enable = true; + git-credential-oauth.enable = true; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + eza = { + enable = true; + git = true; + icons = "auto"; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + }; + + thefuck = { + enable = true; + enableZshIntegration = true; + }; + }; + + home.packages = with pkgs; [ + keepassxc + insync + + telegram-desktop + element-desktop + + wireguard-tools + wirelesstools + + kdiff3 + jetbrains-toolbox + + blanket + vlc + ]; + + home.file."policy.json" = { + target = ".config/containers/policy.json"; + text = builtins.readFile ./.config/containers/policy.json; + }; +} diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 1f2ff01d..695270b1 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -1,66 +1,14 @@ -{ ... }: +{ pkgs, config, ... }: { - config.home-manager.users.vinzenz = - { pkgs, ... }: - { - imports = [ - ./editorconfig.nix - ./git.nix - ./gnome.nix - ./ssh.nix - ./vscode.nix - ./zsh.nix - ]; - - config = { - - programs = { - home-manager.enable = true; - fzf.enable = true; - git-credential-oauth.enable = true; - - direnv = { - enable = true; - nix-direnv.enable = true; - }; - - eza = { - enable = true; - git = true; - icons = "auto"; - extraOptions = [ - "--group-directories-first" - "--header" - ]; - }; - - thefuck = { - enable = true; - enableZshIntegration = true; - }; - }; - - home.packages = with pkgs; [ - keepassxc - insync - - telegram-desktop - element-desktop - - wireguard-tools - wirelesstools - - kdiff3 - jetbrains-toolbox - - blanket - vlc - ]; - - home.file."policy.json" = { - target = ".config/containers/policy.json"; - text = builtins.readFile ./.config/containers/policy.json; - }; - }; - }; + imports = [ + ./configuration.nix + ./editorconfig.nix + ./git.nix + ./gnome.nix + ./niri.nix + ./ssh.nix + ./vscode.nix + ./waybar.nix + ./zsh.nix + ]; } diff --git a/home/vinzenz/niri.nix b/home/vinzenz/niri.nix new file mode 100644 index 00000000..378e3105 --- /dev/null +++ b/home/vinzenz/niri.nix @@ -0,0 +1,290 @@ +{ pkgs, ... }: +{ + config = { + home.sessionVariables.NIXOS_OZONE_WL = "1"; + + home.packages = with pkgs; [ + xwayland-satellite + alacritty + fuzzel + swaylock + ]; + + programs.niri.settings = { + input.keyboard.xkb.layout = "de"; + + outputs."eDP-1" = { + scale = 1.0; + variable-refresh-rate = true; + background-color = "#000000"; + }; + + layout.gaps = 8; + + # defaults taken from https://github.com/sodiboo/niri-flake/issues/483 + binds = { + # Keys consist of modifiers separated by + signs, followed by an XKB key name + # in the end. To find an XKB name for a particular key, you may use a program + # like wev. + # + # "Mod" is a special modifier equal to Super when running on a TTY, and to Alt + # when running as a winit window. + # + # Most actions that you can bind here can also be invoked programmatically with + # `niri msg action do-something`. + + # Mod-Shift-/, which is usually the same as Mod-?, + # shows a list of important hotkeys. + "Mod+Shift+Slash".action.show-hotkey-overlay = { }; + + # Suggested binds for running programs: terminal, app launcher, screen locker. + "Mod+T".action.spawn = "alacritty"; + "Mod+D".action.spawn = "fuzzel"; + "Super+Alt+L".action.spawn = "swaylock"; + + # You can also use a shell. Do this if you need pipes, multiple commands, etc. + # Note: the entire command goes as a single argument in the end. + # Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } + + # Example volume keys mappings for PipeWire & WirePlumber. + # The allow-when-locked=true property makes them work even when the session is locked. + "XF86AudioRaiseVolume" = { + allow-when-locked = true; + action.spawn = [ + "wpctl" + "set-volume" + "@DEFAULT_AUDIO_SINK@" + "0.1+" + ]; + }; + "XF86AudioLowerVolume" = { + allow-when-locked = true; + action.spawn = [ + "wpctl" + "set-volume" + "@DEFAULT_AUDIO_SINK@" + "0.1-" + ]; + }; + "XF86AudioMute" = { + allow-when-locked = true; + action.spawn = [ + "wpctl" + "set-mute" + "@DEFAULT_AUDIO_SINK@" + "toggle" + ]; + }; + "XF86AudioMicMute" = { + allow-when-locked = true; + action.spawn = [ + "wpctl" + "set-mute" + "@DEFAULT_AUDIO_SOURCE@" + "toggle" + ]; + }; + + "Mod+Q".action.close-window = { }; + + "Mod+Left".action.focus-column-left = { }; + "Mod+Down".action.focus-window-down = { }; + "Mod+Up".action.focus-window-up = { }; + "Mod+Right".action.focus-column-right = { }; + "Mod+H".action.focus-column-left = { }; + "Mod+J".action.focus-window-down = { }; + "Mod+K".action.focus-window-up = { }; + "Mod+L".action.focus-column-right = { }; + + "Mod+Ctrl+Left".action.move-column-left = { }; + "Mod+Ctrl+Down".action.move-window-down = { }; + "Mod+Ctrl+Up".action.move-window-up = { }; + "Mod+Ctrl+Right".action.move-column-right = { }; + "Mod+Ctrl+H".action.move-column-left = { }; + "Mod+Ctrl+J".action.move-window-down = { }; + "Mod+Ctrl+K".action.move-window-up = { }; + "Mod+Ctrl+L".action.move-column-right = { }; + + # Alternative commands that move across workspaces when reaching + # the first or last window in a column. + # Mod+J { focus-window-or-workspace-down; } + # Mod+K { focus-window-or-workspace-up; } + # Mod+Ctrl+J { move-window-down-or-to-workspace-down; } + # Mod+Ctrl+K { move-window-up-or-to-workspace-up; } + + "Mod+Home".action.focus-column-first = { }; + "Mod+End".action.focus-column-last = { }; + "Mod+Ctrl+Home".action.move-column-to-first = { }; + "Mod+Ctrl+End".action.move-column-to-last = { }; + + "Mod+Shift+Left".action.focus-monitor-left = { }; + "Mod+Shift+Down".action.focus-monitor-down = { }; + "Mod+Shift+Up".action.focus-monitor-up = { }; + "Mod+Shift+Right".action.focus-monitor-right = { }; + "Mod+Shift+H".action.focus-monitor-left = { }; + "Mod+Shift+J".action.focus-monitor-down = { }; + "Mod+Shift+K".action.focus-monitor-up = { }; + "Mod+Shift+L".action.focus-monitor-right = { }; + + "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = { }; + "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = { }; + "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = { }; + "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = { }; + "Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = { }; + "Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = { }; + "Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = { }; + "Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = { }; + + # Alternatively, there are commands to move just a single window: + # Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } + # ... + + # And you can also move a whole workspace to another monitor: + # Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; } + # ... + + "Mod+Page_Down".action.focus-workspace-down = { }; + "Mod+Page_Up".action.focus-workspace-up = { }; + "Mod+U".action.focus-workspace-down = { }; + "Mod+I".action.focus-workspace-up = { }; + "Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = { }; + "Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = { }; + "Mod+Ctrl+U".action.move-column-to-workspace-down = { }; + "Mod+Ctrl+I".action.move-column-to-workspace-up = { }; + + # Alternatively, there are commands to move just a single window: + # Mod+Ctrl+Page_Down { move-window-to-workspace-down; } + # ... + + "Mod+Shift+Page_Down".action.move-workspace-down = { }; + "Mod+Shift+Page_Up".action.move-workspace-up = { }; + "Mod+Shift+U".action.move-workspace-down = { }; + "Mod+Shift+I".action.move-workspace-up = { }; + + # You can bind mouse wheel scroll ticks using the following syntax. + # These binds will change direction based on the natural-scroll setting. + # + # To avoid scrolling through workspaces really fast, you can use + # the cooldown-ms property. The bind will be rate-limited to this value. + # You can set a cooldown on any bind, but it's most useful for the wheel. + "Mod+WheelScrollDown" = { + cooldown-ms = 150; + action.focus-workspace-down = { }; + }; + "Mod+WheelScrollUp" = { + cooldown-ms = 150; + action.focus-workspace-up = { }; + }; + "Mod+Ctrl+WheelScrollDown" = { + cooldown-ms = 150; + action.move-column-to-workspace-down = { }; + }; + "Mod+Ctrl+WheelScrollUp" = { + cooldown-ms = 150; + action.move-column-to-workspace-up = { }; + }; + + "Mod+WheelScrollRight".action.focus-column-right = { }; + "Mod+WheelScrollLeft".action.focus-column-left = { }; + "Mod+Ctrl+WheelScrollRight".action.move-column-right = { }; + "Mod+Ctrl+WheelScrollLeft".action.move-column-left = { }; + + # Usually scrolling up and down with Shift in applications results in + # horizontal scrolling; these binds replicate that. + "Mod+Shift+WheelScrollDown".action.focus-column-right = { }; + "Mod+Shift+WheelScrollUp".action.focus-column-left = { }; + "Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = { }; + "Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = { }; + + # Similarly, you can bind touchpad scroll "ticks". + # Touchpad scrolling is continuous, so for these binds it is split into + # discrete intervals. + # These binds are also affected by touchpad's natural-scroll, so these + # example binds are "inverted", since we have natural-scroll enabled for + # touchpads by default. + # Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } + # Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } + + # You can refer to workspaces by index. However, keep in mind that + # niri is a dynamic workspace system, so these commands are kind of + # "best effort". Trying to refer to a workspace index bigger than + # the current workspace count will instead refer to the bottommost + # (empty) workspace. + # + # For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on + # will all refer to the 3rd workspace. + "Mod+1".action.focus-workspace = 1; + "Mod+2".action.focus-workspace = 2; + "Mod+3".action.focus-workspace = 3; + "Mod+4".action.focus-workspace = 4; + "Mod+5".action.focus-workspace = 5; + "Mod+6".action.focus-workspace = 6; + "Mod+7".action.focus-workspace = 7; + "Mod+8".action.focus-workspace = 8; + "Mod+9".action.focus-workspace = 9; + "Mod+Ctrl+1".action.move-column-to-workspace = 1; + "Mod+Ctrl+2".action.move-column-to-workspace = 2; + "Mod+Ctrl+3".action.move-column-to-workspace = 3; + "Mod+Ctrl+4".action.move-column-to-workspace = 4; + "Mod+Ctrl+5".action.move-column-to-workspace = 5; + "Mod+Ctrl+6".action.move-column-to-workspace = 6; + "Mod+Ctrl+7".action.move-column-to-workspace = 7; + "Mod+Ctrl+8".action.move-column-to-workspace = 8; + "Mod+Ctrl+9".action.move-column-to-workspace = 9; + + # Alternatively, there are commands to move just a single window: + # Mod+Ctrl+1 { move-window-to-workspace 1; } + + # Switches focus between the current and the previous workspace. + # Mod+Tab { focus-workspace-previous; } + + "Mod+Comma".action.consume-window-into-column = { }; + "Mod+Period".action.expel-window-from-column = { }; + + # There are also commands that consume or expel a single window to the side. + # Mod+BracketLeft { consume-or-expel-window-left; } + # Mod+BracketRight { consume-or-expel-window-right; } + + "Mod+R".action.switch-preset-column-width = { }; + "Mod+Shift+R".action.reset-window-height = { }; + "Mod+F".action.maximize-column = { }; + "Mod+Shift+F".action.fullscreen-window = { }; + "Mod+C".action.center-column = { }; + + # Finer width adjustments. + # This command can also: + # * set width in pixels: "1000" + # * adjust width in pixels: "-5" or "+5" + # * set width as a percentage of screen width: "25%" + # * adjust width as a percentage of screen width: "-10%" or "+10%" + # Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0, + # set-column-width "100" will make the column occupy 200 physical screen pixels. + "Mod+Minus".action.set-column-width = "-10%"; + "Mod+Equal".action.set-column-width = "+10%"; + + # Finer height adjustments when in column with other windows. + "Mod+Shift+Minus".action.set-window-height = "-10%"; + "Mod+Shift+Equal".action.set-window-height = "+10%"; + + # Actions to switch layouts. + # Note: if you uncomment these, make sure you do NOT have + # a matching layout switch hotkey configured in xkb options above. + # Having both at once on the same hotkey will break the switching, + # since it will switch twice upon pressing the hotkey (once by xkb, once by niri). + # Mod+Space { switch-layout "next"; } + # Mod+Shift+Space { switch-layout "prev"; } + + "Print".action.screenshot = { }; + "Ctrl+Print".action.screenshot-screen = { }; + "Alt+Print".action.screenshot-window = { }; + + # The quit action will show a confirmation dialog to avoid accidental exits. + "Mod+Shift+E".action.quit = { }; + + # Powers off the monitors. To turn them back on, do any input like + # moving the mouse or pressing any other key. + "Mod+Shift+P".action.power-off-monitors = { }; + }; + }; + }; +} diff --git a/home/vinzenz/waybar.nix b/home/vinzenz/waybar.nix new file mode 100644 index 00000000..ae245a14 --- /dev/null +++ b/home/vinzenz/waybar.nix @@ -0,0 +1,120 @@ +{ pkgs, device, ... }: +{ + config.programs.waybar = { + enable = true; + settings = { + mainBar = { + layer = "top"; + position = "top"; + output = [ + "eDP-1" + "HDMI-A-1" + ]; + mode = "dock"; + spacing = "8"; + modules-left = [ + "niri/workspaces" + "niri/window" + ]; + modules-center = [ + "clock" + ]; + modules-right = [ + "tray" + "mpd" + + "temperature" + "cpu" + + "disk" + "backlight" + "pulseaudio" + "bluetooth" + "memory" + "network" + "battery" + ]; + "niri/workspaces" = { + format = "{icon}"; + }; + + "niri/window" = { + separate-outputs = true; + icon = true; + }; + network = { + interface = "wlo1"; + format = "{ifname}"; + format-wifi = " "; + format-ethernet = "󰈀 "; + format-linked = "󱘖 "; + format-disconnected = "󰣽 "; + tooltip-format = "{ifname} via {gwaddr}"; + tooltip-format-wifi = "{essid} ({signalStrength}%)"; + tooltip-format-ethernet = "{ifname} {ipaddr}/{cidr}"; + tooltip-format-disconnected = "Disconnected"; + max-length = 50; + }; + clock = { + format = "{:%a, %d. %b %H:%M}"; + tooltip-format = "{calendar}"; + calendar = { + mode = "month"; + weeks-pos = "right"; + on-scroll = 1; + on-click-right = "mode"; + format = { + #months = "{}"; + #days = "{}"; + #weeks = "W{}"; + #weekdays = "{}"; + #weekdays = "{}"; + today = "{}"; + }; + }; + actions = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_down"; + on-scroll-down = "shift_up"; + }; + }; + battery = { + format = "{capacity}% {icon}"; + format-icons = [ + "" + "" + "" + "" + "" + ]; + }; + backlight = { + device = "intel_backlight"; + format = "{percent}% "; + }; + cpu = { + "interval" = 1; + "format" = + "{usage}%@{avg_frequency} " + + (builtins.getAttr device { + "vinzenz-lpt2" = + "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}{icon16}{icon17}{icon18}{icon19}"; + }) + + " "; + "format-icons" = [ + "" + "" + "" + "" + "" + "" + "" + "" + ]; + }; + }; + }; + }; +} diff --git a/hosts/vinzenz-lpt2/configuration.nix b/hosts/vinzenz-lpt2/configuration.nix index 7ad1351b..d880b421 100644 --- a/hosts/vinzenz-lpt2/configuration.nix +++ b/hosts/vinzenz-lpt2/configuration.nix @@ -18,6 +18,8 @@ # Configure console keymap console.keyMap = "de"; + home-manager.users.vinzenz = import ../../home/vinzenz; + users.users.vinzenz.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' diff --git a/hosts/vinzenz-lpt2/imports.nix b/hosts/vinzenz-lpt2/imports.nix index a37f1ffb..2526b3f4 100644 --- a/hosts/vinzenz-lpt2/imports.nix +++ b/hosts/vinzenz-lpt2/imports.nix @@ -1,16 +1,13 @@ { imports = [ - ../../home/gnome.nix ../../users/vinzenz.nix + ../../modules/gnome.nix ../../modules/gaming.nix ../../modules/printing.nix ../../modules/podman.nix - - ../../home + ../../modules/niri.nix ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix - - ../../home/vinzenz ]; } diff --git a/hosts/vinzenz-pc2/configuration.nix b/hosts/vinzenz-pc2/configuration.nix index ea297352..aa010957 100644 --- a/hosts/vinzenz-pc2/configuration.nix +++ b/hosts/vinzenz-pc2/configuration.nix @@ -20,6 +20,11 @@ # Configure console keymap console.keyMap = "de"; + home-manager.users = { + vinzenz = import ../../home/vinzenz; + ronja = import ../../home/ronja; + }; + users.users.vinzenz.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' diff --git a/hosts/vinzenz-pc2/imports.nix b/hosts/vinzenz-pc2/imports.nix index 1834b06c..2526b3f4 100644 --- a/hosts/vinzenz-pc2/imports.nix +++ b/hosts/vinzenz-pc2/imports.nix @@ -1,17 +1,13 @@ { imports = [ - ../../home/gnome.nix ../../users/vinzenz.nix - ../../users/ronja.nix + ../../modules/gnome.nix ../../modules/gaming.nix ../../modules/printing.nix ../../modules/podman.nix - - ../../home + ../../modules/niri.nix ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix - - ../../home/vinzenz ]; } diff --git a/common/globalinstalls.nix b/modules/globalinstalls.nix similarity index 100% rename from common/globalinstalls.nix rename to modules/globalinstalls.nix diff --git a/home/gnome-shared-dconf.nix b/modules/gnome-shared-dconf.nix similarity index 100% rename from home/gnome-shared-dconf.nix rename to modules/gnome-shared-dconf.nix diff --git a/modules/gnome.nix b/modules/gnome.nix index 4b0d1ff0..c510a9da 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -64,5 +64,44 @@ # RDP connections networking.firewall.allowedTCPPorts = [ 3389 ]; + + home-manager.sharedModules = [ + { + home.packages = + with pkgs; + [ + gitg + meld + simple-scan + pinta + dconf-editor + gpaste + + # graphical installer for flatpak apps + gnome-software + ] + ++ (with gnomeExtensions; [ + caffeine + appindicator + ]); + + dconf.settings = import ./gnome-shared-dconf.nix; + + gtk = { + enable = true; + iconTheme.name = "Adwaita"; + cursorTheme.name = "Adwaita"; + theme = { + name = "adw-gtk3-dark"; + package = pkgs.adw-gtk3; + }; + }; + } + + { + home.packages = with pkgs; [ trayscale ] ++ (with gnomeExtensions; [ tailscale-qs ]); + dconf.settings."org/gnome/shell".enabled-extensions = [ "tailscale@joaophi.github.com" ]; + } + ]; }; } diff --git a/modules/home-manager.nix b/modules/home-manager.nix new file mode 100644 index 00000000..9af6a19a --- /dev/null +++ b/modules/home-manager.nix @@ -0,0 +1,61 @@ +_: { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + sharedModules = [ + # set stateVersion + { home.stateVersion = "22.11"; } + # make nano the default editor + { + home = { + sessionVariables.EDITOR = "nano"; + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + } + # command line niceness + { + programs = { + command-not-found.enable = true; + dircolors.enable = true; + + zsh = { + enable = true; + syntaxHighlighting.enable = true; + autosuggestion.enable = true; + enableVteIntegration = true; + }; + }; + } + # common git config + { + programs = { + git = { + enable = true; + extraConfig.init.defaultBranch = "main"; + }; + + gh = { + enable = true; + gitCredentialHelper.enable = true; + }; + }; + } + # Templates + { + home.file = { + "Templates/Empty file".text = ""; + "Templates/Empty bash script".text = '' + #!/usr/bin/env bash + # abort on error, undefined variables + set -eu + # print commands before execution + set -x + ''; + }; + } + ]; + }; +} diff --git a/common/i18n.nix b/modules/i18n.nix similarity index 100% rename from common/i18n.nix rename to modules/i18n.nix diff --git a/common/networking.nix b/modules/networking.nix similarity index 100% rename from common/networking.nix rename to modules/networking.nix diff --git a/modules/niri.nix b/modules/niri.nix new file mode 100644 index 00000000..42af7344 --- /dev/null +++ b/modules/niri.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + programs.niri = { + enable = true; + package = pkgs.niri-stable; + }; +} diff --git a/common/nixpkgs.nix b/modules/nixpkgs.nix similarity index 93% rename from common/nixpkgs.nix rename to modules/nixpkgs.nix index 03c9c0c2..aba35048 100644 --- a/common/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -17,11 +17,13 @@ "https://cache.nixos.org/" "https://nix-community.cachix.org" "https://cache.lix.systems" + "https://niri.cachix.org" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" + "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" ]; experimental-features = [ "nix-command" diff --git a/users/vinzenz.nix b/users/vinzenz.nix index 5a2d4224..aeb49260 100644 --- a/users/vinzenz.nix +++ b/users/vinzenz.nix @@ -15,6 +15,7 @@ "nginx" "adbusers" "kvm" + "input" ]; shell = pkgs.zsh; autoSubUidGidRange = true; From 64baa2e7733e4b94078dc13082a39275d3e1d21a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 16 Mar 2025 10:43:14 +0100 Subject: [PATCH 0237/1295] merge users with home --- home/ronja/configuration.nix | 56 +++++++++++++++++++++ home/ronja/default.nix | 75 +++++++++------------------- home/vinzenz/default.nix | 58 ++++++++++++++++----- home/vinzenz/waybar.nix | 2 +- hosts/vinzenz-lpt2/configuration.nix | 2 - hosts/vinzenz-lpt2/imports.nix | 5 +- hosts/vinzenz-pc2/imports.nix | 4 +- users/ronja.nix | 23 --------- users/vinzenz.nix | 36 ------------- 9 files changed, 131 insertions(+), 130 deletions(-) create mode 100644 home/ronja/configuration.nix delete mode 100644 users/ronja.nix delete mode 100644 users/vinzenz.nix diff --git a/home/ronja/configuration.nix b/home/ronja/configuration.nix new file mode 100644 index 00000000..85f4772b --- /dev/null +++ b/home/ronja/configuration.nix @@ -0,0 +1,56 @@ +{ config, pkgs, ... }: +{ + config = { + home.packages = with pkgs; [ + ## Apps + telegram-desktop + kdiff3 + ]; + + programs = { + home-manager.enable = true; + + zsh = { + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = [ + "git" + "sudo" + "systemadmin" + ]; + }; + }; + + git = { + userName = "Ronja Spiegelberg"; + userEmail = "ronja.spiegelberg@gmail.com"; + + extraConfig = { + pull.ff = "only"; + merge.tool = "kdiff3"; + }; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + }; + }; +} diff --git a/home/ronja/default.nix b/home/ronja/default.nix index b4bebd08..46aa8489 100644 --- a/home/ronja/default.nix +++ b/home/ronja/default.nix @@ -1,57 +1,28 @@ -inputs@{ config, pkgs, ... }: +{ pkgs, ... }: { - imports = [ ./vscode.nix ]; - config.home-manager.users.ronja = { - home.packages = with pkgs; [ - ## Apps - telegram-desktop - kdiff3 + config = { + # Define user account + users.users.ronja = { + isNormalUser = true; + name = "ronja"; + description = "Ronja"; + home = "/home/ronja"; + extraGroups = [ + "networkmanager" + "wheel" + "games" + "podman" + ]; + shell = pkgs.zsh; + }; + + home-manager.users.ronja.imports = [ + ./configuration.nix + ./vscode.nix ]; - programs = { - home-manager.enable = true; - - zsh = { - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = [ - "git" - "sudo" - "systemadmin" - ]; - }; - }; - - git = { - userName = "Ronja Spiegelberg"; - userEmail = "ronja.spiegelberg@gmail.com"; - - extraConfig = { - pull.ff = "only"; - merge.tool = "kdiff3"; - }; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - }; + allowedUnfreePackages = [ + "vscode-extension-ms-vscode-remote-remote-ssh" + ]; }; } diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 695270b1..5d68bfc4 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -1,14 +1,48 @@ -{ pkgs, config, ... }: +{ pkgs, ... }: { - imports = [ - ./configuration.nix - ./editorconfig.nix - ./git.nix - ./gnome.nix - ./niri.nix - ./ssh.nix - ./vscode.nix - ./waybar.nix - ./zsh.nix - ]; + config = { + users.users.vinzenz = { + isNormalUser = true; + name = "vinzenz"; + description = "Vinzenz"; + home = "/home/vinzenz"; + extraGroups = [ + "networkmanager" + "wheel" + "games" + "dialout" + "podman" + "nginx" + "adbusers" + "kvm" + "input" + ]; + shell = pkgs.zsh; + autoSubUidGidRange = true; + }; + + home-manager.users.vinzenz.imports = [ + ./configuration.nix + ./editorconfig.nix + ./git.nix + ./gnome.nix + ./niri.nix + ./ssh.nix + ./vscode.nix + ./waybar.nix + ./zsh.nix + ]; + + allowedUnfreePackages = [ + "vscode-extension-ms-vscode-remote-remote-ssh" + "insync" + "insync-pkg" + + "rider" + "pycharm-professional" + "jetbrains-toolbox" + + "anydesk" + ]; + }; } diff --git a/home/vinzenz/waybar.nix b/home/vinzenz/waybar.nix index ae245a14..413036d6 100644 --- a/home/vinzenz/waybar.nix +++ b/home/vinzenz/waybar.nix @@ -97,7 +97,7 @@ cpu = { "interval" = 1; "format" = - "{usage}%@{avg_frequency} " + "{usage:3}%@{avg_frequency:4} " + (builtins.getAttr device { "vinzenz-lpt2" = "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}{icon16}{icon17}{icon18}{icon19}"; diff --git a/hosts/vinzenz-lpt2/configuration.nix b/hosts/vinzenz-lpt2/configuration.nix index d880b421..7ad1351b 100644 --- a/hosts/vinzenz-lpt2/configuration.nix +++ b/hosts/vinzenz-lpt2/configuration.nix @@ -18,8 +18,6 @@ # Configure console keymap console.keyMap = "de"; - home-manager.users.vinzenz = import ../../home/vinzenz; - users.users.vinzenz.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' diff --git a/hosts/vinzenz-lpt2/imports.nix b/hosts/vinzenz-lpt2/imports.nix index 2526b3f4..7e9f61af 100644 --- a/hosts/vinzenz-lpt2/imports.nix +++ b/hosts/vinzenz-lpt2/imports.nix @@ -1,7 +1,5 @@ { imports = [ - ../../users/vinzenz.nix - ../../modules/gnome.nix ../../modules/gaming.nix ../../modules/printing.nix @@ -9,5 +7,8 @@ ../../modules/niri.nix ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix + + ../../home/vinzenz + ../../home/ronja ]; } diff --git a/hosts/vinzenz-pc2/imports.nix b/hosts/vinzenz-pc2/imports.nix index 2526b3f4..cf430db6 100644 --- a/hosts/vinzenz-pc2/imports.nix +++ b/hosts/vinzenz-pc2/imports.nix @@ -1,7 +1,5 @@ { imports = [ - ../../users/vinzenz.nix - ../../modules/gnome.nix ../../modules/gaming.nix ../../modules/printing.nix @@ -9,5 +7,7 @@ ../../modules/niri.nix ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix + + ../../home/vinzenz ]; } diff --git a/users/ronja.nix b/users/ronja.nix deleted file mode 100644 index 3ed2b8a9..00000000 --- a/users/ronja.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ pkgs, ... }: -{ - config = { - # Define user account - users.users.ronja = { - isNormalUser = true; - name = "ronja"; - description = "Ronja"; - home = "/home/ronja"; - extraGroups = [ - "networkmanager" - "wheel" - "games" - "podman" - ]; - shell = pkgs.zsh; - }; - - allowedUnfreePackages = [ - "vscode-extension-ms-vscode-remote-remote-ssh" - ]; - }; -} diff --git a/users/vinzenz.nix b/users/vinzenz.nix deleted file mode 100644 index aeb49260..00000000 --- a/users/vinzenz.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs, ... }: -{ - config = { - users.users.vinzenz = { - isNormalUser = true; - name = "vinzenz"; - description = "Vinzenz"; - home = "/home/vinzenz"; - extraGroups = [ - "networkmanager" - "wheel" - "games" - "dialout" - "podman" - "nginx" - "adbusers" - "kvm" - "input" - ]; - shell = pkgs.zsh; - autoSubUidGidRange = true; - }; - - allowedUnfreePackages = [ - "vscode-extension-ms-vscode-remote-remote-ssh" - "insync" - "insync-pkg" - - "rider" - "pycharm-professional" - "jetbrains-toolbox" - - "anydesk" - ]; - }; -} From ed9df2da836c42c424083ae33ef00068d038512e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 17 Mar 2025 18:09:24 +0100 Subject: [PATCH 0238/1295] misc niri/waybar tweaks --- home/vinzenz/niri.nix | 17 +++++ home/vinzenz/waybar.nix | 164 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 170 insertions(+), 11 deletions(-) diff --git a/home/vinzenz/niri.nix b/home/vinzenz/niri.nix index 378e3105..b801c6bd 100644 --- a/home/vinzenz/niri.nix +++ b/home/vinzenz/niri.nix @@ -10,6 +10,23 @@ swaylock ]; + qt.style = { + package = pkgs.adwaita-qt; + name = "adwaita-dark"; + }; + + services = { + kdeconnect = { + enable = true; + indicator = true; + }; + mako = { + enable = true; + }; + }; + + # services.swayidle.enable = true; + programs.niri.settings = { input.keyboard.xkb.layout = "de"; diff --git a/home/vinzenz/waybar.nix b/home/vinzenz/waybar.nix index 413036d6..145e15a5 100644 --- a/home/vinzenz/waybar.nix +++ b/home/vinzenz/waybar.nix @@ -1,6 +1,13 @@ { pkgs, device, ... }: { - config.programs.waybar = { + home.packages = with pkgs; [ + waybar + playerctl + ]; + + programs.cava.enable = true; + + programs.waybar = { enable = true; settings = { mainBar = { @@ -14,25 +21,31 @@ spacing = "8"; modules-left = [ "niri/workspaces" + "tray" "niri/window" ]; modules-center = [ + "privacy" "clock" ]; modules-right = [ - "tray" - "mpd" + "mpris" + "image" + "cava" + "gamemode" "temperature" "cpu" - - "disk" - "backlight" - "pulseaudio" - "bluetooth" "memory" + "disk" + "wireplumber" + "bluetooth" + "backlight" "network" + "power-profiles-daemon" "battery" + "idle_inhibitor" + #"group/group-power" ]; "niri/workspaces" = { format = "{icon}"; @@ -95,15 +108,15 @@ format = "{percent}% "; }; cpu = { - "interval" = 1; - "format" = + interval = 1; + format = "{usage:3}%@{avg_frequency:4} " + (builtins.getAttr device { "vinzenz-lpt2" = "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}{icon16}{icon17}{icon18}{icon19}"; }) + " "; - "format-icons" = [ + format-icons = [ "" "" "" @@ -114,6 +127,135 @@ "" ]; }; + cava = { + framerate = 15; + autosens = 1; + method = "pipewire"; + sleep_timer = 3; + source = "auto"; + bar_delimiter = 0; + bars = 12; + input_delay = 2; + hide_on_silence = true; + format-icons = [ + "" + "" + "" + "" + "" + "" + "" + "" + ]; + actions = { + "on-click-right" = "mode"; + }; + }; + disk = { + format = "{free}/{total}"; + }; + "group/group-power" = { + "orientation" = "inherit"; + "drawer" = { + "transition-duration" = 500; + "children-class" = "not-power"; + "transition-left-to-right" = false; + }; + "modules" = [ + "custom/power" # First element is the "group leader" and won't ever be hidden + "custom/quit" + "custom/lock" + "custom/reboot" + ]; + }; + "custom/quit" = { + "format" = "󰗼"; + "tooltip" = false; + "on-click" = "hyprctl dispatch exit"; + min-width = 20; + }; + "custom/lock" = { + "format" = "󰍁"; + "tooltip" = false; + "on-click" = "swaylock"; + }; + "custom/reboot" = { + "format" = "󰜉"; + "tooltip" = false; + "on-click" = "reboot"; + }; + "custom/power" = { + "format" = ""; + "tooltip" = false; + "on-click" = "shutdown now"; + }; + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + }; + image = + let + albumArtScript = pkgs.writeShellScriptBin "album-art.sh" '' + #!${pkgs.bash}/bin/bash + album_art=$(playerctl metadata mpris:artUrl) + if [[ -z $album_art ]] + then + exit + fi + curl -s "''${album_art}" --output "/tmp/cover.jpeg" + echo "/tmp/cover.jpeg" + ''; + in + { + exec = "${albumArtScript}/bin/album-art.sh"; + interval = 15; + on-click = "playerctl play-pause"; + }; + mpris = { + format = "{title} "; + tooltip-format = "{player} ({status}) {dynamic}"; + }; + memory = { + format = "{}% "; + }; + power-profiles-daemon = { + format = "{icon}"; + tooltip-format = "Power profile: {profile}\nDriver: {driver}"; + tooltip = true; + format-icons = { + default = ""; + performance = ""; + balanced = ""; + power-saver = ""; + }; + }; + wireplumber = { + format = "{volume}% {icon}"; + format-muted = ""; + format-icons = [ + "" + "" + "" + ]; + }; + temperature = { + format = "{temperatureC}°C "; + }; + tray = { + spacing = 4; + }; + bluetooth = { + format = "  {status} "; + format-connected = "  {device_alias} "; + format-connected-battery = "  {device_alias} {device_battery_percentage}% "; + tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected"; + tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}"; + tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; + tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%"; + }; }; }; }; From ba0ff8e45698475d2c3c8862eb7acf888f5aadcf Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 17 Mar 2025 18:23:52 +0100 Subject: [PATCH 0239/1295] fix vms import non existing file --- hosts/forgejo-runner-1/imports.nix | 1 - hosts/hetzner-vpn2/imports.nix | 2 -- 2 files changed, 3 deletions(-) diff --git a/hosts/forgejo-runner-1/imports.nix b/hosts/forgejo-runner-1/imports.nix index f63120ef..8b867c68 100644 --- a/hosts/forgejo-runner-1/imports.nix +++ b/hosts/forgejo-runner-1/imports.nix @@ -1,6 +1,5 @@ { imports = [ - ../../users/vinzenz.nix ../../modules/podman.nix ./forgejo-runner.nix ]; diff --git a/hosts/hetzner-vpn2/imports.nix b/hosts/hetzner-vpn2/imports.nix index b17a1c81..3fadabb4 100644 --- a/hosts/hetzner-vpn2/imports.nix +++ b/hosts/hetzner-vpn2/imports.nix @@ -1,7 +1,5 @@ { imports = [ ./nginx.nix - ../../users/vinzenz.nix - ../../users/ronja.nix ]; } From 638bcfdc3f8b1a3c20066f582148d24e64853fbb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 17 Mar 2025 18:25:25 +0100 Subject: [PATCH 0240/1295] remove ssh keys for removed users --- hosts/hetzner-vpn2/configuration.nix | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hosts/hetzner-vpn2/configuration.nix b/hosts/hetzner-vpn2/configuration.nix index c4b747d4..be2fe7b5 100644 --- a/hosts/hetzner-vpn2/configuration.nix +++ b/hosts/hetzner-vpn2/configuration.nix @@ -12,15 +12,9 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' ]; - vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - ]; + #ronja.openssh.authorizedKeys.keys = [ + # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + #]; }; system.autoUpgrade.allowReboot = true; From e8762f575f44ea8162e13ee6223f3609dde71783 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 17 Mar 2025 19:06:47 +0100 Subject: [PATCH 0241/1295] deadnix -e --- flake.nix | 2 -- home/vinzenz/zsh.nix | 2 +- hosts/forgejo-runner-1/configuration.nix | 2 +- hosts/forgejo-runner-1/hardware.nix | 2 +- hosts/hetzner-vpn2/configuration.nix | 2 +- hosts/hetzner-vpn2/hardware.nix | 2 +- hosts/hetzner-vpn2/nginx.nix | 2 +- hosts/vinzenz-lpt2/configuration.nix | 2 +- hosts/vinzenz-pc2/configuration.nix | 2 +- modules/desktop-environment.nix | 2 +- modules/desktop-hardware.nix | 1 - modules/gaming.nix | 2 +- modules/gnome.nix | 2 +- modules/intel-graphics.nix | 2 +- 14 files changed, 12 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index 9b21548a..f8701127 100644 --- a/flake.nix +++ b/flake.nix @@ -22,11 +22,9 @@ outputs = { - self, nixpkgs, home-manager, lix-module, - nixos-hardware, niri, }: let diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index 0b5ed96c..4f2e6bb3 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, pkgs, ... }: { config.programs.zsh = { initExtra = '' diff --git a/hosts/forgejo-runner-1/configuration.nix b/hosts/forgejo-runner-1/configuration.nix index 81b5be86..345e622f 100644 --- a/hosts/forgejo-runner-1/configuration.nix +++ b/hosts/forgejo-runner-1/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ ... }: { # uncomment for build check on non arm system (requires --impure) # nixpkgs.buildPlatform = builtins.currentSystem; diff --git a/hosts/forgejo-runner-1/hardware.nix b/hosts/forgejo-runner-1/hardware.nix index f7cb0837..e3e6880e 100644 --- a/hosts/forgejo-runner-1/hardware.nix +++ b/hosts/forgejo-runner-1/hardware.nix @@ -1,4 +1,4 @@ -{ lib, modulesPath, ... }: +{ modulesPath, ... }: { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; diff --git a/hosts/hetzner-vpn2/configuration.nix b/hosts/hetzner-vpn2/configuration.nix index be2fe7b5..8e16ff71 100644 --- a/hosts/hetzner-vpn2/configuration.nix +++ b/hosts/hetzner-vpn2/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ ... }: { # uncomment for build check on non arm system (requires --impure) # nixpkgs.buildPlatform = builtins.currentSystem; diff --git a/hosts/hetzner-vpn2/hardware.nix b/hosts/hetzner-vpn2/hardware.nix index 7cf5ce7c..e8fa931c 100644 --- a/hosts/hetzner-vpn2/hardware.nix +++ b/hosts/hetzner-vpn2/hardware.nix @@ -1,4 +1,4 @@ -{ lib, modulesPath, ... }: +{ modulesPath, ... }: { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix index a9bc5835..218b7a90 100644 --- a/hosts/hetzner-vpn2/nginx.nix +++ b/hosts/hetzner-vpn2/nginx.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ pkgs, ... }: { security.acme = { acceptTerms = true; diff --git a/hosts/vinzenz-lpt2/configuration.nix b/hosts/vinzenz-lpt2/configuration.nix index 7ad1351b..5267e899 100644 --- a/hosts/vinzenz-lpt2/configuration.nix +++ b/hosts/vinzenz-lpt2/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ ... }: { imports = [ ./nginx.nix ]; diff --git a/hosts/vinzenz-pc2/configuration.nix b/hosts/vinzenz-pc2/configuration.nix index aa010957..d2f74392 100644 --- a/hosts/vinzenz-pc2/configuration.nix +++ b/hosts/vinzenz-pc2/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ ... }: { imports = [ ./hardware.nix diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index 9d4fcd8c..afb52552 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { config = { services = { diff --git a/modules/desktop-hardware.nix b/modules/desktop-hardware.nix index 62d0ab9b..1fed3a83 100644 --- a/modules/desktop-hardware.nix +++ b/modules/desktop-hardware.nix @@ -1,7 +1,6 @@ { lib, pkgs, - config, ... }: { diff --git a/modules/gaming.nix b/modules/gaming.nix index 6cb625f9..4214c23b 100644 --- a/modules/gaming.nix +++ b/modules/gaming.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { config = { hardware = { diff --git a/modules/gnome.nix b/modules/gnome.nix index c510a9da..669109c2 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { config = { services = { diff --git a/modules/intel-graphics.nix b/modules/intel-graphics.nix index f23b3571..74c6e670 100644 --- a/modules/intel-graphics.nix +++ b/modules/intel-graphics.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { config = { hardware.graphics = { From 526fd80f077a66dabda650852299498e86a2bb4f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 17 Mar 2025 19:07:12 +0100 Subject: [PATCH 0242/1295] new aliases for pretty build logs --- home/vinzenz/zsh.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index 4f2e6bb3..02efbce6 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -9,11 +9,9 @@ enableCompletion = true; shellAliases = { - my-apply = "sudo nixos-rebuild boot --flake"; - my-switch = "sudo nixos-rebuild switch --flake"; - my-update = "sudo nixos-rebuild boot --upgrade --flake"; - my-pull = "git -C ~/Repos/nixos-configuration pull --rebase"; - my-test = "sudo nixos-rebuild test"; + myos-rebuild-boot = "sudo nixos-rebuild boot --flake .# --show-trace --log-format internal-json -v |& ${pkgs.nix-output-monitor}/bin/nom --json"; + myos-rebuild-switch = "sudo nixos-rebuild switch --flake .# --show-trace --log-format internal-json -v |& ${pkgs.nix-output-monitor}/bin/nom --json"; + my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; my-ip4 = "ip addr show | grep 192"; deadnix = "nix run github:astro/deadnix -- "; From c129b25c6f77773c91e5a9efd7d789efe0decf25 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 17 Mar 2025 19:15:50 +0100 Subject: [PATCH 0243/1295] nix flake update, remove nixos-hardware --- flake.lock | 47 +++++++++++++++-------------------------------- flake.nix | 2 +- 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/flake.lock b/flake.lock index c4b18585..a608a1bf 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1739757849, - "narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=", + "lastModified": 1742234739, + "narHash": "sha256-zFL6zsf/5OztR1NSNQF33dvS1fL/BzVUjabZq4qrtY4=", "owner": "nix-community", "repo": "home-manager", - "rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe", + "rev": "f6af7280a3390e65c2ad8fd059cdc303426cbd59", "type": "github" }, "original": { @@ -103,11 +103,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1742032096, - "narHash": "sha256-/vWpgh3DCdoREIoydTfUnZLYSxKa0yRczOJaT0dDT0o=", + "lastModified": 1742220949, + "narHash": "sha256-ZlPrKLM0FWUP36MNCJYGTlN4ZvoXZ4WY/ENKoaGU6yg=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "e2614d598a86eb892e4d98d18458ee2633285c00", + "rev": "5d8d116ac90f54e4c95bd5c9de31b8df477b12b9", "type": "github" }, "original": { @@ -136,11 +136,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1742026950, - "narHash": "sha256-pd00WzjmAxxS3Da0e4eEzfgauAfX5HwMGfs3nm2hwwA=", + "lastModified": 1742103165, + "narHash": "sha256-zAzMwvozlS2gmqdhrgeMz0PNp3kRDkwxIEfqWT3Hj6g=", "owner": "YaLTeR", "repo": "niri", - "rev": "9e560e7e607638da4f47b6dfef5a83b18711f75d", + "rev": "287480b541e85b13ff6419d372f82fa8e42c603c", "type": "github" }, "original": { @@ -149,29 +149,13 @@ "type": "github" } }, - "nixos-hardware": { - "locked": { - "lastModified": 1741325094, - "narHash": "sha256-RUAdT8dZ6k/486vnu3tiNRrNW6+Q8uSD2Mq7gTX4jlo=", - "owner": "NixOS", - "repo": "nixos-hardware", - "rev": "b48cc4dab0f9711af296fc367b6108cf7b8ccb16", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "master", - "repo": "nixos-hardware", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1741332913, - "narHash": "sha256-ri1e8ZliWS3Jnp9yqpKApHaOo7KBN33W8ECAKA4teAQ=", + "lastModified": 1742136038, + "narHash": "sha256-DDe16FJk18sadknQKKG/9FbwEro7A57tg9vB5kxZ8kY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "20755fa05115c84be00b04690630cb38f0a203ad", + "rev": "a1185f4064c18a5db37c5c84e5638c78b46e3341", "type": "github" }, "original": { @@ -186,7 +170,6 @@ "home-manager": "home-manager", "lix-module": "lix-module", "niri": "niri", - "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs" } }, @@ -225,11 +208,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1741910413, - "narHash": "sha256-z9bvteu0rf+xmUDj4VifN06XAFJZQGRSOvdN7rn/oDs=", + "lastModified": 1742083780, + "narHash": "sha256-cVLagXvI4jFbCe76tpvAWA2N2WF94Pl0PpgsGp2P6rM=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "0325cb1f48a292d873a6844772cca00251cbf945", + "rev": "f9ec97b007547ad80147404335ed22e880dbd69d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f8701127..e4d0b8ad 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; - nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + # nixos-hardware.url = "github:NixOS/nixos-hardware/master"; home-manager = { url = "github:nix-community/home-manager/release-24.11"; From e2b8dd31921956933a4b29872b1912287f70d39a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 17 Mar 2025 19:17:16 +0100 Subject: [PATCH 0244/1295] fix missing parameter deadnix removed --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index e4d0b8ad..703576dc 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,7 @@ outputs = { + self, nixpkgs, home-manager, lix-module, From c3c2c1ad6da2819751d6066362601ee43bbbef37 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 17 Mar 2025 21:09:27 +0100 Subject: [PATCH 0245/1295] add swaylock --- home/vinzenz/default.nix | 1 + home/vinzenz/niri.nix | 1 - home/vinzenz/swaylock.nix | 21 +++++++++++++++++++++ home/vinzenz/waybar.nix | 3 +-- modules/globalinstalls.nix | 2 ++ 5 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 home/vinzenz/swaylock.nix diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 5d68bfc4..227ed063 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -28,6 +28,7 @@ ./gnome.nix ./niri.nix ./ssh.nix + ./swaylock.nix ./vscode.nix ./waybar.nix ./zsh.nix diff --git a/home/vinzenz/niri.nix b/home/vinzenz/niri.nix index b801c6bd..fa3d008b 100644 --- a/home/vinzenz/niri.nix +++ b/home/vinzenz/niri.nix @@ -7,7 +7,6 @@ xwayland-satellite alacritty fuzzel - swaylock ]; qt.style = { diff --git a/home/vinzenz/swaylock.nix b/home/vinzenz/swaylock.nix new file mode 100644 index 00000000..9a4bc2b0 --- /dev/null +++ b/home/vinzenz/swaylock.nix @@ -0,0 +1,21 @@ +# based on https://codeberg.org/kiara/cfg/src/commit/b9c472acd78c9c08dfe8b6a643c5c82cc5828433/home-manager/kiara/swaylock.nix# +{ pkgs, ... }: +{ + programs.swaylock = { + enable = true; + package = pkgs.swaylock-effects; + # https://github.com/jirutka/swaylock-effects/blob/master/swaylock.1.scd + settings = { + screenshot = true; + effect-blur = "9x9"; + effect-vignette = "0.5:0.5"; + fade-in = 0.5; + font-size = 75; + indicator-caps-lock = true; + clock = true; + indicator-radius = 400; + show-failed-attempts = true; + ignore-empty-password = true; + }; + }; +} diff --git a/home/vinzenz/waybar.nix b/home/vinzenz/waybar.nix index 145e15a5..22e608d5 100644 --- a/home/vinzenz/waybar.nix +++ b/home/vinzenz/waybar.nix @@ -3,10 +3,9 @@ home.packages = with pkgs; [ waybar playerctl + cava ]; - programs.cava.enable = true; - programs.waybar = { enable = true; settings = { diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix index 9afad7d6..c4c21d21 100644 --- a/modules/globalinstalls.nix +++ b/modules/globalinstalls.nix @@ -15,6 +15,8 @@ tldr neofetch + + nix-output-monitor ]; }; From 06886d02dcdc8093ac9c0e88fe225d830c3fe95e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 17 Mar 2025 21:49:44 +0100 Subject: [PATCH 0246/1295] brightness control, swayidle --- home/vinzenz/default.nix | 1 + home/vinzenz/niri.nix | 13 ++++--- home/vinzenz/swaylock.nix | 51 +++++++++++++++++++--------- home/vinzenz/waybar.nix | 10 +++++- hosts/vinzenz-lpt2/configuration.nix | 11 +++++- 5 files changed, 63 insertions(+), 23 deletions(-) diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 227ed063..95573f13 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -16,6 +16,7 @@ "adbusers" "kvm" "input" + "video" ]; shell = pkgs.zsh; autoSubUidGidRange = true; diff --git a/home/vinzenz/niri.nix b/home/vinzenz/niri.nix index fa3d008b..53e68994 100644 --- a/home/vinzenz/niri.nix +++ b/home/vinzenz/niri.nix @@ -1,8 +1,13 @@ -{ pkgs, ... }: +{ + pkgs, + lib, + devices, + config, + ... +}: { config = { home.sessionVariables.NIXOS_OZONE_WL = "1"; - home.packages = with pkgs; [ xwayland-satellite alacritty @@ -24,8 +29,6 @@ }; }; - # services.swayidle.enable = true; - programs.niri.settings = { input.keyboard.xkb.layout = "de"; @@ -56,7 +59,7 @@ # Suggested binds for running programs: terminal, app launcher, screen locker. "Mod+T".action.spawn = "alacritty"; "Mod+D".action.spawn = "fuzzel"; - "Super+Alt+L".action.spawn = "swaylock"; + "Super+Alt+L".action.spawn = "${config.programs.swaylock.package}/bin/swaylock"; # You can also use a shell. Do this if you need pipes, multiple commands, etc. # Note: the entire command goes as a single argument in the end. diff --git a/home/vinzenz/swaylock.nix b/home/vinzenz/swaylock.nix index 9a4bc2b0..291a90ca 100644 --- a/home/vinzenz/swaylock.nix +++ b/home/vinzenz/swaylock.nix @@ -1,21 +1,40 @@ # based on https://codeberg.org/kiara/cfg/src/commit/b9c472acd78c9c08dfe8b6a643c5c82cc5828433/home-manager/kiara/swaylock.nix# -{ pkgs, ... }: +{ pkgs, config, ... }: { - programs.swaylock = { - enable = true; - package = pkgs.swaylock-effects; - # https://github.com/jirutka/swaylock-effects/blob/master/swaylock.1.scd - settings = { - screenshot = true; - effect-blur = "9x9"; - effect-vignette = "0.5:0.5"; - fade-in = 0.5; - font-size = 75; - indicator-caps-lock = true; - clock = true; - indicator-radius = 400; - show-failed-attempts = true; - ignore-empty-password = true; + config = { + programs.swaylock = { + enable = true; + package = pkgs.swaylock-effects; + # https://github.com/jirutka/swaylock-effects/blob/master/swaylock.1.scd + settings = { + screenshot = true; + effect-blur = "9x9"; + effect-vignette = "0.2:0.2"; + fade-in = 0.5; + font-size = 75; + indicator-caps-lock = true; + clock = true; + indicator-radius = 400; + show-failed-attempts = true; + ignore-empty-password = true; + grace = 2; + color = "000000"; + indicator-thickness = 20; + }; + }; + + services.swayidle = { + enable = true; + timeouts = [ + { + timeout = 60; + command = "${config.programs.swaylock.package}/bin/swaylock"; + } + #{ + # timeout = 90; + # command = "${pkgs.systemd}/bin/systemctl suspend"; + #} + ]; }; }; } diff --git a/home/vinzenz/waybar.nix b/home/vinzenz/waybar.nix index 22e608d5..a3797cfc 100644 --- a/home/vinzenz/waybar.nix +++ b/home/vinzenz/waybar.nix @@ -1,4 +1,9 @@ -{ pkgs, device, ... }: +{ + pkgs, + device, + config, + ... +}: { home.packages = with pkgs; [ waybar @@ -8,6 +13,7 @@ programs.waybar = { enable = true; + systemd.enable = true; settings = { mainBar = { layer = "top"; @@ -105,6 +111,8 @@ backlight = { device = "intel_backlight"; format = "{percent}% "; + on-scroll-down = "light -U 1"; + on-scroll-up = "light -A 1"; }; cpu = { interval = 1; diff --git a/hosts/vinzenz-lpt2/configuration.nix b/hosts/vinzenz-lpt2/configuration.nix index 5267e899..5ec706ea 100644 --- a/hosts/vinzenz-lpt2/configuration.nix +++ b/hosts/vinzenz-lpt2/configuration.nix @@ -27,6 +27,15 @@ # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' #]; - programs.adb.enable = true; + programs = { + adb.enable = true; + light = { + enable = true; + brightnessKeys = { + enable = true; + step = 5; + }; + }; + }; }; } From d1e0c69e4c68b9970916159adbaec11fdfe2f0d6 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 18 Mar 2025 17:15:11 +0100 Subject: [PATCH 0247/1295] make fuzzel less bright --- home/vinzenz/niri.nix | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/home/vinzenz/niri.nix b/home/vinzenz/niri.nix index 53e68994..57c30eb9 100644 --- a/home/vinzenz/niri.nix +++ b/home/vinzenz/niri.nix @@ -11,7 +11,6 @@ home.packages = with pkgs; [ xwayland-satellite alacritty - fuzzel ]; qt.style = { @@ -29,6 +28,35 @@ }; }; + programs.fuzzel = { + enable = true; + settings = { + main = { + terminal = "${pkgs.alacritty}/bin/alacritty"; + icon-theme = "Adwaita"; + counter = true; + font = "sans:size=10"; + }; + colors = { + border = "0003B3FF"; + background = "0F0F0FFF"; + text = "657b83ff"; + prompt = "586e75ff"; + placeholder = "93a1a1ff"; + input = "657b83ff"; + match = "cb4b16ff"; + selection = "eee8d5ff"; + selection-text = "586e75ff"; + selection-match = "cb4b16ff"; + counter = "93a1a1ff"; + }; + border = { + radius = 30; + width = 3; + }; + }; + }; + programs.niri.settings = { input.keyboard.xkb.layout = "de"; @@ -54,7 +82,7 @@ # Mod-Shift-/, which is usually the same as Mod-?, # shows a list of important hotkeys. - "Mod+Shift+Slash".action.show-hotkey-overlay = { }; + "Mod+Shift+Numbersign".action.show-hotkey-overlay = { }; # Suggested binds for running programs: terminal, app launcher, screen locker. "Mod+T".action.spawn = "alacritty"; From da09ddee494c4e1248ddca2c91ff179104783611 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 16 Feb 2025 12:55:06 +0100 Subject: [PATCH 0248/1295] re-disable amdvlk --- modules/amd-graphics.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/amd-graphics.nix b/modules/amd-graphics.nix index 9ec5f755..4ae15acb 100644 --- a/modules/amd-graphics.nix +++ b/modules/amd-graphics.nix @@ -10,7 +10,7 @@ opencl.enable = true; amdvlk = { # TODO: this creates black borders around GNOME apps - enable = true; + # enable = true; support32Bit.enable = config.hardware.graphics.enable32Bit; }; }; From c5ec082fc2d547410b277a1960405ef9e160a491 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 23 Mar 2025 12:08:40 +0100 Subject: [PATCH 0249/1295] fix pc2 build --- home/vinzenz/waybar.nix | 2 ++ hosts/vinzenz-pc2/configuration.nix | 5 ----- hosts/vinzenz-pc2/imports.nix | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/home/vinzenz/waybar.nix b/home/vinzenz/waybar.nix index a3797cfc..0cd0c559 100644 --- a/home/vinzenz/waybar.nix +++ b/home/vinzenz/waybar.nix @@ -121,6 +121,8 @@ + (builtins.getAttr device { "vinzenz-lpt2" = "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}{icon16}{icon17}{icon18}{icon19}"; + "vinzenz-pc2" = + "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}"; }) + " "; format-icons = [ diff --git a/hosts/vinzenz-pc2/configuration.nix b/hosts/vinzenz-pc2/configuration.nix index d2f74392..78c9e919 100644 --- a/hosts/vinzenz-pc2/configuration.nix +++ b/hosts/vinzenz-pc2/configuration.nix @@ -20,11 +20,6 @@ # Configure console keymap console.keyMap = "de"; - home-manager.users = { - vinzenz = import ../../home/vinzenz; - ronja = import ../../home/ronja; - }; - users.users.vinzenz.openssh.authorizedKeys.keys = [ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' diff --git a/hosts/vinzenz-pc2/imports.nix b/hosts/vinzenz-pc2/imports.nix index cf430db6..7e9f61af 100644 --- a/hosts/vinzenz-pc2/imports.nix +++ b/hosts/vinzenz-pc2/imports.nix @@ -9,5 +9,6 @@ ../../modules/desktop-hardware.nix ../../home/vinzenz + ../../home/ronja ]; } From f437f448970574de4feddda418014fef3995fbae Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 5 Apr 2025 11:40:13 +0200 Subject: [PATCH 0250/1295] more niri config --- home/vinzenz/default.nix | 1 + home/vinzenz/fuzzel.nix | 31 +++++++++++++++++++++++++++++++ home/vinzenz/niri.nix | 29 ----------------------------- home/vinzenz/swaylock.nix | 21 ++++++++++++++++----- home/vinzenz/waybar.nix | 2 +- 5 files changed, 49 insertions(+), 35 deletions(-) create mode 100644 home/vinzenz/fuzzel.nix diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 95573f13..59c47471 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -25,6 +25,7 @@ home-manager.users.vinzenz.imports = [ ./configuration.nix ./editorconfig.nix + ./fuzzel.nix ./git.nix ./gnome.nix ./niri.nix diff --git a/home/vinzenz/fuzzel.nix b/home/vinzenz/fuzzel.nix new file mode 100644 index 00000000..db700e89 --- /dev/null +++ b/home/vinzenz/fuzzel.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: +{ + config.programs.fuzzel = { + enable = true; + settings = { + main = { + terminal = "${pkgs.alacritty}/bin/alacritty"; + icon-theme = "Adwaita"; + counter = true; + font = "sans:size=10"; + }; + colors = { + border = "0003B3FF"; + background = "0F0F0FFF"; + text = "657b83ff"; + prompt = "586e75ff"; + placeholder = "93a1a1ff"; + input = "657b83ff"; + match = "cb4b16ff"; + selection = "eee8d5ff"; + selection-text = "586e75ff"; + selection-match = "cb4b16ff"; + counter = "93a1a1ff"; + }; + border = { + radius = 30; + width = 3; + }; + }; + }; +} diff --git a/home/vinzenz/niri.nix b/home/vinzenz/niri.nix index 57c30eb9..9c532ee8 100644 --- a/home/vinzenz/niri.nix +++ b/home/vinzenz/niri.nix @@ -28,35 +28,6 @@ }; }; - programs.fuzzel = { - enable = true; - settings = { - main = { - terminal = "${pkgs.alacritty}/bin/alacritty"; - icon-theme = "Adwaita"; - counter = true; - font = "sans:size=10"; - }; - colors = { - border = "0003B3FF"; - background = "0F0F0FFF"; - text = "657b83ff"; - prompt = "586e75ff"; - placeholder = "93a1a1ff"; - input = "657b83ff"; - match = "cb4b16ff"; - selection = "eee8d5ff"; - selection-text = "586e75ff"; - selection-match = "cb4b16ff"; - counter = "93a1a1ff"; - }; - border = { - radius = 30; - width = 3; - }; - }; - }; - programs.niri.settings = { input.keyboard.xkb.layout = "de"; diff --git a/home/vinzenz/swaylock.nix b/home/vinzenz/swaylock.nix index 291a90ca..9255f041 100644 --- a/home/vinzenz/swaylock.nix +++ b/home/vinzenz/swaylock.nix @@ -25,15 +25,26 @@ services.swayidle = { enable = true; + systemdTarget = "graphical-session.target"; timeouts = [ { - timeout = 60; + timeout = 30; + command = "${config.programs.swaylock.package}/bin/swaylock"; + } + { + timeout = 60 * 10; + command = "${pkgs.systemd}/bin/systemctl suspend"; + } + ]; + events = [ + { + event = "before-sleep"; + command = "${pkgs.playerctl}/bin/playerctl pause; ${config.programs.swaylock.package}/bin/swaylock"; + } + { + event = "lock"; command = "${config.programs.swaylock.package}/bin/swaylock"; } - #{ - # timeout = 90; - # command = "${pkgs.systemd}/bin/systemctl suspend"; - #} ]; }; }; diff --git a/home/vinzenz/waybar.nix b/home/vinzenz/waybar.nix index 0cd0c559..af276ac6 100644 --- a/home/vinzenz/waybar.nix +++ b/home/vinzenz/waybar.nix @@ -6,7 +6,6 @@ }: { home.packages = with pkgs; [ - waybar playerctl cava ]; @@ -14,6 +13,7 @@ programs.waybar = { enable = true; systemd.enable = true; + systemd.target = "graphical-session.target"; settings = { mainBar = { layer = "top"; From 5fc8fe8ac64ec3b29fda34b8cfe4130e24543d68 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 5 Apr 2025 11:42:35 +0200 Subject: [PATCH 0251/1295] update flake --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index a608a1bf..edfe1e81 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1742234739, - "narHash": "sha256-zFL6zsf/5OztR1NSNQF33dvS1fL/BzVUjabZq4qrtY4=", + "lastModified": 1743808813, + "narHash": "sha256-2lDQBOmlz9ggPxcS7/GvcVdzXMIiT+PpMao6FbLJSr0=", "owner": "nix-community", "repo": "home-manager", - "rev": "f6af7280a3390e65c2ad8fd059cdc303426cbd59", + "rev": "a9f8b3db211b4609ddd83683f9db89796c7f6ac6", "type": "github" }, "original": { @@ -103,11 +103,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1742220949, - "narHash": "sha256-ZlPrKLM0FWUP36MNCJYGTlN4ZvoXZ4WY/ENKoaGU6yg=", + "lastModified": 1743791363, + "narHash": "sha256-hGETu0Ilugf0f7S5fFETUP+sS0ATrKcm+7YHs7GBwx4=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "5d8d116ac90f54e4c95bd5c9de31b8df477b12b9", + "rev": "f160e322673614c928e1187c268add9ef038a513", "type": "github" }, "original": { @@ -136,11 +136,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1742103165, - "narHash": "sha256-zAzMwvozlS2gmqdhrgeMz0PNp3kRDkwxIEfqWT3Hj6g=", + "lastModified": 1743774669, + "narHash": "sha256-xrg3m1RP7mvBi0sLPJjnn9UiCqN+NKqU94DZJMoaXZU=", "owner": "YaLTeR", "repo": "niri", - "rev": "287480b541e85b13ff6419d372f82fa8e42c603c", + "rev": "e8da89a430f4af0accfe80efe286b2cffd20a4aa", "type": "github" }, "original": { @@ -151,11 +151,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1742136038, - "narHash": "sha256-DDe16FJk18sadknQKKG/9FbwEro7A57tg9vB5kxZ8kY=", + "lastModified": 1743703532, + "narHash": "sha256-s1KLDALEeqy+ttrvqV3jx9mBZEvmthQErTVOAzbjHZs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a1185f4064c18a5db37c5c84e5638c78b46e3341", + "rev": "bdb91860de2f719b57eef819b5617762f7120c70", "type": "github" }, "original": { @@ -208,11 +208,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1742083780, - "narHash": "sha256-cVLagXvI4jFbCe76tpvAWA2N2WF94Pl0PpgsGp2P6rM=", + "lastModified": 1743346993, + "narHash": "sha256-i7rWd/5BcqLgQEtB5L/6gKN5R5GUJcmm34F+iBivH60=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "f9ec97b007547ad80147404335ed22e880dbd69d", + "rev": "45c055696437a08e3989d9b91d9c617b84cc2bc3", "type": "github" }, "original": { From 869213eb0279788080984cff8a36afe82ae1b000 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 7 Apr 2025 19:43:41 +0200 Subject: [PATCH 0252/1295] update dependencies, add zerforschen.plus to lpt2 as a test --- flake.lock | 67 ++++++++++++++++--------- flake.nix | 14 ++++-- hosts/vinzenz-lpt2/configuration.nix | 4 +- hosts/vinzenz-lpt2/zerforschen-plus.nix | 40 +++++++++++++++ 4 files changed, 98 insertions(+), 27 deletions(-) create mode 100644 hosts/vinzenz-lpt2/zerforschen-plus.nix diff --git a/flake.lock b/flake.lock index edfe1e81..fc02edbb 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -57,15 +57,15 @@ "lix": { "flake": false, "locked": { - "lastModified": 1729298361, - "narHash": "sha256-hiGtfzxFkDc9TSYsb96Whg0vnqBVV7CUxyscZNhed0U=", - "rev": "ad9d06f7838a25beec425ff406fe68721fef73be", + "lastModified": 1737234286, + "narHash": "sha256-pgDJZjj4jpzkFxsqBTI/9Yb0n3gW+DvDtuv9SwQZZcs=", + "rev": "079528098f5998ba13c88821a2eca1005c1695de", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/ad9d06f7838a25beec425ff406fe68721fef73be.tar.gz?rev=ad9d06f7838a25beec425ff406fe68721fef73be" + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/079528098f5998ba13c88821a2eca1005c1695de.tar.gz?rev=079528098f5998ba13c88821a2eca1005c1695de" }, "original": { "type": "tarball", - "url": "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz" + "url": "https://git.lix.systems/lix-project/lix/archive/release-2.92.tar.gz" } }, "lix-module": { @@ -78,15 +78,15 @@ ] }, "locked": { - "lastModified": 1729360442, - "narHash": "sha256-6U0CyPycIBc04hbYy2hBINnVso58n/ZyywY2BD3hu+s=", - "rev": "9098ac95768f7006d7e070b88bae76939f6034e6", + "lastModified": 1742943028, + "narHash": "sha256-fprwZKE1uMzO9tiWWOrmLWBW3GPkMayQfb0xOvVFIno=", + "rev": "868d97695bab9d21f6070b03957bcace249fbe3c", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/9098ac95768f7006d7e070b88bae76939f6034e6.tar.gz?rev=9098ac95768f7006d7e070b88bae76939f6034e6" + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/868d97695bab9d21f6070b03957bcace249fbe3c.tar.gz?rev=868d97695bab9d21f6070b03957bcace249fbe3c" }, "original": { "type": "tarball", - "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz" + "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0-3.tar.gz" } }, "niri": { @@ -103,11 +103,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1743791363, - "narHash": "sha256-hGETu0Ilugf0f7S5fFETUP+sS0ATrKcm+7YHs7GBwx4=", + "lastModified": 1743943715, + "narHash": "sha256-9xCTf79Naq7mxvqtjgbcU9ZlNwubAep0qlwrL3GqZQQ=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "f160e322673614c928e1187c268add9ef038a513", + "rev": "f53eac2ea3c72dd4e9739228660f661eb27359d0", "type": "github" }, "original": { @@ -136,11 +136,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1743774669, - "narHash": "sha256-xrg3m1RP7mvBi0sLPJjnn9UiCqN+NKqU94DZJMoaXZU=", + "lastModified": 1743923080, + "narHash": "sha256-Hb3t6FoJycnqIZmu3c6K1bJGndBsrDw8IQtM2ieLbzU=", "owner": "YaLTeR", "repo": "niri", - "rev": "e8da89a430f4af0accfe80efe286b2cffd20a4aa", + "rev": "430b155929a60644ea223012ee0c1389fc5e3755", "type": "github" }, "original": { @@ -151,11 +151,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743703532, - "narHash": "sha256-s1KLDALEeqy+ttrvqV3jx9mBZEvmthQErTVOAzbjHZs=", + "lastModified": 1743813633, + "narHash": "sha256-BgkBz4NpV6Kg8XF7cmHDHRVGZYnKbvG0Y4p+jElwxaM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bdb91860de2f719b57eef819b5617762f7120c70", + "rev": "7819a0d29d1dd2bc331bec4b327f0776359b1fa6", "type": "github" }, "original": { @@ -170,7 +170,8 @@ "home-manager": "home-manager", "lix-module": "lix-module", "niri": "niri", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "zerforschen-plus": "zerforschen-plus" } }, "systems": { @@ -220,6 +221,26 @@ "repo": "xwayland-satellite", "type": "github" } + }, + "zerforschen-plus": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744047745, + "narHash": "sha256-hde60MbFtTb4IR6D2fMkyYZmN/fXGk7/Jc7DK/6LTTk=", + "ref": "refs/heads/main", + "rev": "f739fdfd3b6184cb489910492ff3bc99d319f64d", + "revCount": 6, + "type": "git", + "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" + }, + "original": { + "type": "git", + "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 703576dc..8091440a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,6 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; - # nixos-hardware.url = "github:NixOS/nixos-hardware/master"; home-manager = { url = "github:nix-community/home-manager/release-24.11"; @@ -9,7 +8,7 @@ }; lix-module = { - url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz"; + url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0-3.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -18,15 +17,21 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs-stable.follows = "nixpkgs"; }; + + zerforschen-plus = { + url = "git+https://git.berlin.ccc.de/vinzenz/zerforschen.plus"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = - { + inputs@{ self, nixpkgs, home-manager, lix-module, niri, + zerforschen-plus, }: let devices = { @@ -46,6 +51,9 @@ device: system: nixpkgs.lib.nixosSystem { inherit system; + specialArgs = { + inherit inputs; + }; modules = [ lix-module.nixosModules.default diff --git a/hosts/vinzenz-lpt2/configuration.nix b/hosts/vinzenz-lpt2/configuration.nix index 5ec706ea..773d0c57 100644 --- a/hosts/vinzenz-lpt2/configuration.nix +++ b/hosts/vinzenz-lpt2/configuration.nix @@ -1,6 +1,6 @@ { ... }: { - imports = [ ./nginx.nix ]; + imports = [ ./zerforschen-plus.nix ]; config = { networking.networkmanager.enable = true; @@ -37,5 +37,7 @@ }; }; }; + + networking.firewall.allowedTCPPorts = [ 8776 ]; }; } diff --git a/hosts/vinzenz-lpt2/zerforschen-plus.nix b/hosts/vinzenz-lpt2/zerforschen-plus.nix new file mode 100644 index 00000000..af3ea3c8 --- /dev/null +++ b/hosts/vinzenz-lpt2/zerforschen-plus.nix @@ -0,0 +1,40 @@ +{ + pkgs, + system, + inputs, + ... +}: +{ + security.acme = { + acceptTerms = true; + defaults.email = "acme@zerforschen.plus"; + }; + + security.pam.services.nginx.setEnvironment = false; + systemd.services.nginx.serviceConfig = { + SupplementaryGroups = [ "shadow" ]; + }; + + services.nginx = { + enable = true; + additionalModules = [ pkgs.nginxModules.pam ]; + + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + + virtualHosts = { + "zerforschen.plus" = { + #addSSL = true; + #enableACME = true; + root = inputs.zerforschen-plus.packages."${pkgs.system}".zerforschen-plus-content; + }; + }; + }; + + #networking.firewall.allowedTCPPorts = [ + # 80 + # 443 + #]; +} From 3312a89195ab61a21abb5e80bed997e29e679f2d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 7 Apr 2025 19:52:23 +0200 Subject: [PATCH 0253/1295] add website to vpn2 --- hosts/hetzner-vpn2/nginx.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix index 218b7a90..8db0fb0a 100644 --- a/hosts/hetzner-vpn2/nginx.nix +++ b/hosts/hetzner-vpn2/nginx.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, inputs,... }: { security.acme = { acceptTerms = true; @@ -45,6 +45,12 @@ # (mkServiceConfig pc2 8542) # { locations."/".proxyWebsockets = true; } #]; + + "zerforschen.plus" = { + addSSL = true; + enableACME = true; + root = inputs.zerforschen-plus.packages."${pkgs.system}".zerforschen-plus-content; + }; }; }; From 6d001a11f4e81d02827dc87332a9c6da5a864e2c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 10 Apr 2025 00:00:05 +0200 Subject: [PATCH 0254/1295] update zerforschen.plus --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index fc02edbb..573e0708 100644 --- a/flake.lock +++ b/flake.lock @@ -229,11 +229,11 @@ ] }, "locked": { - "lastModified": 1744047745, - "narHash": "sha256-hde60MbFtTb4IR6D2fMkyYZmN/fXGk7/Jc7DK/6LTTk=", + "lastModified": 1744235905, + "narHash": "sha256-8ZylJRpDyGvgXJZG1lAGkzlGnVmbZ+GxorkSOzdTXcI=", "ref": "refs/heads/main", - "rev": "f739fdfd3b6184cb489910492ff3bc99d319f64d", - "revCount": 6, + "rev": "19a412f05b282c4a0a8d23c347de8b925ea508be", + "revCount": 10, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From d5509e6ea1e2af6ae8b9f71e66d30a53e4a591a7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 13 Apr 2025 21:40:52 +0200 Subject: [PATCH 0255/1295] add new host --- flake.nix | 2 ++ home/vinzenz/vscode.nix | 1 + hosts/hetzner-vpn2/nginx.nix | 40 ++++++++++++++-------------- hosts/ronja-pc/configuration.nix | 25 +++++++++++++++++ hosts/ronja-pc/hardware.nix | 31 +++++++++++++++++++++ hosts/ronja-pc/imports.nix | 10 +++++++ hosts/vinzenz-lpt2/configuration.nix | 1 - hosts/vinzenz-pc2/configuration.nix | 1 - modules/desktop-hardware.nix | 1 + 9 files changed, 90 insertions(+), 22 deletions(-) create mode 100644 hosts/ronja-pc/configuration.nix create mode 100644 hosts/ronja-pc/hardware.nix create mode 100644 hosts/ronja-pc/imports.nix diff --git a/flake.nix b/flake.nix index 8091440a..7d830080 100644 --- a/flake.nix +++ b/flake.nix @@ -37,12 +37,14 @@ devices = { vinzenz-lpt2 = "x86_64-linux"; vinzenz-pc2 = "x86_64-linux"; + ronja-pc = "x86_64-linux"; hetzner-vpn2 = "aarch64-linux"; forgejo-runner-1 = "aarch64-linux"; }; homeDevices = [ "vinzenz-lpt2" "vinzenz-pc2" + "ronja-pc" ]; forDevice = f: nixpkgs.lib.mapAttrs f devices; in diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index 098fc4ae..d1add794 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -20,6 +20,7 @@ ms-dotnettools.csharp ms-vscode-remote.remote-ssh RoweWilsonFrederiskHolme.wikitext + davidanson.vscode-markdownlint ]; userSettings = { "files.autoSave" = "afterDelay"; diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix index 8db0fb0a..bd45ab73 100644 --- a/hosts/hetzner-vpn2/nginx.nix +++ b/hosts/hetzner-vpn2/nginx.nix @@ -20,26 +20,26 @@ recommendedOptimisation = true; virtualHosts = - let - servicesDomain = "services.zerforschen.plus"; - mkServiceConfig = host: port: { - addSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://${host}:${toString port}/"; - extraConfig = '' - # bind to tailscale ip - proxy_bind 100.88.118.60; - # pam auth - limit_except OPTIONS { - auth_pam "Password Required"; - auth_pam_service_name "nginx"; - } - ''; - }; - }; - pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; - in + #let + # servicesDomain = "services.zerforschen.plus"; + # mkServiceConfig = host: port: { + # addSSL = true; + # enableACME = true; + # locations."/" = { + # proxyPass = "http://${host}:${toString port}/"; + # extraConfig = '' + # # bind to tailscale ip + # proxy_bind 100.88.118.60; + # # pam auth + # limit_except OPTIONS { + # auth_pam "Password Required"; + # auth_pam_service_name "nginx"; + # } + # ''; + # }; + # }; + # pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; + #in { #"vscode.${servicesDomain}" = lib.mkMerge [ # (mkServiceConfig pc2 8542) diff --git a/hosts/ronja-pc/configuration.nix b/hosts/ronja-pc/configuration.nix new file mode 100644 index 00000000..0d0a968d --- /dev/null +++ b/hosts/ronja-pc/configuration.nix @@ -0,0 +1,25 @@ +{ + config, + pkgs, + ... +}: { + # Configure keymap in X11 + services.xserver.xkb = { + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + ]; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; +} diff --git a/hosts/ronja-pc/hardware.nix b/hosts/ronja-pc/hardware.nix new file mode 100644 index 00000000..68f6e8da --- /dev/null +++ b/hosts/ronja-pc/hardware.nix @@ -0,0 +1,31 @@ +{lib, ...}: { + boot = { + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + initrd = { + availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; + kernelModules = []; + }; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/27eccf93-a79f-4fcb-8588-ec55d913508f"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/85D4-43FC"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/bf9d19fb-499b-4bfb-b67d-131fa5bf8259";} + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = true; +} diff --git a/hosts/ronja-pc/imports.nix b/hosts/ronja-pc/imports.nix new file mode 100644 index 00000000..8b9ed4b9 --- /dev/null +++ b/hosts/ronja-pc/imports.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ../../modules/gnome.nix + ../../modules/gaming.nix + ../../modules/desktop-environment.nix + ../../modules/desktop-hardware.nix + + ../../home/ronja + ]; +} diff --git a/hosts/vinzenz-lpt2/configuration.nix b/hosts/vinzenz-lpt2/configuration.nix index 773d0c57..e7b01536 100644 --- a/hosts/vinzenz-lpt2/configuration.nix +++ b/hosts/vinzenz-lpt2/configuration.nix @@ -3,7 +3,6 @@ imports = [ ./zerforschen-plus.nix ]; config = { - networking.networkmanager.enable = true; nix.settings.extra-platforms = [ "aarch64-linux" "i686-linux" diff --git a/hosts/vinzenz-pc2/configuration.nix b/hosts/vinzenz-pc2/configuration.nix index 78c9e919..114d24e3 100644 --- a/hosts/vinzenz-pc2/configuration.nix +++ b/hosts/vinzenz-pc2/configuration.nix @@ -5,7 +5,6 @@ ./vscode-server.nix ]; config = { - networking.networkmanager.enable = true; nix.settings.extra-platforms = [ "aarch64-linux" "i686-linux" diff --git a/modules/desktop-hardware.nix b/modules/desktop-hardware.nix index 1fed3a83..a8b2f938 100644 --- a/modules/desktop-hardware.nix +++ b/modules/desktop-hardware.nix @@ -27,6 +27,7 @@ }; }; + networking.networkmanager.enable = true; # 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 From 719c066ea41bf7583fca4c79fd5c32f29090555b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 13 Apr 2025 21:40:52 +0200 Subject: [PATCH 0256/1295] update zerfoschen.plus --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 573e0708..f85e220a 100644 --- a/flake.lock +++ b/flake.lock @@ -229,11 +229,11 @@ ] }, "locked": { - "lastModified": 1744235905, - "narHash": "sha256-8ZylJRpDyGvgXJZG1lAGkzlGnVmbZ+GxorkSOzdTXcI=", + "lastModified": 1745521155, + "narHash": "sha256-MyiSgItvxrFLJhAlFGsyfeDsMpIQFb6T5tpA8HY4Qq8=", "ref": "refs/heads/main", - "rev": "19a412f05b282c4a0a8d23c347de8b925ea508be", - "revCount": 10, + "rev": "ad8b48fbc3cc8ff5134e0104015fe4789aed3615", + "revCount": 11, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From 29b9fb5c107b37b75051e0faffab90ba5e742440 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 24 Apr 2025 22:42:53 +0200 Subject: [PATCH 0257/1295] update zerforschen.plus --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index f85e220a..22be79bb 100644 --- a/flake.lock +++ b/flake.lock @@ -229,11 +229,11 @@ ] }, "locked": { - "lastModified": 1745521155, - "narHash": "sha256-MyiSgItvxrFLJhAlFGsyfeDsMpIQFb6T5tpA8HY4Qq8=", + "lastModified": 1745527190, + "narHash": "sha256-5Dve5nrUc1TJkWbZ0iKs4VK3GFSXn8SmdT05MsvFblQ=", "ref": "refs/heads/main", - "rev": "ad8b48fbc3cc8ff5134e0104015fe4789aed3615", - "revCount": 11, + "rev": "7411c96c0610c5d71235f84e80e58512a69a1a46", + "revCount": 13, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From 64b8d473fd7e7e3f8d1e65d957b8806f82657847 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Apr 2025 11:06:06 +0200 Subject: [PATCH 0258/1295] nix flake update --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 22be79bb..3b4ce176 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1743808813, - "narHash": "sha256-2lDQBOmlz9ggPxcS7/GvcVdzXMIiT+PpMao6FbLJSr0=", + "lastModified": 1745557122, + "narHash": "sha256-eqSo9ugzsqhFgaDFYUZj943nurlX4L6f+AW0skJ4W+M=", "owner": "nix-community", "repo": "home-manager", - "rev": "a9f8b3db211b4609ddd83683f9db89796c7f6ac6", + "rev": "dd26f75fb4ec1c731d4b1396eaf4439ce40a91c1", "type": "github" }, "original": { @@ -103,11 +103,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1743943715, - "narHash": "sha256-9xCTf79Naq7mxvqtjgbcU9ZlNwubAep0qlwrL3GqZQQ=", + "lastModified": 1745657526, + "narHash": "sha256-Mfw6ELZ9M7TiVu/xkDGlAmWJZCFP87QGfpwUPreQCKo=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "f53eac2ea3c72dd4e9739228660f661eb27359d0", + "rev": "03511f07e6357067d2d0a54f8752475c2bdd9629", "type": "github" }, "original": { @@ -136,11 +136,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1743923080, - "narHash": "sha256-Hb3t6FoJycnqIZmu3c6K1bJGndBsrDw8IQtM2ieLbzU=", + "lastModified": 1745653128, + "narHash": "sha256-32HDXJOw9a3O23hAD5km7alRMM5CBmnj0+/1rdDVjhk=", "owner": "YaLTeR", "repo": "niri", - "rev": "430b155929a60644ea223012ee0c1389fc5e3755", + "rev": "a99a0b2492722d2c254b7bdf172d388123de8996", "type": "github" }, "original": { @@ -151,11 +151,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743813633, - "narHash": "sha256-BgkBz4NpV6Kg8XF7cmHDHRVGZYnKbvG0Y4p+jElwxaM=", + "lastModified": 1745487689, + "narHash": "sha256-FQoi3R0NjQeBAsEOo49b5tbDPcJSMWc3QhhaIi9eddw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7819a0d29d1dd2bc331bec4b327f0776359b1fa6", + "rev": "5630cf13cceac06cefe9fc607e8dfa8fb342dde3", "type": "github" }, "original": { @@ -209,11 +209,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1743346993, - "narHash": "sha256-i7rWd/5BcqLgQEtB5L/6gKN5R5GUJcmm34F+iBivH60=", + "lastModified": 1745372360, + "narHash": "sha256-5DX9lYmEbkdANCzME2v3coV0EnWOhS7NsTlGBQuqmjM=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "45c055696437a08e3989d9b91d9c617b84cc2bc3", + "rev": "c31679aa41966ee9272bb240703755cb1e7c72e3", "type": "github" }, "original": { From 3240ba9bdf0f80bc1f00852e4a3e413a8a1acea4 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 26 Apr 2025 11:06:34 +0200 Subject: [PATCH 0259/1295] misc home tweaks --- home/vinzenz/configuration.nix | 8 ++++++++ home/vinzenz/vscode.nix | 2 +- home/vinzenz/zsh.nix | 2 ++ modules/gnome.nix | 8 +++----- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix index 19277807..1890000a 100644 --- a/home/vinzenz/configuration.nix +++ b/home/vinzenz/configuration.nix @@ -24,6 +24,8 @@ enable = true; enableZshIntegration = true; }; + + chromium.enable = true; }; home.packages = with pkgs; [ @@ -41,6 +43,12 @@ blanket vlc + + arduino + arduino-ide + arduino-cli + kicad + kikit ]; home.file."policy.json" = { diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index d1add794..dca318b3 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -47,7 +47,7 @@ "git.autofetch" = true; "git.path" = "${lib.getBin pkgs.git}/bin/git"; "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; + "explorer.excludeGitIgnore" = false; "markdown.extension.tableFormatter.normalizeIndentation" = true; "markdown.extension.toc.orderedList" = false; "rust-analyzer.checkOnSave.command" = "clippy"; diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index 02efbce6..8d3bb620 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -12,6 +12,8 @@ myos-rebuild-boot = "sudo nixos-rebuild boot --flake .# --show-trace --log-format internal-json -v |& ${pkgs.nix-output-monitor}/bin/nom --json"; myos-rebuild-switch = "sudo nixos-rebuild switch --flake .# --show-trace --log-format internal-json -v |& ${pkgs.nix-output-monitor}/bin/nom --json"; + s = "nix-shell -p"; + my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; my-ip4 = "ip addr show | grep 192"; deadnix = "nix run github:astro/deadnix -- "; diff --git a/modules/gnome.nix b/modules/gnome.nix index 669109c2..afbae7ee 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -57,11 +57,6 @@ # baobab # disk usage ]; - environment.systemPackages = with pkgs; [ - ghex - impression - ]; - # RDP connections networking.firewall.allowedTCPPorts = [ 3389 ]; @@ -76,6 +71,9 @@ pinta dconf-editor gpaste + ghex + impression + papers # graphical installer for flatpak apps gnome-software From 4aa418f56289db293935463fd728915e47564f08 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 1 May 2025 15:14:32 +0200 Subject: [PATCH 0260/1295] code domain --- hosts/hetzner-vpn2/nginx.nix | 59 +++++++++++++++++------------ hosts/ronja-pc/configuration.nix | 3 +- hosts/ronja-pc/hardware.nix | 27 +++++++++---- hosts/vinzenz-pc2/vscode-server.nix | 1 + 4 files changed, 56 insertions(+), 34 deletions(-) diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix index bd45ab73..ac37f259 100644 --- a/hosts/hetzner-vpn2/nginx.nix +++ b/hosts/hetzner-vpn2/nginx.nix @@ -1,4 +1,4 @@ -{ pkgs, inputs,... }: +{ pkgs, inputs, ... }: { security.acme = { acceptTerms = true; @@ -20,31 +20,40 @@ recommendedOptimisation = true; virtualHosts = - #let - # servicesDomain = "services.zerforschen.plus"; - # mkServiceConfig = host: port: { - # addSSL = true; - # enableACME = true; - # locations."/" = { - # proxyPass = "http://${host}:${toString port}/"; - # extraConfig = '' - # # bind to tailscale ip - # proxy_bind 100.88.118.60; - # # pam auth - # limit_except OPTIONS { - # auth_pam "Password Required"; - # auth_pam_service_name "nginx"; - # } - # ''; - # }; - # }; - # pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; - #in + let + servicesDomain = "services.zerforschen.plus"; + mkServiceConfig = + { host, port }: + { + addSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://${host}:${toString port}/"; + extraConfig = '' + # bind to tailscale ip + proxy_bind 100.88.118.60; + # pam auth + limit_except OPTIONS { + auth_pam "Password Required"; + auth_pam_service_name "nginx"; + } + ''; + }; + }; + pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; + in { - #"vscode.${servicesDomain}" = lib.mkMerge [ - # (mkServiceConfig pc2 8542) - # { locations."/".proxyWebsockets = true; } - #]; + "code.${servicesDomain}" = lib.mkMerge [ + (mkServiceConfig { + host = pc2; + port = 8542; + }) + { locations."/".proxyWebsockets = true; } + ]; + "view.${servicesDomain}" = mkServiceConfig { + host = pc2; + port = 1313; + }; "zerforschen.plus" = { addSSL = true; diff --git a/hosts/ronja-pc/configuration.nix b/hosts/ronja-pc/configuration.nix index 0d0a968d..0e9124d6 100644 --- a/hosts/ronja-pc/configuration.nix +++ b/hosts/ronja-pc/configuration.nix @@ -2,7 +2,8 @@ config, pkgs, ... -}: { +}: +{ # Configure keymap in X11 services.xserver.xkb = { layout = "de"; diff --git a/hosts/ronja-pc/hardware.nix b/hosts/ronja-pc/hardware.nix index 68f6e8da..f668726f 100644 --- a/hosts/ronja-pc/hardware.nix +++ b/hosts/ronja-pc/hardware.nix @@ -1,10 +1,18 @@ -{lib, ...}: { +{ lib, ... }: +{ boot = { - kernelModules = ["kvm-intel"]; - extraModulePackages = []; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; initrd = { - availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; - kernelModules = []; + availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + kernelModules = [ ]; }; }; @@ -12,18 +20,21 @@ "/" = { device = "/dev/disk/by-uuid/27eccf93-a79f-4fcb-8588-ec55d913508f"; fsType = "btrfs"; - options = ["subvol=@"]; + options = [ "subvol=@" ]; }; "/boot" = { device = "/dev/disk/by-uuid/85D4-43FC"; fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; }; swapDevices = [ - {device = "/dev/disk/by-uuid/bf9d19fb-499b-4bfb-b67d-131fa5bf8259";} + { device = "/dev/disk/by-uuid/bf9d19fb-499b-4bfb-b67d-131fa5bf8259"; } ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/hosts/vinzenz-pc2/vscode-server.nix b/hosts/vinzenz-pc2/vscode-server.nix index 6f8e2d4a..770a3473 100644 --- a/hosts/vinzenz-pc2/vscode-server.nix +++ b/hosts/vinzenz-pc2/vscode-server.nix @@ -21,6 +21,7 @@ 8543 8544 80 + 1313 ]; }; }; From 5f5c7267dc8c734eca2de87b5c0168523c9fa3b3 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 1 May 2025 17:32:04 +0200 Subject: [PATCH 0261/1295] revert code domain --- hosts/hetzner-vpn2/nginx.nix | 66 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix index ac37f259..ff00daa6 100644 --- a/hosts/hetzner-vpn2/nginx.nix +++ b/hosts/hetzner-vpn2/nginx.nix @@ -20,40 +20,40 @@ recommendedOptimisation = true; virtualHosts = - let - servicesDomain = "services.zerforschen.plus"; - mkServiceConfig = - { host, port }: - { - addSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://${host}:${toString port}/"; - extraConfig = '' - # bind to tailscale ip - proxy_bind 100.88.118.60; - # pam auth - limit_except OPTIONS { - auth_pam "Password Required"; - auth_pam_service_name "nginx"; - } - ''; - }; - }; - pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; - in + #let + # servicesDomain = "services.zerforschen.plus"; + # mkServiceConfig = + # { host, port }: + # { + # addSSL = true; + # enableACME = true; + # locations."/" = { + # proxyPass = "http://${host}:${toString port}/"; + # extraConfig = '' + # # bind to tailscale ip + # proxy_bind 100.88.118.60; + # # pam auth + # limit_except OPTIONS { + # auth_pam "Password Required"; + # auth_pam_service_name "nginx"; + # } + # ''; + # }; + # }; + # pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; + #in { - "code.${servicesDomain}" = lib.mkMerge [ - (mkServiceConfig { - host = pc2; - port = 8542; - }) - { locations."/".proxyWebsockets = true; } - ]; - "view.${servicesDomain}" = mkServiceConfig { - host = pc2; - port = 1313; - }; + #"code.${servicesDomain}" = lib.mkMerge [ + # (mkServiceConfig { + # host = pc2; + # port = 8542; + # }) + # { locations."/".proxyWebsockets = true; } + #]; + #"view.${servicesDomain}" = mkServiceConfig { + # host = pc2; + # port = 1313; + #}; "zerforschen.plus" = { addSSL = true; From 01f5308c73135d7d1bb7dbab77145e5b49210cbc Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 1 May 2025 22:19:50 +0200 Subject: [PATCH 0262/1295] add unstable packages --- flake.lock | 17 +++++++++++++++++ flake.nix | 29 ++++++++++++++++++++++------- home/vinzenz/configuration.nix | 2 ++ 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index 3b4ce176..84dee85b 100644 --- a/flake.lock +++ b/flake.lock @@ -165,12 +165,29 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1746061036, + "narHash": "sha256-OxYwCGJf9VJ2KnUO+w/hVJVTjOgscdDg/lPv8Eus07Y=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3afd19146cac33ed242fc0fc87481c67c758a59e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", "lix-module": "lix-module", "niri": "niri", "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", "zerforschen-plus": "zerforschen-plus" } }, diff --git a/flake.nix b/flake.nix index 7d830080..566b5e79 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,8 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + home-manager = { url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; @@ -32,6 +34,7 @@ lix-module, niri, zerforschen-plus, + nixpkgs-unstable, }: let devices = { @@ -48,14 +51,15 @@ ]; forDevice = f: nixpkgs.lib.mapAttrs f devices; in - { + rec { nixosConfigurations = forDevice ( device: system: - nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - }; + let specialArgs = { + inherit inputs device; + pkgs-unstable = nixpkgs-unstable.legacyPackages."${system}"; + }; + in nixpkgs.lib.nixosSystem { + inherit system specialArgs; modules = [ lix-module.nixosModules.default @@ -69,10 +73,12 @@ ./hosts/${device}/hardware.nix ./hosts/${device}/imports.nix ./hosts/${device}/configuration.nix + + { nixpkgs.overlays = [ overlays.unstable-packages ]; } ] ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ home-manager.nixosModules.home-manager - { home-manager.extraSpecialArgs = { inherit device; }; } + { home-manager.extraSpecialArgs = specialArgs; } ./modules/home-manager.nix ./modules/i18n.nix @@ -83,6 +89,15 @@ } ); + overlays = { + unstable-packages = final: prev: { + unstable = import nixpkgs-unstable { + system = prev.system; + config = prev.config; + }; + }; + }; + formatter = { x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.nixfmt-rfc-style; diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix index 1890000a..8da0974a 100644 --- a/home/vinzenz/configuration.nix +++ b/home/vinzenz/configuration.nix @@ -49,6 +49,8 @@ arduino-cli kicad kikit + + unstable.ut1999 ]; home.file."policy.json" = { From 8394652443ddd6912e368390619b361a9a46e113 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 2 May 2025 12:36:36 +0200 Subject: [PATCH 0263/1295] update flake --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 84dee85b..88e914e8 100644 --- a/flake.lock +++ b/flake.lock @@ -103,11 +103,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1745657526, - "narHash": "sha256-Mfw6ELZ9M7TiVu/xkDGlAmWJZCFP87QGfpwUPreQCKo=", + "lastModified": 1746125750, + "narHash": "sha256-RCIBY3OxO2G9+moEvZV4WGE3DblRrM96xjiaZbAQRO0=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "03511f07e6357067d2d0a54f8752475c2bdd9629", + "rev": "bb8dc8510f335ed9d52bb00308935b56cd142f32", "type": "github" }, "original": { @@ -136,11 +136,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1745653128, - "narHash": "sha256-32HDXJOw9a3O23hAD5km7alRMM5CBmnj0+/1rdDVjhk=", + "lastModified": 1746122794, + "narHash": "sha256-Cydn06ne11atToF/d6no3HWXwZd4aaTZXBZD1sdCVek=", "owner": "YaLTeR", "repo": "niri", - "rev": "a99a0b2492722d2c254b7bdf172d388123de8996", + "rev": "eb590c53460c24a23024db192a3132687aabc06d", "type": "github" }, "original": { @@ -151,11 +151,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1745487689, - "narHash": "sha256-FQoi3R0NjQeBAsEOo49b5tbDPcJSMWc3QhhaIi9eddw=", + "lastModified": 1746055187, + "narHash": "sha256-3dqArYSMP9hM7Qpy5YWhnSjiqniSaT2uc5h2Po7tmg0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5630cf13cceac06cefe9fc607e8dfa8fb342dde3", + "rev": "3e362ce63e16b9572d8c2297c04f7c19ab6725a5", "type": "github" }, "original": { @@ -226,11 +226,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1745372360, - "narHash": "sha256-5DX9lYmEbkdANCzME2v3coV0EnWOhS7NsTlGBQuqmjM=", + "lastModified": 1745730655, + "narHash": "sha256-Tdsw5lD/XM8i1GnQr7ombqnEaCpt/voPs2AbjuYBbjI=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "c31679aa41966ee9272bb240703755cb1e7c72e3", + "rev": "56a681bfecc5831f41f8eb0ec8c7e96c6b277153", "type": "github" }, "original": { From 24a3148044021eff2a01466c576efbbeaddc66a1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 10 May 2025 13:24:08 +0200 Subject: [PATCH 0264/1295] add servicepoint tools --- flake.lock | 101 +++++++++++++++++++++++++++++++++ flake.nix | 49 +++++++++++++--- home/vinzenz/configuration.nix | 3 + 3 files changed, 146 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index 88e914e8..dc2dd755 100644 --- a/flake.lock +++ b/flake.lock @@ -89,6 +89,26 @@ "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0-3.tar.gz" } }, + "naersk": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745925850, + "narHash": "sha256-cyAAMal0aPrlb1NgzMxZqeN1mAJ2pJseDhm2m6Um8T0=", + "owner": "nix-community", + "repo": "naersk", + "rev": "38bc60bbc157ae266d4a0c96671c6c742ee17a5f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, "niri": { "inputs": { "niri-stable": "niri-stable", @@ -149,6 +169,36 @@ "type": "github" } }, + "nix-filter": { + "locked": { + "lastModified": 1731533336, + "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, + "nix-filter_2": { + "locked": { + "lastModified": 1731533336, + "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1746055187, @@ -185,12 +235,63 @@ "inputs": { "home-manager": "home-manager", "lix-module": "lix-module", + "naersk": "naersk", "niri": "niri", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", + "servicepoint-cli": "servicepoint-cli", + "servicepoint-simulator": "servicepoint-simulator", "zerforschen-plus": "zerforschen-plus" } }, + "servicepoint-cli": { + "inputs": { + "naersk": [ + "naersk" + ], + "nix-filter": "nix-filter", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746866001, + "narHash": "sha256-6jqzJyBRXdwmd5SKIJTfbJ5pRVNshVNPzCtFqobRgTE=", + "ref": "refs/heads/main", + "rev": "e9d3b32f57674e06db1ebf0762bfd736e1f5ea31", + "revCount": 41, + "type": "git", + "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git" + }, + "original": { + "type": "git", + "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git" + } + }, + "servicepoint-simulator": { + "inputs": { + "naersk": [ + "naersk" + ], + "nix-filter": "nix-filter_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746268672, + "narHash": "sha256-IIgxxA5Fk1iLwXiCGbCLrVdduTDAA54DJ2gnfvCOMLQ=", + "ref": "refs/heads/main", + "rev": "33301a51bf501a6886ec2e1c6ad8111247141d2f", + "revCount": 108, + "type": "git", + "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git" + }, + "original": { + "type": "git", + "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index 566b5e79..75f905ae 100644 --- a/flake.nix +++ b/flake.nix @@ -24,6 +24,23 @@ url = "git+https://git.berlin.ccc.de/vinzenz/zerforschen.plus"; inputs.nixpkgs.follows = "nixpkgs"; }; + + naersk = { + url = "github:nix-community/naersk"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + servicepoint-cli = { + url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.naersk.follows = "naersk"; + }; + + servicepoint-simulator = { + url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.naersk.follows = "naersk"; + }; }; outputs = @@ -35,6 +52,9 @@ niri, zerforschen-plus, nixpkgs-unstable, + servicepoint-cli, + servicepoint-simulator, + naersk, }: let devices = { @@ -54,11 +74,12 @@ rec { nixosConfigurations = forDevice ( device: system: - let specialArgs = { - inherit inputs device; - pkgs-unstable = nixpkgs-unstable.legacyPackages."${system}"; - }; - in nixpkgs.lib.nixosSystem { + let + specialArgs = { + inherit inputs device; + }; + in + nixpkgs.lib.nixosSystem { inherit system specialArgs; modules = [ @@ -74,7 +95,11 @@ ./hosts/${device}/imports.nix ./hosts/${device}/configuration.nix - { nixpkgs.overlays = [ overlays.unstable-packages ]; } + { + nixpkgs.overlays = [ + overlays.unstable-packages + ]; + } ] ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ home-manager.nixosModules.home-manager @@ -84,7 +109,12 @@ ./modules/i18n.nix niri.nixosModules.niri - { nixpkgs.overlays = [ niri.overlays.niri ]; } + { + nixpkgs.overlays = [ + niri.overlays.niri + overlays.servicepoint-packages + ]; + } ]); } ); @@ -96,6 +126,11 @@ config = prev.config; }; }; + servicepoint-packages = final: prev: { + servicepoint-cli = servicepoint-cli.legacyPackages."${prev.system}".servicepoint-cli; + servicepoint-simulator = + servicepoint-simulator.legacyPackages."${prev.system}".servicepoint-simulator; + }; }; formatter = { diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix index 8da0974a..d2c79a89 100644 --- a/home/vinzenz/configuration.nix +++ b/home/vinzenz/configuration.nix @@ -51,6 +51,9 @@ kikit unstable.ut1999 + + servicepoint-cli + servicepoint-simulator ]; home.file."policy.json" = { From a2cdba3c909fda1f4b49b4adef7000392d7fb6b3 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 10 May 2025 14:06:50 +0200 Subject: [PATCH 0265/1295] nix flake update --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index dc2dd755..8aa586bf 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1745557122, - "narHash": "sha256-eqSo9ugzsqhFgaDFYUZj943nurlX4L6f+AW0skJ4W+M=", + "lastModified": 1746171682, + "narHash": "sha256-EyXUNSa+H+YvGVuQJP1nZskXAowxKYp79RNUsNdQTj4=", "owner": "nix-community", "repo": "home-manager", - "rev": "dd26f75fb4ec1c731d4b1396eaf4439ce40a91c1", + "rev": "50eee705bbdbac942074a8c120e8194185633675", "type": "github" }, "original": { @@ -123,11 +123,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1746125750, - "narHash": "sha256-RCIBY3OxO2G9+moEvZV4WGE3DblRrM96xjiaZbAQRO0=", + "lastModified": 1746142190, + "narHash": "sha256-t36K3TWLMRWoGyjYyo+H8bBquDcp4orZqNZVagWNjwY=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "bb8dc8510f335ed9d52bb00308935b56cd142f32", + "rev": "af701c1c16c289b1b14f333d844b4f756308d244", "type": "github" }, "original": { @@ -156,11 +156,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1746122794, - "narHash": "sha256-Cydn06ne11atToF/d6no3HWXwZd4aaTZXBZD1sdCVek=", + "lastModified": 1746124654, + "narHash": "sha256-LmhkAt2KLvf8lp+kEUQuTFmmv7iXO8IkwwSaPasfXJw=", "owner": "YaLTeR", "repo": "niri", - "rev": "eb590c53460c24a23024db192a3132687aabc06d", + "rev": "6c9705dd4b2eaba25f024d1a3efd7943fd393632", "type": "github" }, "original": { @@ -201,11 +201,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1746055187, - "narHash": "sha256-3dqArYSMP9hM7Qpy5YWhnSjiqniSaT2uc5h2Po7tmg0=", + "lastModified": 1746557022, + "narHash": "sha256-QkNoyEf6TbaTW5UZYX0OkwIJ/ZMeKSSoOMnSDPQuol0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3e362ce63e16b9572d8c2297c04f7c19ab6725a5", + "rev": "1d3aeb5a193b9ff13f63f4d9cc169fb88129f860", "type": "github" }, "original": { @@ -217,11 +217,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1746061036, - "narHash": "sha256-OxYwCGJf9VJ2KnUO+w/hVJVTjOgscdDg/lPv8Eus07Y=", + "lastModified": 1746576598, + "narHash": "sha256-FshoQvr6Aor5SnORVvh/ZdJ1Sa2U4ZrIMwKBX5k2wu0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3afd19146cac33ed242fc0fc87481c67c758a59e", + "rev": "b3582c75c7f21ce0b429898980eddbbf05c68e55", "type": "github" }, "original": { From 889bff482c77b4f0ec2da8d9723c3aa83a8bf9b4 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 18 May 2025 10:05:23 +0200 Subject: [PATCH 0266/1295] change vscode server bind --- hosts/vinzenz-pc2/vscode-server.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/vinzenz-pc2/vscode-server.nix b/hosts/vinzenz-pc2/vscode-server.nix index 770a3473..74169725 100644 --- a/hosts/vinzenz-pc2/vscode-server.nix +++ b/hosts/vinzenz-pc2/vscode-server.nix @@ -4,7 +4,7 @@ enable = true; telemetryLevel = "off"; port = 8542; - host = "100.125.93.127"; # tailscale + host = "127.0.0.1"; withoutConnectionToken = true; extraPackages = with pkgs; [ nodejs From b6ad841847674cc38cae536f41083fd525bf90f8 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 18 May 2025 11:03:25 +0200 Subject: [PATCH 0267/1295] configure vscode nix formatting --- home/ronja/vscode.nix | 102 ++++++++++++++++++++------------------ home/vinzenz/vscode.nix | 107 ++++++++++++++++++++++------------------ 2 files changed, 113 insertions(+), 96 deletions(-) diff --git a/home/ronja/vscode.nix b/home/ronja/vscode.nix index 79ab666d..7b37dd6c 100644 --- a/home/ronja/vscode.nix +++ b/home/ronja/vscode.nix @@ -1,57 +1,65 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { - config.programs.vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - bbenoist.nix - ms-python.python - kamadorueda.alejandra - editorconfig.editorconfig - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - rust-lang.rust-analyzer - tamasfe.even-better-toml - llvm-vs-code-extensions.vscode-clangd - mkhl.direnv - vadimcn.vscode-lldb - ms-dotnettools.csharp - ms-vscode-remote.remote-ssh - ]; - userSettings = { - "files.autoSave" = "afterDelay"; - "files.autoSaveWhenNoErrors" = true; - "files.autoSaveWorkspaceFilesOnly" = true; + config = { + home.sessionVariables.NIXOS_OZONE_WL = "1"; + programs.vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + jnoortheen.nix-ide + ms-python.python + editorconfig.editorconfig + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + rust-lang.rust-analyzer + tamasfe.even-better-toml + llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + vadimcn.vscode-lldb + ms-dotnettools.csharp + ms-vscode-remote.remote-ssh + ]; + userSettings = { + "files.autoSave" = "afterDelay"; + "files.autoSaveWhenNoErrors" = true; + "files.autoSaveWorkspaceFilesOnly" = true; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; - "workbench.startupEditor" = "readme"; - "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; - "update.mode" = "none"; - "extensions.autoUpdate" = false; - "extensions.autoCheckUpdates" = false; + "update.mode" = "none"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; - "git.autofetch" = true; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "rust-analyzer.checkOnSave.command" = "clippy"; + "git.autofetch" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "rust-analyzer.checkOnSave.command" = "clippy"; - "\[makefile\]" = { - "editor.insertSpaces" = false; - "editor.detectIndentation" = false; + "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt"; + + "\[makefile\]" = { + "editor.insertSpaces" = false; + "editor.detectIndentation" = false; + }; + + "\[nix\]" = { + "editor.formatOnSave" = false; + }; }; }; }; diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index dca318b3..15f747ea 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -1,60 +1,69 @@ { pkgs, lib, ... }: { - config.programs.vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - bbenoist.nix - ms-python.python - kamadorueda.alejandra - editorconfig.editorconfig - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - rust-lang.rust-analyzer - tamasfe.even-better-toml - llvm-vs-code-extensions.vscode-clangd - mkhl.direnv - vadimcn.vscode-lldb - ms-dotnettools.csharp - ms-vscode-remote.remote-ssh - RoweWilsonFrederiskHolme.wikitext - davidanson.vscode-markdownlint - ]; - userSettings = { - "files.autoSave" = "afterDelay"; - "files.autoSaveWhenNoErrors" = true; - "files.autoSaveWorkspaceFilesOnly" = true; + config = { + home.sessionVariables.NIXOS_OZONE_WL = "1"; + programs.vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + jnoortheen.nix-ide + ms-python.python + editorconfig.editorconfig + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + rust-lang.rust-analyzer + tamasfe.even-better-toml + llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + vadimcn.vscode-lldb + ms-dotnettools.csharp + ms-vscode-remote.remote-ssh + RoweWilsonFrederiskHolme.wikitext + davidanson.vscode-markdownlint + ]; + userSettings = { + "files.autoSave" = "afterDelay"; + "files.autoSaveWhenNoErrors" = true; + "files.autoSaveWorkspaceFilesOnly" = true; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; - "workbench.startupEditor" = "readme"; - "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; - "update.mode" = "none"; - "extensions.autoUpdate" = false; - "extensions.autoCheckUpdates" = false; + "update.mode" = "none"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; - "git.autofetch" = true; - "git.path" = "${lib.getBin pkgs.git}/bin/git"; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = false; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "rust-analyzer.checkOnSave.command" = "clippy"; + "git.autofetch" = true; + "git.path" = "${lib.getBin pkgs.git}/bin/git"; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = false; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; - "\[makefile\]" = { - "editor.insertSpaces" = false; - "editor.detectIndentation" = false; + "rust-analyzer.checkOnSave.command" = "clippy"; + + "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt"; + + "\[makefile\]" = { + "editor.insertSpaces" = false; + "editor.detectIndentation" = false; + }; + + "\[nix\]" = { + "editor.formatOnSave" = false; + }; }; }; }; From 63ba09cb0dd5f50234f3f67f1e68c4653cf4997d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 18 May 2025 11:03:34 +0200 Subject: [PATCH 0268/1295] fix intellij file system watcher --- home/vinzenz/configuration.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix index d2c79a89..8bcc7be0 100644 --- a/home/vinzenz/configuration.nix +++ b/home/vinzenz/configuration.nix @@ -56,8 +56,11 @@ servicepoint-simulator ]; - home.file."policy.json" = { - target = ".config/containers/policy.json"; - text = builtins.readFile ./.config/containers/policy.json; + home.file = { + "policy.json" = { + target = ".config/containers/policy.json"; + text = builtins.readFile ./.config/containers/policy.json; + }; + "idea.properties".text = "idea.filewatcher.executable.path = ${pkgs.fsnotifier}/bin/fsnotifier"; }; } From f71f9f50fb2d7f6411475b3eafad3786fc4851ce Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 28 May 2025 01:11:44 +0200 Subject: [PATCH 0269/1295] update zerforschen.plus --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 8aa586bf..2b1d8e04 100644 --- a/flake.lock +++ b/flake.lock @@ -347,11 +347,11 @@ ] }, "locked": { - "lastModified": 1745527190, - "narHash": "sha256-5Dve5nrUc1TJkWbZ0iKs4VK3GFSXn8SmdT05MsvFblQ=", + "lastModified": 1748387402, + "narHash": "sha256-5hae2UmVd42S/U6vp0+JQmjkgJrdKkp4vKM9+oEoQDQ=", "ref": "refs/heads/main", - "rev": "7411c96c0610c5d71235f84e80e58512a69a1a46", - "revCount": 13, + "rev": "fe4068c9ec1a8f4184d632d47916580edc2f9c17", + "revCount": 15, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From 1e91b4ba76ac933154bb46d3b1a75484ed7b8c2b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 29 May 2025 16:06:22 +0200 Subject: [PATCH 0270/1295] upgrade to 25.05, fix deprecation warnings, remove unfree extensions --- flake.lock | 36 ++++++------ flake.nix | 6 +- home/ronja/default.nix | 4 -- home/ronja/vscode.nix | 94 +++++++++++++++--------------- home/vinzenz/configuration.nix | 5 ++ home/vinzenz/default.nix | 1 - home/vinzenz/vscode.nix | 100 ++++++++++++++++---------------- home/vinzenz/zsh.nix | 4 +- modules/desktop-environment.nix | 18 +++--- 9 files changed, 137 insertions(+), 131 deletions(-) diff --git a/flake.lock b/flake.lock index 2b1d8e04..dc9bd6fc 100644 --- a/flake.lock +++ b/flake.lock @@ -40,16 +40,16 @@ ] }, "locked": { - "lastModified": 1746171682, - "narHash": "sha256-EyXUNSa+H+YvGVuQJP1nZskXAowxKYp79RNUsNdQTj4=", + "lastModified": 1748487945, + "narHash": "sha256-e9zc/rHdoH9i+sFFhhQiKoF6IuD+T2rB/nUyPaO7CCg=", "owner": "nix-community", "repo": "home-manager", - "rev": "50eee705bbdbac942074a8c120e8194185633675", + "rev": "0d13ea58d565d3c1c1468ddae1f623316dc395d9", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.11", + "ref": "release-25.05", "repo": "home-manager", "type": "github" } @@ -57,15 +57,15 @@ "lix": { "flake": false, "locked": { - "lastModified": 1737234286, - "narHash": "sha256-pgDJZjj4jpzkFxsqBTI/9Yb0n3gW+DvDtuv9SwQZZcs=", - "rev": "079528098f5998ba13c88821a2eca1005c1695de", + "lastModified": 1746827285, + "narHash": "sha256-hsFe4Tsqqg4l+FfQWphDtjC79WzNCZbEFhHI8j2KJzw=", + "rev": "47aad376c87e2e65967f17099277428e4b3f8e5a", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/079528098f5998ba13c88821a2eca1005c1695de.tar.gz?rev=079528098f5998ba13c88821a2eca1005c1695de" + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/47aad376c87e2e65967f17099277428e4b3f8e5a.tar.gz?rev=47aad376c87e2e65967f17099277428e4b3f8e5a" }, "original": { "type": "tarball", - "url": "https://git.lix.systems/lix-project/lix/archive/release-2.92.tar.gz" + "url": "https://git.lix.systems/lix-project/lix/archive/2.93.0.tar.gz" } }, "lix-module": { @@ -78,15 +78,15 @@ ] }, "locked": { - "lastModified": 1742943028, - "narHash": "sha256-fprwZKE1uMzO9tiWWOrmLWBW3GPkMayQfb0xOvVFIno=", - "rev": "868d97695bab9d21f6070b03957bcace249fbe3c", + "lastModified": 1746838955, + "narHash": "sha256-11R4K3iAx4tLXjUs+hQ5K90JwDABD/XHhsM9nkeS5N8=", + "rev": "cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/868d97695bab9d21f6070b03957bcace249fbe3c.tar.gz?rev=868d97695bab9d21f6070b03957bcace249fbe3c" + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc.tar.gz?rev=cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc" }, "original": { "type": "tarball", - "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0-3.tar.gz" + "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz" } }, "naersk": { @@ -201,16 +201,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1746557022, - "narHash": "sha256-QkNoyEf6TbaTW5UZYX0OkwIJ/ZMeKSSoOMnSDPQuol0=", + "lastModified": 1748302896, + "narHash": "sha256-ixMT0a8mM091vSswlTORZj93WQAJsRNmEvqLL+qwTFM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1d3aeb5a193b9ff13f63f4d9cc169fb88129f860", + "rev": "7848cd8c982f7740edf76ddb3b43d234cb80fc4d", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.11", + "ref": "nixos-25.05", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 75f905ae..bafecdc1 100644 --- a/flake.nix +++ b/flake.nix @@ -1,16 +1,16 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; home-manager = { - url = "github:nix-community/home-manager/release-24.11"; + url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; lix-module = { - url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0-3.tar.gz"; + url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/home/ronja/default.nix b/home/ronja/default.nix index 46aa8489..8ce9b92b 100644 --- a/home/ronja/default.nix +++ b/home/ronja/default.nix @@ -20,9 +20,5 @@ ./configuration.nix ./vscode.nix ]; - - allowedUnfreePackages = [ - "vscode-extension-ms-vscode-remote-remote-ssh" - ]; }; } diff --git a/home/ronja/vscode.nix b/home/ronja/vscode.nix index 7b37dd6c..5a4ac7f1 100644 --- a/home/ronja/vscode.nix +++ b/home/ronja/vscode.nix @@ -5,60 +5,62 @@ programs.vscode = { enable = true; package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - jnoortheen.nix-ide - ms-python.python - editorconfig.editorconfig - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - rust-lang.rust-analyzer - tamasfe.even-better-toml - llvm-vs-code-extensions.vscode-clangd - mkhl.direnv - vadimcn.vscode-lldb - ms-dotnettools.csharp - ms-vscode-remote.remote-ssh - ]; - userSettings = { - "files.autoSave" = "afterDelay"; - "files.autoSaveWhenNoErrors" = true; - "files.autoSaveWorkspaceFilesOnly" = true; + profiles.default = { + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + jnoortheen.nix-ide + ms-python.python + editorconfig.editorconfig + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + rust-lang.rust-analyzer + tamasfe.even-better-toml + llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + vadimcn.vscode-lldb + # ms-dotnettools.csharp + # ms-vscode-remote.remote-ssh + ]; + userSettings = { + "files.autoSave" = "afterDelay"; + "files.autoSaveWhenNoErrors" = true; + "files.autoSaveWorkspaceFilesOnly" = true; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; - "workbench.startupEditor" = "readme"; - "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; - "update.mode" = "none"; - "extensions.autoUpdate" = false; - "extensions.autoCheckUpdates" = false; + "update.mode" = "none"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; - "git.autofetch" = true; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "rust-analyzer.checkOnSave.command" = "clippy"; + "git.autofetch" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "rust-analyzer.checkOnSave.command" = "clippy"; - "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt"; + "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt"; - "\[makefile\]" = { - "editor.insertSpaces" = false; - "editor.detectIndentation" = false; - }; + "\[makefile\]" = { + "editor.insertSpaces" = false; + "editor.detectIndentation" = false; + }; - "\[nix\]" = { - "editor.formatOnSave" = false; + "\[nix\]" = { + "editor.formatOnSave" = false; + }; }; }; }; diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix index 8bcc7be0..c67ce487 100644 --- a/home/vinzenz/configuration.nix +++ b/home/vinzenz/configuration.nix @@ -8,6 +8,7 @@ direnv = { enable = true; nix-direnv.enable = true; + enableZshIntegration = true; }; eza = { @@ -44,6 +45,8 @@ blanket vlc + ptyxis + arduino arduino-ide arduino-cli @@ -54,6 +57,8 @@ servicepoint-cli servicepoint-simulator + + anydesk ]; home.file = { diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 59c47471..c1471221 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -37,7 +37,6 @@ ]; allowedUnfreePackages = [ - "vscode-extension-ms-vscode-remote-remote-ssh" "insync" "insync-pkg" diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index 15f747ea..bb48bd7e 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -5,64 +5,66 @@ programs.vscode = { enable = true; package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - jnoortheen.nix-ide - ms-python.python - editorconfig.editorconfig - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - rust-lang.rust-analyzer - tamasfe.even-better-toml - llvm-vs-code-extensions.vscode-clangd - mkhl.direnv - vadimcn.vscode-lldb - ms-dotnettools.csharp - ms-vscode-remote.remote-ssh - RoweWilsonFrederiskHolme.wikitext - davidanson.vscode-markdownlint - ]; - userSettings = { - "files.autoSave" = "afterDelay"; - "files.autoSaveWhenNoErrors" = true; - "files.autoSaveWorkspaceFilesOnly" = true; + profiles.default = { + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + jnoortheen.nix-ide + ms-python.python + editorconfig.editorconfig + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + rust-lang.rust-analyzer + tamasfe.even-better-toml + llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + vadimcn.vscode-lldb + # ms-dotnettools.csharp + # ms-vscode-remote.remote-ssh + RoweWilsonFrederiskHolme.wikitext + davidanson.vscode-markdownlint + ]; + userSettings = { + "files.autoSave" = "afterDelay"; + "files.autoSaveWhenNoErrors" = true; + "files.autoSaveWorkspaceFilesOnly" = true; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; - "workbench.startupEditor" = "readme"; - "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; - "update.mode" = "none"; - "extensions.autoUpdate" = false; - "extensions.autoCheckUpdates" = false; + "update.mode" = "none"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; - "git.autofetch" = true; - "git.path" = "${lib.getBin pkgs.git}/bin/git"; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = false; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; + "git.autofetch" = true; + "git.path" = "${lib.getBin pkgs.git}/bin/git"; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = false; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; - "rust-analyzer.checkOnSave.command" = "clippy"; + "rust-analyzer.checkOnSave.command" = "clippy"; - "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt"; + "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt"; - "\[makefile\]" = { - "editor.insertSpaces" = false; - "editor.detectIndentation" = false; - }; + "\[makefile\]" = { + "editor.insertSpaces" = false; + "editor.detectIndentation" = false; + }; - "\[nix\]" = { - "editor.formatOnSave" = false; + "\[nix\]" = { + "editor.formatOnSave" = false; + }; }; }; }; diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index 8d3bb620..ba89d8ed 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -1,8 +1,8 @@ { config, pkgs, ... }: { config.programs.zsh = { - initExtra = '' - eval "$(direnv hook zsh)"; + initContent = '' + # eval "$(direnv hook zsh)"; export PATH=$PATH:/home/vinzenz/.cargo/bin ''; diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index afb52552..ffb00eb3 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -13,14 +13,16 @@ }; # Enable sound with pipewire. - hardware.pulseaudio.enable = false; security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - #jack.enable = true; + services = { + pulseaudio.enable = false; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + #jack.enable = true; + }; }; programs = { @@ -100,7 +102,7 @@ enableDefaultPackages = true; fontconfig.defaultFonts.monospace = [ "FiraCode Nerd Font" ]; packages = with pkgs; [ - (nerdfonts.override { fonts = [ "FiraCode" ]; }) + nerd-fonts.fira-code roboto-mono recursive ]; From f9b79cf4a00eb84499f292220363060867a128ae Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 1 Jun 2025 09:41:05 +0200 Subject: [PATCH 0271/1295] i trust myself --- home/vinzenz/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index c1471221..5b7e80d7 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -22,6 +22,8 @@ autoSubUidGidRange = true; }; + nix.settings.trusted-users = [ "vinzenz" ]; + home-manager.users.vinzenz.imports = [ ./configuration.nix ./editorconfig.nix From 3d27f554015ece713fa22fe829d711b430d6bbda Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 1 Jun 2025 10:22:07 +0200 Subject: [PATCH 0272/1295] 25.05 fixes --- flake.lock | 6 +++--- home/vinzenz/configuration.nix | 2 +- home/vinzenz/niri.nix | 3 ++- hosts/vinzenz-pc2/vscode-server.nix | 1 + modules/amd-graphics.nix | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index dc9bd6fc..d503e7b0 100644 --- a/flake.lock +++ b/flake.lock @@ -217,11 +217,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1746576598, - "narHash": "sha256-FshoQvr6Aor5SnORVvh/ZdJ1Sa2U4ZrIMwKBX5k2wu0=", + "lastModified": 1748662220, + "narHash": "sha256-7gGa49iB9nCnFk4h/g9zwjlQAyjtpgcFkODjcOQS0Es=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b3582c75c7f21ce0b429898980eddbbf05c68e55", + "rev": "59138c7667b7970d205d6a05a8bfa2d78caa3643", "type": "github" }, "original": { diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix index c67ce487..a7b8fb4d 100644 --- a/home/vinzenz/configuration.nix +++ b/home/vinzenz/configuration.nix @@ -53,7 +53,7 @@ kicad kikit - unstable.ut1999 + ut1999 servicepoint-cli servicepoint-simulator diff --git a/home/vinzenz/niri.nix b/home/vinzenz/niri.nix index 9c532ee8..7c90a935 100644 --- a/home/vinzenz/niri.nix +++ b/home/vinzenz/niri.nix @@ -21,7 +21,8 @@ services = { kdeconnect = { enable = true; - indicator = true; + # this still shows up in gnome session starting with 25.05 + # indicator = true; }; mako = { enable = true; diff --git a/hosts/vinzenz-pc2/vscode-server.nix b/hosts/vinzenz-pc2/vscode-server.nix index 74169725..d1164f13 100644 --- a/hosts/vinzenz-pc2/vscode-server.nix +++ b/hosts/vinzenz-pc2/vscode-server.nix @@ -2,6 +2,7 @@ { services.openvscode-server = { enable = true; + package = pkgs.unstable.openvscode-server; telemetryLevel = "off"; port = 8542; host = "127.0.0.1"; diff --git a/modules/amd-graphics.nix b/modules/amd-graphics.nix index 4ae15acb..d36b42db 100644 --- a/modules/amd-graphics.nix +++ b/modules/amd-graphics.nix @@ -11,7 +11,7 @@ amdvlk = { # TODO: this creates black borders around GNOME apps # enable = true; - support32Bit.enable = config.hardware.graphics.enable32Bit; + # support32Bit.enable = config.hardware.graphics.enable32Bit; }; }; }; From 62307246d54f49444b6dbc535be0dddf5f85d35d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 1 Jun 2025 13:47:59 +0200 Subject: [PATCH 0273/1295] nil --- home/vinzenz/vscode.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index bb48bd7e..58d31b68 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -56,6 +56,15 @@ "rust-analyzer.checkOnSave.command" = "clippy"; "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt"; + "nix.enableLanguageServer" = true; + "nix.serverPath" = "${lib.getBin pkgs.nil}/bin/nil"; + "nix.serverSettings" = { + "nil" = { + "formatting" = { + "command" = [ "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt" ]; + }; + }; + }; "\[makefile\]" = { "editor.insertSpaces" = false; From 3b16163af92097228353794af1221993b6273ee4 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 1 Jun 2025 13:49:03 +0200 Subject: [PATCH 0274/1295] update zerforschen.plus --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index d503e7b0..c7d16fd9 100644 --- a/flake.lock +++ b/flake.lock @@ -347,11 +347,11 @@ ] }, "locked": { - "lastModified": 1748387402, - "narHash": "sha256-5hae2UmVd42S/U6vp0+JQmjkgJrdKkp4vKM9+oEoQDQ=", + "lastModified": 1748777873, + "narHash": "sha256-sDyp1LeP+BOiG4AvpX28bPPxLUpXwlredK+uqxguTPs=", "ref": "refs/heads/main", - "rev": "fe4068c9ec1a8f4184d632d47916580edc2f9c17", - "revCount": 15, + "rev": "da2b589ad01d79a02985511fd5dce31731abad5a", + "revCount": 17, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From 9ddcc7511dc1753c72c4b9f508e543b3790e8c00 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 6 Jun 2025 17:37:51 +0200 Subject: [PATCH 0275/1295] add builder to ssh config --- home/vinzenz/ssh.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/home/vinzenz/ssh.nix b/home/vinzenz/ssh.nix index 260185fc..51212708 100644 --- a/home/vinzenz/ssh.nix +++ b/home/vinzenz/ssh.nix @@ -50,6 +50,10 @@ hostname = "avd.club.berlin.ccc.de"; user = "vinzenz"; }; + "builder.berlin.ccc.de" = { + hostname = "195.160.172.36"; + user = "root"; + }; }; }; } From 6ac5b12bc357f695d1d83e05070521098620cbcc Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 6 Jun 2025 17:40:13 +0200 Subject: [PATCH 0276/1295] nix flake update --- flake.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index c7d16fd9..f4724d7f 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1748487945, - "narHash": "sha256-e9zc/rHdoH9i+sFFhhQiKoF6IuD+T2rB/nUyPaO7CCg=", + "lastModified": 1749154018, + "narHash": "sha256-gjN3j7joRvT3a8Zgcylnd4NFsnXeDBumqiu4HmY1RIg=", "owner": "nix-community", "repo": "home-manager", - "rev": "0d13ea58d565d3c1c1468ddae1f623316dc395d9", + "rev": "7aae0ee71a17b19708b93b3ed448a1a0952bf111", "type": "github" }, "original": { @@ -123,11 +123,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1746142190, - "narHash": "sha256-t36K3TWLMRWoGyjYyo+H8bBquDcp4orZqNZVagWNjwY=", + "lastModified": 1749144707, + "narHash": "sha256-JcSmySCB3pOtzeWMaEksZgaiNedEDIC6qyBezkK+92Q=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "af701c1c16c289b1b14f333d844b4f756308d244", + "rev": "32d49ef427be377c82d32ce74ff3082c2c992199", "type": "github" }, "original": { @@ -156,11 +156,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1746124654, - "narHash": "sha256-LmhkAt2KLvf8lp+kEUQuTFmmv7iXO8IkwwSaPasfXJw=", + "lastModified": 1749112952, + "narHash": "sha256-ajI1cXa2AgdZSELvlVaQZd0XMi4eM8H3Ys0Ek8a/roI=", "owner": "YaLTeR", "repo": "niri", - "rev": "6c9705dd4b2eaba25f024d1a3efd7943fd393632", + "rev": "242ebf294514cc22f4f9d83c0566c8ffe1cb8d8a", "type": "github" }, "original": { @@ -201,11 +201,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1748302896, - "narHash": "sha256-ixMT0a8mM091vSswlTORZj93WQAJsRNmEvqLL+qwTFM=", + "lastModified": 1749086602, + "narHash": "sha256-DJcgJMekoxVesl9kKjfLPix2Nbr42i7cpEHJiTnBUwU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7848cd8c982f7740edf76ddb3b43d234cb80fc4d", + "rev": "4792576cb003c994bd7cc1edada3129def20b27d", "type": "github" }, "original": { @@ -217,11 +217,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1748662220, - "narHash": "sha256-7gGa49iB9nCnFk4h/g9zwjlQAyjtpgcFkODjcOQS0Es=", + "lastModified": 1749174413, + "narHash": "sha256-urN9UMK5cd1dzhR+Lx0xHeTgBp2MatA5+6g9JaxjuQs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "59138c7667b7970d205d6a05a8bfa2d78caa3643", + "rev": "6ad174a6dc07c7742fc64005265addf87ad08615", "type": "github" }, "original": { @@ -327,11 +327,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1745730655, - "narHash": "sha256-Tdsw5lD/XM8i1GnQr7ombqnEaCpt/voPs2AbjuYBbjI=", + "lastModified": 1748488455, + "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "56a681bfecc5831f41f8eb0ec8c7e96c6b277153", + "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", "type": "github" }, "original": { From 0261c84d626896256932a45bbad045e2838d179d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 7 Jun 2025 23:07:44 +0200 Subject: [PATCH 0277/1295] add hosts to ssh --- home/vinzenz/ssh.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/home/vinzenz/ssh.nix b/home/vinzenz/ssh.nix index 51212708..57eeb5fb 100644 --- a/home/vinzenz/ssh.nix +++ b/home/vinzenz/ssh.nix @@ -54,6 +54,15 @@ hostname = "195.160.172.36"; user = "root"; }; + "cccb.zerforschen.plus" = { + hostname = "2a01:4f8:c013:cbdd::1"; + user = "root"; + }; + "berlin.ccc.de" = { + hostname = "195.160.173.9"; + user = "deploy"; + port = 31337; + }; }; }; } From be565adff68e8084ee0da83b2815f229323cebdc Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 28 Jun 2025 09:46:08 +0200 Subject: [PATCH 0278/1295] add nix-vscode-extensions, deduplicate inputs --- flake.lock | 69 ++++++++++++++++++++++++++++++++++-------------------- flake.nix | 34 +++++++++++++++++++++++---- 2 files changed, 72 insertions(+), 31 deletions(-) diff --git a/flake.lock b/flake.lock index f4724d7f..9525d73a 100644 --- a/flake.lock +++ b/flake.lock @@ -70,7 +70,9 @@ }, "lix-module": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": [ + "flake-utils" + ], "flakey-profile": "flakey-profile", "lix": "lix", "nixpkgs": [ @@ -123,11 +125,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1749144707, - "narHash": "sha256-JcSmySCB3pOtzeWMaEksZgaiNedEDIC6qyBezkK+92Q=", + "lastModified": 1749890123, + "narHash": "sha256-pRkyWFytGAMaHlrOJIYYEur8NRDe0kTfMIhRdTeasRQ=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "32d49ef427be377c82d32ce74ff3082c2c992199", + "rev": "8f39eb82488525728eda222b34e79b1ecf6d3f96", "type": "github" }, "original": { @@ -156,11 +158,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1749112952, - "narHash": "sha256-ajI1cXa2AgdZSELvlVaQZd0XMi4eM8H3Ys0Ek8a/roI=", + "lastModified": 1749797708, + "narHash": "sha256-P5x0U6AW5Zn20bARv4D83d8XlNaWK1st9QwBfSe+Vfg=", "owner": "YaLTeR", "repo": "niri", - "rev": "242ebf294514cc22f4f9d83c0566c8ffe1cb8d8a", + "rev": "f3f6e79eeca8924ff9cfea4b30006e5b782bc93e", "type": "github" }, "original": { @@ -184,28 +186,36 @@ "type": "github" } }, - "nix-filter_2": { + "nix-vscode-extensions": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, "locked": { - "lastModified": 1731533336, - "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", + "lastModified": 1749953646, + "narHash": "sha256-NwuPVQfAbrq46nAtjz9MIQ3XLK6f9OLzgY8hJlQKS/8=", + "owner": "nix-community", + "repo": "nix-vscode-extensions", + "rev": "459503794a816b2d9038fc0c9181805acf45bafb", "type": "github" }, "original": { - "owner": "numtide", - "repo": "nix-filter", + "owner": "nix-community", + "repo": "nix-vscode-extensions", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1749086602, - "narHash": "sha256-DJcgJMekoxVesl9kKjfLPix2Nbr42i7cpEHJiTnBUwU=", + "lastModified": 1749727998, + "narHash": "sha256-mHv/yeUbmL91/TvV95p+mBVahm9mdQMJoqaTVTALaFw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4792576cb003c994bd7cc1edada3129def20b27d", + "rev": "fd487183437963a59ba763c0cc4f27e3447dd6dd", "type": "github" }, "original": { @@ -217,11 +227,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1749174413, - "narHash": "sha256-urN9UMK5cd1dzhR+Lx0xHeTgBp2MatA5+6g9JaxjuQs=", + "lastModified": 1749871736, + "narHash": "sha256-K9yBph93OLTNw02Q6e9CYFGrUhvEXnh45vrZqIRWfvQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6ad174a6dc07c7742fc64005265addf87ad08615", + "rev": "6afe187897bef7933475e6af374c893f4c84a293", "type": "github" }, "original": { @@ -233,10 +243,13 @@ }, "root": { "inputs": { + "flake-utils": "flake-utils", "home-manager": "home-manager", "lix-module": "lix-module", "naersk": "naersk", "niri": "niri", + "nix-filter": "nix-filter", + "nix-vscode-extensions": "nix-vscode-extensions", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "servicepoint-cli": "servicepoint-cli", @@ -249,7 +262,9 @@ "naersk": [ "naersk" ], - "nix-filter": "nix-filter", + "nix-filter": [ + "nix-filter" + ], "nixpkgs": [ "nixpkgs" ] @@ -273,7 +288,9 @@ "naersk": [ "naersk" ], - "nix-filter": "nix-filter_2", + "nix-filter": [ + "nix-filter" + ], "nixpkgs": [ "nixpkgs" ] @@ -327,11 +344,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1748488455, - "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", + "lastModified": 1749315541, + "narHash": "sha256-bEik1BfVOFnWvtOrcOHluos/edJ8f+G2y1QySbt/0Ak=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", + "rev": "da2ecb5be816de35e2efe23a408a1c49fe8b11ba", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bafecdc1..1791bbb9 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,10 @@ lix-module = { url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"; - inputs.nixpkgs.follows = "nixpkgs"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; }; niri = { @@ -32,15 +35,33 @@ servicepoint-cli = { url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.naersk.follows = "naersk"; + inputs = { + nixpkgs.follows = "nixpkgs"; + naersk.follows = "naersk"; + nix-filter.follows = "nix-filter"; + }; }; servicepoint-simulator = { url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.naersk.follows = "naersk"; + inputs = { + nixpkgs.follows = "nixpkgs"; + naersk.follows = "naersk"; + nix-filter.follows = "nix-filter"; + }; }; + + nix-vscode-extensions = { + url = "github:nix-community/nix-vscode-extensions"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; + + # this is used to pin transitive dependencies to the same version + flake-utils.url = "github:numtide/flake-utils"; + nix-filter.url = "github:numtide/nix-filter"; }; outputs = @@ -55,6 +76,8 @@ servicepoint-cli, servicepoint-simulator, naersk, + nix-vscode-extensions, + ... }: let devices = { @@ -113,6 +136,7 @@ nixpkgs.overlays = [ niri.overlays.niri overlays.servicepoint-packages + nix-vscode-extensions.overlays.default ]; } ]); From 316e88afd345160267d2955f0e37de57b949c1ad Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 28 Jun 2025 09:46:50 +0200 Subject: [PATCH 0279/1295] get most extensions from open-vsx --- home/vinzenz/default.nix | 2 ++ home/vinzenz/vscode.nix | 40 +++++++++++++++++++++++----------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 5b7e80d7..db555969 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -47,6 +47,8 @@ "jetbrains-toolbox" "anydesk" + + "vscode-extension-ms-dotnettools-csharp" ]; }; } diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index 58d31b68..548ed3e7 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -7,23 +7,27 @@ package = pkgs.vscodium; profiles.default = { enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - jnoortheen.nix-ide - ms-python.python - editorconfig.editorconfig - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - rust-lang.rust-analyzer - tamasfe.even-better-toml - llvm-vs-code-extensions.vscode-clangd - mkhl.direnv - vadimcn.vscode-lldb - # ms-dotnettools.csharp - # ms-vscode-remote.remote-ssh - RoweWilsonFrederiskHolme.wikitext - davidanson.vscode-markdownlint - ]; + extensions = + with pkgs.nix-vscode-extensions.open-vsx; + [ + jnoortheen.nix-ide + ms-python.python + editorconfig.editorconfig + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + rust-lang.rust-analyzer + tamasfe.even-better-toml + llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + muhammad-sammy.csharp + davidanson.vscode-markdownlint + ] + ++ (with pkgs.vscode-extensions; [ + vadimcn.vscode-lldb + RoweWilsonFrederiskHolme.wikitext + ms-dotnettools.csharp + ]); userSettings = { "files.autoSave" = "afterDelay"; "files.autoSaveWhenNoErrors" = true; @@ -66,6 +70,8 @@ }; }; + "dotnetAcquisitionExtension.sharedExistingDotnetPath" = "${lib.getBin pkgs.dotnet-sdk}/bin/dotnet"; + "\[makefile\]" = { "editor.insertSpaces" = false; "editor.detectIndentation" = false; From 12a1359d318fcb480531a85e634ad25683b94faa Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 28 Jun 2025 09:47:59 +0200 Subject: [PATCH 0280/1295] nix flake update --- flake.lock | 58 +++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/flake.lock b/flake.lock index 9525d73a..d626a2a0 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1749154018, - "narHash": "sha256-gjN3j7joRvT3a8Zgcylnd4NFsnXeDBumqiu4HmY1RIg=", + "lastModified": 1750792728, + "narHash": "sha256-Lh3dopA8DdY+ZoaAJPrtkZOZaFEJGSYjOdAYYgOPgE4=", "owner": "nix-community", "repo": "home-manager", - "rev": "7aae0ee71a17b19708b93b3ed448a1a0952bf111", + "rev": "366f00797b1efb70f2882d3da485e3c10fd3d557", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1749890123, - "narHash": "sha256-pRkyWFytGAMaHlrOJIYYEur8NRDe0kTfMIhRdTeasRQ=", + "lastModified": 1751073903, + "narHash": "sha256-6pUwEiEJw8PGqUn2+Mf0IEJN4M0FMoXCM4sNa2EZuKk=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "8f39eb82488525728eda222b34e79b1ecf6d3f96", + "rev": "3667e998b5ad7a1ec56207f79c9629a919eafd43", "type": "github" }, "original": { @@ -141,16 +141,16 @@ "niri-stable": { "flake": false, "locked": { - "lastModified": 1740117926, - "narHash": "sha256-mTTHA0RAaQcdYe+9A3Jx77cmmyLFHmRoZdd8RpWa+m8=", + "lastModified": 1748151941, + "narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=", "owner": "YaLTeR", "repo": "niri", - "rev": "b94a5db8790339cf9134873d8b490be69e02ac71", + "rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7", "type": "github" }, "original": { "owner": "YaLTeR", - "ref": "v25.02", + "ref": "v25.05.1", "repo": "niri", "type": "github" } @@ -158,11 +158,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1749797708, - "narHash": "sha256-P5x0U6AW5Zn20bARv4D83d8XlNaWK1st9QwBfSe+Vfg=", + "lastModified": 1750791124, + "narHash": "sha256-F5iVU/hjoSHSSe0gllxm0PcAaseEtGNanYK5Ha3k2Tg=", "owner": "YaLTeR", "repo": "niri", - "rev": "f3f6e79eeca8924ff9cfea4b30006e5b782bc93e", + "rev": "37458d94b288945f6cfbd3c5c233f634d59f246c", "type": "github" }, "original": { @@ -196,11 +196,11 @@ ] }, "locked": { - "lastModified": 1749953646, - "narHash": "sha256-NwuPVQfAbrq46nAtjz9MIQ3XLK6f9OLzgY8hJlQKS/8=", + "lastModified": 1751076164, + "narHash": "sha256-to92MoMF7QC2K2gdpkYoN/Y9wuF6Q/qlvNyHca6uPjQ=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "459503794a816b2d9038fc0c9181805acf45bafb", + "rev": "7f443f5e4125f9aad3885542c04653f29b15b92a", "type": "github" }, "original": { @@ -211,11 +211,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1749727998, - "narHash": "sha256-mHv/yeUbmL91/TvV95p+mBVahm9mdQMJoqaTVTALaFw=", + "lastModified": 1750969886, + "narHash": "sha256-zW/OFnotiz/ndPFdebpo3X0CrbVNf22n4DjN2vxlb58=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fd487183437963a59ba763c0cc4f27e3447dd6dd", + "rev": "a676066377a2fe7457369dd37c31fd2263b662f4", "type": "github" }, "original": { @@ -227,11 +227,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1749871736, - "narHash": "sha256-K9yBph93OLTNw02Q6e9CYFGrUhvEXnh45vrZqIRWfvQ=", + "lastModified": 1750994206, + "narHash": "sha256-3u6rEbIX9CN/5A5/mc3u0wIO1geZ0EhjvPBXmRDHqWM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6afe187897bef7933475e6af374c893f4c84a293", + "rev": "80d50fc87924c2a0d346372d242c27973cf8cdbf", "type": "github" }, "original": { @@ -327,16 +327,16 @@ "xwayland-satellite-stable": { "flake": false, "locked": { - "lastModified": 1739246919, - "narHash": "sha256-/hBM43/Gd0/tW+egrhlWgOIISeJxEs2uAOIYVpfDKeU=", + "lastModified": 1748488455, + "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "44590a416d4a3e8220e19e29e0b6efe64a80315d", + "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", "type": "github" }, "original": { "owner": "Supreeeme", - "ref": "v0.5.1", + "ref": "v0.6", "repo": "xwayland-satellite", "type": "github" } @@ -344,11 +344,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1749315541, - "narHash": "sha256-bEik1BfVOFnWvtOrcOHluos/edJ8f+G2y1QySbt/0Ak=", + "lastModified": 1750821680, + "narHash": "sha256-Bu5unTxnqok2RoU5P394Gh0vRaoyI/5xlOOJDF6akrc=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "da2ecb5be816de35e2efe23a408a1c49fe8b11ba", + "rev": "2e7c318ac2bbf699b6ab92ef91e661e16415dfac", "type": "github" }, "original": { From 62d579ee92915b7bda8c9ff312d48a7959912e87 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 28 Jun 2025 14:35:38 +0200 Subject: [PATCH 0281/1295] update ssh config --- home/vinzenz/ssh.nix | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/home/vinzenz/ssh.nix b/home/vinzenz/ssh.nix index 57eeb5fb..98acce9b 100644 --- a/home/vinzenz/ssh.nix +++ b/home/vinzenz/ssh.nix @@ -3,21 +3,11 @@ config.programs.ssh = { enable = true; matchBlocks = { - "vpn1" = { - host = "vpn1 hetzner-vpn1"; - hostname = "157.90.146.125"; # 2a01:4f8:c012:7137::/64 - user = "root"; - }; "vpn2" = { host = "vpn2 hetzner-vpn2"; hostname = "2a01:4f8:c013:65dd::1"; user = "root"; }; - "vpn1-ts" = { - host = "vpn1-ts hetzner-vpn1.donkey-pentatonic.ts.net"; - hostname = "hetzner-vpn1.donkey-pentatonic.ts.net"; - user = "root"; - }; "openwrt" = { host = "openwrt openwrt.lan"; hostname = "openwrt.lan"; @@ -63,6 +53,10 @@ user = "deploy"; port = 31337; }; + "forgejo-runner-1" = { + hostname = "forgejo-runner-1.dev.zerforschen.plus"; + user = "root"; + }; }; }; } From 846f28b1c1639a22b854019d0cf608acd19271c9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 28 Jun 2025 16:43:19 +0200 Subject: [PATCH 0282/1295] update servicepoint packages --- flake.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index d626a2a0..a29a5411 100644 --- a/flake.lock +++ b/flake.lock @@ -270,11 +270,11 @@ ] }, "locked": { - "lastModified": 1746866001, - "narHash": "sha256-6jqzJyBRXdwmd5SKIJTfbJ5pRVNshVNPzCtFqobRgTE=", + "lastModified": 1751117291, + "narHash": "sha256-iOeiPypZkl6uPL5mQ4aFG4wYVs9w9BJZ2/5XHlLgyIk=", "ref": "refs/heads/main", - "rev": "e9d3b32f57674e06db1ebf0762bfd736e1f5ea31", - "revCount": 41, + "rev": "2a4818dc2158cbdad34a701ab12d0b1cf7f52c46", + "revCount": 45, "type": "git", "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git" }, @@ -296,11 +296,11 @@ ] }, "locked": { - "lastModified": 1746268672, - "narHash": "sha256-IIgxxA5Fk1iLwXiCGbCLrVdduTDAA54DJ2gnfvCOMLQ=", + "lastModified": 1751118401, + "narHash": "sha256-tVLbgLaJQzu/wicqVHkeBGyM8U4TvpIw8NykBaeKy6A=", "ref": "refs/heads/main", - "rev": "33301a51bf501a6886ec2e1c6ad8111247141d2f", - "revCount": 108, + "rev": "86c9c20b499da9c7c203d4e982e49ddd5a8aad46", + "revCount": 110, "type": "git", "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git" }, From 13c5dbe9504f6a26fdf8d89fb749ce1def85e2f0 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 30 Jun 2025 18:59:07 +0200 Subject: [PATCH 0283/1295] add shell aliases --- home/ronja/configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/home/ronja/configuration.nix b/home/ronja/configuration.nix index 85f4772b..26cceacd 100644 --- a/home/ronja/configuration.nix +++ b/home/ronja/configuration.nix @@ -26,6 +26,10 @@ "systemadmin" ]; }; + shellAliases = { + myos-update = ''echo "Enter sudo password" && sudo nixos-rebuild boot --flake git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git --show-trace --log-format internal-json -v |& ${pkgs.nix-output-monitor}/bin/nom --json''; + myos-apply = ''echo "Enter sudo password" && sudo nixos-rebuild switch --flake .# --show-trace --log-format internal-json -v |& ${pkgs.nix-output-monitor}/bin/nom --json''; + }; }; git = { From 05052b1279b4f44d50a54c799ddfdb2ea3c14e09 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 3 Jul 2025 17:02:12 +0200 Subject: [PATCH 0284/1295] nix flake update --- flake.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index a29a5411..1871a083 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1750792728, - "narHash": "sha256-Lh3dopA8DdY+ZoaAJPrtkZOZaFEJGSYjOdAYYgOPgE4=", + "lastModified": 1751468302, + "narHash": "sha256-tWosziZTT039x6PgEZUhzGlV8oLvdDmIgKTE8ESMaEA=", "owner": "nix-community", "repo": "home-manager", - "rev": "366f00797b1efb70f2882d3da485e3c10fd3d557", + "rev": "501cfec8277f931a9c9af9f23d3105c537faeafe", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1751073903, - "narHash": "sha256-6pUwEiEJw8PGqUn2+Mf0IEJN4M0FMoXCM4sNa2EZuKk=", + "lastModified": 1751335430, + "narHash": "sha256-OVP1yknJHvRK+eIy56UZsf9kUXSmwlwitPa9dZ0/HWo=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "3667e998b5ad7a1ec56207f79c9629a919eafd43", + "rev": "fab3c874b28d95696225b4e575c3b6dc5d6058fe", "type": "github" }, "original": { @@ -196,11 +196,11 @@ ] }, "locked": { - "lastModified": 1751076164, - "narHash": "sha256-to92MoMF7QC2K2gdpkYoN/Y9wuF6Q/qlvNyHca6uPjQ=", + "lastModified": 1751422033, + "narHash": "sha256-R6ZonDO1yldt3KUDi+u8irXo09+EjisiqK4s7Je46B4=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "7f443f5e4125f9aad3885542c04653f29b15b92a", + "rev": "e3a859385648ba529eacc2efe61d529eef6f5485", "type": "github" }, "original": { @@ -211,11 +211,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1750969886, - "narHash": "sha256-zW/OFnotiz/ndPFdebpo3X0CrbVNf22n4DjN2vxlb58=", + "lastModified": 1751211869, + "narHash": "sha256-1Cu92i1KSPbhPCKxoiVG5qnoRiKTgR5CcGSRyLpOd7Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a676066377a2fe7457369dd37c31fd2263b662f4", + "rev": "b43c397f6c213918d6cfe6e3550abfe79b5d1c51", "type": "github" }, "original": { @@ -227,11 +227,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1750994206, - "narHash": "sha256-3u6rEbIX9CN/5A5/mc3u0wIO1geZ0EhjvPBXmRDHqWM=", + "lastModified": 1751498133, + "narHash": "sha256-QWJ+NQbMU+NcU2xiyo7SNox1fAuwksGlQhpzBl76g1I=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "80d50fc87924c2a0d346372d242c27973cf8cdbf", + "rev": "d55716bb59b91ae9d1ced4b1ccdea7a442ecbfdb", "type": "github" }, "original": { @@ -344,11 +344,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1750821680, - "narHash": "sha256-Bu5unTxnqok2RoU5P394Gh0vRaoyI/5xlOOJDF6akrc=", + "lastModified": 1751228685, + "narHash": "sha256-MENtauGBhJ+kDeFaawvWGXaFG3Il6qQzjaP0RmtfM0k=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "2e7c318ac2bbf699b6ab92ef91e661e16415dfac", + "rev": "557ebeb616e03d5e4a8049862bbbd1f02c6f020b", "type": "github" }, "original": { From b5845033362c495cbdb0c22df29dae63854ef1c8 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 3 Jul 2025 19:40:43 +0200 Subject: [PATCH 0285/1295] update servicepoint-simulator --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 1871a083..21f3a015 100644 --- a/flake.lock +++ b/flake.lock @@ -296,11 +296,11 @@ ] }, "locked": { - "lastModified": 1751118401, - "narHash": "sha256-tVLbgLaJQzu/wicqVHkeBGyM8U4TvpIw8NykBaeKy6A=", + "lastModified": 1751564158, + "narHash": "sha256-HDYvjBK2om96tJVGHzUCv87mfcosdoPK9cBHyDEWv2E=", "ref": "refs/heads/main", - "rev": "86c9c20b499da9c7c203d4e982e49ddd5a8aad46", - "revCount": 110, + "rev": "4eed089a061b24b35bfcc7e615a312877d9b8997", + "revCount": 113, "type": "git", "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git" }, From 66ab4dd1b4bab0d03d505ccb1459464126479efa Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 12 Jul 2025 14:30:21 +0200 Subject: [PATCH 0286/1295] nix flake update --- flake.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/flake.lock b/flake.lock index 21f3a015..db4c8936 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1751468302, - "narHash": "sha256-tWosziZTT039x6PgEZUhzGlV8oLvdDmIgKTE8ESMaEA=", + "lastModified": 1752208517, + "narHash": "sha256-aRY1cYOdVdXdNjcL/Twpa27CknO7pVHxooPsBizDraE=", "owner": "nix-community", "repo": "home-manager", - "rev": "501cfec8277f931a9c9af9f23d3105c537faeafe", + "rev": "c6a01e54af81b381695db796a43360bf6db5702f", "type": "github" }, "original": { @@ -98,11 +98,11 @@ ] }, "locked": { - "lastModified": 1745925850, - "narHash": "sha256-cyAAMal0aPrlb1NgzMxZqeN1mAJ2pJseDhm2m6Um8T0=", + "lastModified": 1752249768, + "narHash": "sha256-wKqMvhTqMgTKM/CdTH/ihq9eLZM95qpU0FG7cvTBFJg=", "owner": "nix-community", "repo": "naersk", - "rev": "38bc60bbc157ae266d4a0c96671c6c742ee17a5f", + "rev": "35aa63738857c40f98ecb04db52887d664836e74", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1751335430, - "narHash": "sha256-OVP1yknJHvRK+eIy56UZsf9kUXSmwlwitPa9dZ0/HWo=", + "lastModified": 1752291616, + "narHash": "sha256-zpPFo4cgr5tOy8DCLIoD++idsKjnzgVPnBeZLmazYc4=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "fab3c874b28d95696225b4e575c3b6dc5d6058fe", + "rev": "30962469e2e8fb93c3672ee605316b89b8e9a198", "type": "github" }, "original": { @@ -196,11 +196,11 @@ ] }, "locked": { - "lastModified": 1751422033, - "narHash": "sha256-R6ZonDO1yldt3KUDi+u8irXo09+EjisiqK4s7Je46B4=", + "lastModified": 1752286423, + "narHash": "sha256-5a4+w/P9cr5l8YOypiwNrAIOyhLYA9x9Va1mqKkvwRs=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "e3a859385648ba529eacc2efe61d529eef6f5485", + "rev": "f942441f13f5dbd29e4bd5596b2c2ba346c4940e", "type": "github" }, "original": { @@ -211,11 +211,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1751211869, - "narHash": "sha256-1Cu92i1KSPbhPCKxoiVG5qnoRiKTgR5CcGSRyLpOd7Y=", + "lastModified": 1752162966, + "narHash": "sha256-3MxxkU8ZXMHXcbFz7UE4M6qnIPTYGcE/7EMqlZNnVDE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b43c397f6c213918d6cfe6e3550abfe79b5d1c51", + "rev": "10e687235226880ed5e9f33f1ffa71fe60f2638a", "type": "github" }, "original": { @@ -227,11 +227,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1751498133, - "narHash": "sha256-QWJ+NQbMU+NcU2xiyo7SNox1fAuwksGlQhpzBl76g1I=", + "lastModified": 1752012998, + "narHash": "sha256-Q82Ms+FQmgOBkdoSVm+FBpuFoeUAffNerR5yVV7SgT8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d55716bb59b91ae9d1ced4b1ccdea7a442ecbfdb", + "rev": "2a2130494ad647f953593c4e84ea4df839fbd68c", "type": "github" }, "original": { @@ -296,11 +296,11 @@ ] }, "locked": { - "lastModified": 1751564158, - "narHash": "sha256-HDYvjBK2om96tJVGHzUCv87mfcosdoPK9cBHyDEWv2E=", + "lastModified": 1752323001, + "narHash": "sha256-YEcYegmlv12yN9VWrz2qt0nyL+9EeGIlrDvac8Pf7Cw=", "ref": "refs/heads/main", - "rev": "4eed089a061b24b35bfcc7e615a312877d9b8997", - "revCount": 113, + "rev": "75a0ae7a59e687bea5f92791a2d64c048f35846d", + "revCount": 119, "type": "git", "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git" }, From 4c507953410906105955e7ef6e3ad465ee8f9d3f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 14 Jul 2025 09:44:13 +0200 Subject: [PATCH 0287/1295] add group openvscode-server to ronja --- home/ronja/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/ronja/default.nix b/home/ronja/default.nix index 8ce9b92b..7c2f96d1 100644 --- a/home/ronja/default.nix +++ b/home/ronja/default.nix @@ -12,6 +12,7 @@ "wheel" "games" "podman" + "openvscode-server" ]; shell = pkgs.zsh; }; From debc6cbabcc9bb6910492f48356c0ae2fa535b82 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 28 Jul 2025 21:46:41 +0200 Subject: [PATCH 0288/1295] lact, overdrive bit --- hosts/vinzenz-pc2/configuration.nix | 4 +++- modules/amd-graphics.nix | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hosts/vinzenz-pc2/configuration.nix b/hosts/vinzenz-pc2/configuration.nix index 114d24e3..812f6f09 100644 --- a/hosts/vinzenz-pc2/configuration.nix +++ b/hosts/vinzenz-pc2/configuration.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, ... }: { imports = [ ./hardware.nix @@ -29,5 +29,7 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' ]; + + environment.systemPackages = with pkgs; [lact]; }; } diff --git a/modules/amd-graphics.nix b/modules/amd-graphics.nix index d36b42db..041d7007 100644 --- a/modules/amd-graphics.nix +++ b/modules/amd-graphics.nix @@ -13,6 +13,7 @@ # enable = true; # support32Bit.enable = config.hardware.graphics.enable32Bit; }; + overdrive.enable = true; }; }; From e0f956950ada949b9b60617aaa40615067fc8c33 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 29 Jul 2025 18:01:54 +0200 Subject: [PATCH 0289/1295] disable niri and open port on pc2 --- hosts/vinzenz-pc2/imports.nix | 2 +- hosts/vinzenz-pc2/vscode-server.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/vinzenz-pc2/imports.nix b/hosts/vinzenz-pc2/imports.nix index 7e9f61af..f9a0ae19 100644 --- a/hosts/vinzenz-pc2/imports.nix +++ b/hosts/vinzenz-pc2/imports.nix @@ -4,7 +4,7 @@ ../../modules/gaming.nix ../../modules/printing.nix ../../modules/podman.nix - ../../modules/niri.nix + #../../modules/niri.nix ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix diff --git a/hosts/vinzenz-pc2/vscode-server.nix b/hosts/vinzenz-pc2/vscode-server.nix index d1164f13..199c0156 100644 --- a/hosts/vinzenz-pc2/vscode-server.nix +++ b/hosts/vinzenz-pc2/vscode-server.nix @@ -23,6 +23,7 @@ 8544 80 1313 + 5201 ]; }; }; From b0ba87b8c23d07e64d3daff63852b232b18ba636 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 6 Aug 2025 23:34:43 +0200 Subject: [PATCH 0290/1295] update misc config --- home/vinzenz/configuration.nix | 8 +++----- home/vinzenz/gnome.nix | 2 +- hosts/vinzenz-lpt2/configuration.nix | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix index a7b8fb4d..37da5362 100644 --- a/home/vinzenz/configuration.nix +++ b/home/vinzenz/configuration.nix @@ -50,15 +50,13 @@ arduino arduino-ide arduino-cli - kicad - kikit - - ut1999 servicepoint-cli servicepoint-simulator - anydesk + icu + + nextcloud-client ]; home.file = { diff --git a/home/vinzenz/gnome.nix b/home/vinzenz/gnome.nix index b0f6e3dc..c8d5a5e0 100644 --- a/home/vinzenz/gnome.nix +++ b/home/vinzenz/gnome.nix @@ -7,7 +7,7 @@ quick-settings-tweaker solaar-extension alphabetical-app-grid - ]; + ] ++ (with pkgs; [foliate]); dconf.settings = { "org/gnome/shell" = { diff --git a/hosts/vinzenz-lpt2/configuration.nix b/hosts/vinzenz-lpt2/configuration.nix index e7b01536..b627078a 100644 --- a/hosts/vinzenz-lpt2/configuration.nix +++ b/hosts/vinzenz-lpt2/configuration.nix @@ -1,6 +1,6 @@ { ... }: { - imports = [ ./zerforschen-plus.nix ]; + imports = [ ./nginx.nix ]; config = { nix.settings.extra-platforms = [ @@ -37,6 +37,6 @@ }; }; - networking.firewall.allowedTCPPorts = [ 8776 ]; + networking.firewall.allowedTCPPorts = [ 8776 1337 ]; }; } From 199ad72258351677ada8d7731f4e83277675a37d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 6 Aug 2025 23:34:53 +0200 Subject: [PATCH 0291/1295] update flake --- flake.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index db4c8936..07f182a7 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1752208517, - "narHash": "sha256-aRY1cYOdVdXdNjcL/Twpa27CknO7pVHxooPsBizDraE=", + "lastModified": 1753592768, + "narHash": "sha256-oV695RvbAE4+R9pcsT9shmp6zE/+IZe6evHWX63f2Qg=", "owner": "nix-community", "repo": "home-manager", - "rev": "c6a01e54af81b381695db796a43360bf6db5702f", + "rev": "fc3add429f21450359369af74c2375cb34a2d204", "type": "github" }, "original": { @@ -125,11 +125,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1752291616, - "narHash": "sha256-zpPFo4cgr5tOy8DCLIoD++idsKjnzgVPnBeZLmazYc4=", + "lastModified": 1754403288, + "narHash": "sha256-FdI2tV45ChVgwly2JRx1lA68gHIdZ38yyzHJeHHYTSc=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "30962469e2e8fb93c3672ee605316b89b8e9a198", + "rev": "a5151e16afa09a01ef7b360d87956730d0534da7", "type": "github" }, "original": { @@ -158,11 +158,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1750791124, - "narHash": "sha256-F5iVU/hjoSHSSe0gllxm0PcAaseEtGNanYK5Ha3k2Tg=", + "lastModified": 1754400448, + "narHash": "sha256-tP4wYaIKlhMTzNp0S9ouU5Key0+41Z5KkjP9zO6bIQU=", "owner": "YaLTeR", "repo": "niri", - "rev": "37458d94b288945f6cfbd3c5c233f634d59f246c", + "rev": "52c579d5567d0b16ae68177fad05c612baba38af", "type": "github" }, "original": { @@ -196,11 +196,11 @@ ] }, "locked": { - "lastModified": 1752286423, - "narHash": "sha256-5a4+w/P9cr5l8YOypiwNrAIOyhLYA9x9Va1mqKkvwRs=", + "lastModified": 1754446681, + "narHash": "sha256-uOvHmY2GsvIdjBKMKmg0WJp5TLN11iPYaEV7NhHbMXg=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "f942441f13f5dbd29e4bd5596b2c2ba346c4940e", + "rev": "c6ddec5efaa0f74798badd283559f85244d39c2d", "type": "github" }, "original": { @@ -211,11 +211,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1752162966, - "narHash": "sha256-3MxxkU8ZXMHXcbFz7UE4M6qnIPTYGcE/7EMqlZNnVDE=", + "lastModified": 1754292888, + "narHash": "sha256-1ziydHSiDuSnaiPzCQh1mRFBsM2d2yRX9I+5OPGEmIE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "10e687235226880ed5e9f33f1ffa71fe60f2638a", + "rev": "ce01daebf8489ba97bd1609d185ea276efdeb121", "type": "github" }, "original": { @@ -227,11 +227,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1752012998, - "narHash": "sha256-Q82Ms+FQmgOBkdoSVm+FBpuFoeUAffNerR5yVV7SgT8=", + "lastModified": 1754340878, + "narHash": "sha256-lgmUyVQL9tSnvvIvBp7x1euhkkCho7n3TMzgjdvgPoU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2a2130494ad647f953593c4e84ea4df839fbd68c", + "rev": "cab778239e705082fe97bb4990e0d24c50924c04", "type": "github" }, "original": { @@ -344,11 +344,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1751228685, - "narHash": "sha256-MENtauGBhJ+kDeFaawvWGXaFG3Il6qQzjaP0RmtfM0k=", + "lastModified": 1754367142, + "narHash": "sha256-U0gbn4Qe2NfdaQHvSerzjn3iLhrH+Ah0DMBJfRh1OT8=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "557ebeb616e03d5e4a8049862bbbd1f02c6f020b", + "rev": "ecbe57e7be12452d6fe477f2154a6d93f60c41e0", "type": "github" }, "original": { From e39e8075b74f43cf41219d5060106022df8279ea Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 8 Aug 2025 02:28:37 +0200 Subject: [PATCH 0292/1295] update zerforschen.plus --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 07f182a7..c4e2bfc2 100644 --- a/flake.lock +++ b/flake.lock @@ -364,11 +364,11 @@ ] }, "locked": { - "lastModified": 1748777873, - "narHash": "sha256-sDyp1LeP+BOiG4AvpX28bPPxLUpXwlredK+uqxguTPs=", + "lastModified": 1754612733, + "narHash": "sha256-ozj5frLB2f5B8FizhboWT5Y9SoI2IMJ0V5VJgz8MIBM=", "ref": "refs/heads/main", - "rev": "da2b589ad01d79a02985511fd5dce31731abad5a", - "revCount": 17, + "rev": "900f0b293c0c24fb73c3f2290427961ef89d568a", + "revCount": 18, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From 28116592f53c8eb8cf7953fb636fed53c18ce5c1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Aug 2025 17:05:19 +0200 Subject: [PATCH 0293/1295] update zerforschen.plus --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index c4e2bfc2..e9e5719a 100644 --- a/flake.lock +++ b/flake.lock @@ -364,11 +364,11 @@ ] }, "locked": { - "lastModified": 1754612733, - "narHash": "sha256-ozj5frLB2f5B8FizhboWT5Y9SoI2IMJ0V5VJgz8MIBM=", + "lastModified": 1754751875, + "narHash": "sha256-4Ut7/y9T/mZ6XNg1pkca7Hzey1elXwPNlEq/BqD1f9g=", "ref": "refs/heads/main", - "rev": "900f0b293c0c24fb73c3f2290427961ef89d568a", - "revCount": 18, + "rev": "229b4588c10f288646e00a519080867c625470f0", + "revCount": 20, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From b544e480d28828e5ff57f8866756256d7a59465a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 15 Aug 2025 15:01:08 +0200 Subject: [PATCH 0294/1295] disable btrfs root mount --- hosts/vinzenz-pc2/fstab.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hosts/vinzenz-pc2/fstab.nix b/hosts/vinzenz-pc2/fstab.nix index 1c9c7e51..fbacbc86 100644 --- a/hosts/vinzenz-pc2/fstab.nix +++ b/hosts/vinzenz-pc2/fstab.nix @@ -22,13 +22,13 @@ fsType = "vfat"; }; - "/mnt/nixos_btrfs_root" = { - # subvolume with id 5 is always the root volume - # this is convenient for managing the flat subvolume hierarchy - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = [ "subvolid=5" ]; - }; + #"/mnt/nixos_btrfs_root" = { + # # subvolume with id 5 is always the root volume + # # this is convenient for managing the flat subvolume hierarchy + # device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + # fsType = "btrfs"; + # options = [ "subvolid=5" ]; + #}; "/mnt/ssd2" = { device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; From 117e47c34a600e7c3fa7875013b3e60e949c4752 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 16 Aug 2025 12:22:48 +0200 Subject: [PATCH 0295/1295] re enable some gnome apps --- modules/gnome.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/gnome.nix b/modules/gnome.nix index afbae7ee..f5a5dc0d 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -41,15 +41,11 @@ gnome-maps gnome-weather gnome-tour - gnome-contacts sysprof orca # screen reader - gnome-disk-utility - gnome-system-monitor gnome-weather gnome-backgrounds gnome-user-docs - gnome-calendar yelp # help app # gnome-music # totem # video player From 533b401675979b2760b62132ca64ca9b0e008fb1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Aug 2025 01:24:53 +0200 Subject: [PATCH 0296/1295] update zerforschen.plus --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index e9e5719a..2f62bc39 100644 --- a/flake.lock +++ b/flake.lock @@ -364,11 +364,11 @@ ] }, "locked": { - "lastModified": 1754751875, - "narHash": "sha256-4Ut7/y9T/mZ6XNg1pkca7Hzey1elXwPNlEq/BqD1f9g=", + "lastModified": 1755386607, + "narHash": "sha256-BW9jupoY/GU8kJVcJ88DSqlrzMD1bSYIsAuySOvl3OQ=", "ref": "refs/heads/main", - "rev": "229b4588c10f288646e00a519080867c625470f0", - "revCount": 20, + "rev": "6323e61952287fb28dced43ef488ae2cb303060a", + "revCount": 23, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From 1e019ac7e6230b1907aa9281b75cf5bb8b4c8d24 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Aug 2025 01:30:15 +0200 Subject: [PATCH 0297/1295] forgot draft --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 2f62bc39..db360656 100644 --- a/flake.lock +++ b/flake.lock @@ -364,11 +364,11 @@ ] }, "locked": { - "lastModified": 1755386607, - "narHash": "sha256-BW9jupoY/GU8kJVcJ88DSqlrzMD1bSYIsAuySOvl3OQ=", + "lastModified": 1755386987, + "narHash": "sha256-ipGu5BLyXdWKMG/lzH0/zP/+vWvs7HpmKoFb/VCEg6g=", "ref": "refs/heads/main", - "rev": "6323e61952287fb28dced43ef488ae2cb303060a", - "revCount": 23, + "rev": "c664b83a9f011da0b23565778e69548ce4f6efa1", + "revCount": 24, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From 677f2d41038eb69632038abb7491503f842bb247 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Aug 2025 14:00:53 +0200 Subject: [PATCH 0298/1295] update website --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index db360656..876fc906 100644 --- a/flake.lock +++ b/flake.lock @@ -364,11 +364,11 @@ ] }, "locked": { - "lastModified": 1755386987, - "narHash": "sha256-ipGu5BLyXdWKMG/lzH0/zP/+vWvs7HpmKoFb/VCEg6g=", + "lastModified": 1755431984, + "narHash": "sha256-iBgSdzkta6zQ2eIRWjmJTLZ3b1e1EZiCyCPcgCdqPGU=", "ref": "refs/heads/main", - "rev": "c664b83a9f011da0b23565778e69548ce4f6efa1", - "revCount": 24, + "rev": "31abcb7a9583c4ed931f658eca3e3c1970e60814", + "revCount": 28, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From 7f47ae9174ba3d6eee98ff47f659cfb2fe2c9193 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 17 Aug 2025 15:08:48 +0200 Subject: [PATCH 0299/1295] update flake --- flake.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index 876fc906..39bc9473 100644 --- a/flake.lock +++ b/flake.lock @@ -125,11 +125,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1754403288, - "narHash": "sha256-FdI2tV45ChVgwly2JRx1lA68gHIdZ38yyzHJeHHYTSc=", + "lastModified": 1755424351, + "narHash": "sha256-xcorYLNdtLpb0wH5CPlUcpmYQUxeK95j1X855xQw+DY=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "a5151e16afa09a01ef7b360d87956730d0534da7", + "rev": "9aa137af01f05386e5bb5050e983750017007a66", "type": "github" }, "original": { @@ -158,11 +158,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1754400448, - "narHash": "sha256-tP4wYaIKlhMTzNp0S9ouU5Key0+41Z5KkjP9zO6bIQU=", + "lastModified": 1755419373, + "narHash": "sha256-EFH3zbpyLYjEboNV2Lmkxf9joEuFCmeYX+MMLRPStpg=", "owner": "YaLTeR", "repo": "niri", - "rev": "52c579d5567d0b16ae68177fad05c612baba38af", + "rev": "a6febb86aa5af0df7bf2792ca027ef95a503d599", "type": "github" }, "original": { @@ -196,11 +196,11 @@ ] }, "locked": { - "lastModified": 1754446681, - "narHash": "sha256-uOvHmY2GsvIdjBKMKmg0WJp5TLN11iPYaEV7NhHbMXg=", + "lastModified": 1755396877, + "narHash": "sha256-92gZRDz3zEsodraI0ZxPzZrpjSqc2qjxTW9HOflzKFw=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "c6ddec5efaa0f74798badd283559f85244d39c2d", + "rev": "0cf076c0bafbe7cbd33a3b7377ed24827674e8be", "type": "github" }, "original": { @@ -211,11 +211,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1754292888, - "narHash": "sha256-1ziydHSiDuSnaiPzCQh1mRFBsM2d2yRX9I+5OPGEmIE=", + "lastModified": 1755274400, + "narHash": "sha256-rTInmnp/xYrfcMZyFMH3kc8oko5zYfxsowaLv1LVobY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ce01daebf8489ba97bd1609d185ea276efdeb121", + "rev": "ad7196ae55c295f53a7d1ec39e4a06d922f3b899", "type": "github" }, "original": { @@ -227,11 +227,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1754340878, - "narHash": "sha256-lgmUyVQL9tSnvvIvBp7x1euhkkCho7n3TMzgjdvgPoU=", + "lastModified": 1755268003, + "narHash": "sha256-nNaeJjo861wFR0tjHDyCnHs1rbRtrMgxAKMoig9Sj/w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cab778239e705082fe97bb4990e0d24c50924c04", + "rev": "32f313e49e42f715491e1ea7b306a87c16fe0388", "type": "github" }, "original": { @@ -344,11 +344,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1754367142, - "narHash": "sha256-U0gbn4Qe2NfdaQHvSerzjn3iLhrH+Ah0DMBJfRh1OT8=", + "lastModified": 1755219541, + "narHash": "sha256-yKV6xHaPbEbh5RPxAJnb9yTs1wypr7do86hFFGQm1w8=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "ecbe57e7be12452d6fe477f2154a6d93f60c41e0", + "rev": "5a184d435927c3423f0ad189ea2b490578450fb7", "type": "github" }, "original": { From a38a4eef56ce7a3663f697fef5c1323553cc7372 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 28 Aug 2025 17:50:16 +0200 Subject: [PATCH 0300/1295] p10k --- home/vinzenz/.zsh/p10k.zsh | 1843 ++++++++++++++++++++++++++++++++++++ home/vinzenz/zsh.nix | 5 +- 2 files changed, 1847 insertions(+), 1 deletion(-) create mode 100644 home/vinzenz/.zsh/p10k.zsh diff --git a/home/vinzenz/.zsh/p10k.zsh b/home/vinzenz/.zsh/p10k.zsh new file mode 100644 index 00000000..3b6355df --- /dev/null +++ b/home/vinzenz/.zsh/p10k.zsh @@ -0,0 +1,1843 @@ +# Generated by Powerlevel10k configuration wizard on 2025-08-28 at 17:39 CEST. +# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh. +# Wizard options: nerdfont-v3 + powerline, large icons, rainbow, unicode, 24h time, +# angled separators, sharp heads, flat tails, 2 lines, disconnected, no frame, compact, +# many icons, concise, instant_prompt=verbose. +# Type `p10k configure` to generate another config. +# +# Config for Powerlevel10k with powerline prompt style with colorful background. +# Type `p10k configure` to generate your own config based on it. +# +# Tip: Looking for a nice color? Here's a one-liner to print colormap. +# +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done + +# Temporarily change options. +'builtin' 'local' '-a' 'p10k_config_opts' +[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') +[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') +[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') +'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' + +() { + emulate -L zsh -o extended_glob + + # Unset all configuration options. This allows you to apply configuration changes without + # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' + + # Zsh >= 5.1 is required. + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return + + # The list of segments shown on the left. Fill it with the most important segments. + typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + os_icon # os identifier + dir # current directory + vcs # git status + # =========================[ Line #2 ]========================= + newline # \n + prompt_char # prompt symbol + ) + + # The list of segments shown on the right. Fill it with less important segments. + # Right prompt on the last prompt line (where you are typing your commands) gets + # automatically hidden when the input line reaches it. Right prompt above the + # last prompt line gets hidden if it would overlap with left prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + status # exit code of the last command + command_execution_time # duration of the last command + background_jobs # presence of background jobs + direnv # direnv status (https://direnv.net/) + asdf # asdf version manager (https://github.com/asdf-vm/asdf) + virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) + anaconda # conda environment (https://conda.io/) + pyenv # python environment (https://github.com/pyenv/pyenv) + goenv # go environment (https://github.com/syndbg/goenv) + nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) + nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) + nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) + # node_version # node.js version + # go_version # go version (https://golang.org) + # rust_version # rustc version (https://www.rust-lang.org) + # dotnet_version # .NET version (https://dotnet.microsoft.com) + # php_version # php version (https://www.php.net/) + # laravel_version # laravel php framework version (https://laravel.com/) + # java_version # java version (https://www.java.com/) + # package # name@version from package.json (https://docs.npmjs.com/files/package.json) + rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) + rvm # ruby version from rvm (https://rvm.io) + fvm # flutter version management (https://github.com/leoafarias/fvm) + luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) + jenv # java version from jenv (https://github.com/jenv/jenv) + plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) + phpenv # php version from phpenv (https://github.com/phpenv/phpenv) + scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) + haskell_stack # haskell version from stack (https://haskellstack.org/) + kubecontext # current kubernetes context (https://kubernetes.io/) + terraform # terraform workspace (https://www.terraform.io) + # terraform_version # terraform version (https://www.terraform.io) + aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) + aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) + azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) + gcloud # google cloud cli account and project (https://cloud.google.com/) + google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + toolbox # toolbox name (https://github.com/containers/toolbox) + context # user@hostname + nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) + ranger # ranger shell (https://github.com/ranger/ranger) + yazi # yazi shell (https://github.com/sxyazi/yazi) + nnn # nnn shell (https://github.com/jarun/nnn) + lf # lf shell (https://github.com/gokcehan/lf) + xplr # xplr shell (https://github.com/sayanarijit/xplr) + vim_shell # vim shell indicator (:sh) + midnight_commander # midnight commander shell (https://midnight-commander.org/) + nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) + # vi_mode # vi mode (you don't need this if you've enabled prompt_char) + # vpn_ip # virtual private network indicator + # load # CPU load + # disk_usage # disk usage + # ram # free RAM + # swap # used swap + todo # todo items (https://github.com/todotxt/todo.txt-cli) + timewarrior # timewarrior tracking status (https://timewarrior.net/) + taskwarrior # taskwarrior task count (https://taskwarrior.org/) + per_directory_history # Oh My Zsh per-directory-history local/global indicator + # cpu_arch # CPU architecture + time # current time + # =========================[ Line #2 ]========================= + newline + # ip # ip address and bandwidth usage for a specified network interface + # public_ip # public IP address + # proxy # system-wide http/https/ftp proxy + # battery # internal battery + # wifi # wifi speed + # example # example user-defined segment (see prompt_example function below) + ) + + # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. + typeset -g POWERLEVEL9K_MODE=nerdfont-v3 + # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid + # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. + typeset -g POWERLEVEL9K_ICON_PADDING=moderate + + # When set to true, icons appear before content on both sides of the prompt. When set + # to false, icons go after content. If empty or not set, icons go before content in the left + # prompt and after content in the right prompt. + # + # You can also override it for a specific segment: + # + # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false + # + # Or for a specific segment in specific state: + # + # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false + typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= + + # Add an empty line before each prompt. + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false + + # Connect left prompt lines with these symbols. You'll probably want to use the same color + # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= + # Connect right prompt lines with these symbols. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= + + # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or + # '─'. The last two make it easier to see the alignment between left and right prompt and to + # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false + # for more compact prompt if using this option. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= + if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then + # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE + # ornaments defined above. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 + # Start filler from the edge of the screen if there are no left segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' + # End filler on the edge of the screen if there are no right segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' + fi + + # Separator between same-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1' + # Separator between same-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3' + # Separator between different-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' + # Separator between different-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' + # To remove a separator between two segments, add "_joined" to the second segment name. + # For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined) + + # The right end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' + # The left end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' + # The left end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='' + # The right end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='' + # Left prompt terminator for lines without any segments. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + + #################################[ os_icon: os identifier ]################################## + # OS identifier color. + typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232 + typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' + + ################################[ prompt_char: prompt symbol ]################################ + # Transparent background. + typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= + # Green prompt symbol if the last command succeeded. + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 + # Red prompt symbol if the last command failed. + typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 + # Default prompt symbol. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' + # Prompt symbol in command vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' + # Prompt symbol in visual vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' + # Prompt symbol in overwrite vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' + typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true + # No line terminator if prompt_char is the last segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + # No line introducer if prompt_char is the first segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + # No surrounding whitespace. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= + + ##################################[ dir: current directory ]################################## + # Current directory background color. + typeset -g POWERLEVEL9K_DIR_BACKGROUND=4 + # Default current directory foreground color. + typeset -g POWERLEVEL9K_DIR_FOREGROUND=254 + # If directory is too long, shorten some of its segments to the shortest possible unique + # prefix. The shortened directory can be tab-completed to the original. + typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique + # Replace removed segment suffixes with this symbol. + typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= + # Color of the shortened directory segments. + typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250 + # Color of the anchor directory segments. Anchor segments are never shortened. The first + # segment is always an anchor. + typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255 + # Display anchor directory segments in bold. + typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true + # Don't shorten directories that contain any of these files. They are anchors. + local anchor_files=( + .bzr + .citc + .git + .hg + .node-version + .python-version + .go-version + .ruby-version + .lua-version + .java-version + .perl-version + .php-version + .tool-versions + .mise.toml + .shorten_folder_marker + .svn + .terraform + CVS + Cargo.toml + composer.json + go.mod + package.json + stack.yaml + ) + typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains + # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) + # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers + # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false + # Don't shorten this many last directory segments. They are anchors. + typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + # Shorten directory if it's longer than this even if there is space for it. The value can + # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, + # directory will be shortened only when prompt doesn't fit or when other parameters demand it + # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). + # If set to `0`, directory will always be shortened to its minimum length. + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this + # many columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least + # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 + # If set to true, embed a hyperlink into the directory. Useful for quickly + # opening a directory in the file manager simply by clicking the link. + # Can also be handy when the directory is shortened, as it allows you to see + # the full directory that was used in previous commands. + typeset -g POWERLEVEL9K_DIR_HYPERLINK=false + + # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON + # and POWERLEVEL9K_DIR_CLASSES below. + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 + + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. + # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' + + # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different + # directories. It must be an array with 3 * N elements. Each triplet consists of: + # + # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with + # extended_glob option enabled. + # 2. Directory class for the purpose of styling. + # 3. An empty string. + # + # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. + # + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=( + # '~/work(|/*)' WORK '' + # '~(|/*)' HOME '' + # '*' DEFAULT '') + # + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. + # + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an + # option to define custom colors and icons for different directory classes. + # + # # Styling for WORK. + # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NOT_WRITABLE. + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=255 + # + # If a styling parameter isn't explicitly defined for some class, it falls back to the classless + # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls + # back to POWERLEVEL9K_DIR_FOREGROUND. + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=() + + # Custom prefix. + # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' + + #####################################[ vcs: git status ]###################################### + # Version control background colors. + typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 + + # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' + + # Untracked files icon. It's really a question mark, your font isn't broken. + # Change the value of this parameter to show a different icon. + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + + # Formatter for Git status. + # + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # + # You can edit the function to customize how Git status looks. + # + # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: + # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. + function my_git_formatter() { + emulate -L zsh + + if [[ -n $P9K_CONTENT ]]; then + # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from + # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. + typeset -g my_git_format=$P9K_CONTENT + return + fi + + # Styling for different parts of Git status. + local meta='%7F' # white foreground + local clean='%0F' # black foreground + local modified='%0F' # black foreground + local untracked='%0F' # black foreground + local conflicted='%1F' # red foreground + + local res + + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" + fi + + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi + + # Display the current Git commit if there is no branch and no tag. + # Tip: To always display the current Git commit, delete the next line. + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + + # Show tracking branch name if it differs from local branch. + if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" + fi + + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + + if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then + # Tip: Uncomment the next line to display '=' if up to date with the remote. + # res+=" ${clean}=" + fi + + # ⇠42 if behind the push remote. + (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" + (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " + # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. + (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" + # *42 if have stashes. + (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" + # 'merge' if the repo is in an unusual state. + [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" + # ~42 if have merge conflicts. + (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" + # +42 if have staged changes. + (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" + # !42 if have unstaged changes. + (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" + # ?42 if have untracked files. It's really a question mark, your font isn't broken. + # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. + # Remove the next line if you don't want to see untracked files at all. + (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" + # "─" if the number of unstaged files is unknown. This can happen due to + # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower + # than the number of files in the Git index, or due to bash.showDirtyState being set to false + # in the repository config. The number of staged and untracked files may also be unknown + # in this case. + (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" + + typeset -g my_git_format=$res + } + functions -M my_git_formatter 2>/dev/null + + # Don't count the number of unstaged, untracked and conflicted files in Git repositories with + # more than this many files in the index. Negative value means infinity. + # + # If you are working in Git repositories with tens of millions of files and seeing performance + # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output + # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's + # config: `git config bash.showDirtyState false`. + typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 + + # Don't show Git status in prompt for repositories whose workdir matches this pattern. + # For example, if set to '~', the Git repository at $HOME/.git will be ignored. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. + typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' + + # Disable the default Git status formatting. + typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true + # Install our own Git status formatter. + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}' + # Enable counters for staged, unstaged, etc. + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 + + # Custom icon. + # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_VCS_PREFIX='on ' + + # Show status of repositories of these types. You can add svn and/or hg if you are + # using them. If you do, your prompt may become slow even when your current directory + # isn't in an svn or hg repository. + typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) + + ##########################[ status: exit code of the last command ]########################### + # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and + # style them independently from the regular OK and ERROR state. + typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true + + # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as + # it will signify success by turning green. + typeset -g POWERLEVEL9K_STATUS_OK=false + typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 + + # Status when some part of a pipe command fails but the overall exit status is zero. It may look + # like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 + + # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as + # it will signify error by turning red. + typeset -g POWERLEVEL9K_STATUS_ERROR=false + typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 + + # Status when the last command was terminated by a signal. + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true + # Use terse signal names: "INT" instead of "SIGINT(2)". + typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 + + # Status when some part of a pipe command fails and the overall exit status is also non-zero. + # It may look like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 + + ###################[ command_execution_time: duration of the last command ]################### + # Execution time color. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3 + # Show duration of the last command if takes at least this many seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 + # Show this many fractional digits. Zero means round to seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + # Duration format: 1d 2h 3m 4s. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + # Custom icon. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took ' + + #######################[ background_jobs: presence of background jobs ]####################### + # Background jobs color. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 + # Don't show the number of background jobs. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false + # Custom icon. + # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ direnv: direnv status (https://direnv.net/) ]######################## + # Direnv color. + typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 + typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override these parameters for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND and + # POWERLEVEL9K_ASDF_${TOOL}_BACKGROUND. + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 + + # There are four parameters that can be used to hide asdf tools. Each parameter describes + # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at + # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to + # hide a tool, it gets shown. + # + # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and + # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + + # If set to non-empty value, hide tools unless there is a file matching the specified file pattern + # in the current directory, or its parent directory, or its grandparent directory, and so on. + # + # Note: If this parameter is set to empty value, it won't hide tools. + # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. + # + # Example: Hide nodejs version when there is no package.json and no *.js files in the current + # directory, in `..`, in `../..` and so on. + # + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' + typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_GOLANG_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1 + typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' + + # PHP version from asdf. + typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PHP_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Haskell version from asdf. + typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_HASKELL_BACKGROUND=3 + # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### + # NordVPN connection indicator color. + typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 + typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 + # Hide NordVPN connection indicator when not connected. + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= + # Custom icon. + # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## + # Ranger shell color. + typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 + typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### + # Yazi shell color. + typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3 + typeset -g POWERLEVEL9K_YAZI_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### + # Nnn shell color. + typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 + typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]####################### + # lf shell color. + typeset -g POWERLEVEL9K_LF_FOREGROUND=0 + typeset -g POWERLEVEL9K_LF_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 + typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### + # Vim shell indicator color. + typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### + # Midnight Commander shell color. + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## + # Nix shell color. + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 + + # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. + # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false + + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. + # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ disk_usage: disk usage ]################################## + # Colors for different levels of disk usage. + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1 + # Thresholds for different levels of disk usage (percentage points). + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 + # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. + typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false + # Custom icon. + # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### + # Foreground color. + typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 + # Text and color for normal (a.k.a. command) vi mode. + typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL + typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 + # Text and color for visual vi mode. + typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL + typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 + # Text and color for overtype (a.k.a. overwrite and replace) vi mode. + typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE + typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 + # Text and color for insert vi mode. + typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= + typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 + # Custom icon. + # typeset -g POWERLEVEL9K_VI_MODE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ ram: free RAM ]####################################### + # RAM color. + typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################################[ swap: used swap ]###################################### + # Swap color. + typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 + typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ load: CPU load ]###################################### + # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. + typeset -g POWERLEVEL9K_LOAD_WHICH=5 + # Load color when load is under 50%. + typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 + # Load color when load is between 50% and 70%. + typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 + # Load color when load is over 70%. + typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 + # Custom icon. + # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ + # Todo color. + typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 + typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 + # Hide todo when the total number of tasks is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true + # Hide todo when the number of tasks after filtering is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false + + # Todo format. The following parameters are available within the expansion. + # + # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. + # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. + # + # These variables correspond to the last line of the output of `todo.sh -p ls`: + # + # TODO: 24 of 42 tasks shown + # + # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. + # + # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ + # Timewarrior color. + typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 + typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 + + # If the tracked task is longer than 24 characters, truncate and append "…". + # Tip: To always display tasks without truncation, delete the following parameter. + # Tip: To hide task names and display just the icon when time tracking is enabled, set the + # value of the following parameter to "". + typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' + + # Custom icon. + # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## + # Taskwarrior color. + typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 + typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 + + # Taskwarrior segment format. The following parameters are available within the expansion. + # + # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. + # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. + # + # Zero values are represented as empty parameters. + # + # The default format: + # + # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' + # + # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### + # Color when using local/global history. + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_BACKGROUND=5 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_BACKGROUND=3 + + # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' + + # Custom icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ cpu_arch: CPU architecture ]################################ + # CPU architecture color. + typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=0 + typeset -g POWERLEVEL9K_CPU_ARCH_BACKGROUND=3 + + # Hide the segment when on a specific CPU architecture. + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= + # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ context: user@hostname ]################################## + # Context color when running with privileges. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 + typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0 + # Context color in SSH without privileges. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0 + # Default context color (no privileges, no SSH). + typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0 + + # Context format when running with privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' + # Context format when in SSH without privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' + # Default context format (no privileges, no SSH): user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' + + # Don't show context unless running with privileges or in SSH. + # Tip: Remove the next line to always show context. + typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with ' + + ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### + # Python virtual environment color. + typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 + # Don't show Python version next to the virtual environment name. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false + # Separate environment name from Python version only with a space. + typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ anaconda: conda environment (https://conda.io/) ]###################### + # Anaconda environment color. + typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' + + # Custom icon. + # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ + # Pyenv color. + typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 + # Hide python version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) + # If set to false, hide python version if it's the same as global: + # $(pyenv version-name) == $(pyenv global). + typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide python version if it's equal to "system". + typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # The default format has the following logic: + # + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ + # Goenv color. + typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 + # Hide go version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) + # If set to false, hide go version if it's the same as global: + # $(goenv version-name) == $(goenv global). + typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide go version if it's equal to "system". + typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## + # Nodenv color. + typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 + # Hide node version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) + # If set to false, hide node version if it's the same as global: + # $(nodenv version-name) == $(nodenv global). + typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### + # Nvm color. + typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 + # If set to false, hide node version if it's the same as default: + # $(nvm version current) == $(nvm version default). + typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ + # Nodeenv color. + typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 + # Don't show Node version next to the environment name. + typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false + # Separate environment name from Node version only with a space. + typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############################[ node_version: node.js version ]############################### + # Node version color. + typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 + # Show node version only when in a directory tree containing package.json. + typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ go_version: go version (https://golang.org) ]######################## + # Go version color. + typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 + typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 + # Show go version only when in a go project subdirectory. + typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## + # Rust version color. + typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 + # Show rust version only when in a rust project subdirectory. + typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ + # .NET version color. + typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 + # Show .NET version only when in a .NET project subdirectory. + typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ php_version: php version (https://www.php.net/) ]###################### + # PHP version color. + typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5 + # Show PHP version only when in a PHP project subdirectory. + typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### + # Laravel version color. + typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## + # Rbenv color. + typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 + # Hide ruby version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) + # If set to false, hide ruby version if it's the same as global: + # $(rbenv version-name) == $(rbenv global). + typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide ruby version if it's equal to "system". + typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ java_version: java version (https://www.java.com/) ]#################### + # Java version color. + typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7 + # Show java version only when in a java project subdirectory. + typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true + # Show brief version. + typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false + # Custom icon. + # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### + # Package color. + typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 + typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 + + # Package format. The following parameters are available within the expansion. + # + # - P9K_PACKAGE_NAME The value of `name` field in package.json. + # - P9K_PACKAGE_VERSION The value of `version` field in package.json. + # + # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## + # Rvm color. + typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 + # Don't show @gemset at the end. + typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false + # Don't show ruby- at the front. + typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ + # Fvm color. + typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### + # Lua color. + typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 + # Hide lua version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) + # If set to false, hide lua version if it's the same as global: + # $(luaenv version-name) == $(luaenv global). + typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide lua version if it's equal to "system". + typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ + # Java color. + typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 + typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 + # Hide java version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) + # If set to false, hide java version if it's the same as global: + # $(jenv version-name) == $(jenv global). + typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide java version if it's equal to "system". + typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ + # Perl color. + typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 + # Hide perl version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) + # If set to false, hide perl version if it's the same as global: + # $(plenv version-name) == $(plenv global). + typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide perl version if it's equal to "system". + typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ + # Perlbrew color. + typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 + # Show perlbrew version only when in a perl project subdirectory. + typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true + # Don't show "perl-" at the front. + typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ + # PHP color. + typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 + # Hide php version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) + # If set to false, hide php version if it's the same as global: + # $(phpenv version-name) == $(phpenv global). + typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide PHP version if it's equal to "system". + typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### + # Haskell color. + typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 + typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3 + + # Hide haskell version if it doesn't come from one of these sources. + # + # shell: version is set by STACK_YAML + # local: version is set by stack.yaml up the directory tree + # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) + typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) + # If set to false, hide haskell version if it's the same as in the implicit global project. + typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true + # Custom icon. + # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform: terraform workspace (https://www.terraform.io) ]################# + # Don't show terraform workspace if it's literally "default". + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current terraform workspace is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' + + #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# + # Show kubecontext only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show kubecontext. + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' + + # Kubernetes context classes for the purpose of using different colors, icons and expansions with + # different contexts. + # + # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current kubernetes context gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current kubernetes context is "deathray-testing/default", its class is TEST + # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=0 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_BACKGROUND=2 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5 + # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext + # segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # Within the expansion the following parameters are always available: + # + # - P9K_CONTENT The content that would've been displayed if there was no content + # expansion defined. + # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE + # in the output of `kubectl config get-contexts`. If there is no + # namespace, the parameter is set to "default". + # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the + # output of `kubectl config get-contexts`. + # + # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), + # the following extra parameters are available: + # + # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. + # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. + # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. + # + # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, + # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=gke + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + # + # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=eks + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= + # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' + # Append the current context's namespace if it's not "default". + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' + + # Custom prefix. + # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' + + #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# + # Show aws only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show aws. + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current AWS profile gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current AWS profile is "company_test", its class is TEST + # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 + # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# + # AWS Elastic Beanstalk environment color. + typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## + # Show azure only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show azure. + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current azure account name gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current azure account is "company_test", its class is TEST because "company_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_AZURE_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + + # Azure account name color. + typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=7 + typeset -g POWERLEVEL9K_AZURE_OTHER_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### + # Show gcloud only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show gcloud. + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' + # Google cloud color. + typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 + typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 + + # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or + # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative + # enough. You can use the following parameters in the expansions. Each of them corresponds to the + # output of `gcloud` tool. + # + # Parameter | Source + # -------------------------|-------------------------------------------------------------------- + # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' + # P9K_GCLOUD_ACCOUNT | gcloud config get-value account + # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project + # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. + # + # Obtaining project name requires sending a request to Google servers. This can take a long time + # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud + # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets + # set and gcloud prompt segment transitions to state COMPLETE. + # + # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL + # and COMPLETE. You can also hide gcloud in state PARTIAL by setting + # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and + # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. + typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' + typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' + + # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name + # this often. Negative value disables periodic polling. In this mode project name is retrieved + # only when the current configuration, account or project id changes. + typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 + + # Custom icon. + # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# + # Show google_app_cred only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show google_app_cred. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' + + # Google application credentials classes for the purpose of using different colors, icons and + # expansions with different credentials. + # + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first + # element in each pair defines a pattern against which the current kubernetes context gets + # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion + # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION + # parameters, you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. + # The first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD + # '*:*test*:*' TEST + # '*' DEFAULT) + # + # If your current Google application credentials is "service_account deathray-testing x@y.com", + # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD # These values are examples that are unlikely + # '*:*test*:*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by + # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # You can use the following parameters in the expansion. Each of them corresponds to one of the + # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. + # + # Parameter | JSON key file field + # ---------------------------------+--------------- + # P9K_GOOGLE_APP_CRED_TYPE | type + # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id + # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0 + typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in ' + + ###############################[ public_ip: public IP address ]############################### + # Public IP color. + typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 + typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ########################[ vpn_ip: virtual private network indicator ]######################### + # VPN IP color. + typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 + typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 + # When on VPN, show just an icon without the IP address. + # Tip: To display the private IP address when on VPN, remove the next line. + typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)' + # If set to true, show one segment per matching network interface. If set to false, show only + # one segment corresponding to the first matching network interface. + # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. + typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false + # Custom icon. + # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_BACKGROUND=4 + typeset -g POWERLEVEL9K_IP_FOREGROUND=0 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+⇡$P9K_IP_TX_RATE }$P9K_IP_IP' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #########################[ proxy: system-wide http/https/ftp proxy ]########################## + # Proxy color. + typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 + typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ battery: internal battery ]################################# + # Show battery in red when it's below this level and not connected to power supply. + typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 + typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 + # Show battery in green when it's charging or fully charged. + typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 + # Show battery in yellow when it's discharging. + typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 + # Battery pictograms going from low to high level of charge. + typeset -g POWERLEVEL9K_BATTERY_STAGES='\UF008E\UF007A\UF007B\UF007C\UF007D\UF007E\UF007F\UF0080\UF0081\UF0082\UF0079' + # Don't show the remaining time to charge/discharge. + typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 + + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 + typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(0 0 0 0 0) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + + ####################################[ time: current time ]#################################### + # Current time color. + typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 + # Format for the current time: 09:51:02. See `man 3 strftime`. + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' + # If set to true, time will update when you hit enter. This way prompts for the past + # commands will contain the start times of their commands as opposed to the default + # behavior where they contain the end times of their preceding commands. + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + # Custom icon. + # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TIME_PREFIX='at ' + + # Example of a user-defined prompt segment. Function prompt_example will be called on every + # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or + # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and yellow text on red background + # greeting the user. + # + # Type `p10k help segment` for documentation and a more sophisticated example. + function prompt_example() { + p10k segment -b 1 -f 3 -i '⭐' -t 'hello, %n' + } + + # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job + # is to generate the prompt segment for display in instant prompt. See + # https://github.com/romkatv/powerlevel10k#instant-prompt. + # + # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function + # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k + # will replay these calls without actually calling instant_prompt_*. It is imperative that + # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this + # rule is not observed, the content of instant prompt will be incorrect. + # + # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If + # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. + function instant_prompt_example() { + # Since prompt_example always makes the same `p10k segment` calls, we can call it from + # instant_prompt_example. This will give us the same `example` prompt segment in the instant + # and regular prompts. + prompt_example + } + + # User-defined prompt segments can be customized the same way as built-in segments. + typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 + typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1 + # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt + # when accepting a command line. Supported values: + # + # - off: Don't change prompt when accepting a command line. + # - always: Trim down prompt when accepting a command line. + # - same-dir: Trim down prompt when accepting a command line unless this is the first command + # typed after changing current working directory. + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off + + # Instant prompt mode. + # + # - off: Disable instant prompt. Choose this if you've tried instant prompt and found + # it incompatible with your zsh configuration files. + # - quiet: Enable instant prompt and don't print warnings when detecting console output + # during zsh initialization. Choose this if you've read and understood + # https://github.com/romkatv/powerlevel10k#instant-prompt. + # - verbose: Enable instant prompt and print a warning when detecting console output during + # zsh initialization. Choose this if you've never tried instant prompt, haven't + # seen the warning, or if you are unsure what this all means. + typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose + + # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. + # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload + # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you + # really need it. + typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true + + # If p10k is already loaded, reload configuration. + # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. + (( ! $+functions[p10k] )) || p10k reload +} + +# Tell `p10k configure` which file it should overwrite. +typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} + +(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} +'builtin' 'unset' 'p10k_config_opts' diff --git a/home/vinzenz/zsh.nix b/home/vinzenz/zsh.nix index ba89d8ed..d7cbcfa7 100644 --- a/home/vinzenz/zsh.nix +++ b/home/vinzenz/zsh.nix @@ -4,8 +4,11 @@ initContent = '' # eval "$(direnv hook zsh)"; export PATH=$PATH:/home/vinzenz/.cargo/bin - ''; + source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme + + source ${./.zsh/p10k.zsh} + ''; enableCompletion = true; shellAliases = { From ac59b051579d3e6cb89a0449aba74a9f219a694f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 6 Sep 2025 17:24:30 +0200 Subject: [PATCH 0301/1295] update flake --- flake.lock | 104 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 72 insertions(+), 32 deletions(-) diff --git a/flake.lock b/flake.lock index 39bc9473..ac9a2f2e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,27 @@ { "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "naersk", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1752475459, + "narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=", + "owner": "nix-community", + "repo": "fenix", + "rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -40,11 +62,11 @@ ] }, "locked": { - "lastModified": 1753592768, - "narHash": "sha256-oV695RvbAE4+R9pcsT9shmp6zE/+IZe6evHWX63f2Qg=", + "lastModified": 1756679287, + "narHash": "sha256-Xd1vOeY9ccDf5VtVK12yM0FS6qqvfUop8UQlxEB+gTQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "fc3add429f21450359369af74c2375cb34a2d204", + "rev": "07fc025fe10487dd80f2ec694f1cd790e752d0e8", "type": "github" }, "original": { @@ -93,16 +115,17 @@ }, "naersk": { "inputs": { + "fenix": "fenix", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1752249768, - "narHash": "sha256-wKqMvhTqMgTKM/CdTH/ihq9eLZM95qpU0FG7cvTBFJg=", + "lastModified": 1752689277, + "narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=", "owner": "nix-community", "repo": "naersk", - "rev": "35aa63738857c40f98ecb04db52887d664836e74", + "rev": "0e72363d0938b0208d6c646d10649164c43f4d64", "type": "github" }, "original": { @@ -125,11 +148,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1755424351, - "narHash": "sha256-xcorYLNdtLpb0wH5CPlUcpmYQUxeK95j1X855xQw+DY=", + "lastModified": 1756801989, + "narHash": "sha256-eOIQ1CUMHwU4zsBGaCj9jCgNTxzyq2aeHuwgx0xLFwo=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "9aa137af01f05386e5bb5050e983750017007a66", + "rev": "d6a98b86d86b512c6167601ea646ab785137bada", "type": "github" }, "original": { @@ -141,16 +164,16 @@ "niri-stable": { "flake": false, "locked": { - "lastModified": 1748151941, - "narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=", + "lastModified": 1756556321, + "narHash": "sha256-RLD89dfjN0RVO86C/Mot0T7aduCygPGaYbog566F0Qo=", "owner": "YaLTeR", "repo": "niri", - "rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7", + "rev": "01be0e65f4eb91a9cd624ac0b76aaeab765c7294", "type": "github" }, "original": { "owner": "YaLTeR", - "ref": "v25.05.1", + "ref": "v25.08", "repo": "niri", "type": "github" } @@ -158,11 +181,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1755419373, - "narHash": "sha256-EFH3zbpyLYjEboNV2Lmkxf9joEuFCmeYX+MMLRPStpg=", + "lastModified": 1756728273, + "narHash": "sha256-7tYNlNO/qVRA6shdWxNuBMYOE+pGgxqE0f54S4Wr9PE=", "owner": "YaLTeR", "repo": "niri", - "rev": "a6febb86aa5af0df7bf2792ca027ef95a503d599", + "rev": "77465e11fe36fdd9bc0a304b96bb2558116568af", "type": "github" }, "original": { @@ -196,11 +219,11 @@ ] }, "locked": { - "lastModified": 1755396877, - "narHash": "sha256-92gZRDz3zEsodraI0ZxPzZrpjSqc2qjxTW9HOflzKFw=", + "lastModified": 1756778240, + "narHash": "sha256-fEN9e5eTYTYiLWDgIm0LpfBZ/IKEmP+BvmDtg2HeHUY=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "0cf076c0bafbe7cbd33a3b7377ed24827674e8be", + "rev": "88023dda65dbb10c52aa03b39a0426024ad8e543", "type": "github" }, "original": { @@ -211,11 +234,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1755274400, - "narHash": "sha256-rTInmnp/xYrfcMZyFMH3kc8oko5zYfxsowaLv1LVobY=", + "lastModified": 1756754095, + "narHash": "sha256-9Rsn9XEWINExosFkKEqdp8EI6Mujr1gmQiyrEcts2ls=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad7196ae55c295f53a7d1ec39e4a06d922f3b899", + "rev": "7c815e513adbf03c9098b2bd230c1e0525c8a7f9", "type": "github" }, "original": { @@ -227,11 +250,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1755268003, - "narHash": "sha256-nNaeJjo861wFR0tjHDyCnHs1rbRtrMgxAKMoig9Sj/w=", + "lastModified": 1756696532, + "narHash": "sha256-6FWagzm0b7I/IGigOv9pr6LL7NQ86mextfE8g8Q6HBg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "32f313e49e42f715491e1ea7b306a87c16fe0388", + "rev": "58dcbf1ec551914c3756c267b8b9c8c86baa1b2f", "type": "github" }, "original": { @@ -257,6 +280,23 @@ "zerforschen-plus": "zerforschen-plus" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1752428706, + "narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "591e3b7624be97e4443ea7b5542c191311aa141d", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "servicepoint-cli": { "inputs": { "naersk": [ @@ -327,16 +367,16 @@ "xwayland-satellite-stable": { "flake": false, "locked": { - "lastModified": 1748488455, - "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", + "lastModified": 1755491097, + "narHash": "sha256-m+9tUfsmBeF2Gn4HWa6vSITZ4Gz1eA1F5Kh62B0N4oE=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", + "rev": "388d291e82ffbc73be18169d39470f340707edaa", "type": "github" }, "original": { "owner": "Supreeeme", - "ref": "v0.6", + "ref": "v0.7", "repo": "xwayland-satellite", "type": "github" } @@ -344,11 +384,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1755219541, - "narHash": "sha256-yKV6xHaPbEbh5RPxAJnb9yTs1wypr7do86hFFGQm1w8=", + "lastModified": 1756679414, + "narHash": "sha256-yQGJ/n6mRwoIQnaL5oV2TGOHg4SEHpINTaoHrvkjr1Q=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "5a184d435927c3423f0ad189ea2b490578450fb7", + "rev": "c0497c990d46fcc012d9deff885bbe533e91e044", "type": "github" }, "original": { From 857471d3db7ff605ab8b33ded4b6c7c95f870bb9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 6 Sep 2025 19:16:13 +0200 Subject: [PATCH 0302/1295] remove pins, comment out nix for lp2 --- flake.lock | 66 ++++++++++++++++++++++++++------- flake.nix | 67 +++++++++++++++------------------- home/vinzenz/default.nix | 2 +- home/vinzenz/niri.nix | 2 - hosts/vinzenz-lpt2/imports.nix | 2 +- 5 files changed, 83 insertions(+), 56 deletions(-) diff --git a/flake.lock b/flake.lock index ac9a2f2e..dd59ff39 100644 --- a/flake.lock +++ b/flake.lock @@ -40,6 +40,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flakey-profile": { "locked": { "lastModified": 1712898590, @@ -92,9 +110,7 @@ }, "lix-module": { "inputs": { - "flake-utils": [ - "flake-utils" - ], + "flake-utils": "flake-utils", "flakey-profile": "flakey-profile", "lix": "lix", "nixpkgs": [ @@ -209,11 +225,24 @@ "type": "github" } }, + "nix-filter_2": { + "locked": { + "lastModified": 1731533336, + "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, "nix-vscode-extensions": { "inputs": { - "flake-utils": [ - "flake-utils" - ], + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ] @@ -266,12 +295,10 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", "home-manager": "home-manager", "lix-module": "lix-module", "naersk": "naersk", "niri": "niri", - "nix-filter": "nix-filter", "nix-vscode-extensions": "nix-vscode-extensions", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", @@ -302,9 +329,7 @@ "naersk": [ "naersk" ], - "nix-filter": [ - "nix-filter" - ], + "nix-filter": "nix-filter", "nixpkgs": [ "nixpkgs" ] @@ -328,9 +353,7 @@ "naersk": [ "naersk" ], - "nix-filter": [ - "nix-filter" - ], + "nix-filter": "nix-filter_2", "nixpkgs": [ "nixpkgs" ] @@ -364,6 +387,21 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "xwayland-satellite-stable": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 1791bbb9..e719f8d5 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,6 @@ url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"; inputs = { nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; }; }; @@ -38,7 +37,6 @@ inputs = { nixpkgs.follows = "nixpkgs"; naersk.follows = "naersk"; - nix-filter.follows = "nix-filter"; }; }; @@ -47,7 +45,6 @@ inputs = { nixpkgs.follows = "nixpkgs"; naersk.follows = "naersk"; - nix-filter.follows = "nix-filter"; }; }; @@ -55,13 +52,8 @@ url = "github:nix-community/nix-vscode-extensions"; inputs = { nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; }; }; - - # this is used to pin transitive dependencies to the same version - flake-utils.url = "github:numtide/flake-utils"; - nix-filter.url = "github:numtide/nix-filter"; }; outputs = @@ -104,42 +96,41 @@ in nixpkgs.lib.nixosSystem { inherit system specialArgs; - modules = - [ - lix-module.nixosModules.default + modules = [ + lix-module.nixosModules.default - { networking.hostName = device; } + { networking.hostName = device; } - ./modules/globalinstalls.nix - ./modules/networking.nix - ./modules/nixpkgs.nix + ./modules/globalinstalls.nix + ./modules/networking.nix + ./modules/nixpkgs.nix - ./hosts/${device}/hardware.nix - ./hosts/${device}/imports.nix - ./hosts/${device}/configuration.nix + ./hosts/${device}/hardware.nix + ./hosts/${device}/imports.nix + ./hosts/${device}/configuration.nix - { - nixpkgs.overlays = [ - overlays.unstable-packages - ]; - } - ] - ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ - home-manager.nixosModules.home-manager - { home-manager.extraSpecialArgs = specialArgs; } - ./modules/home-manager.nix + { + nixpkgs.overlays = [ + overlays.unstable-packages + ]; + } + ] + ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ + home-manager.nixosModules.home-manager + { home-manager.extraSpecialArgs = specialArgs; } + ./modules/home-manager.nix - ./modules/i18n.nix + ./modules/i18n.nix - niri.nixosModules.niri - { - nixpkgs.overlays = [ - niri.overlays.niri - overlays.servicepoint-packages - nix-vscode-extensions.overlays.default - ]; - } - ]); + niri.nixosModules.niri + { + nixpkgs.overlays = [ + niri.overlays.niri + overlays.servicepoint-packages + nix-vscode-extensions.overlays.default + ]; + } + ]); } ); diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index db555969..6e0ff643 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -30,7 +30,7 @@ ./fuzzel.nix ./git.nix ./gnome.nix - ./niri.nix + #./niri.nix ./ssh.nix ./swaylock.nix ./vscode.nix diff --git a/home/vinzenz/niri.nix b/home/vinzenz/niri.nix index 7c90a935..3cb557aa 100644 --- a/home/vinzenz/niri.nix +++ b/home/vinzenz/niri.nix @@ -1,7 +1,5 @@ { pkgs, - lib, - devices, config, ... }: diff --git a/hosts/vinzenz-lpt2/imports.nix b/hosts/vinzenz-lpt2/imports.nix index 7e9f61af..f9a0ae19 100644 --- a/hosts/vinzenz-lpt2/imports.nix +++ b/hosts/vinzenz-lpt2/imports.nix @@ -4,7 +4,7 @@ ../../modules/gaming.nix ../../modules/printing.nix ../../modules/podman.nix - ../../modules/niri.nix + #../../modules/niri.nix ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix From 88f192d38dd9970ac4cd1b575f0a9e9fa17f927a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 6 Sep 2025 20:28:38 +0200 Subject: [PATCH 0303/1295] anubis test --- hosts/vinzenz-lpt2/nginx.nix | 80 ++++++++++++++++++++++++++---------- 1 file changed, 58 insertions(+), 22 deletions(-) diff --git a/hosts/vinzenz-lpt2/nginx.nix b/hosts/vinzenz-lpt2/nginx.nix index c0715f0c..302a271d 100644 --- a/hosts/vinzenz-lpt2/nginx.nix +++ b/hosts/vinzenz-lpt2/nginx.nix @@ -1,30 +1,66 @@ -_: { - services.nginx = { - enable = true; +{ inputs, pkgs, ... }: +let + blog-domain-socket = "/run/nginx/blog.sock"; + anubis-domain-socket = "/run/anubis/anubis-blog.sock"; +in +{ + users.groups = { + anubis.members = [ "nginx" ]; + nginx.members = [ "anubis" ]; + }; + services = { + nginx = { + enable = true; - recommendedProxySettings = true; - recommendedTlsSettings = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; - virtualHosts = { - "vinzenz-lpt2" = { - locations."/" = { - proxyPass = "http://127.0.0.1:3000/"; - proxyWebsockets = true; + virtualHosts = { + #"vinzenz-lpt2" = { + # locations."/" = { + # proxyPass = "http://127.0.0.1:3000/"; + # proxyWebsockets = true; + # }; + # + # serverAliases = [ "172.23.42.96" ]; + #}; + + "vinzenz-lpt2" = { + locations."/" = { + proxyPass = ("http://unix:" + anubis-domain-socket); + }; }; - serverAliases = [ "172.23.42.96" ]; + "vinzenz-lpt2-in-anubis" = { + root = inputs.zerforschen-plus.packages."${pkgs.system}".zerforschen-plus-content; + listen = [ + { + addr = ("unix:" + blog-domain-socket); + } + ]; + }; + }; + }; + + #networking.firewall = { + # allowedTCPPorts = [ + # 80 + # 8001 + # 3000 + # ]; + # allowedUDPPorts = [ 2342 ]; + #}; + + anubis = { + instances.main = { + enable = true; + settings = { + BIND = anubis-domain-socket; + TARGET = "unix://" + blog-domain-socket; + }; }; }; }; - - networking.firewall = { - allowedTCPPorts = [ - 80 - 8001 - 3000 - ]; - allowedUDPPorts = [ 2342 ]; - }; } From 2909c9001af29dfea02c91b116a724030fd3a67a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 6 Sep 2025 20:34:58 +0200 Subject: [PATCH 0304/1295] anubis for blog --- hosts/hetzner-vpn2/nginx.nix | 49 ++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix index ff00daa6..b29451ae 100644 --- a/hosts/hetzner-vpn2/nginx.nix +++ b/hosts/hetzner-vpn2/nginx.nix @@ -1,4 +1,8 @@ -{ pkgs, inputs, ... }: +{ inputs, pkgs, ... }: +let + blog-domain-socket = "/run/nginx/blog.sock"; + anubis-domain-socket = "/run/anubis/anubis-blog.sock"; +in { security.acme = { acceptTerms = true; @@ -6,8 +10,16 @@ }; security.pam.services.nginx.setEnvironment = false; - systemd.services.nginx.serviceConfig = { - SupplementaryGroups = [ "shadow" ]; + systemd.services = { + nginx.serviceConfig = { + SupplementaryGroups = [ + "shadow" + "anubis" + ]; + }; + anubis-main.serviceConfig = { + SupplementaryGroups = [ "nginx" ]; + }; }; services.nginx = { @@ -58,13 +70,34 @@ "zerforschen.plus" = { addSSL = true; enableACME = true; + locations."/" = { + proxyPass = ("http://unix:" + anubis-domain-socket); + }; + }; + + "vinzenz-lpt2-in-anubis" = { root = inputs.zerforschen-plus.packages."${pkgs.system}".zerforschen-plus-content; + listen = [ + { + addr = ("unix:" + blog-domain-socket); + } + ]; }; }; - }; - networking.firewall.allowedTCPPorts = [ - 80 - 443 - ]; + anubis = { + instances.main = { + enable = true; + settings = { + BIND = anubis-domain-socket; + TARGET = "unix://" + blog-domain-socket; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; + }; } From d3555228be6209952ca855b935b74ec4785df54e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 6 Sep 2025 20:41:45 +0200 Subject: [PATCH 0305/1295] add port for some reason --- hosts/hetzner-vpn2/nginx.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix index b29451ae..7d161c31 100644 --- a/hosts/hetzner-vpn2/nginx.nix +++ b/hosts/hetzner-vpn2/nginx.nix @@ -98,6 +98,7 @@ in networking.firewall.allowedTCPPorts = [ 80 443 + 5201 ]; }; } From d04005b782e11d628f14bfffd0b0c2b5faeec591 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 6 Sep 2025 20:43:21 +0200 Subject: [PATCH 0306/1295] fix brackets --- hosts/hetzner-vpn2/nginx.nix | 128 ++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 63 deletions(-) diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix index 7d161c31..e9955a3f 100644 --- a/hosts/hetzner-vpn2/nginx.nix +++ b/hosts/hetzner-vpn2/nginx.nix @@ -22,68 +22,70 @@ in }; }; - services.nginx = { - enable = true; - additionalModules = [ pkgs.nginxModules.pam ]; + services = { + nginx = { + enable = true; + additionalModules = [ pkgs.nginxModules.pam ]; - recommendedProxySettings = true; - recommendedTlsSettings = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; - virtualHosts = - #let - # servicesDomain = "services.zerforschen.plus"; - # mkServiceConfig = - # { host, port }: - # { - # addSSL = true; - # enableACME = true; - # locations."/" = { - # proxyPass = "http://${host}:${toString port}/"; - # extraConfig = '' - # # bind to tailscale ip - # proxy_bind 100.88.118.60; - # # pam auth - # limit_except OPTIONS { - # auth_pam "Password Required"; - # auth_pam_service_name "nginx"; - # } - # ''; - # }; - # }; - # pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; - #in - { - #"code.${servicesDomain}" = lib.mkMerge [ - # (mkServiceConfig { - # host = pc2; - # port = 8542; - # }) - # { locations."/".proxyWebsockets = true; } - #]; - #"view.${servicesDomain}" = mkServiceConfig { - # host = pc2; - # port = 1313; - #}; + virtualHosts = + #let + # servicesDomain = "services.zerforschen.plus"; + # mkServiceConfig = + # { host, port }: + # { + # addSSL = true; + # enableACME = true; + # locations."/" = { + # proxyPass = "http://${host}:${toString port}/"; + # extraConfig = '' + # # bind to tailscale ip + # proxy_bind 100.88.118.60; + # # pam auth + # limit_except OPTIONS { + # auth_pam "Password Required"; + # auth_pam_service_name "nginx"; + # } + # ''; + # }; + # }; + # pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; + #in + { + #"code.${servicesDomain}" = lib.mkMerge [ + # (mkServiceConfig { + # host = pc2; + # port = 8542; + # }) + # { locations."/".proxyWebsockets = true; } + #]; + #"view.${servicesDomain}" = mkServiceConfig { + # host = pc2; + # port = 1313; + #}; - "zerforschen.plus" = { - addSSL = true; - enableACME = true; - locations."/" = { - proxyPass = ("http://unix:" + anubis-domain-socket); + "zerforschen.plus" = { + addSSL = true; + enableACME = true; + locations."/" = { + proxyPass = ("http://unix:" + anubis-domain-socket); + }; + }; + + "vinzenz-lpt2-in-anubis" = { + root = inputs.zerforschen-plus.packages."${pkgs.system}".zerforschen-plus-content; + listen = [ + { + addr = ("unix:" + blog-domain-socket); + } + ]; }; }; - - "vinzenz-lpt2-in-anubis" = { - root = inputs.zerforschen-plus.packages."${pkgs.system}".zerforschen-plus-content; - listen = [ - { - addr = ("unix:" + blog-domain-socket); - } - ]; - }; - }; + }; anubis = { instances.main = { @@ -94,11 +96,11 @@ in }; }; }; - - networking.firewall.allowedTCPPorts = [ - 80 - 443 - 5201 - ]; }; + + networking.firewall.allowedTCPPorts = [ + 80 + 443 + 5201 + ]; } From c7ac4077526172ca06ed0c2821acbe5a95f37f89 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 7 Sep 2025 18:37:17 +0200 Subject: [PATCH 0307/1295] remove insync --- home/vinzenz/configuration.nix | 1 - home/vinzenz/default.nix | 3 --- 2 files changed, 4 deletions(-) diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix index 37da5362..74be21f3 100644 --- a/home/vinzenz/configuration.nix +++ b/home/vinzenz/configuration.nix @@ -31,7 +31,6 @@ home.packages = with pkgs; [ keepassxc - insync telegram-desktop element-desktop diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix index 6e0ff643..e555eba3 100644 --- a/home/vinzenz/default.nix +++ b/home/vinzenz/default.nix @@ -39,9 +39,6 @@ ]; allowedUnfreePackages = [ - "insync" - "insync-pkg" - "rider" "pycharm-professional" "jetbrains-toolbox" From 3da7dd3bca0d5f853f62d0caf05dc57f9b9ee487 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 7 Sep 2025 18:37:28 +0200 Subject: [PATCH 0308/1295] fix virtualhost name --- hosts/hetzner-vpn2/nginx.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix index e9955a3f..8fa27c6a 100644 --- a/hosts/hetzner-vpn2/nginx.nix +++ b/hosts/hetzner-vpn2/nginx.nix @@ -76,7 +76,7 @@ in }; }; - "vinzenz-lpt2-in-anubis" = { + "blog-in-anubis" = { root = inputs.zerforschen-plus.packages."${pkgs.system}".zerforschen-plus-content; listen = [ { From ea0fb2b24dfc816bbc7c88a5986adaee80ca7608 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 7 Sep 2025 18:39:17 +0200 Subject: [PATCH 0309/1295] nix flake update --- flake.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index dd59ff39..3c236ae6 100644 --- a/flake.lock +++ b/flake.lock @@ -164,11 +164,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1756801989, - "narHash": "sha256-eOIQ1CUMHwU4zsBGaCj9jCgNTxzyq2aeHuwgx0xLFwo=", + "lastModified": 1757246205, + "narHash": "sha256-x+cTvOZL5Fwa/YVmfMEnXg1+bjj4e8wYGoe1pt6c/oM=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "d6a98b86d86b512c6167601ea646ab785137bada", + "rev": "4f38421373b783cfbe395973fda7a1b39af60200", "type": "github" }, "original": { @@ -197,11 +197,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1756728273, - "narHash": "sha256-7tYNlNO/qVRA6shdWxNuBMYOE+pGgxqE0f54S4Wr9PE=", + "lastModified": 1757242823, + "narHash": "sha256-EqZPBr+fPs7uoFCDLxRa8kRcrUgn0kZTVTky/7I81aI=", "owner": "YaLTeR", "repo": "niri", - "rev": "77465e11fe36fdd9bc0a304b96bb2558116568af", + "rev": "22f629c24b9f81a2fcaaf3a79d75128484c6ed78", "type": "github" }, "original": { @@ -248,11 +248,11 @@ ] }, "locked": { - "lastModified": 1756778240, - "narHash": "sha256-fEN9e5eTYTYiLWDgIm0LpfBZ/IKEmP+BvmDtg2HeHUY=", + "lastModified": 1757210357, + "narHash": "sha256-bg36ANsd4jVmTMYhYpRoYoNh+9Z6d6VMJm8iKI2xBYQ=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "88023dda65dbb10c52aa03b39a0426024ad8e543", + "rev": "34a2ba2ce0129dc06db7e1b9a5a4d3441f24b4a7", "type": "github" }, "original": { @@ -263,11 +263,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1756754095, - "narHash": "sha256-9Rsn9XEWINExosFkKEqdp8EI6Mujr1gmQiyrEcts2ls=", + "lastModified": 1757020766, + "narHash": "sha256-PLoSjHRa2bUbi1x9HoXgTx2AiuzNXs54c8omhadyvp0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7c815e513adbf03c9098b2bd230c1e0525c8a7f9", + "rev": "fe83bbdde2ccdc2cb9573aa846abe8363f79a97a", "type": "github" }, "original": { @@ -279,11 +279,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1756696532, - "narHash": "sha256-6FWagzm0b7I/IGigOv9pr6LL7NQ86mextfE8g8Q6HBg=", + "lastModified": 1757034884, + "narHash": "sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "58dcbf1ec551914c3756c267b8b9c8c86baa1b2f", + "rev": "ca77296380960cd497a765102eeb1356eb80fed0", "type": "github" }, "original": { @@ -422,11 +422,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1756679414, - "narHash": "sha256-yQGJ/n6mRwoIQnaL5oV2TGOHg4SEHpINTaoHrvkjr1Q=", + "lastModified": 1757179758, + "narHash": "sha256-TIvyWzRt1miQj6Cf5Wy8Qz43XIZX7c4vTVwRLAT5S4Y=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "c0497c990d46fcc012d9deff885bbe533e91e044", + "rev": "970728d0d9d1eada342bb8860af214b601139e58", "type": "github" }, "original": { From f49c5f4fd257bb4405a75c6c56a9b08403c68b1a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 10 Sep 2025 22:41:31 +0200 Subject: [PATCH 0310/1295] wip hass --- hosts/vinzenz-pc2/configuration.nix | 1 + hosts/vinzenz-pc2/hass.nix | 62 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 hosts/vinzenz-pc2/hass.nix diff --git a/hosts/vinzenz-pc2/configuration.nix b/hosts/vinzenz-pc2/configuration.nix index 812f6f09..fcd92565 100644 --- a/hosts/vinzenz-pc2/configuration.nix +++ b/hosts/vinzenz-pc2/configuration.nix @@ -3,6 +3,7 @@ imports = [ ./hardware.nix ./vscode-server.nix + ./hass.nix ]; config = { nix.settings.extra-platforms = [ diff --git a/hosts/vinzenz-pc2/hass.nix b/hosts/vinzenz-pc2/hass.nix new file mode 100644 index 00000000..187cc30f --- /dev/null +++ b/hosts/vinzenz-pc2/hass.nix @@ -0,0 +1,62 @@ +{ pkgs, ... }: +let + hass-image = "ghcr.io/home-assistant/home-assistant:stable"; + hass-service = "podman-homeassistant"; +in +{ + virtualisation.oci-containers = { + backend = "podman"; + containers.homeassistant = { + image = hass-image; + hostname = "hass.lan"; + serviceName = hass-service; + volumes = [ "home-assistant:/config" ]; + environment.TZ = "Europe/Berlin"; + extraOptions = [ "--network=host" ]; + }; + }; + + systemd = { + timers.update-hass = { + timerConfig = { + Unit = "update-hass.service"; + OnCalendar = "Sun 02:00"; + }; + wantedBy = [ "timers.target" ]; + }; + + services.update-hass = { + serviceConfig = { + Type = "oneshot"; + ExecStart = pkgs.writeShellScriptBin "update-hass" '' + podman pull ${hass-image}; + systemctl restart ${hass-service}; + ''; + }; + }; + }; + + services = { + mosquitto = { + enable = true; + }; + + nginx = { + enable = true; + + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + + # TODO: add ssl + # TODO: add pam auth + + virtualHosts."hass.lan" = { + locations."/" = { + proxyPass = "localhost:8123"; + }; + }; + }; + }; +} From 14eb2e1aaaadbe432c33281f44acf4ed9f10ae59 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 10 Sep 2025 22:58:37 +0200 Subject: [PATCH 0311/1295] nix flake update --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 3c236ae6..8f4a4b0d 100644 --- a/flake.lock +++ b/flake.lock @@ -164,11 +164,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1757246205, - "narHash": "sha256-x+cTvOZL5Fwa/YVmfMEnXg1+bjj4e8wYGoe1pt6c/oM=", + "lastModified": 1757437545, + "narHash": "sha256-7ssbrFnmSrqtCtOySiu5ncyOBxPrR6p2nhNHrg6D+fo=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "4f38421373b783cfbe395973fda7a1b39af60200", + "rev": "ef694b996daeeb8684c0adfaa9b7067a6e709054", "type": "github" }, "original": { @@ -197,11 +197,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1757242823, - "narHash": "sha256-EqZPBr+fPs7uoFCDLxRa8kRcrUgn0kZTVTky/7I81aI=", + "lastModified": 1757358784, + "narHash": "sha256-UNeUJW3c10z0aMJ87QKS85C/JgK9ng6pdRS0EwY6OLg=", "owner": "YaLTeR", "repo": "niri", - "rev": "22f629c24b9f81a2fcaaf3a79d75128484c6ed78", + "rev": "bdee1a657699a77bc4cdb050f7355f37f64c45a6", "type": "github" }, "original": { @@ -248,11 +248,11 @@ ] }, "locked": { - "lastModified": 1757210357, - "narHash": "sha256-bg36ANsd4jVmTMYhYpRoYoNh+9Z6d6VMJm8iKI2xBYQ=", + "lastModified": 1757469080, + "narHash": "sha256-nBBLIfu1ugSFRLtOpOt7OkQTrUMOjH0hzCcfDAQF3Yc=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "34a2ba2ce0129dc06db7e1b9a5a4d3441f24b4a7", + "rev": "34d1884d25d6eb93cf1c3434e04407f2b88c9dea", "type": "github" }, "original": { @@ -263,11 +263,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1757020766, - "narHash": "sha256-PLoSjHRa2bUbi1x9HoXgTx2AiuzNXs54c8omhadyvp0=", + "lastModified": 1757408970, + "narHash": "sha256-aSgK4BLNFFGvDTNKPeB28lVXYqVn8RdyXDNAvgGq+k0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fe83bbdde2ccdc2cb9573aa846abe8363f79a97a", + "rev": "d179d77c139e0a3f5c416477f7747e9d6b7ec315", "type": "github" }, "original": { From 506aed82ff3c1ed3a1adb2d3a450d4e19ef03d1f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 12 Sep 2025 23:51:00 +0200 Subject: [PATCH 0312/1295] change formatter to nixfmt-tree, reformat --- flake.nix | 18 ++++++++++++++---- home/vinzenz/gnome.nix | 17 ++++++++++------- hosts/vinzenz-lpt2/configuration.nix | 5 ++++- hosts/vinzenz-pc2/configuration.nix | 2 +- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index e719f8d5..8d5ee19c 100644 --- a/flake.nix +++ b/flake.nix @@ -85,6 +85,19 @@ "ronja-pc" ]; forDevice = f: nixpkgs.lib.mapAttrs f devices; + supported-systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + forAllSystems = + f: + nixpkgs.lib.genAttrs supported-systems ( + system: + f rec { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + } + ); in rec { nixosConfigurations = forDevice ( @@ -148,9 +161,6 @@ }; }; - formatter = { - x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; - aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.nixfmt-rfc-style; - }; + formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); }; } diff --git a/home/vinzenz/gnome.nix b/home/vinzenz/gnome.nix index c8d5a5e0..5648cf6b 100644 --- a/home/vinzenz/gnome.nix +++ b/home/vinzenz/gnome.nix @@ -1,13 +1,16 @@ { pkgs, ... }: { config = { - home.packages = with pkgs.gnomeExtensions; [ - gsconnect - # battery-health-charging - quick-settings-tweaker - solaar-extension - alphabetical-app-grid - ] ++ (with pkgs; [foliate]); + home.packages = + with pkgs.gnomeExtensions; + [ + gsconnect + # battery-health-charging + quick-settings-tweaker + solaar-extension + alphabetical-app-grid + ] + ++ (with pkgs; [ foliate ]); dconf.settings = { "org/gnome/shell" = { diff --git a/hosts/vinzenz-lpt2/configuration.nix b/hosts/vinzenz-lpt2/configuration.nix index b627078a..b38f25a9 100644 --- a/hosts/vinzenz-lpt2/configuration.nix +++ b/hosts/vinzenz-lpt2/configuration.nix @@ -37,6 +37,9 @@ }; }; - networking.firewall.allowedTCPPorts = [ 8776 1337 ]; + networking.firewall.allowedTCPPorts = [ + 8776 + 1337 + ]; }; } diff --git a/hosts/vinzenz-pc2/configuration.nix b/hosts/vinzenz-pc2/configuration.nix index fcd92565..4f6b859c 100644 --- a/hosts/vinzenz-pc2/configuration.nix +++ b/hosts/vinzenz-pc2/configuration.nix @@ -31,6 +31,6 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' ]; - environment.systemPackages = with pkgs; [lact]; + environment.systemPackages = with pkgs; [ lact ]; }; } From c858ac5d4c3b2773a5b9bb0683352553b8ca11f7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 01:18:18 +0200 Subject: [PATCH 0313/1295] new lix installation method --- flake.lock | 86 +------------------------------------------------ flake.nix | 11 +------ modules/lix.nix | 12 +++++++ 3 files changed, 14 insertions(+), 95 deletions(-) create mode 100644 modules/lix.nix diff --git a/flake.lock b/flake.lock index 8f4a4b0d..f49bda1c 100644 --- a/flake.lock +++ b/flake.lock @@ -40,39 +40,6 @@ "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flakey-profile": { - "locked": { - "lastModified": 1712898590, - "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", - "owner": "lf-", - "repo": "flakey-profile", - "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", - "type": "github" - }, - "original": { - "owner": "lf-", - "repo": "flakey-profile", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -94,41 +61,6 @@ "type": "github" } }, - "lix": { - "flake": false, - "locked": { - "lastModified": 1746827285, - "narHash": "sha256-hsFe4Tsqqg4l+FfQWphDtjC79WzNCZbEFhHI8j2KJzw=", - "rev": "47aad376c87e2e65967f17099277428e4b3f8e5a", - "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/47aad376c87e2e65967f17099277428e4b3f8e5a.tar.gz?rev=47aad376c87e2e65967f17099277428e4b3f8e5a" - }, - "original": { - "type": "tarball", - "url": "https://git.lix.systems/lix-project/lix/archive/2.93.0.tar.gz" - } - }, - "lix-module": { - "inputs": { - "flake-utils": "flake-utils", - "flakey-profile": "flakey-profile", - "lix": "lix", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1746838955, - "narHash": "sha256-11R4K3iAx4tLXjUs+hQ5K90JwDABD/XHhsM9nkeS5N8=", - "rev": "cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc", - "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc.tar.gz?rev=cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc" - }, - "original": { - "type": "tarball", - "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz" - } - }, "naersk": { "inputs": { "fenix": "fenix", @@ -242,7 +174,7 @@ }, "nix-vscode-extensions": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils", "nixpkgs": [ "nixpkgs" ] @@ -296,7 +228,6 @@ "root": { "inputs": { "home-manager": "home-manager", - "lix-module": "lix-module", "naersk": "naersk", "niri": "niri", "nix-vscode-extensions": "nix-vscode-extensions", @@ -387,21 +318,6 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "xwayland-satellite-stable": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 8d5ee19c..c7e62e0b 100644 --- a/flake.nix +++ b/flake.nix @@ -9,13 +9,6 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - lix-module = { - url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; - niri = { url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; @@ -61,7 +54,6 @@ self, nixpkgs, home-manager, - lix-module, niri, zerforschen-plus, nixpkgs-unstable, @@ -110,13 +102,12 @@ nixpkgs.lib.nixosSystem { inherit system specialArgs; modules = [ - lix-module.nixosModules.default - { networking.hostName = device; } ./modules/globalinstalls.nix ./modules/networking.nix ./modules/nixpkgs.nix + ./modules/lix.nix ./hosts/${device}/hardware.nix ./hosts/${device}/imports.nix diff --git a/modules/lix.nix b/modules/lix.nix new file mode 100644 index 00000000..55a32659 --- /dev/null +++ b/modules/lix.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + nixpkgs.overlays = [ (final: prev: { + inherit (prev.lixPackageSets.stable) + nixpkgs-review + nix-eval-jobs + nix-fast-build + colmena; + }) ]; + + nix.package = pkgs.lixPackageSets.stable.lix; +} From 05c888f20ad4e7db0f11c057b3469da2d6d9db88 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 12:39:02 +0200 Subject: [PATCH 0314/1295] nix flake update --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index f49bda1c..44edeab7 100644 --- a/flake.lock +++ b/flake.lock @@ -96,11 +96,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1757437545, - "narHash": "sha256-7ssbrFnmSrqtCtOySiu5ncyOBxPrR6p2nhNHrg6D+fo=", + "lastModified": 1757698528, + "narHash": "sha256-vXZaxm2LfFrVyuUOKkyWpwR0K2WB7k2oo94HN1o4910=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "ef694b996daeeb8684c0adfaa9b7067a6e709054", + "rev": "2418edea929640fb5f856bc0a25fb91f54dfc229", "type": "github" }, "original": { @@ -129,11 +129,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1757358784, - "narHash": "sha256-UNeUJW3c10z0aMJ87QKS85C/JgK9ng6pdRS0EwY6OLg=", + "lastModified": 1757656821, + "narHash": "sha256-MDaLusQZflxngGMU41g6cqabM7KE8I55UazzAZsjNN0=", "owner": "YaLTeR", "repo": "niri", - "rev": "bdee1a657699a77bc4cdb050f7355f37f64c45a6", + "rev": "b7909dbf61c7c1511b9a51ef46e1d503d5ba3d05", "type": "github" }, "original": { @@ -180,11 +180,11 @@ ] }, "locked": { - "lastModified": 1757469080, - "narHash": "sha256-nBBLIfu1ugSFRLtOpOt7OkQTrUMOjH0hzCcfDAQF3Yc=", + "lastModified": 1757727921, + "narHash": "sha256-xP3XDh1r5gV0tbXstOoIzwX0VBLltBPs+Qq/UvBRU0E=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "34d1884d25d6eb93cf1c3434e04407f2b88c9dea", + "rev": "1e79494a0dfb1e81fed3e5bfc3b2371267efdfb6", "type": "github" }, "original": { @@ -195,11 +195,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1757408970, - "narHash": "sha256-aSgK4BLNFFGvDTNKPeB28lVXYqVn8RdyXDNAvgGq+k0=", + "lastModified": 1757545623, + "narHash": "sha256-mCxPABZ6jRjUQx3bPP4vjA68ETbPLNz9V2pk9tO7pRQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d179d77c139e0a3f5c416477f7747e9d6b7ec315", + "rev": "8cd5ce828d5d1d16feff37340171a98fc3bf6526", "type": "github" }, "original": { @@ -211,11 +211,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1757034884, - "narHash": "sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao=", + "lastModified": 1757686808, + "narHash": "sha256-PL+Z3OrNpFNHddbsBaxeojYkWObYc2NlyhTmsmpt+hc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ca77296380960cd497a765102eeb1356eb80fed0", + "rev": "098982b6eca9b809cc2f583e733338f5a36b3ad8", "type": "github" }, "original": { From 7524f74f76fcf9d6dacb2e0d849e1138b3bdf5fb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 12:46:46 +0200 Subject: [PATCH 0315/1295] show rust and dotnet version in shell --- home/vinzenz/.zsh/p10k.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home/vinzenz/.zsh/p10k.zsh b/home/vinzenz/.zsh/p10k.zsh index 3b6355df..fc3c2b28 100644 --- a/home/vinzenz/.zsh/p10k.zsh +++ b/home/vinzenz/.zsh/p10k.zsh @@ -60,8 +60,8 @@ nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) # node_version # node.js version # go_version # go version (https://golang.org) - # rust_version # rustc version (https://www.rust-lang.org) - # dotnet_version # .NET version (https://dotnet.microsoft.com) + rust_version # rustc version (https://www.rust-lang.org) + dotnet_version # .NET version (https://dotnet.microsoft.com) # php_version # php version (https://www.php.net/) # laravel_version # laravel php framework version (https://laravel.com/) # java_version # java version (https://www.java.com/) @@ -756,14 +756,14 @@ typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - + ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### # Yazi shell color. typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3 typeset -g POWERLEVEL9K_YAZI_BACKGROUND=0 # Custom icon. # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' - + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 From a63f1c69c794bb238296f07dd50a9df1b8c78bfe Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 14:05:04 +0200 Subject: [PATCH 0316/1295] move stuff into nixosModules --- flake.lock | 16 ++++++------- flake.nix | 53 ++++++++++++++++++++++++++------------------ modules/lix.nix | 12 ---------- nixosModules/lix.nix | 15 +++++++++++++ 4 files changed, 54 insertions(+), 42 deletions(-) delete mode 100644 modules/lix.nix create mode 100644 nixosModules/lix.nix diff --git a/flake.lock b/flake.lock index 44edeab7..7d1be42d 100644 --- a/flake.lock +++ b/flake.lock @@ -266,11 +266,11 @@ ] }, "locked": { - "lastModified": 1751117291, - "narHash": "sha256-iOeiPypZkl6uPL5mQ4aFG4wYVs9w9BJZ2/5XHlLgyIk=", + "lastModified": 1757763404, + "narHash": "sha256-a1h+58wDOtbQXrHoZwLwB7PhXwFhBXRHhNRhAQGq/oY=", "ref": "refs/heads/main", - "rev": "2a4818dc2158cbdad34a701ab12d0b1cf7f52c46", - "revCount": 45, + "rev": "07a5fbca27ec941c841ad93f2ac65bc529225a51", + "revCount": 46, "type": "git", "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git" }, @@ -290,11 +290,11 @@ ] }, "locked": { - "lastModified": 1752323001, - "narHash": "sha256-YEcYegmlv12yN9VWrz2qt0nyL+9EeGIlrDvac8Pf7Cw=", + "lastModified": 1757763091, + "narHash": "sha256-V3E6JKGzCrq5u+hp38sAdKv/EoxU+X0qfSoBIPxALi4=", "ref": "refs/heads/main", - "rev": "75a0ae7a59e687bea5f92791a2d64c048f35846d", - "revCount": 119, + "rev": "493b7b0343334019b372176f811a966839ba9aa5", + "revCount": 121, "type": "git", "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git" }, diff --git a/flake.nix b/flake.nix index c7e62e0b..04e0bcc4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,6 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; - nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; home-manager = { @@ -104,10 +103,7 @@ modules = [ { networking.hostName = device; } - ./modules/globalinstalls.nix - ./modules/networking.nix - ./modules/nixpkgs.nix - ./modules/lix.nix + self.nixosModules.default ./hosts/${device}/hardware.nix ./hosts/${device}/imports.nix @@ -120,20 +116,8 @@ } ] ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ - home-manager.nixosModules.home-manager + self.nixosModules.desktopDefault { home-manager.extraSpecialArgs = specialArgs; } - ./modules/home-manager.nix - - ./modules/i18n.nix - - niri.nixosModules.niri - { - nixpkgs.overlays = [ - niri.overlays.niri - overlays.servicepoint-packages - nix-vscode-extensions.overlays.default - ]; - } ]); } ); @@ -145,10 +129,35 @@ config = prev.config; }; }; - servicepoint-packages = final: prev: { - servicepoint-cli = servicepoint-cli.legacyPackages."${prev.system}".servicepoint-cli; - servicepoint-simulator = - servicepoint-simulator.legacyPackages."${prev.system}".servicepoint-simulator; + }; + + nixosModules = { + lix = (import ./nixosModules/lix.nix); + niri = { + imports = [ niri.nixosModules.niri ]; + nixpkgs.overlays = [ niri.overlays.niri ]; + }; + pkgs-unstable = { + nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; + }; + desktopDefault = { + imports = [ + self.nixosModules.pkgs-unstable + self.nixosModules.niri + home-manager.nixosModules.home-manager + servicepoint-simulator.nixosModules.default + servicepoint-cli.nixosModules.default + ./modules/home-manager.nix + ./modules/i18n.nix + ]; + }; + default = { + imports = [ + self.nixosModules.lix + ./modules/globalinstalls.nix + ./modules/networking.nix + ./modules/nixpkgs.nix + ]; }; }; diff --git a/modules/lix.nix b/modules/lix.nix deleted file mode 100644 index 55a32659..00000000 --- a/modules/lix.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: -{ - nixpkgs.overlays = [ (final: prev: { - inherit (prev.lixPackageSets.stable) - nixpkgs-review - nix-eval-jobs - nix-fast-build - colmena; - }) ]; - - nix.package = pkgs.lixPackageSets.stable.lix; -} diff --git a/nixosModules/lix.nix b/nixosModules/lix.nix new file mode 100644 index 00000000..3480d06a --- /dev/null +++ b/nixosModules/lix.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: +{ + nixpkgs.overlays = [ + (final: prev: { + inherit (prev.lixPackageSets.stable) + nixpkgs-review + nix-eval-jobs + nix-fast-build + colmena + ; + }) + ]; + + nix.package = pkgs.lixPackageSets.latest.lix; +} From 16422ccbd7d2377d862d0beb59b8b8356b657a93 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 14:56:45 +0200 Subject: [PATCH 0317/1295] move kdeconnect settings to nixosModule --- flake.nix | 2 ++ home/vinzenz/gnome.nix | 2 -- home/vinzenz/niri.nix | 11 +------ modules/desktop-environment.nix | 20 ------------- modules/gnome-shared-dconf.nix | 3 -- modules/gnome.nix | 1 - nixosModules/kdeconnect.nix | 53 +++++++++++++++++++++++++++++++++ 7 files changed, 56 insertions(+), 36 deletions(-) create mode 100644 nixosModules/kdeconnect.nix diff --git a/flake.nix b/flake.nix index 04e0bcc4..6260502b 100644 --- a/flake.nix +++ b/flake.nix @@ -133,6 +133,7 @@ nixosModules = { lix = (import ./nixosModules/lix.nix); + kdeconnect = (import ./nixosModules/kdeconnect.nix); niri = { imports = [ niri.nixosModules.niri ]; nixpkgs.overlays = [ niri.overlays.niri ]; @@ -144,6 +145,7 @@ imports = [ self.nixosModules.pkgs-unstable self.nixosModules.niri + self.nixosModules.kdeconnect home-manager.nixosModules.home-manager servicepoint-simulator.nixosModules.default servicepoint-cli.nixosModules.default diff --git a/home/vinzenz/gnome.nix b/home/vinzenz/gnome.nix index 5648cf6b..3a4f479a 100644 --- a/home/vinzenz/gnome.nix +++ b/home/vinzenz/gnome.nix @@ -4,7 +4,6 @@ home.packages = with pkgs.gnomeExtensions; [ - gsconnect # battery-health-charging quick-settings-tweaker solaar-extension @@ -16,7 +15,6 @@ "org/gnome/shell" = { enabled-extensions = [ "GPaste@gnome-shell-extensions.gnome.org" - "gsconnect@andyholmes.github.io" "solaar-extension@sidevesh" "AlphabeticalAppGrid@stuarthayhurst" ]; diff --git a/home/vinzenz/niri.nix b/home/vinzenz/niri.nix index 3cb557aa..3562ae1c 100644 --- a/home/vinzenz/niri.nix +++ b/home/vinzenz/niri.nix @@ -16,16 +16,7 @@ name = "adwaita-dark"; }; - services = { - kdeconnect = { - enable = true; - # this still shows up in gnome session starting with 25.05 - # indicator = true; - }; - mako = { - enable = true; - }; - }; + services.mako.enable = true; programs.niri.settings = { input.keyboard.xkb.layout = "de"; diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index ffb00eb3..50d6245c 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -26,7 +26,6 @@ }; programs = { - kdeconnect.enable = true; firefox = { enable = true; languagePacks = [ @@ -59,25 +58,6 @@ }; }; - networking = { - firewall = { - allowedTCPPortRanges = [ - { - # KDE Connect / gsconnect - from = 1714; - to = 1764; - } - ]; - allowedUDPPortRanges = [ - { - # KDE Connect / gsconnect - from = 1714; - to = 1764; - } - ]; - }; - }; - systemd = { # save some boot time because nothing actually requires network connectivity services.NetworkManager-wait-online.enable = false; diff --git a/modules/gnome-shared-dconf.nix b/modules/gnome-shared-dconf.nix index b9b3716f..5d54628e 100644 --- a/modules/gnome-shared-dconf.nix +++ b/modules/gnome-shared-dconf.nix @@ -40,7 +40,4 @@ "org/gnome/shell/extensions/alphabetical-app-grid" = { folder-order-position = "start"; }; - "org/gnome/shell/extensions/gsconnect" = { - enabled = true; - }; } diff --git a/modules/gnome.nix b/modules/gnome.nix index f5a5dc0d..ddca6b0c 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -29,7 +29,6 @@ programs = { dconf.enable = true; gpaste.enable = true; - kdeconnect.package = pkgs.gnomeExtensions.gsconnect; }; # remove some gnome default apps diff --git a/nixosModules/kdeconnect.nix b/nixosModules/kdeconnect.nix new file mode 100644 index 00000000..16b669f0 --- /dev/null +++ b/nixosModules/kdeconnect.nix @@ -0,0 +1,53 @@ +{ + lib, + config, + pkgs, + ... +}: +{ + config = lib.mkMerge [ + { + networking.firewall = + let + kdeconnect-range = { + from = 1714; + to = 1764; + }; + in + { + allowedTCPPortRanges = [ kdeconnect-range ]; + allowedUDPPortRanges = [ kdeconnect-range ]; + }; + + programs.kdeconnect.enable = true; + home-manager.sharedModules = [ + { + services.kdeconnect = { + enable = true; + # this still shows up in gnome session starting with 25.05 + # indicator = true; + }; + } + ]; + } + + (lib.mkIf config.services.xserver.desktopManager.gnome.enable { + # replace kdeconnect with gsconnect + programs.kdeconnect.package = pkgs.gnomeExtensions.gsconnect; + + home-manager.sharedModules = [ + ( + { pkgs, ... }: + { + home.packages = [ pkgs.gnomeExtensions.gsconnect ]; + # enable gsconnect extension + dconf.settings = { + "org/gnome/shell".enabled-extensions = [ "gsconnect@andyholmes.github.io" ]; + "org/gnome/shell/extensions/gsconnect".enabled = true; + }; + } + ) + ]; + }) + ]; +} From ecc65f071d0869bb70c66688d0b71c1aa38b49b6 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 15:10:42 +0200 Subject: [PATCH 0318/1295] remove inputs from specialArgs --- flake.nix | 10 +++++++--- hosts/hetzner-vpn2/nginx.nix | 16 +++++++--------- hosts/vinzenz-lpt2/nginx.nix | 4 ++-- hosts/vinzenz-lpt2/zerforschen-plus.nix | 4 +--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index 6260502b..bc32d3d1 100644 --- a/flake.nix +++ b/flake.nix @@ -49,7 +49,7 @@ }; outputs = - inputs@{ + { self, nixpkgs, home-manager, @@ -58,7 +58,6 @@ nixpkgs-unstable, servicepoint-cli, servicepoint-simulator, - naersk, nix-vscode-extensions, ... }: @@ -95,7 +94,7 @@ device: system: let specialArgs = { - inherit inputs device; + inherit device; }; in nixpkgs.lib.nixosSystem { @@ -112,6 +111,7 @@ { nixpkgs.overlays = [ overlays.unstable-packages + overlays.zerforschen ]; } ] @@ -129,6 +129,10 @@ config = prev.config; }; }; + + zerforschen = final: prev: { + zerforschen-plus-content = zerforschen-plus.packages."${prev.system}".zerforschen-plus-content; + }; }; nixosModules = { diff --git a/hosts/hetzner-vpn2/nginx.nix b/hosts/hetzner-vpn2/nginx.nix index 8fa27c6a..85207bc2 100644 --- a/hosts/hetzner-vpn2/nginx.nix +++ b/hosts/hetzner-vpn2/nginx.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, ... }: +{ pkgs, ... }: let blog-domain-socket = "/run/nginx/blog.sock"; anubis-domain-socket = "/run/anubis/anubis-blog.sock"; @@ -77,7 +77,7 @@ in }; "blog-in-anubis" = { - root = inputs.zerforschen-plus.packages."${pkgs.system}".zerforschen-plus-content; + root = pkgs.zerforschen-plus-content; listen = [ { addr = ("unix:" + blog-domain-socket); @@ -87,13 +87,11 @@ in }; }; - anubis = { - instances.main = { - enable = true; - settings = { - BIND = anubis-domain-socket; - TARGET = "unix://" + blog-domain-socket; - }; + anubis.instances.main = { + enable = true; + settings = { + BIND = anubis-domain-socket; + TARGET = "unix://" + blog-domain-socket; }; }; }; diff --git a/hosts/vinzenz-lpt2/nginx.nix b/hosts/vinzenz-lpt2/nginx.nix index 302a271d..fef3dec0 100644 --- a/hosts/vinzenz-lpt2/nginx.nix +++ b/hosts/vinzenz-lpt2/nginx.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, ... }: +{ pkgs, ... }: let blog-domain-socket = "/run/nginx/blog.sock"; anubis-domain-socket = "/run/anubis/anubis-blog.sock"; @@ -34,7 +34,7 @@ in }; "vinzenz-lpt2-in-anubis" = { - root = inputs.zerforschen-plus.packages."${pkgs.system}".zerforschen-plus-content; + root = pkgs.zerforschen-plus-content; listen = [ { addr = ("unix:" + blog-domain-socket); diff --git a/hosts/vinzenz-lpt2/zerforschen-plus.nix b/hosts/vinzenz-lpt2/zerforschen-plus.nix index af3ea3c8..d2b919db 100644 --- a/hosts/vinzenz-lpt2/zerforschen-plus.nix +++ b/hosts/vinzenz-lpt2/zerforschen-plus.nix @@ -1,7 +1,5 @@ { pkgs, - system, - inputs, ... }: { @@ -28,7 +26,7 @@ "zerforschen.plus" = { #addSSL = true; #enableACME = true; - root = inputs.zerforschen-plus.packages."${pkgs.system}".zerforschen-plus-content; + root = pkgs.zerforschen-plus-content; }; }; }; From 26625c69523003242c2a882aaa8f27929cda86e9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 15:25:54 +0200 Subject: [PATCH 0319/1295] move stuff into nixosModules --- flake.nix | 28 ++++++++++++++---- modules/globalinstalls.nix | 34 --------------------- modules/i18n.nix | 19 ------------ modules/nixpkgs.nix | 52 +++++++++++---------------------- nixosModules/autoupdate.nix | 15 ++++++++++ nixosModules/en-de.nix | 19 ++++++++++++ nixosModules/globalinstalls.nix | 23 +++++++++++++++ 7 files changed, 96 insertions(+), 94 deletions(-) delete mode 100644 modules/globalinstalls.nix delete mode 100644 modules/i18n.nix create mode 100644 nixosModules/autoupdate.nix create mode 100644 nixosModules/en-de.nix create mode 100644 nixosModules/globalinstalls.nix diff --git a/flake.nix b/flake.nix index bc32d3d1..5e305584 100644 --- a/flake.nix +++ b/flake.nix @@ -100,7 +100,13 @@ nixpkgs.lib.nixosSystem { inherit system specialArgs; modules = [ - { networking.hostName = device; } + { + networking.hostName = device; + system = { + stateVersion = "22.11"; + autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; + }; + } self.nixosModules.default @@ -117,7 +123,11 @@ ] ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ self.nixosModules.desktopDefault - { home-manager.extraSpecialArgs = specialArgs; } + { + home-manager.extraSpecialArgs = specialArgs; + + time.timeZone = "Europe/Berlin"; + } ]); } ); @@ -138,6 +148,9 @@ nixosModules = { lix = (import ./nixosModules/lix.nix); kdeconnect = (import ./nixosModules/kdeconnect.nix); + globalinstalls = (import ./nixosModules/globalinstalls.nix); + autoupdate = (import ./nixosModules/autoupdate.nix); + en-de = (import ./nixosModules/en-de.nix); niri = { imports = [ niri.nixosModules.niri ]; nixpkgs.overlays = [ niri.overlays.niri ]; @@ -150,17 +163,20 @@ self.nixosModules.pkgs-unstable self.nixosModules.niri self.nixosModules.kdeconnect + self.nixosModules.en-de + home-manager.nixosModules.home-manager servicepoint-simulator.nixosModules.default servicepoint-cli.nixosModules.default + ./modules/home-manager.nix - ./modules/i18n.nix ]; }; default = { - imports = [ - self.nixosModules.lix - ./modules/globalinstalls.nix + imports = with self.nixosModules; [ + lix + globalinstalls + autoupdate ./modules/networking.nix ./modules/nixpkgs.nix ]; diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix deleted file mode 100644 index c4c21d21..00000000 --- a/modules/globalinstalls.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ pkgs, ... }: -{ - config = { - environment = { - systemPackages = with pkgs; [ - ncdu - glances - iotop - - pciutils - lsof - dig - - screen - - tldr - neofetch - - nix-output-monitor - ]; - }; - - programs = { - zsh.enable = true; - htop.enable = true; - iotop.enable = true; - git.enable = true; - nano = { - enable = true; - syntaxHighlight = true; - }; - }; - }; -} diff --git a/modules/i18n.nix b/modules/i18n.nix deleted file mode 100644 index 3d789f0f..00000000 --- a/modules/i18n.nix +++ /dev/null @@ -1,19 +0,0 @@ -_: { - config = { - time.timeZone = "Europe/Berlin"; - i18n = { - defaultLocale = "en_US.UTF-8"; - extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; - }; - }; - }; -} diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index aba35048..5fdb60df 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -11,41 +11,23 @@ allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages; }; - nix = { - settings = { - substituters = [ - "https://cache.nixos.org/" - "https://nix-community.cachix.org" - "https://cache.lix.systems" - "https://niri.cachix.org" - ]; - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" - "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" - ]; - experimental-features = [ - "nix-command" - "flakes" - ]; - }; - gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 7d"; - }; - optimise.automatic = true; - }; - - system = { - stateVersion = "22.11"; - # enable auto updates - autoUpgrade = { - enable = true; - dates = "daily"; - flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; - }; + nix.settings = { + substituters = [ + "https://cache.nixos.org/" + "https://nix-community.cachix.org" + "https://cache.lix.systems" + "https://niri.cachix.org" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" + "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" + ]; + experimental-features = [ + "nix-command" + "flakes" + ]; }; documentation = { diff --git a/nixosModules/autoupdate.nix b/nixosModules/autoupdate.nix new file mode 100644 index 00000000..5a45b106 --- /dev/null +++ b/nixosModules/autoupdate.nix @@ -0,0 +1,15 @@ +{ + nix = { + optimise.automatic = true; + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + }; + }; + + system.autoUpgrade = { + enable = true; + dates = "daily"; + }; +} diff --git a/nixosModules/en-de.nix b/nixosModules/en-de.nix new file mode 100644 index 00000000..1df68115 --- /dev/null +++ b/nixosModules/en-de.nix @@ -0,0 +1,19 @@ +{ + i18n = { + defaultLocale = "en_US.UTF-8"; + extraLocales = [ + "de_DE.UTF-8/UTF-8" + ]; + extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + }; +} diff --git a/nixosModules/globalinstalls.nix b/nixosModules/globalinstalls.nix new file mode 100644 index 00000000..47fb343a --- /dev/null +++ b/nixosModules/globalinstalls.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + ncdu + glances + lsof + dig + screen + tldr + nix-output-monitor + ]; + + programs = { + zsh.enable = true; + htop.enable = true; + iotop.enable = true; + git.enable = true; + nano = { + enable = true; + syntaxHighlight = true; + }; + }; +} From a377c8e30b2c5fd10d8c6fe8b7fc9ed81c30a75d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 17:22:20 +0200 Subject: [PATCH 0320/1295] auto-import nixosModules, openssh mod --- flake.nix | 66 +++++++++++++++++++--------------------- modules/networking.nix | 10 ------ nixosModules/openssh.nix | 11 +++++++ 3 files changed, 43 insertions(+), 44 deletions(-) create mode 100644 nixosModules/openssh.nix diff --git a/flake.nix b/flake.nix index 5e305584..26dc2e7a 100644 --- a/flake.nix +++ b/flake.nix @@ -145,43 +145,41 @@ }; }; - nixosModules = { - lix = (import ./nixosModules/lix.nix); - kdeconnect = (import ./nixosModules/kdeconnect.nix); - globalinstalls = (import ./nixosModules/globalinstalls.nix); - autoupdate = (import ./nixosModules/autoupdate.nix); - en-de = (import ./nixosModules/en-de.nix); - niri = { - imports = [ niri.nixosModules.niri ]; - nixpkgs.overlays = [ niri.overlays.niri ]; - }; - pkgs-unstable = { - nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; - }; - desktopDefault = { - imports = [ - self.nixosModules.pkgs-unstable - self.nixosModules.niri - self.nixosModules.kdeconnect - self.nixosModules.en-de + nixosModules = + (builtins.mapAttrs (m: _: import ./nixosModules/${m}) (builtins.readDir ./nixosModules)) + // { + niri = { + imports = [ niri.nixosModules.niri ]; + nixpkgs.overlays = [ niri.overlays.niri ]; + }; + pkgs-unstable = { + nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; + }; + desktopDefault = { + imports = [ + self.nixosModules.pkgs-unstable + self.nixosModules.niri + self.nixosModules.kdeconnect + self.nixosModules.en-de - home-manager.nixosModules.home-manager - servicepoint-simulator.nixosModules.default - servicepoint-cli.nixosModules.default + home-manager.nixosModules.home-manager + servicepoint-simulator.nixosModules.default + servicepoint-cli.nixosModules.default - ./modules/home-manager.nix - ]; + ./modules/home-manager.nix + ]; + }; + default = { + imports = with self.nixosModules; [ + lix + globalinstalls + autoupdate + openssh + ./modules/networking.nix + ./modules/nixpkgs.nix + ]; + }; }; - default = { - imports = with self.nixosModules; [ - lix - globalinstalls - autoupdate - ./modules/networking.nix - ./modules/nixpkgs.nix - ]; - }; - }; formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); }; diff --git a/modules/networking.nix b/modules/networking.nix index a6a8d032..68ce3eae 100644 --- a/modules/networking.nix +++ b/modules/networking.nix @@ -1,15 +1,5 @@ _: { config = { - services.openssh = { - enable = true; - openFirewall = true; - settings = { - PermitRootLogin = "without-password"; - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - }; - }; - services.tailscale = { enable = true; openFirewall = true; diff --git a/nixosModules/openssh.nix b/nixosModules/openssh.nix new file mode 100644 index 00000000..ed24fe29 --- /dev/null +++ b/nixosModules/openssh.nix @@ -0,0 +1,11 @@ +{ + services.openssh = { + enable = true; + openFirewall = true; + settings = { + PermitRootLogin = "without-password"; + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; + }; +} From c0d650d54fefd80e6082199854078abf6821ea47 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 17:37:38 +0200 Subject: [PATCH 0321/1295] move printing to nixosModules --- flake.nix | 8 +++++++- hosts/vinzenz-lpt2/imports.nix | 3 ++- hosts/vinzenz-pc2/imports.nix | 3 ++- modules/printing.nix | 14 -------------- nixosModules/printing.nix | 12 ++++++++++++ 5 files changed, 23 insertions(+), 17 deletions(-) delete mode 100644 modules/printing.nix create mode 100644 nixosModules/printing.nix diff --git a/flake.nix b/flake.nix index 26dc2e7a..cbfb6559 100644 --- a/flake.nix +++ b/flake.nix @@ -95,6 +95,7 @@ let specialArgs = { inherit device; + inherit (self) nixosModules; }; in nixpkgs.lib.nixosSystem { @@ -146,7 +147,12 @@ }; nixosModules = - (builtins.mapAttrs (m: _: import ./nixosModules/${m}) (builtins.readDir ./nixosModules)) + let + lib = nixpkgs.lib; + in + (lib.attrsets.mapAttrs' ( + m: _: lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) (import ./nixosModules/${m}) + ) (builtins.readDir ./nixosModules)) // { niri = { imports = [ niri.nixosModules.niri ]; diff --git a/hosts/vinzenz-lpt2/imports.nix b/hosts/vinzenz-lpt2/imports.nix index f9a0ae19..490252a2 100644 --- a/hosts/vinzenz-lpt2/imports.nix +++ b/hosts/vinzenz-lpt2/imports.nix @@ -1,8 +1,9 @@ +{ nixosModules, ... }: { imports = [ ../../modules/gnome.nix ../../modules/gaming.nix - ../../modules/printing.nix + nixosModules.printing ../../modules/podman.nix #../../modules/niri.nix ../../modules/desktop-environment.nix diff --git a/hosts/vinzenz-pc2/imports.nix b/hosts/vinzenz-pc2/imports.nix index f9a0ae19..490252a2 100644 --- a/hosts/vinzenz-pc2/imports.nix +++ b/hosts/vinzenz-pc2/imports.nix @@ -1,8 +1,9 @@ +{ nixosModules, ... }: { imports = [ ../../modules/gnome.nix ../../modules/gaming.nix - ../../modules/printing.nix + nixosModules.printing ../../modules/podman.nix #../../modules/niri.nix ../../modules/desktop-environment.nix diff --git a/modules/printing.nix b/modules/printing.nix deleted file mode 100644 index 4b74421d..00000000 --- a/modules/printing.nix +++ /dev/null @@ -1,14 +0,0 @@ -_: { - config = { - services = { - # Enable CUPS to print documents. - printing.enable = true; - - avahi = { - enable = true; # runs the Avahi daemon - nssmdns4 = true; # enables the mDNS NSS plug-in - openFirewall = true; # opens the firewall for UDP port 5353 - }; - }; - }; -} diff --git a/nixosModules/printing.nix b/nixosModules/printing.nix new file mode 100644 index 00000000..c85edd74 --- /dev/null +++ b/nixosModules/printing.nix @@ -0,0 +1,12 @@ +{ + services = { + # Enable CUPS to print documents. + printing.enable = true; + + avahi = { + enable = true; # runs the Avahi daemon + nssmdns4 = true; # enables the mDNS NSS plug-in + openFirewall = true; # opens the firewall for UDP port 5353 + }; + }; +} From 3ba30b1a6dad3c2fed4cf8595f3539fcd31b2187 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 17:49:17 +0200 Subject: [PATCH 0322/1295] do not provide default nixosModule --- flake.nix | 78 +++++++++++------------- nixosModules/autoupdate.nix | 1 + nixosModules/{lix.nix => lix-is-nix.nix} | 0 3 files changed, 35 insertions(+), 44 deletions(-) rename nixosModules/{lix.nix => lix-is-nix.nix} (100%) diff --git a/flake.nix b/flake.nix index cbfb6559..690dbf82 100644 --- a/flake.nix +++ b/flake.nix @@ -74,20 +74,26 @@ "vinzenz-pc2" "ronja-pc" ]; - forDevice = f: nixpkgs.lib.mapAttrs f devices; + lib = nixpkgs.lib; + forDevice = f: lib.mapAttrs f devices; supported-systems = [ "x86_64-linux" "aarch64-linux" ]; forAllSystems = f: - nixpkgs.lib.genAttrs supported-systems ( + lib.genAttrs supported-systems ( system: f rec { inherit system; pkgs = nixpkgs.legacyPackages.${system}; } ); + importDir = + dir: + (lib.attrsets.mapAttrs' ( + m: _: lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) (import "${dir}/${m}") + ) (builtins.readDir dir)); in rec { nixosConfigurations = forDevice ( @@ -109,12 +115,17 @@ }; } - self.nixosModules.default - ./hosts/${device}/hardware.nix ./hosts/${device}/imports.nix ./hosts/${device}/configuration.nix + self.nixosModules.lix-is-nix + self.nixosModules.globalinstalls + self.nixosModules.autoupdate + self.nixosModules.openssh + ./modules/networking.nix + ./modules/nixpkgs.nix + { nixpkgs.overlays = [ overlays.unstable-packages @@ -123,12 +134,22 @@ } ] ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ - self.nixosModules.desktopDefault { home-manager.extraSpecialArgs = specialArgs; time.timeZone = "Europe/Berlin"; } + + self.nixosModules.pkgs-unstable + self.nixosModules.niri + self.nixosModules.kdeconnect + self.nixosModules.en-de + ./modules/home-manager.nix + + home-manager.nixosModules.home-manager + servicepoint-simulator.nixosModules.default + servicepoint-cli.nixosModules.default + ]); } ); @@ -146,46 +167,15 @@ }; }; - nixosModules = - let - lib = nixpkgs.lib; - in - (lib.attrsets.mapAttrs' ( - m: _: lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) (import ./nixosModules/${m}) - ) (builtins.readDir ./nixosModules)) - // { - niri = { - imports = [ niri.nixosModules.niri ]; - nixpkgs.overlays = [ niri.overlays.niri ]; - }; - pkgs-unstable = { - nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; - }; - desktopDefault = { - imports = [ - self.nixosModules.pkgs-unstable - self.nixosModules.niri - self.nixosModules.kdeconnect - self.nixosModules.en-de - - home-manager.nixosModules.home-manager - servicepoint-simulator.nixosModules.default - servicepoint-cli.nixosModules.default - - ./modules/home-manager.nix - ]; - }; - default = { - imports = with self.nixosModules; [ - lix - globalinstalls - autoupdate - openssh - ./modules/networking.nix - ./modules/nixpkgs.nix - ]; - }; + nixosModules = (importDir ./nixosModules) // { + niri = { + imports = [ niri.nixosModules.niri ]; + nixpkgs.overlays = [ niri.overlays.niri ]; }; + pkgs-unstable = { + nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; + }; + }; formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); }; diff --git a/nixosModules/autoupdate.nix b/nixosModules/autoupdate.nix index 5a45b106..0f26b7ee 100644 --- a/nixosModules/autoupdate.nix +++ b/nixosModules/autoupdate.nix @@ -11,5 +11,6 @@ system.autoUpgrade = { enable = true; dates = "daily"; + # do not forget to set `flake` when using this module! }; } diff --git a/nixosModules/lix.nix b/nixosModules/lix-is-nix.nix similarity index 100% rename from nixosModules/lix.nix rename to nixosModules/lix-is-nix.nix From d2b11ad2e2755d94253f6758e62f5dd48e1aa767 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 18:03:16 +0200 Subject: [PATCH 0323/1295] move podman to nixosModules --- hosts/forgejo-runner-1/imports.nix | 3 ++- hosts/vinzenz-lpt2/imports.nix | 3 +-- hosts/vinzenz-pc2/imports.nix | 2 +- {modules => nixosModules}/podman.nix | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename {modules => nixosModules}/podman.nix (97%) diff --git a/hosts/forgejo-runner-1/imports.nix b/hosts/forgejo-runner-1/imports.nix index 8b867c68..05d6c4d7 100644 --- a/hosts/forgejo-runner-1/imports.nix +++ b/hosts/forgejo-runner-1/imports.nix @@ -1,6 +1,7 @@ +{ nixosModules, ... }: { imports = [ - ../../modules/podman.nix + nixosModules.podman ./forgejo-runner.nix ]; } diff --git a/hosts/vinzenz-lpt2/imports.nix b/hosts/vinzenz-lpt2/imports.nix index 490252a2..751d35b2 100644 --- a/hosts/vinzenz-lpt2/imports.nix +++ b/hosts/vinzenz-lpt2/imports.nix @@ -4,8 +4,7 @@ ../../modules/gnome.nix ../../modules/gaming.nix nixosModules.printing - ../../modules/podman.nix - #../../modules/niri.nix + nixosModules.podman ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix diff --git a/hosts/vinzenz-pc2/imports.nix b/hosts/vinzenz-pc2/imports.nix index 490252a2..73bf9578 100644 --- a/hosts/vinzenz-pc2/imports.nix +++ b/hosts/vinzenz-pc2/imports.nix @@ -4,7 +4,7 @@ ../../modules/gnome.nix ../../modules/gaming.nix nixosModules.printing - ../../modules/podman.nix + nixosModules.podman #../../modules/niri.nix ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix diff --git a/modules/podman.nix b/nixosModules/podman.nix similarity index 97% rename from modules/podman.nix rename to nixosModules/podman.nix index abecea4f..93540f89 100644 --- a/modules/podman.nix +++ b/nixosModules/podman.nix @@ -1,4 +1,4 @@ -_: { +{ virtualisation = { containers.enable = true; podman = { From 2059b854de4b7a6660c38ef77c46313fc04c1ed0 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 18:08:41 +0200 Subject: [PATCH 0324/1295] tailscale mod --- flake.nix | 2 +- modules/networking.nix | 13 ------------- nixosModules/tailscale.nix | 8 ++++++++ 3 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 modules/networking.nix create mode 100644 nixosModules/tailscale.nix diff --git a/flake.nix b/flake.nix index 690dbf82..267e260a 100644 --- a/flake.nix +++ b/flake.nix @@ -123,7 +123,7 @@ self.nixosModules.globalinstalls self.nixosModules.autoupdate self.nixosModules.openssh - ./modules/networking.nix + self.nixosModules.tailscale ./modules/nixpkgs.nix { diff --git a/modules/networking.nix b/modules/networking.nix deleted file mode 100644 index 68ce3eae..00000000 --- a/modules/networking.nix +++ /dev/null @@ -1,13 +0,0 @@ -_: { - config = { - services.tailscale = { - enable = true; - openFirewall = true; - }; - - networking.firewall = { - enable = true; - checkReversePath = "loose"; - }; - }; -} diff --git a/nixosModules/tailscale.nix b/nixosModules/tailscale.nix new file mode 100644 index 00000000..e51ee7f4 --- /dev/null +++ b/nixosModules/tailscale.nix @@ -0,0 +1,8 @@ +{ + services.tailscale = { + enable = true; + openFirewall = true; + }; + + networking.firewall.checkReversePath = "loose"; +} From 78400473efbadf736a9858d394eee737a7f57d1f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 13 Sep 2025 18:20:00 +0200 Subject: [PATCH 0325/1295] wip split gnome mod --- flake.nix | 3 ++- modules/gnome.nix | 41 +--------------------------------------- nixosModules/adwaita.nix | 12 ++++++++++++ nixosModules/gnome.nix | 31 ++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 41 deletions(-) create mode 100644 nixosModules/adwaita.nix create mode 100644 nixosModules/gnome.nix diff --git a/flake.nix b/flake.nix index 267e260a..9566a130 100644 --- a/flake.nix +++ b/flake.nix @@ -144,12 +144,13 @@ self.nixosModules.niri self.nixosModules.kdeconnect self.nixosModules.en-de + self.nixosModules.adwaita + self.nixosModules.gnome ./modules/home-manager.nix home-manager.nixosModules.home-manager servicepoint-simulator.nixosModules.default servicepoint-cli.nixosModules.default - ]); } ); diff --git a/modules/gnome.nix b/modules/gnome.nix index ddca6b0c..507247df 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -1,36 +1,6 @@ { pkgs, ... }: { config = { - services = { - xserver = { - # Enable the GNOME Desktop Environment. - desktopManager.gnome = { - enable = true; - extraGSettingsOverridePackages = [ pkgs.mutter ]; - extraGSettingsOverrides = '' - [org.gnome.mutter] - experimental-features=['scale-monitor-framebuffer'] - ''; - }; - displayManager.gdm.enable = true; - excludePackages = with pkgs; [ xterm ]; - }; - - displayManager.defaultSession = "gnome"; - - gnome = { - tinysparql.enable = false; - localsearch.enable = false; - sushi.enable = true; - gnome-remote-desktop.enable = true; - }; - }; - - programs = { - dconf.enable = true; - gpaste.enable = true; - }; - # remove some gnome default apps environment.gnome.excludePackages = with pkgs; [ cheese # photo booth @@ -53,6 +23,7 @@ ]; # RDP connections + services.gnome.gnome-remote-desktop.enable = true; networking.firewall.allowedTCPPorts = [ 3389 ]; home-manager.sharedModules = [ @@ -79,16 +50,6 @@ ]); dconf.settings = import ./gnome-shared-dconf.nix; - - gtk = { - enable = true; - iconTheme.name = "Adwaita"; - cursorTheme.name = "Adwaita"; - theme = { - name = "adw-gtk3-dark"; - package = pkgs.adw-gtk3; - }; - }; } { diff --git a/nixosModules/adwaita.nix b/nixosModules/adwaita.nix new file mode 100644 index 00000000..96d24c73 --- /dev/null +++ b/nixosModules/adwaita.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + gtk = { + enable = true; + iconTheme.name = "Adwaita"; + cursorTheme.name = "Adwaita"; + theme = { + name = "adw-gtk3-dark"; + package = pkgs.adw-gtk3; + }; + }; +} diff --git a/nixosModules/gnome.nix b/nixosModules/gnome.nix new file mode 100644 index 00000000..3afe9ce4 --- /dev/null +++ b/nixosModules/gnome.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: +{ + services = { + xserver = { + # Enable the GNOME Desktop Environment. + desktopManager.gnome = { + enable = true; + extraGSettingsOverridePackages = [ pkgs.mutter ]; + extraGSettingsOverrides = '' + [org.gnome.mutter] + experimental-features=['scale-monitor-framebuffer'] + ''; + }; + displayManager.gdm.enable = true; + excludePackages = [ pkgs.xterm ]; + }; + + displayManager.defaultSession = "gnome"; + + gnome = { + tinysparql.enable = false; + localsearch.enable = false; + sushi.enable = true; + }; + }; + + programs = { + dconf.enable = true; + gpaste.enable = true; + }; +} From 084e819232cbf43bdf3fca62d4f385e6fdfdeee6 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 14 Sep 2025 12:22:20 +0200 Subject: [PATCH 0326/1295] steam mod, move adwaita to homeModules --- flake.nix | 29 ++++++++---- {nixosModules => homeModules}/adwaita.nix | 0 hosts/ronja-pc/imports.nix | 2 + hosts/vinzenz-lpt2/imports.nix | 1 + hosts/vinzenz-pc2/imports.nix | 1 + modules/desktop-environment.nix | 1 + modules/gaming.nix | 57 ++--------------------- modules/nixpkgs.nix | 44 +++-------------- nixosModules/allowed-unfree-list.nix | 15 ++++++ nixosModules/extra-caches.nix | 16 +++++++ nixosModules/steam.nix | 48 +++++++++++++++++++ 11 files changed, 113 insertions(+), 101 deletions(-) rename {nixosModules => homeModules}/adwaita.nix (100%) create mode 100644 nixosModules/allowed-unfree-list.nix create mode 100644 nixosModules/extra-caches.nix create mode 100644 nixosModules/steam.nix diff --git a/flake.nix b/flake.nix index 9566a130..852eae2f 100644 --- a/flake.nix +++ b/flake.nix @@ -92,7 +92,8 @@ importDir = dir: (lib.attrsets.mapAttrs' ( - m: _: lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) (import "${dir}/${m}") + m: _: + lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) { imports = [ "${dir}/${m}" ]; } ) (builtins.readDir dir)); in rec { @@ -113,6 +114,16 @@ stateVersion = "22.11"; autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; }; + + nixpkgs.overlays = [ + overlays.unstable-packages + overlays.zerforschen + ]; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; } ./hosts/${device}/hardware.nix @@ -124,27 +135,25 @@ self.nixosModules.autoupdate self.nixosModules.openssh self.nixosModules.tailscale + self.nixosModules.allowed-unfree-list + self.nixosModules.extra-caches ./modules/nixpkgs.nix - - { - nixpkgs.overlays = [ - overlays.unstable-packages - overlays.zerforschen - ]; - } ] ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ { home-manager.extraSpecialArgs = specialArgs; time.timeZone = "Europe/Berlin"; + + home-manager.sharedModules = [ + self.homeModules.adwaita + ]; } self.nixosModules.pkgs-unstable self.nixosModules.niri self.nixosModules.kdeconnect self.nixosModules.en-de - self.nixosModules.adwaita self.nixosModules.gnome ./modules/home-manager.nix @@ -178,6 +187,8 @@ }; }; + homeModules = importDir ./homeModules; + formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); }; } diff --git a/nixosModules/adwaita.nix b/homeModules/adwaita.nix similarity index 100% rename from nixosModules/adwaita.nix rename to homeModules/adwaita.nix diff --git a/hosts/ronja-pc/imports.nix b/hosts/ronja-pc/imports.nix index 8b9ed4b9..ca628ccf 100644 --- a/hosts/ronja-pc/imports.nix +++ b/hosts/ronja-pc/imports.nix @@ -1,7 +1,9 @@ +{ nixosModules, ... }: { imports = [ ../../modules/gnome.nix ../../modules/gaming.nix + nixosModules.steam ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix diff --git a/hosts/vinzenz-lpt2/imports.nix b/hosts/vinzenz-lpt2/imports.nix index 751d35b2..93358008 100644 --- a/hosts/vinzenz-lpt2/imports.nix +++ b/hosts/vinzenz-lpt2/imports.nix @@ -3,6 +3,7 @@ imports = [ ../../modules/gnome.nix ../../modules/gaming.nix + nixosModules.steam nixosModules.printing nixosModules.podman ../../modules/desktop-environment.nix diff --git a/hosts/vinzenz-pc2/imports.nix b/hosts/vinzenz-pc2/imports.nix index 73bf9578..ca29682f 100644 --- a/hosts/vinzenz-pc2/imports.nix +++ b/hosts/vinzenz-pc2/imports.nix @@ -3,6 +3,7 @@ imports = [ ../../modules/gnome.nix ../../modules/gaming.nix + nixosModules.steam nixosModules.printing nixosModules.podman #../../modules/niri.nix diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index 50d6245c..1f1efe02 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -56,6 +56,7 @@ enable = true; binfmt = true; }; + xwayland.enable = true; }; systemd = { diff --git a/modules/gaming.nix b/modules/gaming.nix index 4214c23b..478c200b 100644 --- a/modules/gaming.nix +++ b/modules/gaming.nix @@ -8,7 +8,6 @@ extraPackages32 = with pkgs; [ mangohud ]; }; - steam-hardware.enable = true; xpadneo.enable = true; }; @@ -23,59 +22,9 @@ lutris ]; - programs = { - xwayland.enable = true; - steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - gamescopeSession.enable = false; - }; - gamemode.enable = true; - }; - - networking.firewall = { - allowedUDPPorts = [ - # Factorio - 34197 - - # steam network transfer - 3478 - ]; - - allowedTCPPorts = [ - # steam network transfer - 24070 - ]; - - allowedTCPPortRanges = [ - # steam network transfer - { - from = 27015; - to = 27050; - } - ]; - - allowedUDPPortRanges = [ - # steam network transfer - { - from = 4379; - to = 4380; - } - { - from = 27000; - to = 27100; - } - ]; - }; - - allowedUnfreePackages = [ - "steam" - "steam-original" - "steam-run" - "steam-unwrapped" - "ut1999" + networking.firewall.allowedUDPPorts = [ + # Factorio + 34197 ]; }; } diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index 5fdb60df..7fb99a72 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -1,41 +1,9 @@ -{ config, lib, ... }: { - options.allowedUnfreePackages = lib.mkOption { - type = lib.types.listOf lib.types.str; - default = [ ]; - example = [ "steam" ]; - }; - config = { - nixpkgs.config = { - # https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085 - allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages; - }; - - nix.settings = { - substituters = [ - "https://cache.nixos.org/" - "https://nix-community.cachix.org" - "https://cache.lix.systems" - "https://niri.cachix.org" - ]; - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" - "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" - ]; - experimental-features = [ - "nix-command" - "flakes" - ]; - }; - - documentation = { - enable = true; # documentation of packages - nixos.enable = false; # nixos documentation - man.enable = true; # manual pages and the man command - info.enable = false; # info pages and the info command - doc.enable = false; # documentation distributed in packages' /share/doc - }; + documentation = { + enable = true; # documentation of packages + nixos.enable = false; # nixos documentation + man.enable = true; # manual pages and the man command + info.enable = false; # info pages and the info command + doc.enable = false; # documentation distributed in packages' /share/doc }; } diff --git a/nixosModules/allowed-unfree-list.nix b/nixosModules/allowed-unfree-list.nix new file mode 100644 index 00000000..a5583cff --- /dev/null +++ b/nixosModules/allowed-unfree-list.nix @@ -0,0 +1,15 @@ +{ lib, config, ... }: +{ + options.allowedUnfreePackages = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + example = [ "steam" ]; + }; + + config = { + nixpkgs.config = { + # https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085 + allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages; + }; + }; +} diff --git a/nixosModules/extra-caches.nix b/nixosModules/extra-caches.nix new file mode 100644 index 00000000..6af372f4 --- /dev/null +++ b/nixosModules/extra-caches.nix @@ -0,0 +1,16 @@ +{ + nix.settings = { + substituters = [ + "https://cache.nixos.org/" + "https://nix-community.cachix.org" + "https://cache.lix.systems" + "https://niri.cachix.org" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" + "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" + ]; + }; +} diff --git a/nixosModules/steam.nix b/nixosModules/steam.nix new file mode 100644 index 00000000..6e3c9970 --- /dev/null +++ b/nixosModules/steam.nix @@ -0,0 +1,48 @@ +{ nixosModules, ... }: +{ + imports = [ nixosModules.allowed-unfree-list ]; + + hardware.steam-hardware.enable = true; + + programs = { + steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + gamescopeSession.enable = false; + }; + gamemode.enable = true; + }; + + # steam network transfer + networking.firewall = { + allowedUDPPorts = [ 3478 ]; + allowedTCPPorts = [ 24070 ]; + + allowedTCPPortRanges = [ + { + from = 27015; + to = 27050; + } + ]; + + allowedUDPPortRanges = [ + { + from = 4379; + to = 4380; + } + { + from = 27000; + to = 27100; + } + ]; + }; + + allowedUnfreePackages = [ + "steam" + "steam-original" + "steam-run" + "steam-unwrapped" + ]; +} From 29d96e90a436fe7d3bacde80cda7b1466832034e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 14 Sep 2025 12:37:29 +0200 Subject: [PATCH 0327/1295] lib, fix homeManagerModules name --- flake.nix | 27 ++++++++++--------- .../adwaita.nix | 0 modules/intel-graphics.nix | 4 ++- 3 files changed, 18 insertions(+), 13 deletions(-) rename {homeModules => homeManagerModules}/adwaita.nix (100%) diff --git a/flake.nix b/flake.nix index 852eae2f..8a352733 100644 --- a/flake.nix +++ b/flake.nix @@ -89,14 +89,17 @@ pkgs = nixpkgs.legacyPackages.${system}; } ); - importDir = - dir: - (lib.attrsets.mapAttrs' ( - m: _: - lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) { imports = [ "${dir}/${m}" ]; } - ) (builtins.readDir dir)); in - rec { + { + lib = { + importDir = + dir: + (lib.attrsets.mapAttrs' ( + m: _: + lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) { imports = [ "${dir}/${m}" ]; } + ) (builtins.readDir dir)); + }; + nixosConfigurations = forDevice ( device: system: let @@ -116,8 +119,8 @@ }; nixpkgs.overlays = [ - overlays.unstable-packages - overlays.zerforschen + self.overlays.unstable-packages + self.overlays.zerforschen ]; nix.settings.experimental-features = [ @@ -146,7 +149,7 @@ time.timeZone = "Europe/Berlin"; home-manager.sharedModules = [ - self.homeModules.adwaita + self.homeManagerModules.adwaita ]; } @@ -177,7 +180,7 @@ }; }; - nixosModules = (importDir ./nixosModules) // { + nixosModules = (self.lib.importDir ./nixosModules) // { niri = { imports = [ niri.nixosModules.niri ]; nixpkgs.overlays = [ niri.overlays.niri ]; @@ -187,7 +190,7 @@ }; }; - homeModules = importDir ./homeModules; + homeManagerModules = self.lib.importDir ./homeManagerModules; formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); }; diff --git a/homeModules/adwaita.nix b/homeManagerModules/adwaita.nix similarity index 100% rename from homeModules/adwaita.nix rename to homeManagerModules/adwaita.nix diff --git a/modules/intel-graphics.nix b/modules/intel-graphics.nix index 74c6e670..d7cae186 100644 --- a/modules/intel-graphics.nix +++ b/modules/intel-graphics.nix @@ -1,5 +1,7 @@ -{ pkgs, ... }: +{ pkgs, nixosModules, ... }: { + imports = [ nixosModules.allowed-unfree-list ]; + config = { hardware.graphics = { extraPackages = with pkgs; [ From 232728a053c02658207912a34e44df35e5b5a91a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 14 Sep 2025 12:54:58 +0200 Subject: [PATCH 0328/1295] use overlay from zerforschen, re-rename homeModules --- flake.lock | 8 ++++---- flake.nix | 13 +++++++------ {homeManagerModules => homeModules}/adwaita.nix | 0 3 files changed, 11 insertions(+), 10 deletions(-) rename {homeManagerModules => homeModules}/adwaita.nix (100%) diff --git a/flake.lock b/flake.lock index 7d1be42d..f53b1f64 100644 --- a/flake.lock +++ b/flake.lock @@ -358,11 +358,11 @@ ] }, "locked": { - "lastModified": 1755431984, - "narHash": "sha256-iBgSdzkta6zQ2eIRWjmJTLZ3b1e1EZiCyCPcgCdqPGU=", + "lastModified": 1757847061, + "narHash": "sha256-YW8fpD35tD+1zTkxk0WhP7FJSL15JlFfG7tscgkdI+A=", "ref": "refs/heads/main", - "rev": "31abcb7a9583c4ed931f658eca3e3c1970e60814", - "revCount": 28, + "rev": "ddff8c9b206564dd9b9007e4e894afa6f7860fc8", + "revCount": 30, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, diff --git a/flake.nix b/flake.nix index 8a352733..4bcfe367 100644 --- a/flake.nix +++ b/flake.nix @@ -120,7 +120,6 @@ nixpkgs.overlays = [ self.overlays.unstable-packages - self.overlays.zerforschen ]; nix.settings.experimental-features = [ @@ -141,6 +140,8 @@ self.nixosModules.allowed-unfree-list self.nixosModules.extra-caches ./modules/nixpkgs.nix + + zerforschen-plus.nixosModules.default ] ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ { @@ -154,6 +155,7 @@ } self.nixosModules.pkgs-unstable + self.nixosModules.pkgs-vscode-extensions self.nixosModules.niri self.nixosModules.kdeconnect self.nixosModules.en-de @@ -174,10 +176,6 @@ config = prev.config; }; }; - - zerforschen = final: prev: { - zerforschen-plus-content = zerforschen-plus.packages."${prev.system}".zerforschen-plus-content; - }; }; nixosModules = (self.lib.importDir ./nixosModules) // { @@ -186,11 +184,14 @@ nixpkgs.overlays = [ niri.overlays.niri ]; }; pkgs-unstable = { + nixpkgs.overlays = [ self.overlays.unstable-packages ]; + }; + pkgs-vscode-extensions = { nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; }; }; - homeManagerModules = self.lib.importDir ./homeManagerModules; + homeModules = self.lib.importDir ./homeModules; formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); }; diff --git a/homeManagerModules/adwaita.nix b/homeModules/adwaita.nix similarity index 100% rename from homeManagerModules/adwaita.nix rename to homeModules/adwaita.nix From 4d28e476dc458c3fb1eba501e33224320d7422f4 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 14 Sep 2025 13:00:03 +0200 Subject: [PATCH 0329/1295] mv hosts nixosConfigurations --- flake.nix | 8 ++++---- modules/desktop-environment.nix | 8 ++++---- .../forgejo-runner-1/configuration.nix | 0 .../forgejo-runner-1/forgejo-runner.nix | 0 .../forgejo-runner-1/hardware.nix | 0 .../forgejo-runner-1/imports.nix | 0 .../hetzner-vpn2/configuration.nix | 0 {hosts => nixosConfigurations}/hetzner-vpn2/hardware.nix | 0 {hosts => nixosConfigurations}/hetzner-vpn2/imports.nix | 0 {hosts => nixosConfigurations}/hetzner-vpn2/nginx.nix | 0 {hosts => nixosConfigurations}/ronja-pc/configuration.nix | 0 {hosts => nixosConfigurations}/ronja-pc/hardware.nix | 0 {hosts => nixosConfigurations}/ronja-pc/imports.nix | 0 .../vinzenz-lpt2/configuration.nix | 0 {hosts => nixosConfigurations}/vinzenz-lpt2/hardware.nix | 0 {hosts => nixosConfigurations}/vinzenz-lpt2/imports.nix | 0 {hosts => nixosConfigurations}/vinzenz-lpt2/nginx.nix | 0 .../vinzenz-lpt2/zerforschen-plus.nix | 0 .../vinzenz-pc2/configuration.nix | 0 {hosts => nixosConfigurations}/vinzenz-pc2/fstab.nix | 0 {hosts => nixosConfigurations}/vinzenz-pc2/hardware.nix | 0 {hosts => nixosConfigurations}/vinzenz-pc2/hass.nix | 0 {hosts => nixosConfigurations}/vinzenz-pc2/imports.nix | 0 .../vinzenz-pc2/vscode-server.nix | 0 24 files changed, 8 insertions(+), 8 deletions(-) rename {hosts => nixosConfigurations}/forgejo-runner-1/configuration.nix (100%) rename {hosts => nixosConfigurations}/forgejo-runner-1/forgejo-runner.nix (100%) rename {hosts => nixosConfigurations}/forgejo-runner-1/hardware.nix (100%) rename {hosts => nixosConfigurations}/forgejo-runner-1/imports.nix (100%) rename {hosts => nixosConfigurations}/hetzner-vpn2/configuration.nix (100%) rename {hosts => nixosConfigurations}/hetzner-vpn2/hardware.nix (100%) rename {hosts => nixosConfigurations}/hetzner-vpn2/imports.nix (100%) rename {hosts => nixosConfigurations}/hetzner-vpn2/nginx.nix (100%) rename {hosts => nixosConfigurations}/ronja-pc/configuration.nix (100%) rename {hosts => nixosConfigurations}/ronja-pc/hardware.nix (100%) rename {hosts => nixosConfigurations}/ronja-pc/imports.nix (100%) rename {hosts => nixosConfigurations}/vinzenz-lpt2/configuration.nix (100%) rename {hosts => nixosConfigurations}/vinzenz-lpt2/hardware.nix (100%) rename {hosts => nixosConfigurations}/vinzenz-lpt2/imports.nix (100%) rename {hosts => nixosConfigurations}/vinzenz-lpt2/nginx.nix (100%) rename {hosts => nixosConfigurations}/vinzenz-lpt2/zerforschen-plus.nix (100%) rename {hosts => nixosConfigurations}/vinzenz-pc2/configuration.nix (100%) rename {hosts => nixosConfigurations}/vinzenz-pc2/fstab.nix (100%) rename {hosts => nixosConfigurations}/vinzenz-pc2/hardware.nix (100%) rename {hosts => nixosConfigurations}/vinzenz-pc2/hass.nix (100%) rename {hosts => nixosConfigurations}/vinzenz-pc2/imports.nix (100%) rename {hosts => nixosConfigurations}/vinzenz-pc2/vscode-server.nix (100%) diff --git a/flake.nix b/flake.nix index 4bcfe367..089732e3 100644 --- a/flake.nix +++ b/flake.nix @@ -128,9 +128,9 @@ ]; } - ./hosts/${device}/hardware.nix - ./hosts/${device}/imports.nix - ./hosts/${device}/configuration.nix + ./nixosConfigurations/${device}/hardware.nix + ./nixosConfigurations/${device}/imports.nix + ./nixosConfigurations/${device}/configuration.nix self.nixosModules.lix-is-nix self.nixosModules.globalinstalls @@ -150,7 +150,7 @@ time.timeZone = "Europe/Berlin"; home-manager.sharedModules = [ - self.homeManagerModules.adwaita + self.homeModules.adwaita ]; } diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index 1f1efe02..e0334ccd 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -73,10 +73,10 @@ lm_sensors # office - libreoffice-qt - hunspell - hunspellDicts.de-de - hunspellDicts.en-us-large + #libreoffice-qt + #hunspell + #hunspellDicts.de-de + #hunspellDicts.en-us-large ]; fonts = { diff --git a/hosts/forgejo-runner-1/configuration.nix b/nixosConfigurations/forgejo-runner-1/configuration.nix similarity index 100% rename from hosts/forgejo-runner-1/configuration.nix rename to nixosConfigurations/forgejo-runner-1/configuration.nix diff --git a/hosts/forgejo-runner-1/forgejo-runner.nix b/nixosConfigurations/forgejo-runner-1/forgejo-runner.nix similarity index 100% rename from hosts/forgejo-runner-1/forgejo-runner.nix rename to nixosConfigurations/forgejo-runner-1/forgejo-runner.nix diff --git a/hosts/forgejo-runner-1/hardware.nix b/nixosConfigurations/forgejo-runner-1/hardware.nix similarity index 100% rename from hosts/forgejo-runner-1/hardware.nix rename to nixosConfigurations/forgejo-runner-1/hardware.nix diff --git a/hosts/forgejo-runner-1/imports.nix b/nixosConfigurations/forgejo-runner-1/imports.nix similarity index 100% rename from hosts/forgejo-runner-1/imports.nix rename to nixosConfigurations/forgejo-runner-1/imports.nix diff --git a/hosts/hetzner-vpn2/configuration.nix b/nixosConfigurations/hetzner-vpn2/configuration.nix similarity index 100% rename from hosts/hetzner-vpn2/configuration.nix rename to nixosConfigurations/hetzner-vpn2/configuration.nix diff --git a/hosts/hetzner-vpn2/hardware.nix b/nixosConfigurations/hetzner-vpn2/hardware.nix similarity index 100% rename from hosts/hetzner-vpn2/hardware.nix rename to nixosConfigurations/hetzner-vpn2/hardware.nix diff --git a/hosts/hetzner-vpn2/imports.nix b/nixosConfigurations/hetzner-vpn2/imports.nix similarity index 100% rename from hosts/hetzner-vpn2/imports.nix rename to nixosConfigurations/hetzner-vpn2/imports.nix diff --git a/hosts/hetzner-vpn2/nginx.nix b/nixosConfigurations/hetzner-vpn2/nginx.nix similarity index 100% rename from hosts/hetzner-vpn2/nginx.nix rename to nixosConfigurations/hetzner-vpn2/nginx.nix diff --git a/hosts/ronja-pc/configuration.nix b/nixosConfigurations/ronja-pc/configuration.nix similarity index 100% rename from hosts/ronja-pc/configuration.nix rename to nixosConfigurations/ronja-pc/configuration.nix diff --git a/hosts/ronja-pc/hardware.nix b/nixosConfigurations/ronja-pc/hardware.nix similarity index 100% rename from hosts/ronja-pc/hardware.nix rename to nixosConfigurations/ronja-pc/hardware.nix diff --git a/hosts/ronja-pc/imports.nix b/nixosConfigurations/ronja-pc/imports.nix similarity index 100% rename from hosts/ronja-pc/imports.nix rename to nixosConfigurations/ronja-pc/imports.nix diff --git a/hosts/vinzenz-lpt2/configuration.nix b/nixosConfigurations/vinzenz-lpt2/configuration.nix similarity index 100% rename from hosts/vinzenz-lpt2/configuration.nix rename to nixosConfigurations/vinzenz-lpt2/configuration.nix diff --git a/hosts/vinzenz-lpt2/hardware.nix b/nixosConfigurations/vinzenz-lpt2/hardware.nix similarity index 100% rename from hosts/vinzenz-lpt2/hardware.nix rename to nixosConfigurations/vinzenz-lpt2/hardware.nix diff --git a/hosts/vinzenz-lpt2/imports.nix b/nixosConfigurations/vinzenz-lpt2/imports.nix similarity index 100% rename from hosts/vinzenz-lpt2/imports.nix rename to nixosConfigurations/vinzenz-lpt2/imports.nix diff --git a/hosts/vinzenz-lpt2/nginx.nix b/nixosConfigurations/vinzenz-lpt2/nginx.nix similarity index 100% rename from hosts/vinzenz-lpt2/nginx.nix rename to nixosConfigurations/vinzenz-lpt2/nginx.nix diff --git a/hosts/vinzenz-lpt2/zerforschen-plus.nix b/nixosConfigurations/vinzenz-lpt2/zerforschen-plus.nix similarity index 100% rename from hosts/vinzenz-lpt2/zerforschen-plus.nix rename to nixosConfigurations/vinzenz-lpt2/zerforschen-plus.nix diff --git a/hosts/vinzenz-pc2/configuration.nix b/nixosConfigurations/vinzenz-pc2/configuration.nix similarity index 100% rename from hosts/vinzenz-pc2/configuration.nix rename to nixosConfigurations/vinzenz-pc2/configuration.nix diff --git a/hosts/vinzenz-pc2/fstab.nix b/nixosConfigurations/vinzenz-pc2/fstab.nix similarity index 100% rename from hosts/vinzenz-pc2/fstab.nix rename to nixosConfigurations/vinzenz-pc2/fstab.nix diff --git a/hosts/vinzenz-pc2/hardware.nix b/nixosConfigurations/vinzenz-pc2/hardware.nix similarity index 100% rename from hosts/vinzenz-pc2/hardware.nix rename to nixosConfigurations/vinzenz-pc2/hardware.nix diff --git a/hosts/vinzenz-pc2/hass.nix b/nixosConfigurations/vinzenz-pc2/hass.nix similarity index 100% rename from hosts/vinzenz-pc2/hass.nix rename to nixosConfigurations/vinzenz-pc2/hass.nix diff --git a/hosts/vinzenz-pc2/imports.nix b/nixosConfigurations/vinzenz-pc2/imports.nix similarity index 100% rename from hosts/vinzenz-pc2/imports.nix rename to nixosConfigurations/vinzenz-pc2/imports.nix diff --git a/hosts/vinzenz-pc2/vscode-server.nix b/nixosConfigurations/vinzenz-pc2/vscode-server.nix similarity index 100% rename from hosts/vinzenz-pc2/vscode-server.nix rename to nixosConfigurations/vinzenz-pc2/vscode-server.nix From ff0c287624437c9608603bf1ec745070edd96ab1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 14 Sep 2025 13:09:37 +0200 Subject: [PATCH 0330/1295] default.nix for hosts --- flake.nix | 4 +--- .../forgejo-runner-1/{imports.nix => default.nix} | 3 +++ nixosConfigurations/hetzner-vpn2/default.nix | 7 +++++++ nixosConfigurations/hetzner-vpn2/imports.nix | 5 ----- nixosConfigurations/ronja-pc/{imports.nix => default.nix} | 3 +++ .../vinzenz-lpt2/{imports.nix => default.nix} | 3 +++ .../vinzenz-pc2/{imports.nix => default.nix} | 3 +++ 7 files changed, 20 insertions(+), 8 deletions(-) rename nixosConfigurations/forgejo-runner-1/{imports.nix => default.nix} (68%) create mode 100644 nixosConfigurations/hetzner-vpn2/default.nix delete mode 100644 nixosConfigurations/hetzner-vpn2/imports.nix rename nixosConfigurations/ronja-pc/{imports.nix => default.nix} (83%) rename nixosConfigurations/vinzenz-lpt2/{imports.nix => default.nix} (87%) rename nixosConfigurations/vinzenz-pc2/{imports.nix => default.nix} (88%) diff --git a/flake.nix b/flake.nix index 089732e3..c55fb041 100644 --- a/flake.nix +++ b/flake.nix @@ -128,9 +128,7 @@ ]; } - ./nixosConfigurations/${device}/hardware.nix - ./nixosConfigurations/${device}/imports.nix - ./nixosConfigurations/${device}/configuration.nix + ./nixosConfigurations/${device} self.nixosModules.lix-is-nix self.nixosModules.globalinstalls diff --git a/nixosConfigurations/forgejo-runner-1/imports.nix b/nixosConfigurations/forgejo-runner-1/default.nix similarity index 68% rename from nixosConfigurations/forgejo-runner-1/imports.nix rename to nixosConfigurations/forgejo-runner-1/default.nix index 05d6c4d7..93d49506 100644 --- a/nixosConfigurations/forgejo-runner-1/imports.nix +++ b/nixosConfigurations/forgejo-runner-1/default.nix @@ -1,6 +1,9 @@ { nixosModules, ... }: { imports = [ + ./configuration.nix + ./hardware.nix + nixosModules.podman ./forgejo-runner.nix ]; diff --git a/nixosConfigurations/hetzner-vpn2/default.nix b/nixosConfigurations/hetzner-vpn2/default.nix new file mode 100644 index 00000000..46ded484 --- /dev/null +++ b/nixosConfigurations/hetzner-vpn2/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./configuration.nix + ./hardware.nix + ./nginx.nix + ]; +} diff --git a/nixosConfigurations/hetzner-vpn2/imports.nix b/nixosConfigurations/hetzner-vpn2/imports.nix deleted file mode 100644 index 3fadabb4..00000000 --- a/nixosConfigurations/hetzner-vpn2/imports.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./nginx.nix - ]; -} diff --git a/nixosConfigurations/ronja-pc/imports.nix b/nixosConfigurations/ronja-pc/default.nix similarity index 83% rename from nixosConfigurations/ronja-pc/imports.nix rename to nixosConfigurations/ronja-pc/default.nix index ca628ccf..9efb5f16 100644 --- a/nixosConfigurations/ronja-pc/imports.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -1,6 +1,9 @@ { nixosModules, ... }: { imports = [ + ./configuration.nix + ./hardware.nix + ../../modules/gnome.nix ../../modules/gaming.nix nixosModules.steam diff --git a/nixosConfigurations/vinzenz-lpt2/imports.nix b/nixosConfigurations/vinzenz-lpt2/default.nix similarity index 87% rename from nixosConfigurations/vinzenz-lpt2/imports.nix rename to nixosConfigurations/vinzenz-lpt2/default.nix index 93358008..6b2603a9 100644 --- a/nixosConfigurations/vinzenz-lpt2/imports.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -1,6 +1,9 @@ { nixosModules, ... }: { imports = [ + ./configuration.nix + ./hardware.nix + ../../modules/gnome.nix ../../modules/gaming.nix nixosModules.steam diff --git a/nixosConfigurations/vinzenz-pc2/imports.nix b/nixosConfigurations/vinzenz-pc2/default.nix similarity index 88% rename from nixosConfigurations/vinzenz-pc2/imports.nix rename to nixosConfigurations/vinzenz-pc2/default.nix index ca29682f..4d5df4da 100644 --- a/nixosConfigurations/vinzenz-pc2/imports.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -1,6 +1,9 @@ { nixosModules, ... }: { imports = [ + ./configuration.nix + ./hardware.nix + ../../modules/gnome.nix ../../modules/gaming.nix nixosModules.steam From 1b3b7cf607b57db75d152829f58f2358f66eabbb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 14 Sep 2025 13:36:45 +0200 Subject: [PATCH 0331/1295] more homeModules --- flake.nix | 23 ++++-- homeModules/git.nix | 13 ++++ homeModules/nano.nix | 9 +++ homeModules/templates.nix | 12 +++ homeModules/zsh-basics.nix | 13 ++++ modules/desktop-environment.nix | 73 +------------------ modules/home-manager.nix | 61 ---------------- modules/intel-graphics.nix | 4 +- .../forgejo-runner-1/default.nix | 4 +- nixosConfigurations/ronja-pc/default.nix | 4 +- nixosConfigurations/vinzenz-lpt2/default.nix | 8 +- nixosConfigurations/vinzenz-pc2/default.nix | 8 +- nixosModules/en-de.nix | 5 ++ nixosModules/modern-desktop.nix | 49 +++++++++++++ nixosModules/nix-ld.nix | 22 ++++++ nixosModules/steam.nix | 4 +- 16 files changed, 158 insertions(+), 154 deletions(-) create mode 100644 homeModules/git.nix create mode 100644 homeModules/nano.nix create mode 100644 homeModules/templates.nix create mode 100644 homeModules/zsh-basics.nix delete mode 100644 modules/home-manager.nix create mode 100644 nixosModules/modern-desktop.nix create mode 100644 nixosModules/nix-ld.nix diff --git a/flake.nix b/flake.nix index c55fb041..8b3b690c 100644 --- a/flake.nix +++ b/flake.nix @@ -103,13 +103,16 @@ nixosConfigurations = forDevice ( device: system: let - specialArgs = { + commonSpecialArgs = { inherit device; - inherit (self) nixosModules; + vinzenzHomeModules = self.homeModules; }; in nixpkgs.lib.nixosSystem { - inherit system specialArgs; + inherit system; + specialArgs = commonSpecialArgs // { + vinzenzNixosModules = self.nixosModules; + }; modules = [ { networking.hostName = device; @@ -143,12 +146,21 @@ ] ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ { - home-manager.extraSpecialArgs = specialArgs; + home-manager = { + extraSpecialArgs = commonSpecialArgs; + useGlobalPkgs = true; + useUserPackages = true; + }; time.timeZone = "Europe/Berlin"; home-manager.sharedModules = [ + { home.stateVersion = "22.11"; } self.homeModules.adwaita + self.homeModules.git + self.homeModules.templates + self.homeModules.zsh-basics + self.homeModules.nano ]; } @@ -158,7 +170,8 @@ self.nixosModules.kdeconnect self.nixosModules.en-de self.nixosModules.gnome - ./modules/home-manager.nix + self.nixosModules.modern-desktop + self.nixosModules.nix-ld home-manager.nixosModules.home-manager servicepoint-simulator.nixosModules.default diff --git a/homeModules/git.nix b/homeModules/git.nix new file mode 100644 index 00000000..76afcebf --- /dev/null +++ b/homeModules/git.nix @@ -0,0 +1,13 @@ +{ + programs = { + git = { + enable = true; + extraConfig.init.defaultBranch = "main"; + }; + + gh = { + enable = true; + gitCredentialHelper.enable = true; + }; + }; +} diff --git a/homeModules/nano.nix b/homeModules/nano.nix new file mode 100644 index 00000000..ab3e7b24 --- /dev/null +++ b/homeModules/nano.nix @@ -0,0 +1,9 @@ +{ + home = { + sessionVariables.EDITOR = "nano"; + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; +} diff --git a/homeModules/templates.nix b/homeModules/templates.nix new file mode 100644 index 00000000..71d2e0b8 --- /dev/null +++ b/homeModules/templates.nix @@ -0,0 +1,12 @@ +{ + home.file = { + "Templates/Empty file".text = ""; + "Templates/Empty bash script".text = '' + #!/usr/bin/env bash + # abort on error, undefined variables + set -eu + # print commands before execution + set -x + ''; + }; +} diff --git a/homeModules/zsh-basics.nix b/homeModules/zsh-basics.nix new file mode 100644 index 00000000..0b0e2818 --- /dev/null +++ b/homeModules/zsh-basics.nix @@ -0,0 +1,13 @@ +{ + programs = { + command-not-found.enable = true; + dircolors.enable = true; + + zsh = { + enable = true; + syntaxHighlighting.enable = true; + autosuggestion.enable = true; + enableVteIntegration = true; + }; + }; +} diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix index e0334ccd..e8393537 100644 --- a/modules/desktop-environment.nix +++ b/modules/desktop-environment.nix @@ -1,73 +1,7 @@ { pkgs, ... }: { config = { - services = { - xserver.enable = true; - libinput.enable = true; - flatpak.enable = true; - fstrim.enable = true; - earlyoom = { - enable = true; - freeMemThreshold = 5; - }; - }; - - # Enable sound with pipewire. - security.rtkit.enable = true; - services = { - pulseaudio.enable = false; - pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - #jack.enable = true; - }; - }; - - programs = { - firefox = { - enable = true; - languagePacks = [ - "en-US" - "de" - ]; - }; - nix-ld = { - enable = true; - libraries = with pkgs; [ - stdenv.cc.cc - zlib - zstd - curl - openssl - attr - libssh - bzip2 - libxml2 - acl - libsodium - util-linux - xz - systemd - ]; - }; - appimage = { - enable = true; - binfmt = true; - }; - xwayland.enable = true; - }; - - systemd = { - # save some boot time because nothing actually requires network connectivity - services.NetworkManager-wait-online.enable = false; - - # prevent stuck units from preventing shutdown (default is 120s) - extraConfig = '' - DefaultTimeoutStopSec=10s - ''; - }; + programs.firefox.enable = true; environment.systemPackages = with pkgs; [ lm_sensors @@ -93,10 +27,5 @@ enable = true; enableGraphical = true; }; - - system.autoUpgrade = { - allowReboot = false; - operation = "boot"; - }; }; } diff --git a/modules/home-manager.nix b/modules/home-manager.nix deleted file mode 100644 index 9af6a19a..00000000 --- a/modules/home-manager.nix +++ /dev/null @@ -1,61 +0,0 @@ -_: { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - sharedModules = [ - # set stateVersion - { home.stateVersion = "22.11"; } - # make nano the default editor - { - home = { - sessionVariables.EDITOR = "nano"; - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - } - # command line niceness - { - programs = { - command-not-found.enable = true; - dircolors.enable = true; - - zsh = { - enable = true; - syntaxHighlighting.enable = true; - autosuggestion.enable = true; - enableVteIntegration = true; - }; - }; - } - # common git config - { - programs = { - git = { - enable = true; - extraConfig.init.defaultBranch = "main"; - }; - - gh = { - enable = true; - gitCredentialHelper.enable = true; - }; - }; - } - # Templates - { - home.file = { - "Templates/Empty file".text = ""; - "Templates/Empty bash script".text = '' - #!/usr/bin/env bash - # abort on error, undefined variables - set -eu - # print commands before execution - set -x - ''; - }; - } - ]; - }; -} diff --git a/modules/intel-graphics.nix b/modules/intel-graphics.nix index d7cae186..709d7208 100644 --- a/modules/intel-graphics.nix +++ b/modules/intel-graphics.nix @@ -1,6 +1,6 @@ -{ pkgs, nixosModules, ... }: +{ pkgs, vinzenzNixosModules, ... }: { - imports = [ nixosModules.allowed-unfree-list ]; + imports = [ vinzenzNixosModules.allowed-unfree-list ]; config = { hardware.graphics = { diff --git a/nixosConfigurations/forgejo-runner-1/default.nix b/nixosConfigurations/forgejo-runner-1/default.nix index 93d49506..79cb6131 100644 --- a/nixosConfigurations/forgejo-runner-1/default.nix +++ b/nixosConfigurations/forgejo-runner-1/default.nix @@ -1,10 +1,10 @@ -{ nixosModules, ... }: +{ vinzenzNixosModules, ... }: { imports = [ ./configuration.nix ./hardware.nix - nixosModules.podman + vinzenzNixosModules.podman ./forgejo-runner.nix ]; } diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index 9efb5f16..e0e91170 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -1,4 +1,4 @@ -{ nixosModules, ... }: +{ vinzenzNixosModules, ... }: { imports = [ ./configuration.nix @@ -6,7 +6,7 @@ ../../modules/gnome.nix ../../modules/gaming.nix - nixosModules.steam + vinzenzNixosModules.steam ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index 6b2603a9..d29ae65c 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -1,4 +1,4 @@ -{ nixosModules, ... }: +{ vinzenzNixosModules, ... }: { imports = [ ./configuration.nix @@ -6,9 +6,9 @@ ../../modules/gnome.nix ../../modules/gaming.nix - nixosModules.steam - nixosModules.printing - nixosModules.podman + vinzenzNixosModules.steam + vinzenzNixosModules.printing + vinzenzNixosModules.podman ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix index 4d5df4da..e31bdbc8 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -1,4 +1,4 @@ -{ nixosModules, ... }: +{ vinzenzNixosModules, ... }: { imports = [ ./configuration.nix @@ -6,9 +6,9 @@ ../../modules/gnome.nix ../../modules/gaming.nix - nixosModules.steam - nixosModules.printing - nixosModules.podman + vinzenzNixosModules.steam + vinzenzNixosModules.printing + vinzenzNixosModules.podman #../../modules/niri.nix ../../modules/desktop-environment.nix ../../modules/desktop-hardware.nix diff --git a/nixosModules/en-de.nix b/nixosModules/en-de.nix index 1df68115..0ed4fafa 100644 --- a/nixosModules/en-de.nix +++ b/nixosModules/en-de.nix @@ -16,4 +16,9 @@ LC_TIME = "de_DE.UTF-8"; }; }; + + programs.firefox.languagePacks = [ + "en-US" + "de" + ]; } diff --git a/nixosModules/modern-desktop.nix b/nixosModules/modern-desktop.nix new file mode 100644 index 00000000..f1879bda --- /dev/null +++ b/nixosModules/modern-desktop.nix @@ -0,0 +1,49 @@ +{ + services = { + xserver.enable = true; + libinput.enable = true; + flatpak.enable = true; + fstrim.enable = true; + earlyoom = { + enable = true; + freeMemThreshold = 5; + }; + }; + + # Enable sound with pipewire. + security.rtkit.enable = true; + services = { + pulseaudio.enable = false; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + #jack.enable = true; + }; + }; + + systemd = { + # save some boot time because nothing actually requires network connectivity + services.NetworkManager-wait-online.enable = false; + + # prevent stuck units from preventing shutdown (default is 120s) + extraConfig = '' + DefaultTimeoutStopSec=10s + ''; + }; + + programs = { + xwayland.enable = true; + + appimage = { + enable = true; + binfmt = true; + }; + }; + + system.autoUpgrade = { + allowReboot = false; + operation = "boot"; + }; +} diff --git a/nixosModules/nix-ld.nix b/nixosModules/nix-ld.nix new file mode 100644 index 00000000..382aa3d3 --- /dev/null +++ b/nixosModules/nix-ld.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + programs.nix-ld = { + enable = true; + libraries = with pkgs; [ + stdenv.cc.cc + zlib + zstd + curl + openssl + attr + libssh + bzip2 + libxml2 + acl + libsodium + util-linux + xz + systemd + ]; + }; +} diff --git a/nixosModules/steam.nix b/nixosModules/steam.nix index 6e3c9970..1c707859 100644 --- a/nixosModules/steam.nix +++ b/nixosModules/steam.nix @@ -1,6 +1,6 @@ -{ nixosModules, ... }: +{ vinzenzNixosModules, ... }: { - imports = [ nixosModules.allowed-unfree-list ]; + imports = [ vinzenzNixosModules.allowed-unfree-list ]; hardware.steam-hardware.enable = true; From 1f1b9013300a1e4ab31c79770ad58204da7f1f66 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 14 Sep 2025 13:45:48 +0200 Subject: [PATCH 0332/1295] move more modules --- flake.nix | 6 +- home/vinzenz/configuration.nix | 2 + modules/amd-graphics.nix | 22 ------- modules/gaming.nix | 5 -- modules/nixpkgs.nix | 9 --- nixosConfigurations/vinzenz-lpt2/hardware.nix | 4 +- .../vinzenz-pc2/configuration.nix | 58 +++++++++---------- nixosConfigurations/vinzenz-pc2/default.nix | 2 + nixosConfigurations/vinzenz-pc2/hardware.nix | 4 +- .../vinzenz-pc2/vscode-server.nix | 20 +++---- nixosModules/amd-graphics.nix | 20 +++++++ {modules => nixosModules}/intel-graphics.nix | 0 12 files changed, 69 insertions(+), 83 deletions(-) delete mode 100644 modules/amd-graphics.nix delete mode 100644 modules/nixpkgs.nix create mode 100644 nixosModules/amd-graphics.nix rename {modules => nixosModules}/intel-graphics.nix (100%) diff --git a/flake.nix b/flake.nix index 8b3b690c..2622042b 100644 --- a/flake.nix +++ b/flake.nix @@ -129,6 +129,11 @@ "nix-command" "flakes" ]; + + documentation = { + info.enable = false; # info pages and the info command + doc.enable = false; # documentation distributed in packages' /share/doc + }; } ./nixosConfigurations/${device} @@ -140,7 +145,6 @@ self.nixosModules.tailscale self.nixosModules.allowed-unfree-list self.nixosModules.extra-caches - ./modules/nixpkgs.nix zerforschen-plus.nixosModules.default ] diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix index 74be21f3..ad8f18af 100644 --- a/home/vinzenz/configuration.nix +++ b/home/vinzenz/configuration.nix @@ -56,6 +56,8 @@ icu nextcloud-client + + lutris ]; home.file = { diff --git a/modules/amd-graphics.nix b/modules/amd-graphics.nix deleted file mode 100644 index 041d7007..00000000 --- a/modules/amd-graphics.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, config, ... }: -{ - config = { - boot.kernelModules = [ "amdgpu" ]; - services.xserver.videoDrivers = [ "amdgpu" ]; - - hardware = { - graphics.enable = true; - amdgpu = { - opencl.enable = true; - amdvlk = { - # TODO: this creates black borders around GNOME apps - # enable = true; - # support32Bit.enable = config.hardware.graphics.enable32Bit; - }; - overdrive.enable = true; - }; - }; - - environment.systemPackages = with pkgs; [ nvtopPackages.amd ]; - }; -} diff --git a/modules/gaming.nix b/modules/gaming.nix index 478c200b..d93b31db 100644 --- a/modules/gaming.nix +++ b/modules/gaming.nix @@ -19,12 +19,7 @@ mangohud vulkan-tools glxinfo - lutris ]; - networking.firewall.allowedUDPPorts = [ - # Factorio - 34197 - ]; }; } diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix deleted file mode 100644 index 7fb99a72..00000000 --- a/modules/nixpkgs.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - documentation = { - enable = true; # documentation of packages - nixos.enable = false; # nixos documentation - man.enable = true; # manual pages and the man command - info.enable = false; # info pages and the info command - doc.enable = false; # documentation distributed in packages' /share/doc - }; -} diff --git a/nixosConfigurations/vinzenz-lpt2/hardware.nix b/nixosConfigurations/vinzenz-lpt2/hardware.nix index f51ccd1f..7a0f2224 100644 --- a/nixosConfigurations/vinzenz-lpt2/hardware.nix +++ b/nixosConfigurations/vinzenz-lpt2/hardware.nix @@ -1,6 +1,6 @@ -{ lib, ... }: +{ lib, vinzenzNixosModules, ... }: { - imports = [ ../../modules/intel-graphics.nix ]; + imports = [ vinzenzNixosModules.intel-graphics ]; config = { # intel cpu boot.kernelModules = [ diff --git a/nixosConfigurations/vinzenz-pc2/configuration.nix b/nixosConfigurations/vinzenz-pc2/configuration.nix index 4f6b859c..d53ad71c 100644 --- a/nixosConfigurations/vinzenz-pc2/configuration.nix +++ b/nixosConfigurations/vinzenz-pc2/configuration.nix @@ -1,36 +1,34 @@ { pkgs, ... }: { - imports = [ - ./hardware.nix - ./vscode-server.nix - ./hass.nix + nix.settings.extra-platforms = [ + "aarch64-linux" + "i686-linux" ]; - config = { - nix.settings.extra-platforms = [ - "aarch64-linux" - "i686-linux" - ]; - services.xserver.xkb = { - # Configure keymap in X11 - layout = "de"; - variant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - - users.users.ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' - ]; - - environment.systemPackages = with pkgs; [ lact ]; + services.xserver.xkb = { + # Configure keymap in X11 + layout = "de"; + variant = ""; }; + + # Configure console keymap + console.keyMap = "de"; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + + users.users.ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' + ]; + + environment.systemPackages = with pkgs; [ lact ]; + + networking.firewall.allowedUDPPorts = [ + # Factorio + 34197 + ]; } diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix index e31bdbc8..4ba36321 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -3,6 +3,8 @@ imports = [ ./configuration.nix ./hardware.nix + ./vscode-server.nix + ./hass.nix ../../modules/gnome.nix ../../modules/gaming.nix diff --git a/nixosConfigurations/vinzenz-pc2/hardware.nix b/nixosConfigurations/vinzenz-pc2/hardware.nix index 316d9a24..1a72824a 100644 --- a/nixosConfigurations/vinzenz-pc2/hardware.nix +++ b/nixosConfigurations/vinzenz-pc2/hardware.nix @@ -1,6 +1,6 @@ -{ ... }: +{ vinzenzNixosModules, ... }: { - imports = [ ../../modules/amd-graphics.nix ]; + imports = [ vinzenzNixosModules.amd-graphics ]; config = { # amd cpu boot.kernelModules = [ "kvm-amd" ]; diff --git a/nixosConfigurations/vinzenz-pc2/vscode-server.nix b/nixosConfigurations/vinzenz-pc2/vscode-server.nix index 199c0156..6632b1f6 100644 --- a/nixosConfigurations/vinzenz-pc2/vscode-server.nix +++ b/nixosConfigurations/vinzenz-pc2/vscode-server.nix @@ -15,16 +15,12 @@ ]; }; - networking = { - firewall = { - allowedTCPPorts = [ - 8542 - 8543 - 8544 - 80 - 1313 - 5201 - ]; - }; - }; + networking.firewall.allowedTCPPorts = [ + 8542 + 8543 + 8544 + 80 + 1313 + 5201 + ]; } diff --git a/nixosModules/amd-graphics.nix b/nixosModules/amd-graphics.nix new file mode 100644 index 00000000..cca63931 --- /dev/null +++ b/nixosModules/amd-graphics.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +{ + boot.kernelModules = [ "amdgpu" ]; + services.xserver.videoDrivers = [ "amdgpu" ]; + + hardware = { + graphics.enable = true; + amdgpu = { + opencl.enable = true; + amdvlk = { + # TODO: this creates black borders around GNOME apps + # enable = true; + # support32Bit.enable = config.hardware.graphics.enable32Bit; + }; + overdrive.enable = true; + }; + }; + + environment.systemPackages = with pkgs; [ nvtopPackages.amd ]; +} diff --git a/modules/intel-graphics.nix b/nixosModules/intel-graphics.nix similarity index 100% rename from modules/intel-graphics.nix rename to nixosModules/intel-graphics.nix From a208ca4df2f507657403377fd6427226685f2228 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 14 Sep 2025 14:01:42 +0200 Subject: [PATCH 0333/1295] move more modules --- flake.nix | 6 ++ modules/desktop-hardware.nix | 60 +++++-------------- .../forgejo-runner-1/hardware.nix | 5 -- nixosConfigurations/hetzner-vpn2/hardware.nix | 5 -- nixosConfigurations/ronja-pc/hardware.nix | 4 +- nixosConfigurations/vinzenz-lpt2/hardware.nix | 37 ++++++------ nixosConfigurations/vinzenz-pc2/hardware.nix | 5 +- nixosModules/quiet-boot.nix | 11 ++++ nixosModules/systemd-boot.nix | 11 ++++ 9 files changed, 70 insertions(+), 74 deletions(-) create mode 100644 nixosModules/quiet-boot.nix create mode 100644 nixosModules/systemd-boot.nix diff --git a/flake.nix b/flake.nix index 2622042b..bb522a69 100644 --- a/flake.nix +++ b/flake.nix @@ -116,6 +116,10 @@ modules = [ { networking.hostName = device; + nixpkgs = { + inherit system; + hostPlatform = lib.mkDefault system; + }; system = { stateVersion = "22.11"; autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; @@ -176,6 +180,8 @@ self.nixosModules.gnome self.nixosModules.modern-desktop self.nixosModules.nix-ld + self.nixosModules.quiet-boot + self.nixosModules.systemd-boot home-manager.nixosModules.home-manager servicepoint-simulator.nixosModules.default diff --git a/modules/desktop-hardware.nix b/modules/desktop-hardware.nix index a8b2f938..97c13fc7 100644 --- a/modules/desktop-hardware.nix +++ b/modules/desktop-hardware.nix @@ -1,48 +1,20 @@ +{ lib, ... }: { - lib, - pkgs, - ... -}: -{ - config = { - boot = { - kernelPackages = pkgs.linuxPackages_zen; - kernelParams = [ - "quiet" - "udev.log_level=3" - ]; - supportedFilesystems = [ "btrfs" ]; - initrd.supportedFilesystems = [ "btrfs" ]; - consoleLogLevel = 0; - initrd.verbose = false; - plymouth.enable = true; - loader = { - timeout = 3; - efi.canTouchEfiVariables = true; - systemd-boot = { - enable = true; - editor = false; # do not allow changing kernel parameters - consoleMode = "max"; - }; - }; - }; + networking.networkmanager.enable = true; + # 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 + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - networking.networkmanager.enable = true; - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - - hardware = { - enableRedistributableFirmware = true; - bluetooth.enable = true; - }; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - services.fwupd.enable = true; + hardware = { + enableRedistributableFirmware = true; + bluetooth.enable = true; }; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + services.fwupd.enable = true; } diff --git a/nixosConfigurations/forgejo-runner-1/hardware.nix b/nixosConfigurations/forgejo-runner-1/hardware.nix index e3e6880e..e8fbc563 100644 --- a/nixosConfigurations/forgejo-runner-1/hardware.nix +++ b/nixosConfigurations/forgejo-runner-1/hardware.nix @@ -3,11 +3,6 @@ imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; config = { - nixpkgs = { - hostPlatform = "aarch64-linux"; - system = "aarch64-linux"; - }; - boot = { tmp.cleanOnBoot = true; kernelParams = [ "console=tty" ]; diff --git a/nixosConfigurations/hetzner-vpn2/hardware.nix b/nixosConfigurations/hetzner-vpn2/hardware.nix index e8fa931c..d7c96f0b 100644 --- a/nixosConfigurations/hetzner-vpn2/hardware.nix +++ b/nixosConfigurations/hetzner-vpn2/hardware.nix @@ -3,11 +3,6 @@ imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; config = { - nixpkgs = { - hostPlatform = "aarch64-linux"; - system = "aarch64-linux"; - }; - boot = { tmp.cleanOnBoot = true; kernelParams = [ "console=tty" ]; diff --git a/nixosConfigurations/ronja-pc/hardware.nix b/nixosConfigurations/ronja-pc/hardware.nix index f668726f..56e653cc 100644 --- a/nixosConfigurations/ronja-pc/hardware.nix +++ b/nixosConfigurations/ronja-pc/hardware.nix @@ -1,6 +1,7 @@ -{ lib, ... }: { boot = { + supportedFilesystems = [ "btrfs" ]; + initrd.supportedFilesystems = [ "btrfs" ]; kernelModules = [ "kvm-intel" ]; extraModulePackages = [ ]; initrd = { @@ -37,6 +38,5 @@ { device = "/dev/disk/by-uuid/bf9d19fb-499b-4bfb-b67d-131fa5bf8259"; } ]; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = true; } diff --git a/nixosConfigurations/vinzenz-lpt2/hardware.nix b/nixosConfigurations/vinzenz-lpt2/hardware.nix index 7a0f2224..4effcf91 100644 --- a/nixosConfigurations/vinzenz-lpt2/hardware.nix +++ b/nixosConfigurations/vinzenz-lpt2/hardware.nix @@ -1,4 +1,9 @@ -{ lib, vinzenzNixosModules, ... }: +{ + lib, + vinzenzNixosModules, + pkgs, + ... +}: { imports = [ vinzenzNixosModules.intel-graphics ]; config = { @@ -9,11 +14,6 @@ ]; hardware.cpu.intel.updateMicrocode = true; - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - # 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 @@ -22,17 +22,20 @@ hardware.enableRedistributableFirmware = true; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - boot.initrd = { - availableKernelModules = [ - "xhci_pci" - "thunderbolt" - "nvme" - ]; - luks.devices = { - "luks-2c654ff2-3c42-48d3-a1e3-9545679afaa3" = { - device = "/dev/disk/by-uuid/2c654ff2-3c42-48d3-a1e3-9545679afaa3"; + boot = { + kernelPackages = pkgs.linuxPackages_zen; + supportedFilesystems = [ "btrfs" ]; + initrd = { + supportedFilesystems = [ "btrfs" ]; + availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "nvme" + ]; + luks.devices = { + "luks-2c654ff2-3c42-48d3-a1e3-9545679afaa3" = { + device = "/dev/disk/by-uuid/2c654ff2-3c42-48d3-a1e3-9545679afaa3"; + }; }; }; }; diff --git a/nixosConfigurations/vinzenz-pc2/hardware.nix b/nixosConfigurations/vinzenz-pc2/hardware.nix index 1a72824a..5a8751fc 100644 --- a/nixosConfigurations/vinzenz-pc2/hardware.nix +++ b/nixosConfigurations/vinzenz-pc2/hardware.nix @@ -1,4 +1,4 @@ -{ vinzenzNixosModules, ... }: +{ vinzenzNixosModules, pkgs, ... }: { imports = [ vinzenzNixosModules.amd-graphics ]; config = { @@ -14,6 +14,9 @@ "usbhid" "sd_mod" ]; # "usb_storage" + kernelPackages = pkgs.linuxPackages_zen; + supportedFilesystems = [ "btrfs" ]; + initrd.supportedFilesystems = [ "btrfs" ]; loader.efi.efiSysMountPoint = "/boot"; }; diff --git a/nixosModules/quiet-boot.nix b/nixosModules/quiet-boot.nix new file mode 100644 index 00000000..8dbcd572 --- /dev/null +++ b/nixosModules/quiet-boot.nix @@ -0,0 +1,11 @@ +{ + boot = { + kernelParams = [ + "quiet" + "udev.log_level=3" + ]; + consoleLogLevel = 0; + initrd.verbose = false; + plymouth.enable = true; + }; +} diff --git a/nixosModules/systemd-boot.nix b/nixosModules/systemd-boot.nix new file mode 100644 index 00000000..321a26cd --- /dev/null +++ b/nixosModules/systemd-boot.nix @@ -0,0 +1,11 @@ +{ + boot.loader = { + timeout = 3; + efi.canTouchEfiVariables = true; + systemd-boot = { + enable = true; + editor = false; # do not allow changing kernel parameters + consoleMode = "max"; + }; + }; +} From f1855c1265a0fd3eb367aa82ef36169ac5c765d3 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 14 Sep 2025 14:12:14 +0200 Subject: [PATCH 0334/1295] remove dektop-hardware module --- flake.nix | 3 ++- modules/desktop-hardware.nix | 20 ------------------- nixosConfigurations/ronja-pc/default.nix | 1 - nixosConfigurations/ronja-pc/hardware.nix | 8 +++++++- nixosConfigurations/vinzenz-lpt2/default.nix | 1 - nixosConfigurations/vinzenz-lpt2/hardware.nix | 16 +++++++-------- nixosConfigurations/vinzenz-pc2/default.nix | 1 - nixosConfigurations/vinzenz-pc2/hardware.nix | 16 ++++++++++++--- nixosModules/firmware-updates.nix | 11 ++++++++++ 9 files changed, 40 insertions(+), 37 deletions(-) delete mode 100644 modules/desktop-hardware.nix create mode 100644 nixosModules/firmware-updates.nix diff --git a/flake.nix b/flake.nix index bb522a69..e5269781 100644 --- a/flake.nix +++ b/flake.nix @@ -149,6 +149,7 @@ self.nixosModules.tailscale self.nixosModules.allowed-unfree-list self.nixosModules.extra-caches + self.nixosModules.systemd-boot zerforschen-plus.nixosModules.default ] @@ -181,7 +182,7 @@ self.nixosModules.modern-desktop self.nixosModules.nix-ld self.nixosModules.quiet-boot - self.nixosModules.systemd-boot + self.nixosModules.firmware-updates home-manager.nixosModules.home-manager servicepoint-simulator.nixosModules.default diff --git a/modules/desktop-hardware.nix b/modules/desktop-hardware.nix deleted file mode 100644 index 97c13fc7..00000000 --- a/modules/desktop-hardware.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ lib, ... }: -{ - networking.networkmanager.enable = true; - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - - hardware = { - enableRedistributableFirmware = true; - bluetooth.enable = true; - }; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - services.fwupd.enable = true; -} diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index e0e91170..6b7fa0b5 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -8,7 +8,6 @@ ../../modules/gaming.nix vinzenzNixosModules.steam ../../modules/desktop-environment.nix - ../../modules/desktop-hardware.nix ../../home/ronja ]; diff --git a/nixosConfigurations/ronja-pc/hardware.nix b/nixosConfigurations/ronja-pc/hardware.nix index 56e653cc..e6ad854f 100644 --- a/nixosConfigurations/ronja-pc/hardware.nix +++ b/nixosConfigurations/ronja-pc/hardware.nix @@ -1,3 +1,4 @@ +{ lib, ... }: { boot = { supportedFilesystems = [ "btrfs" ]; @@ -38,5 +39,10 @@ { device = "/dev/disk/by-uuid/bf9d19fb-499b-4bfb-b67d-131fa5bf8259"; } ]; - hardware.cpu.intel.updateMicrocode = true; + hardware.bluetooth.enable = true; + + networking = { + networkmanager.enable = true; + useDHCP = lib.mkDefault true; + }; } diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index d29ae65c..02f6d82c 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -10,7 +10,6 @@ vinzenzNixosModules.printing vinzenzNixosModules.podman ../../modules/desktop-environment.nix - ../../modules/desktop-hardware.nix ../../home/vinzenz ../../home/ronja diff --git a/nixosConfigurations/vinzenz-lpt2/hardware.nix b/nixosConfigurations/vinzenz-lpt2/hardware.nix index 4effcf91..cf5157cc 100644 --- a/nixosConfigurations/vinzenz-lpt2/hardware.nix +++ b/nixosConfigurations/vinzenz-lpt2/hardware.nix @@ -1,7 +1,7 @@ { - lib, vinzenzNixosModules, pkgs, + lib, ... }: { @@ -12,15 +12,11 @@ "kvm-intel" "xe" ]; - hardware.cpu.intel.updateMicrocode = true; - # 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 - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - - hardware.enableRedistributableFirmware = true; + networking = { + networkmanager.enable = true; + useDHCP = lib.mkDefault true; + }; boot = { kernelPackages = pkgs.linuxPackages_zen; @@ -62,5 +58,7 @@ services.thermald.enable = true; services.hardware.bolt.enable = true; # thunderbolt security + + hardware.bluetooth.enable = true; }; } diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix index 4ba36321..0b5073d4 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -13,7 +13,6 @@ vinzenzNixosModules.podman #../../modules/niri.nix ../../modules/desktop-environment.nix - ../../modules/desktop-hardware.nix ../../home/vinzenz ../../home/ronja diff --git a/nixosConfigurations/vinzenz-pc2/hardware.nix b/nixosConfigurations/vinzenz-pc2/hardware.nix index 5a8751fc..6a4c71a5 100644 --- a/nixosConfigurations/vinzenz-pc2/hardware.nix +++ b/nixosConfigurations/vinzenz-pc2/hardware.nix @@ -1,10 +1,14 @@ -{ vinzenzNixosModules, pkgs, ... }: +{ + vinzenzNixosModules, + pkgs, + lib, + ... +}: { imports = [ vinzenzNixosModules.amd-graphics ]; config = { # amd cpu boot.kernelModules = [ "kvm-amd" ]; - hardware.cpu.amd.updateMicrocode = true; boot = { initrd.availableKernelModules = [ @@ -23,6 +27,12 @@ fileSystems = import ./fstab.nix; swapDevices = [ ]; - networking.interfaces.eno1.wakeOnLan.enable = true; + networking = { + networkmanager.enable = true; + useDHCP = lib.mkDefault true; + interfaces.eno1.wakeOnLan.enable = true; + }; + + hardware.bluetooth.enable = true; }; } diff --git a/nixosModules/firmware-updates.nix b/nixosModules/firmware-updates.nix new file mode 100644 index 00000000..8e81b725 --- /dev/null +++ b/nixosModules/firmware-updates.nix @@ -0,0 +1,11 @@ +{ + hardware = { + enableRedistributableFirmware = true; + cpu = { + amd.updateMicrocode = true; + intel.updateMicrocode = true; + }; + }; + + services.fwupd.enable = true; +} From f5e1b9c7eefe2765560b89d2e9a66c13ac2abab3 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 17:18:59 +0200 Subject: [PATCH 0335/1295] move shared gnome config to homeModule --- flake.nix | 2 + home/vinzenz/configuration.nix | 2 + home/vinzenz/gnome.nix | 28 ++++----- homeModules/gnome-extensions.nix | 101 +++++++++++++++++++++++++++++++ modules/gaming.nix | 35 +++++------ modules/gnome-shared-dconf.nix | 43 ------------- modules/gnome.nix | 95 ++++++++++++----------------- 7 files changed, 174 insertions(+), 132 deletions(-) create mode 100644 homeModules/gnome-extensions.nix delete mode 100644 modules/gnome-shared-dconf.nix diff --git a/flake.nix b/flake.nix index e5269781..e23e1f34 100644 --- a/flake.nix +++ b/flake.nix @@ -106,6 +106,7 @@ commonSpecialArgs = { inherit device; vinzenzHomeModules = self.homeModules; + vinzenzLib = self.lib; }; in nixpkgs.lib.nixosSystem { @@ -170,6 +171,7 @@ self.homeModules.templates self.homeModules.zsh-basics self.homeModules.nano + self.homeModules.gnome-extensions ]; } diff --git a/home/vinzenz/configuration.nix b/home/vinzenz/configuration.nix index ad8f18af..ace80863 100644 --- a/home/vinzenz/configuration.nix +++ b/home/vinzenz/configuration.nix @@ -58,6 +58,8 @@ nextcloud-client lutris + + foliate ]; home.file = { diff --git a/home/vinzenz/gnome.nix b/home/vinzenz/gnome.nix index 3a4f479a..ac8875ee 100644 --- a/home/vinzenz/gnome.nix +++ b/home/vinzenz/gnome.nix @@ -1,23 +1,21 @@ { pkgs, ... }: { config = { - home.packages = - with pkgs.gnomeExtensions; - [ - # battery-health-charging - quick-settings-tweaker - solaar-extension - alphabetical-app-grid - ] - ++ (with pkgs; [ foliate ]); + home.packages = with pkgs.gnomeExtensions; [ + solaar-extension + ]; dconf.settings = { - "org/gnome/shell" = { - enabled-extensions = [ - "GPaste@gnome-shell-extensions.gnome.org" - "solaar-extension@sidevesh" - "AlphabeticalAppGrid@stuarthayhurst" - ]; + "org/gnome/shell".enabled-extensions = [ + "GPaste@gnome-shell-extensions.gnome.org" + "solaar-extension@sidevesh" + ]; + "org/gnome/desktop/interface".color-scheme = "prefer-dark"; + "org/gnome/desktop/wm/keybindings" = { + switch-windows = [ "Tab" ]; + switch-windows-backward = [ "Tab" ]; + switch-applications = [ "Tab" ]; + switch-applications-backward = [ "Tab" ]; }; }; }; diff --git a/homeModules/gnome-extensions.nix b/homeModules/gnome-extensions.nix new file mode 100644 index 00000000..9c30c409 --- /dev/null +++ b/homeModules/gnome-extensions.nix @@ -0,0 +1,101 @@ +{ + lib, + pkgs, + osConfig, + config, + ... +}: +{ + options.vinzenz.gnome-extensions = + let + mkDefaultEnabledOption = + name: + lib.mkOption { + default = true; + example = false; + description = "Whether to enable ${name}."; + type = lib.types.bool; + }; + in + { + enable = mkDefaultEnabledOption "gnome extended options"; + appindicator.enable = mkDefaultEnabledOption "appindicator"; + caffeine.enable = mkDefaultEnabledOption "caffeine"; + tailscale-qs.enable = lib.mkOption { + default = osConfig.services.tailscale.enable; + example = true; + description = "Whether to enable tailscale quick setting."; + type = lib.types.bool; + }; + alphabetic-apps.enable = mkDefaultEnabledOption "alphabetic app grid"; + clock-show-seconds = mkDefaultEnabledOption "clock seconds"; + show-battery-percentage = mkDefaultEnabledOption "battery percentage"; + enable-numlock = mkDefaultEnabledOption "num lock on login"; + enable-systool-warning = lib.mkEnableOption "system configuration tool warning"; + edge-tiling = mkDefaultEnabledOption "edge tiling"; + dynamic-workspaces = mkDefaultEnabledOption "dynamic workspaces"; + tap-to-click = mkDefaultEnabledOption "tap to click"; + two-finger-scrolling = mkDefaultEnabledOption "two finger scrolling"; + }; + + config = + let + cfg = config.vinzenz.gnome-extensions; + in + lib.mkIf cfg.enable ( + lib.mkMerge [ + { + dconf = { + enable = true; + settings = { + "org/gnome/shell" = { + disable-user-extensions = false; + disabled-extensions = [ ]; + enabled-extensions = [ ]; + }; + + "ca/desrt/dconf-editor".show-warning = cfg.enable-systool-warning; + "org/gnome/tweaks".show-extensions-notice = cfg.enable-systool-warning; + "org/gnome/mutter" = { + inherit (cfg) edge-tiling dynamic-workspaces; + }; + "org/gnome/desktop/peripherals/touchpad" = { + inherit (cfg) tap-to-click; + two-finger-scrolling-enabled = cfg.two-finger-scrolling; + }; + "org/gnome/desktop/interface" = { + inherit (cfg) clock-show-seconds show-battery-percentage; + }; + }; + }; + } + + (lib.mkIf cfg.tailscale-qs.enable { + home.packages = [ pkgs.gnomeExtensions.tailscale-qs ]; + dconf.settings."org/gnome/shell".enabled-extensions = [ "tailscale@joaophi.github.com" ]; + }) + + (lib.mkIf cfg.appindicator.enable { + home.packages = [ pkgs.gnomeExtensions.appindicator ]; + dconf.settings."org/gnome/shell".enabled-extensions = [ "appindicatorsupport@rgcjonas.gmail.com" ]; + }) + + (lib.mkIf cfg.caffeine.enable { + home.packages = [ pkgs.gnomeExtensions.caffeine ]; + dconf.settings."org/gnome/shell".enabled-extensions = [ "caffeine@patapon.info" ]; + }) + + (lib.mkIf cfg.alphabetic-apps.enable { + home.packages = [ pkgs.gnomeExtensions.alphabetical-app-grid ]; + dconf.settings = { + "org/gnome/shell".enabled-extensions = [ "AlphabeticalAppGrid@stuarthayhurst" ]; + "org/gnome/shell/extensions/alphabetical-app-grid".folder-order-position = "start"; + }; + }) + + (lib.mkIf cfg.enable-numlock { + dconf.settings."org/gnome/desktop/peripherals/keyboard".numlock-state = true; + }) + ] + ); +} diff --git a/modules/gaming.nix b/modules/gaming.nix index d93b31db..2b9cb514 100644 --- a/modules/gaming.nix +++ b/modules/gaming.nix @@ -1,25 +1,22 @@ { pkgs, ... }: { - config = { - hardware = { - graphics = { - enable32Bit = true; - extraPackages = with pkgs; [ mangohud ]; - extraPackages32 = with pkgs; [ mangohud ]; - }; - - xpadneo.enable = true; + hardware = { + graphics = { + enable32Bit = true; + extraPackages = with pkgs; [ mangohud ]; + extraPackages32 = with pkgs; [ mangohud ]; }; - environment.systemPackages = with pkgs; [ - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks - dxvk - mangohud - vulkan-tools - glxinfo - ]; - + xpadneo.enable = true; }; + + environment.systemPackages = with pkgs; [ + wineWowPackages.stagingFull + wineWowPackages.fonts + winetricks + dxvk + mangohud + vulkan-tools + glxinfo + ]; } diff --git a/modules/gnome-shared-dconf.nix b/modules/gnome-shared-dconf.nix deleted file mode 100644 index 5d54628e..00000000 --- a/modules/gnome-shared-dconf.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - clock-show-seconds = true; - show-battery-percentage = true; - }; - "org/gnome/mutter" = { - edge-tiling = true; - dynamic-workspaces = true; - }; - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; - "org/gnome/desktop/peripherals/touchpad" = { - tap-to-click = true; - two-finger-scrolling-enabled = true; - }; - "org/gnome/tweaks" = { - show-extensions-notice = false; - }; - "org/gnome/shell" = { - disable-user-extensions = false; - disabled-extensions = [ ]; - enabled-extensions = [ - "tailscale@joaophi.github.com" - "appindicatorsupport@rgcjonas.gmail.com" - "workspace-indicator@gnome-shell-extensions.gcampax.github.com" - "caffeine@patapon.info" - ]; - }; - "ca/desrt/dconf-editor" = { - show-warning = false; - }; - "org/gnome/desktop/wm/keybindings" = { - switch-windows = [ "Tab" ]; - switch-windows-backward = [ "Tab" ]; - switch-applications = [ "Tab" ]; - switch-applications-backward = [ "Tab" ]; - }; - "org/gnome/shell/extensions/alphabetical-app-grid" = { - folder-order-position = "start"; - }; -} diff --git a/modules/gnome.nix b/modules/gnome.nix index 507247df..c347e72c 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -1,61 +1,46 @@ { pkgs, ... }: { - config = { - # remove some gnome default apps - environment.gnome.excludePackages = with pkgs; [ - cheese # photo booth - epiphany # web browser - evince # document viewer - geary # email client - gnome-maps - gnome-weather - gnome-tour - sysprof - orca # screen reader - gnome-weather - gnome-backgrounds - gnome-user-docs - yelp # help app - # gnome-music - # totem # video player - # snapshot # camera - # baobab # disk usage - ]; + # remove some gnome default apps + environment.gnome.excludePackages = with pkgs; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + gnome-maps + gnome-weather + gnome-tour + sysprof + orca # screen reader + gnome-weather + gnome-backgrounds + gnome-user-docs + yelp # help app + # gnome-music + # totem # video player + # snapshot # camera + # baobab # disk usage + ]; - # RDP connections - services.gnome.gnome-remote-desktop.enable = true; - networking.firewall.allowedTCPPorts = [ 3389 ]; + # RDP connections + services.gnome.gnome-remote-desktop.enable = true; + networking.firewall.allowedTCPPorts = [ 3389 ]; - home-manager.sharedModules = [ - { - home.packages = - with pkgs; - [ - gitg - meld - simple-scan - pinta - dconf-editor - gpaste - ghex - impression - papers + home-manager.sharedModules = [ + { + home.packages = with pkgs; [ + gitg + meld + simple-scan + pinta + dconf-editor + gpaste + ghex + impression + papers - # graphical installer for flatpak apps - gnome-software - ] - ++ (with gnomeExtensions; [ - caffeine - appindicator - ]); - - dconf.settings = import ./gnome-shared-dconf.nix; - } - - { - home.packages = with pkgs; [ trayscale ] ++ (with gnomeExtensions; [ tailscale-qs ]); - dconf.settings."org/gnome/shell".enabled-extensions = [ "tailscale@joaophi.github.com" ]; - } - ]; - }; + # graphical installer for flatpak apps + gnome-software + ]; + } + ]; } From f89c75aad292c637b90289916981675fed7cdcf7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 17:52:33 +0200 Subject: [PATCH 0336/1295] move more stuff into modules --- home/vinzenz/gnome.nix | 13 ++- modules/desktop-environment.nix | 31 ------- modules/gnome.nix | 46 ---------- nixosConfigurations/ronja-pc/default.nix | 6 +- nixosConfigurations/vinzenz-lpt2/default.nix | 6 +- nixosConfigurations/vinzenz-pc2/default.nix | 7 +- nixosModules/en-de.nix | 7 ++ nixosModules/gnome.nix | 88 +++++++++++++------ {modules => nixosModules}/latex.nix | 0 {modules => nixosModules}/niri.nix | 0 nixosModules/vinzenz-desktop-settings.nix | 28 ++++++ .../wine-gaming.nix | 0 12 files changed, 116 insertions(+), 116 deletions(-) delete mode 100644 modules/desktop-environment.nix delete mode 100644 modules/gnome.nix rename {modules => nixosModules}/latex.nix (100%) rename {modules => nixosModules}/niri.nix (100%) create mode 100644 nixosModules/vinzenz-desktop-settings.nix rename modules/gaming.nix => nixosModules/wine-gaming.nix (100%) diff --git a/home/vinzenz/gnome.nix b/home/vinzenz/gnome.nix index ac8875ee..7424363f 100644 --- a/home/vinzenz/gnome.nix +++ b/home/vinzenz/gnome.nix @@ -1,8 +1,17 @@ { pkgs, ... }: { config = { - home.packages = with pkgs.gnomeExtensions; [ - solaar-extension + home.packages = with pkgs; [ + gitg + meld + simple-scan + pinta + dconf-editor + impression # usb image writer + papers # pdf viewer + gnome-software # for flatpak apps + gnomeExtensions.solaar-extension + snapshot ]; dconf.settings = { diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix deleted file mode 100644 index e8393537..00000000 --- a/modules/desktop-environment.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ pkgs, ... }: -{ - config = { - programs.firefox.enable = true; - - environment.systemPackages = with pkgs; [ - lm_sensors - - # office - #libreoffice-qt - #hunspell - #hunspellDicts.de-de - #hunspellDicts.en-us-large - ]; - - fonts = { - enableDefaultPackages = true; - fontconfig.defaultFonts.monospace = [ "FiraCode Nerd Font" ]; - packages = with pkgs; [ - nerd-fonts.fira-code - roboto-mono - recursive - ]; - }; - - hardware.logitech.wireless = { - enable = true; - enableGraphical = true; - }; - }; -} diff --git a/modules/gnome.nix b/modules/gnome.nix deleted file mode 100644 index c347e72c..00000000 --- a/modules/gnome.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ pkgs, ... }: -{ - # remove some gnome default apps - environment.gnome.excludePackages = with pkgs; [ - cheese # photo booth - epiphany # web browser - evince # document viewer - geary # email client - gnome-maps - gnome-weather - gnome-tour - sysprof - orca # screen reader - gnome-weather - gnome-backgrounds - gnome-user-docs - yelp # help app - # gnome-music - # totem # video player - # snapshot # camera - # baobab # disk usage - ]; - - # RDP connections - services.gnome.gnome-remote-desktop.enable = true; - networking.firewall.allowedTCPPorts = [ 3389 ]; - - home-manager.sharedModules = [ - { - home.packages = with pkgs; [ - gitg - meld - simple-scan - pinta - dconf-editor - gpaste - ghex - impression - papers - - # graphical installer for flatpak apps - gnome-software - ]; - } - ]; -} diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index 6b7fa0b5..225fe6f3 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -4,10 +4,10 @@ ./configuration.nix ./hardware.nix - ../../modules/gnome.nix - ../../modules/gaming.nix + vinzenzNixosModules.gnome vinzenzNixosModules.steam - ../../modules/desktop-environment.nix + vinzenzNixosModules.wine-gaming + vinzenzNixosModules.vinzenz-desktop-settings ../../home/ronja ]; diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index 02f6d82c..fef8d34f 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -4,12 +4,12 @@ ./configuration.nix ./hardware.nix - ../../modules/gnome.nix - ../../modules/gaming.nix + vinzenzNixosModules.gnome + vinzenzNixosModules.wine-gaming vinzenzNixosModules.steam vinzenzNixosModules.printing vinzenzNixosModules.podman - ../../modules/desktop-environment.nix + vinzenzNixosModules.vinzenz-desktop-settings ../../home/vinzenz ../../home/ronja diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix index 0b5073d4..3400235e 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -6,13 +6,12 @@ ./vscode-server.nix ./hass.nix - ../../modules/gnome.nix - ../../modules/gaming.nix + vinzenzNixosModules.gnome + vinzenzNixosModules.wine-gaming vinzenzNixosModules.steam vinzenzNixosModules.printing vinzenzNixosModules.podman - #../../modules/niri.nix - ../../modules/desktop-environment.nix + vinzenzNixosModules.vinzenz-desktop-settings ../../home/vinzenz ../../home/ronja diff --git a/nixosModules/en-de.nix b/nixosModules/en-de.nix index 0ed4fafa..a91780e5 100644 --- a/nixosModules/en-de.nix +++ b/nixosModules/en-de.nix @@ -1,3 +1,4 @@ +{ pkgs, ... }: { i18n = { defaultLocale = "en_US.UTF-8"; @@ -21,4 +22,10 @@ "en-US" "de" ]; + + environment.systemPackages = [ + pkgs.hunspell + pkgs.hunspellDicts.de-de + pkgs.hunspellDicts.en-us + ]; } diff --git a/nixosModules/gnome.nix b/nixosModules/gnome.nix index 3afe9ce4..7a6f9201 100644 --- a/nixosModules/gnome.nix +++ b/nixosModules/gnome.nix @@ -1,31 +1,65 @@ -{ pkgs, ... }: { - services = { - xserver = { - # Enable the GNOME Desktop Environment. - desktopManager.gnome = { - enable = true; - extraGSettingsOverridePackages = [ pkgs.mutter ]; - extraGSettingsOverrides = '' - [org.gnome.mutter] - experimental-features=['scale-monitor-framebuffer'] - ''; + pkgs, + lib, + config, + ... +}: +{ + options.vinzenz = { + keep-gnome-default-apps = lib.mkEnableOption "keep gnome default apps"; + }; + + config = lib.mkMerge [ + { + services = { + xserver = { + # Enable the GNOME Desktop Environment. + desktopManager.gnome = { + enable = true; + extraGSettingsOverridePackages = [ pkgs.mutter ]; + extraGSettingsOverrides = '' + [org.gnome.mutter] + experimental-features=['scale-monitor-framebuffer'] + ''; + }; + displayManager.gdm.enable = true; + excludePackages = [ pkgs.xterm ]; + }; + + displayManager.defaultSession = "gnome"; + + gnome = { + tinysparql.enable = false; + localsearch.enable = false; + sushi.enable = true; + }; }; - displayManager.gdm.enable = true; - excludePackages = [ pkgs.xterm ]; - }; - displayManager.defaultSession = "gnome"; - - gnome = { - tinysparql.enable = false; - localsearch.enable = false; - sushi.enable = true; - }; - }; - - programs = { - dconf.enable = true; - gpaste.enable = true; - }; + programs = { + dconf.enable = true; + gpaste.enable = true; + }; + } + (lib.mkIf (!config.vinzenz.keep-gnome-default-apps) { + environment.gnome.excludePackages = with pkgs; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + gnome-maps + gnome-weather + gnome-tour + sysprof + orca # screen reader + gnome-weather + gnome-backgrounds + gnome-user-docs + yelp # help app + gnome-music + totem # video player + snapshot # camera + baobab # disk usage + ]; + }) + ]; } diff --git a/modules/latex.nix b/nixosModules/latex.nix similarity index 100% rename from modules/latex.nix rename to nixosModules/latex.nix diff --git a/modules/niri.nix b/nixosModules/niri.nix similarity index 100% rename from modules/niri.nix rename to nixosModules/niri.nix diff --git a/nixosModules/vinzenz-desktop-settings.nix b/nixosModules/vinzenz-desktop-settings.nix new file mode 100644 index 00000000..24b4b4fb --- /dev/null +++ b/nixosModules/vinzenz-desktop-settings.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: +{ + programs.firefox.enable = true; + + environment.systemPackages = with pkgs; [ + lm_sensors + libreoffice-qt6 + ]; + + fonts = { + enableDefaultPackages = true; + fontconfig.defaultFonts.monospace = [ "FiraCode Nerd Font" ]; + packages = with pkgs; [ + nerd-fonts.fira-code + roboto-mono + recursive + ]; + }; + + hardware.logitech.wireless = { + enable = true; + enableGraphical = true; + }; + + # RDP connections + services.gnome.gnome-remote-desktop.enable = true; + networking.firewall.allowedTCPPorts = [ 3389 ]; +} diff --git a/modules/gaming.nix b/nixosModules/wine-gaming.nix similarity index 100% rename from modules/gaming.nix rename to nixosModules/wine-gaming.nix From 1bebb5d096d4315756002ed1a67acc324417c617 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 18:07:38 +0200 Subject: [PATCH 0337/1295] mv home homeConfigurations --- {home => homeConfigurations}/ronja/configuration.nix | 0 {home => homeConfigurations}/ronja/default.nix | 0 {home => homeConfigurations}/ronja/vscode.nix | 0 .../vinzenz/.config/containers/policy.json | 0 {home => homeConfigurations}/vinzenz/.zsh/p10k.zsh | 0 {home => homeConfigurations}/vinzenz/configuration.nix | 0 {home => homeConfigurations}/vinzenz/default.nix | 0 {home => homeConfigurations}/vinzenz/editorconfig.nix | 0 {home => homeConfigurations}/vinzenz/fuzzel.nix | 0 {home => homeConfigurations}/vinzenz/git.nix | 0 {home => homeConfigurations}/vinzenz/gnome.nix | 0 {home => homeConfigurations}/vinzenz/niri.nix | 0 {home => homeConfigurations}/vinzenz/ssh.nix | 0 {home => homeConfigurations}/vinzenz/swaylock.nix | 0 {home => homeConfigurations}/vinzenz/vscode.nix | 0 {home => homeConfigurations}/vinzenz/waybar.nix | 0 {home => homeConfigurations}/vinzenz/zsh.nix | 0 17 files changed, 0 insertions(+), 0 deletions(-) rename {home => homeConfigurations}/ronja/configuration.nix (100%) rename {home => homeConfigurations}/ronja/default.nix (100%) rename {home => homeConfigurations}/ronja/vscode.nix (100%) rename {home => homeConfigurations}/vinzenz/.config/containers/policy.json (100%) rename {home => homeConfigurations}/vinzenz/.zsh/p10k.zsh (100%) rename {home => homeConfigurations}/vinzenz/configuration.nix (100%) rename {home => homeConfigurations}/vinzenz/default.nix (100%) rename {home => homeConfigurations}/vinzenz/editorconfig.nix (100%) rename {home => homeConfigurations}/vinzenz/fuzzel.nix (100%) rename {home => homeConfigurations}/vinzenz/git.nix (100%) rename {home => homeConfigurations}/vinzenz/gnome.nix (100%) rename {home => homeConfigurations}/vinzenz/niri.nix (100%) rename {home => homeConfigurations}/vinzenz/ssh.nix (100%) rename {home => homeConfigurations}/vinzenz/swaylock.nix (100%) rename {home => homeConfigurations}/vinzenz/vscode.nix (100%) rename {home => homeConfigurations}/vinzenz/waybar.nix (100%) rename {home => homeConfigurations}/vinzenz/zsh.nix (100%) diff --git a/home/ronja/configuration.nix b/homeConfigurations/ronja/configuration.nix similarity index 100% rename from home/ronja/configuration.nix rename to homeConfigurations/ronja/configuration.nix diff --git a/home/ronja/default.nix b/homeConfigurations/ronja/default.nix similarity index 100% rename from home/ronja/default.nix rename to homeConfigurations/ronja/default.nix diff --git a/home/ronja/vscode.nix b/homeConfigurations/ronja/vscode.nix similarity index 100% rename from home/ronja/vscode.nix rename to homeConfigurations/ronja/vscode.nix diff --git a/home/vinzenz/.config/containers/policy.json b/homeConfigurations/vinzenz/.config/containers/policy.json similarity index 100% rename from home/vinzenz/.config/containers/policy.json rename to homeConfigurations/vinzenz/.config/containers/policy.json diff --git a/home/vinzenz/.zsh/p10k.zsh b/homeConfigurations/vinzenz/.zsh/p10k.zsh similarity index 100% rename from home/vinzenz/.zsh/p10k.zsh rename to homeConfigurations/vinzenz/.zsh/p10k.zsh diff --git a/home/vinzenz/configuration.nix b/homeConfigurations/vinzenz/configuration.nix similarity index 100% rename from home/vinzenz/configuration.nix rename to homeConfigurations/vinzenz/configuration.nix diff --git a/home/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix similarity index 100% rename from home/vinzenz/default.nix rename to homeConfigurations/vinzenz/default.nix diff --git a/home/vinzenz/editorconfig.nix b/homeConfigurations/vinzenz/editorconfig.nix similarity index 100% rename from home/vinzenz/editorconfig.nix rename to homeConfigurations/vinzenz/editorconfig.nix diff --git a/home/vinzenz/fuzzel.nix b/homeConfigurations/vinzenz/fuzzel.nix similarity index 100% rename from home/vinzenz/fuzzel.nix rename to homeConfigurations/vinzenz/fuzzel.nix diff --git a/home/vinzenz/git.nix b/homeConfigurations/vinzenz/git.nix similarity index 100% rename from home/vinzenz/git.nix rename to homeConfigurations/vinzenz/git.nix diff --git a/home/vinzenz/gnome.nix b/homeConfigurations/vinzenz/gnome.nix similarity index 100% rename from home/vinzenz/gnome.nix rename to homeConfigurations/vinzenz/gnome.nix diff --git a/home/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix similarity index 100% rename from home/vinzenz/niri.nix rename to homeConfigurations/vinzenz/niri.nix diff --git a/home/vinzenz/ssh.nix b/homeConfigurations/vinzenz/ssh.nix similarity index 100% rename from home/vinzenz/ssh.nix rename to homeConfigurations/vinzenz/ssh.nix diff --git a/home/vinzenz/swaylock.nix b/homeConfigurations/vinzenz/swaylock.nix similarity index 100% rename from home/vinzenz/swaylock.nix rename to homeConfigurations/vinzenz/swaylock.nix diff --git a/home/vinzenz/vscode.nix b/homeConfigurations/vinzenz/vscode.nix similarity index 100% rename from home/vinzenz/vscode.nix rename to homeConfigurations/vinzenz/vscode.nix diff --git a/home/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix similarity index 100% rename from home/vinzenz/waybar.nix rename to homeConfigurations/vinzenz/waybar.nix diff --git a/home/vinzenz/zsh.nix b/homeConfigurations/vinzenz/zsh.nix similarity index 100% rename from home/vinzenz/zsh.nix rename to homeConfigurations/vinzenz/zsh.nix From 87062e05c4b27921cd61ebd58d07d8e90e3a8be0 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 18:11:53 +0200 Subject: [PATCH 0338/1295] update imports --- flake.nix | 2 ++ nixosConfigurations/ronja-pc/default.nix | 4 ++-- nixosConfigurations/vinzenz-lpt2/default.nix | 6 +++--- nixosConfigurations/vinzenz-pc2/default.nix | 6 +++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index e23e1f34..18a06b9d 100644 --- a/flake.nix +++ b/flake.nix @@ -113,6 +113,7 @@ inherit system; specialArgs = commonSpecialArgs // { vinzenzNixosModules = self.nixosModules; + vinzenzHomeConfigurations = self.homeConfigurations; }; modules = [ { @@ -216,6 +217,7 @@ }; homeModules = self.lib.importDir ./homeModules; + homeConfigurations = self.lib.importDir ./homeConfigurations; formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); }; diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index 225fe6f3..d1a97dbb 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -1,4 +1,4 @@ -{ vinzenzNixosModules, ... }: +{ vinzenzNixosModules, vinzenzHomeConfigurations, ... }: { imports = [ ./configuration.nix @@ -9,6 +9,6 @@ vinzenzNixosModules.wine-gaming vinzenzNixosModules.vinzenz-desktop-settings - ../../home/ronja + vinzenzHomeConfigurations.ronja ]; } diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index fef8d34f..df8e26ae 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -1,4 +1,4 @@ -{ vinzenzNixosModules, ... }: +{ vinzenzNixosModules, vinzenzHomeConfigurations, ... }: { imports = [ ./configuration.nix @@ -11,7 +11,7 @@ vinzenzNixosModules.podman vinzenzNixosModules.vinzenz-desktop-settings - ../../home/vinzenz - ../../home/ronja + vinzenzHomeConfigurations.vinzenz + vinzenzHomeConfigurations.ronja ]; } diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix index 3400235e..0b17b3aa 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -1,4 +1,4 @@ -{ vinzenzNixosModules, ... }: +{ vinzenzNixosModules, vinzenzHomeConfigurations, ... }: { imports = [ ./configuration.nix @@ -13,7 +13,7 @@ vinzenzNixosModules.podman vinzenzNixosModules.vinzenz-desktop-settings - ../../home/vinzenz - ../../home/ronja + vinzenzHomeConfigurations.vinzenz + vinzenzHomeConfigurations.ronja ]; } From 8fc672bfcfcba7f9448c4a024c3d4834929c1bdb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 19:01:30 +0200 Subject: [PATCH 0339/1295] move user and additional module handling into flake.nix --- flake.nix | 103 +++++++++++++----- homeConfigurations/ronja/configuration.nix | 60 ---------- homeConfigurations/ronja/default.nix | 76 +++++++++---- homeConfigurations/vinzenz/default.nix | 62 +++-------- .../forgejo-runner-1/default.nix | 3 - nixosConfigurations/ronja-pc/default.nix | 8 -- nixosConfigurations/vinzenz-lpt2/default.nix | 11 -- nixosConfigurations/vinzenz-lpt2/hardware.nix | 96 ++++++++-------- nixosConfigurations/vinzenz-pc2/default.nix | 11 -- nixosConfigurations/vinzenz-pc2/hardware.nix | 60 +++++----- nixosModules/allowed-unfree-list.nix | 4 +- nixosModules/intel-graphics.nix | 4 +- nixosModules/steam.nix | 3 - nixosModules/user-ronja.nix | 19 ++++ nixosModules/user-vinzenz.nix | 35 ++++++ 15 files changed, 275 insertions(+), 280 deletions(-) delete mode 100644 homeConfigurations/ronja/configuration.nix create mode 100644 nixosModules/user-ronja.nix create mode 100644 nixosModules/user-vinzenz.nix diff --git a/flake.nix b/flake.nix index 18a06b9d..0096a201 100644 --- a/flake.nix +++ b/flake.nix @@ -63,23 +63,66 @@ }: let devices = { - vinzenz-lpt2 = "x86_64-linux"; - vinzenz-pc2 = "x86_64-linux"; - ronja-pc = "x86_64-linux"; - hetzner-vpn2 = "aarch64-linux"; - forgejo-runner-1 = "aarch64-linux"; + vinzenz-lpt2 = { + system = "x86_64-linux"; + additional-modules = [ + self.nixosModules.user-vinzenz + + self.nixosModules.gnome + self.nixosModules.wine-gaming + self.nixosModules.steam + self.nixosModules.printing + self.nixosModules.podman + self.nixosModules.vinzenz-desktop-settings + self.nixosModules.intel-graphics + ]; + home-manager-users = { + inherit (self.homeConfigurations) vinzenz; + }; + }; + vinzenz-pc2 = { + system = "x86_64-linux"; + additional-modules = [ + self.nixosModules.user-vinzenz + self.nixosModules.user-ronja + + self.nixosModules.gnome + self.nixosModules.wine-gaming + self.nixosModules.steam + self.nixosModules.printing + self.nixosModules.podman + self.nixosModules.vinzenz-desktop-settings + self.nixosModules.amd-graphics + ]; + home-manager-users = { + inherit (self.homeConfigurations) vinzenz ronja; + }; + }; + ronja-pc = { + system = "x86_64-linux"; + additional-modules = [ + self.nixosModules.user-ronja + + self.nixosModules.gnome + self.nixosModules.steam + self.nixosModules.wine-gaming + self.nixosModules.vinzenz-desktop-settings + ]; + home-manager-users = { + inherit (self.homeConfigurations) ronja; + }; + }; + hetzner-vpn2 = { + system = "aarch64-linux"; + }; + forgejo-runner-1 = { + system = "aarch64-linux"; + additional-modules = [ self.nixosModules.podman ]; + }; }; - homeDevices = [ - "vinzenz-lpt2" - "vinzenz-pc2" - "ronja-pc" - ]; lib = nixpkgs.lib; - forDevice = f: lib.mapAttrs f devices; - supported-systems = [ - "x86_64-linux" - "aarch64-linux" - ]; + forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) devices; + supported-systems = lib.attrsets.mapAttrsToList (k: v: v.system) devices; forAllSystems = f: lib.genAttrs supported-systems ( @@ -101,20 +144,21 @@ }; nixosConfigurations = forDevice ( - device: system: + { + device, + system, + home-manager-users ? { }, + additional-modules ? [ ], + }: let - commonSpecialArgs = { + specialArgs = { inherit device; vinzenzHomeModules = self.homeModules; vinzenzLib = self.lib; }; in nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = commonSpecialArgs // { - vinzenzNixosModules = self.nixosModules; - vinzenzHomeConfigurations = self.homeConfigurations; - }; + inherit system specialArgs; modules = [ { networking.hostName = device; @@ -134,6 +178,7 @@ nix.settings.experimental-features = [ "nix-command" "flakes" + "repl-flake" ]; documentation = { @@ -144,6 +189,7 @@ ./nixosConfigurations/${device} + self.nixosModules.default self.nixosModules.lix-is-nix self.nixosModules.globalinstalls self.nixosModules.autoupdate @@ -155,10 +201,10 @@ zerforschen-plus.nixosModules.default ] - ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ + ++ (nixpkgs.lib.optionals (home-manager-users != { }) [ { home-manager = { - extraSpecialArgs = commonSpecialArgs; + extraSpecialArgs = specialArgs; useGlobalPkgs = true; useUserPackages = true; }; @@ -174,6 +220,8 @@ self.homeModules.nano self.homeModules.gnome-extensions ]; + + home-manager.users = home-manager-users; } self.nixosModules.pkgs-unstable @@ -190,7 +238,8 @@ home-manager.nixosModules.home-manager servicepoint-simulator.nixosModules.default servicepoint-cli.nixosModules.default - ]); + ]) + ++ additional-modules; } ); @@ -214,6 +263,10 @@ pkgs-vscode-extensions = { nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; }; + # required modules to use other modules, should not do anything on their own + default = { + imports = [ self.nixosModules.allowed-unfree-list ]; + }; }; homeModules = self.lib.importDir ./homeModules; diff --git a/homeConfigurations/ronja/configuration.nix b/homeConfigurations/ronja/configuration.nix deleted file mode 100644 index 26cceacd..00000000 --- a/homeConfigurations/ronja/configuration.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ config, pkgs, ... }: -{ - config = { - home.packages = with pkgs; [ - ## Apps - telegram-desktop - kdiff3 - ]; - - programs = { - home-manager.enable = true; - - zsh = { - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = [ - "git" - "sudo" - "systemadmin" - ]; - }; - shellAliases = { - myos-update = ''echo "Enter sudo password" && sudo nixos-rebuild boot --flake git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git --show-trace --log-format internal-json -v |& ${pkgs.nix-output-monitor}/bin/nom --json''; - myos-apply = ''echo "Enter sudo password" && sudo nixos-rebuild switch --flake .# --show-trace --log-format internal-json -v |& ${pkgs.nix-output-monitor}/bin/nom --json''; - }; - }; - - git = { - userName = "Ronja Spiegelberg"; - userEmail = "ronja.spiegelberg@gmail.com"; - - extraConfig = { - pull.ff = "only"; - merge.tool = "kdiff3"; - }; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - }; - }; -} diff --git a/homeConfigurations/ronja/default.nix b/homeConfigurations/ronja/default.nix index 7c2f96d1..0f202cd0 100644 --- a/homeConfigurations/ronja/default.nix +++ b/homeConfigurations/ronja/default.nix @@ -1,25 +1,61 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: { + imports = [ ./vscode.nix ]; config = { - # Define user account - users.users.ronja = { - isNormalUser = true; - name = "ronja"; - description = "Ronja"; - home = "/home/ronja"; - extraGroups = [ - "networkmanager" - "wheel" - "games" - "podman" - "openvscode-server" - ]; - shell = pkgs.zsh; - }; - - home-manager.users.ronja.imports = [ - ./configuration.nix - ./vscode.nix + home.packages = with pkgs; [ + ## Apps + telegram-desktop + kdiff3 ]; + + programs = { + home-manager.enable = true; + + zsh = { + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = [ + "git" + "sudo" + "systemadmin" + ]; + }; + shellAliases = { + myos-update = ''echo "Enter sudo password" && sudo nixos-rebuild boot --flake git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git --show-trace --log-format internal-json -v |& ${pkgs.nix-output-monitor}/bin/nom --json''; + myos-apply = ''echo "Enter sudo password" && sudo nixos-rebuild switch --flake .# --show-trace --log-format internal-json -v |& ${pkgs.nix-output-monitor}/bin/nom --json''; + }; + }; + + git = { + userName = "Ronja Spiegelberg"; + userEmail = "ronja.spiegelberg@gmail.com"; + + extraConfig = { + pull.ff = "only"; + merge.tool = "kdiff3"; + }; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + }; }; } diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index e555eba3..33cfceb3 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -1,51 +1,15 @@ -{ pkgs, ... }: { - config = { - users.users.vinzenz = { - isNormalUser = true; - name = "vinzenz"; - description = "Vinzenz"; - home = "/home/vinzenz"; - extraGroups = [ - "networkmanager" - "wheel" - "games" - "dialout" - "podman" - "nginx" - "adbusers" - "kvm" - "input" - "video" - ]; - shell = pkgs.zsh; - autoSubUidGidRange = true; - }; - - nix.settings.trusted-users = [ "vinzenz" ]; - - home-manager.users.vinzenz.imports = [ - ./configuration.nix - ./editorconfig.nix - ./fuzzel.nix - ./git.nix - ./gnome.nix - #./niri.nix - ./ssh.nix - ./swaylock.nix - ./vscode.nix - ./waybar.nix - ./zsh.nix - ]; - - allowedUnfreePackages = [ - "rider" - "pycharm-professional" - "jetbrains-toolbox" - - "anydesk" - - "vscode-extension-ms-dotnettools-csharp" - ]; - }; + imports = [ + ./configuration.nix + ./editorconfig.nix + ./fuzzel.nix + ./git.nix + ./gnome.nix + #./niri.nix + ./ssh.nix + ./swaylock.nix + ./vscode.nix + ./waybar.nix + ./zsh.nix + ]; } diff --git a/nixosConfigurations/forgejo-runner-1/default.nix b/nixosConfigurations/forgejo-runner-1/default.nix index 79cb6131..995d3d58 100644 --- a/nixosConfigurations/forgejo-runner-1/default.nix +++ b/nixosConfigurations/forgejo-runner-1/default.nix @@ -1,10 +1,7 @@ -{ vinzenzNixosModules, ... }: { imports = [ ./configuration.nix ./hardware.nix - - vinzenzNixosModules.podman ./forgejo-runner.nix ]; } diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index d1a97dbb..66ff518a 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -1,14 +1,6 @@ -{ vinzenzNixosModules, vinzenzHomeConfigurations, ... }: { imports = [ ./configuration.nix ./hardware.nix - - vinzenzNixosModules.gnome - vinzenzNixosModules.steam - vinzenzNixosModules.wine-gaming - vinzenzNixosModules.vinzenz-desktop-settings - - vinzenzHomeConfigurations.ronja ]; } diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index df8e26ae..66ff518a 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -1,17 +1,6 @@ -{ vinzenzNixosModules, vinzenzHomeConfigurations, ... }: { imports = [ ./configuration.nix ./hardware.nix - - vinzenzNixosModules.gnome - vinzenzNixosModules.wine-gaming - vinzenzNixosModules.steam - vinzenzNixosModules.printing - vinzenzNixosModules.podman - vinzenzNixosModules.vinzenz-desktop-settings - - vinzenzHomeConfigurations.vinzenz - vinzenzHomeConfigurations.ronja ]; } diff --git a/nixosConfigurations/vinzenz-lpt2/hardware.nix b/nixosConfigurations/vinzenz-lpt2/hardware.nix index cf5157cc..175a168e 100644 --- a/nixosConfigurations/vinzenz-lpt2/hardware.nix +++ b/nixosConfigurations/vinzenz-lpt2/hardware.nix @@ -1,64 +1,56 @@ +{ pkgs, lib, ... }: { - vinzenzNixosModules, - pkgs, - lib, - ... -}: -{ - imports = [ vinzenzNixosModules.intel-graphics ]; - config = { - # intel cpu - boot.kernelModules = [ - "kvm-intel" - "xe" - ]; + # intel cpu + boot.kernelModules = [ + "kvm-intel" + "xe" + ]; - networking = { - networkmanager.enable = true; - useDHCP = lib.mkDefault true; - }; + networking = { + networkmanager.enable = true; + useDHCP = lib.mkDefault true; + }; - boot = { - kernelPackages = pkgs.linuxPackages_zen; + boot = { + kernelPackages = pkgs.linuxPackages_zen; + supportedFilesystems = [ "btrfs" ]; + initrd = { supportedFilesystems = [ "btrfs" ]; - initrd = { - supportedFilesystems = [ "btrfs" ]; - availableKernelModules = [ - "xhci_pci" - "thunderbolt" - "nvme" - ]; - luks.devices = { - "luks-2c654ff2-3c42-48d3-a1e3-9545679afaa3" = { - device = "/dev/disk/by-uuid/2c654ff2-3c42-48d3-a1e3-9545679afaa3"; - }; + availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "nvme" + ]; + luks.devices = { + "luks-2c654ff2-3c42-48d3-a1e3-9545679afaa3" = { + device = "/dev/disk/by-uuid/2c654ff2-3c42-48d3-a1e3-9545679afaa3"; }; }; }; + }; - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/e4dad0c8-26a1-45e9-bbd9-48565eb6574e"; - fsType = "btrfs"; - options = [ "subvol=@" ]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/E2B7-2BC1"; - fsType = "vfat"; - }; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/e4dad0c8-26a1-45e9-bbd9-48565eb6574e"; + fsType = "btrfs"; + options = [ "subvol=@" ]; }; - swapDevices = [ - { - device = "/var/lib/swapfile"; - size = 32 * 1024; - } - ]; - - services.thermald.enable = true; - services.hardware.bolt.enable = true; # thunderbolt security - - hardware.bluetooth.enable = true; + "/boot" = { + device = "/dev/disk/by-uuid/E2B7-2BC1"; + fsType = "vfat"; + }; }; + + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 32 * 1024; + } + ]; + + services.thermald.enable = true; + services.hardware.bolt.enable = true; # thunderbolt security + + hardware.bluetooth.enable = true; } diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix index 0b17b3aa..6a54768f 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -1,19 +1,8 @@ -{ vinzenzNixosModules, vinzenzHomeConfigurations, ... }: { imports = [ ./configuration.nix ./hardware.nix ./vscode-server.nix ./hass.nix - - vinzenzNixosModules.gnome - vinzenzNixosModules.wine-gaming - vinzenzNixosModules.steam - vinzenzNixosModules.printing - vinzenzNixosModules.podman - vinzenzNixosModules.vinzenz-desktop-settings - - vinzenzHomeConfigurations.vinzenz - vinzenzHomeConfigurations.ronja ]; } diff --git a/nixosConfigurations/vinzenz-pc2/hardware.nix b/nixosConfigurations/vinzenz-pc2/hardware.nix index 6a4c71a5..9e875c35 100644 --- a/nixosConfigurations/vinzenz-pc2/hardware.nix +++ b/nixosConfigurations/vinzenz-pc2/hardware.nix @@ -1,38 +1,30 @@ +{ pkgs, lib, ... }: { - vinzenzNixosModules, - pkgs, - lib, - ... -}: -{ - imports = [ vinzenzNixosModules.amd-graphics ]; - config = { - # amd cpu - boot.kernelModules = [ "kvm-amd" ]; + # amd cpu + boot.kernelModules = [ "kvm-amd" ]; - boot = { - initrd.availableKernelModules = [ - "nvme" - "xhci_pci" - "ahci" - "usbhid" - "sd_mod" - ]; # "usb_storage" - kernelPackages = pkgs.linuxPackages_zen; - supportedFilesystems = [ "btrfs" ]; - initrd.supportedFilesystems = [ "btrfs" ]; - loader.efi.efiSysMountPoint = "/boot"; - }; - - fileSystems = import ./fstab.nix; - swapDevices = [ ]; - - networking = { - networkmanager.enable = true; - useDHCP = lib.mkDefault true; - interfaces.eno1.wakeOnLan.enable = true; - }; - - hardware.bluetooth.enable = true; + boot = { + initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "sd_mod" + ]; # "usb_storage" + kernelPackages = pkgs.linuxPackages_zen; + supportedFilesystems = [ "btrfs" ]; + initrd.supportedFilesystems = [ "btrfs" ]; + loader.efi.efiSysMountPoint = "/boot"; }; + + fileSystems = import ./fstab.nix; + swapDevices = [ ]; + + networking = { + networkmanager.enable = true; + useDHCP = lib.mkDefault true; + interfaces.eno1.wakeOnLan.enable = true; + }; + + hardware.bluetooth.enable = true; } diff --git a/nixosModules/allowed-unfree-list.nix b/nixosModules/allowed-unfree-list.nix index a5583cff..7bfa7586 100644 --- a/nixosModules/allowed-unfree-list.nix +++ b/nixosModules/allowed-unfree-list.nix @@ -9,7 +9,9 @@ config = { nixpkgs.config = { # https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085 - allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages; + allowUnfreePredicate = lib.mkDefault ( + pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages + ); }; }; } diff --git a/nixosModules/intel-graphics.nix b/nixosModules/intel-graphics.nix index 709d7208..74c6e670 100644 --- a/nixosModules/intel-graphics.nix +++ b/nixosModules/intel-graphics.nix @@ -1,7 +1,5 @@ -{ pkgs, vinzenzNixosModules, ... }: +{ pkgs, ... }: { - imports = [ vinzenzNixosModules.allowed-unfree-list ]; - config = { hardware.graphics = { extraPackages = with pkgs; [ diff --git a/nixosModules/steam.nix b/nixosModules/steam.nix index 1c707859..b0991e66 100644 --- a/nixosModules/steam.nix +++ b/nixosModules/steam.nix @@ -1,7 +1,4 @@ -{ vinzenzNixosModules, ... }: { - imports = [ vinzenzNixosModules.allowed-unfree-list ]; - hardware.steam-hardware.enable = true; programs = { diff --git a/nixosModules/user-ronja.nix b/nixosModules/user-ronja.nix new file mode 100644 index 00000000..b374ab9c --- /dev/null +++ b/nixosModules/user-ronja.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: +{ + users.users.ronja = { + isNormalUser = true; + name = "ronja"; + description = "Ronja"; + home = "/home/ronja"; + extraGroups = [ + "networkmanager" + "wheel" + "games" + "podman" + "openvscode-server" + ]; + shell = pkgs.zsh; + }; + + nix.settings.trusted-users = [ "ronja" ]; +} diff --git a/nixosModules/user-vinzenz.nix b/nixosModules/user-vinzenz.nix new file mode 100644 index 00000000..b48e750e --- /dev/null +++ b/nixosModules/user-vinzenz.nix @@ -0,0 +1,35 @@ +{ pkgs, ... }: +{ + users.users.vinzenz = { + isNormalUser = true; + name = "vinzenz"; + description = "Vinzenz"; + home = "/home/vinzenz"; + extraGroups = [ + "networkmanager" + "wheel" + "games" + "dialout" + "podman" + "nginx" + "adbusers" + "kvm" + "input" + "video" + ]; + shell = pkgs.zsh; + autoSubUidGidRange = true; + }; + + nix.settings.trusted-users = [ "vinzenz" ]; + + allowedUnfreePackages = [ + "rider" + "pycharm-professional" + "jetbrains-toolbox" + + "anydesk" + + "vscode-extension-ms-dotnettools-csharp" + ]; +} From 9cf6333f4b0b470ba61661c714bc7eeb84c02f15 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 19:05:04 +0200 Subject: [PATCH 0340/1295] merge default.nix and configuration.nix --- .../forgejo-runner-1/configuration.nix | 15 ------- .../forgejo-runner-1/default.nix | 16 ++++++- .../hetzner-vpn2/configuration.nix | 21 --------- nixosConfigurations/hetzner-vpn2/default.nix | 22 ++++++++- .../ronja-pc/configuration.nix | 26 ----------- nixosConfigurations/ronja-pc/default.nix | 28 +++++++++++- .../vinzenz-lpt2/configuration.nix | 45 ------------------- nixosConfigurations/vinzenz-lpt2/default.nix | 43 +++++++++++++++++- .../vinzenz-pc2/configuration.nix | 34 -------------- nixosConfigurations/vinzenz-pc2/default.nix | 36 ++++++++++++++- 10 files changed, 140 insertions(+), 146 deletions(-) delete mode 100644 nixosConfigurations/forgejo-runner-1/configuration.nix delete mode 100644 nixosConfigurations/hetzner-vpn2/configuration.nix delete mode 100644 nixosConfigurations/ronja-pc/configuration.nix delete mode 100644 nixosConfigurations/vinzenz-lpt2/configuration.nix delete mode 100644 nixosConfigurations/vinzenz-pc2/configuration.nix diff --git a/nixosConfigurations/forgejo-runner-1/configuration.nix b/nixosConfigurations/forgejo-runner-1/configuration.nix deleted file mode 100644 index 345e622f..00000000 --- a/nixosConfigurations/forgejo-runner-1/configuration.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ ... }: -{ - # uncomment for build check on non arm system (requires --impure) - # nixpkgs.buildPlatform = builtins.currentSystem; - services.tailscale.useRoutingFeatures = "both"; - system.autoUpgrade.allowReboot = true; - - users.users = { - root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - }; -} diff --git a/nixosConfigurations/forgejo-runner-1/default.nix b/nixosConfigurations/forgejo-runner-1/default.nix index 995d3d58..f9d3c3f3 100644 --- a/nixosConfigurations/forgejo-runner-1/default.nix +++ b/nixosConfigurations/forgejo-runner-1/default.nix @@ -1,7 +1,21 @@ { imports = [ - ./configuration.nix ./hardware.nix ./forgejo-runner.nix ]; + + config = { + # uncomment for build check on non arm system (requires --impure) + # nixpkgs.buildPlatform = builtins.currentSystem; + services.tailscale.useRoutingFeatures = "both"; + system.autoUpgrade.allowReboot = true; + + users.users = { + root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + }; + }; } diff --git a/nixosConfigurations/hetzner-vpn2/configuration.nix b/nixosConfigurations/hetzner-vpn2/configuration.nix deleted file mode 100644 index 8e16ff71..00000000 --- a/nixosConfigurations/hetzner-vpn2/configuration.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ ... }: -{ - # uncomment for build check on non arm system (requires --impure) - # nixpkgs.buildPlatform = builtins.currentSystem; - - services.tailscale.useRoutingFeatures = "both"; - - users.users = { - root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - #ronja.openssh.authorizedKeys.keys = [ - # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - #]; - }; - - system.autoUpgrade.allowReboot = true; -} diff --git a/nixosConfigurations/hetzner-vpn2/default.nix b/nixosConfigurations/hetzner-vpn2/default.nix index 46ded484..591dc20e 100644 --- a/nixosConfigurations/hetzner-vpn2/default.nix +++ b/nixosConfigurations/hetzner-vpn2/default.nix @@ -1,7 +1,27 @@ { imports = [ - ./configuration.nix ./hardware.nix ./nginx.nix ]; + + config = { + # uncomment for build check on non arm system (requires --impure) + # nixpkgs.buildPlatform = builtins.currentSystem; + + services.tailscale.useRoutingFeatures = "both"; + + users.users = { + root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + #ronja.openssh.authorizedKeys.keys = [ + # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + #]; + }; + + system.autoUpgrade.allowReboot = true; + }; } diff --git a/nixosConfigurations/ronja-pc/configuration.nix b/nixosConfigurations/ronja-pc/configuration.nix deleted file mode 100644 index 0e9124d6..00000000 --- a/nixosConfigurations/ronja-pc/configuration.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - config, - pkgs, - ... -}: -{ - # Configure keymap in X11 - services.xserver.xkb = { - layout = "de"; - variant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget - ]; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; -} diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index 66ff518a..dd22382c 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -1,6 +1,32 @@ +{ + config, + pkgs, + ... +}: { imports = [ - ./configuration.nix ./hardware.nix ]; + + config = { + # Configure keymap in X11 + services.xserver.xkb = { + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + ]; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ];}; + }; } diff --git a/nixosConfigurations/vinzenz-lpt2/configuration.nix b/nixosConfigurations/vinzenz-lpt2/configuration.nix deleted file mode 100644 index b38f25a9..00000000 --- a/nixosConfigurations/vinzenz-lpt2/configuration.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ ... }: -{ - imports = [ ./nginx.nix ]; - - config = { - nix.settings.extra-platforms = [ - "aarch64-linux" - "i686-linux" - ]; - - services.xserver.xkb = { - # Configure keymap in X11 - layout = "de"; - variant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ]; - - #users.users.ronja.openssh.authorizedKeys.keys = [ - # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - #]; - - programs = { - adb.enable = true; - light = { - enable = true; - brightnessKeys = { - enable = true; - step = 5; - }; - }; - }; - - networking.firewall.allowedTCPPorts = [ - 8776 - 1337 - ]; - }; -} diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index 66ff518a..58eac820 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -1,6 +1,47 @@ { imports = [ - ./configuration.nix ./hardware.nix + ./nginx.nix ]; + + config = { + nix.settings.extra-platforms = [ + "aarch64-linux" + "i686-linux" + ]; + + services.xserver.xkb = { + # Configure keymap in X11 + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ]; + + #users.users.ronja.openssh.authorizedKeys.keys = [ + # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + #]; + + programs = { + adb.enable = true; + light = { + enable = true; + brightnessKeys = { + enable = true; + step = 5; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ + 8776 + 1337 + ]; + }; } diff --git a/nixosConfigurations/vinzenz-pc2/configuration.nix b/nixosConfigurations/vinzenz-pc2/configuration.nix deleted file mode 100644 index d53ad71c..00000000 --- a/nixosConfigurations/vinzenz-pc2/configuration.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ pkgs, ... }: -{ - nix.settings.extra-platforms = [ - "aarch64-linux" - "i686-linux" - ]; - - services.xserver.xkb = { - # Configure keymap in X11 - layout = "de"; - variant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - - users.users.ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' - ]; - - environment.systemPackages = with pkgs; [ lact ]; - - networking.firewall.allowedUDPPorts = [ - # Factorio - 34197 - ]; -} diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix index 6a54768f..23505b1a 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -1,8 +1,42 @@ +{ pkgs, ... }: { imports = [ - ./configuration.nix ./hardware.nix ./vscode-server.nix ./hass.nix ]; + + config = { + nix.settings.extra-platforms = [ + "aarch64-linux" + "i686-linux" + ]; + + services.xserver.xkb = { + # Configure keymap in X11 + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + + users.users.ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' + ]; + + environment.systemPackages = with pkgs; [ lact ]; + + networking.firewall.allowedUDPPorts = [ + # Factorio + 34197 + ]; + }; } From 1735ec5594d1c2d1f8650e75d79cc9699d522e15 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 19:14:32 +0200 Subject: [PATCH 0341/1295] add pre-commit check script --- hooks/pre-commit | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 hooks/pre-commit diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 00000000..6b6b8708 --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euxo pipefail + +nix fmt + +nix flake check --all-systems --show-trace From 6754eed1d88b19216575bdb8c8d8c2d388fd973a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 19:40:49 +0200 Subject: [PATCH 0342/1295] lint checks, formatting, update statix url --- flake.nix | 66 ++++++++++----------- homeConfigurations/vinzenz/editorconfig.nix | 1 - homeConfigurations/vinzenz/git.nix | 1 - homeConfigurations/vinzenz/ssh.nix | 1 - homeConfigurations/vinzenz/zsh.nix | 2 +- nixosConfigurations/hetzner-vpn2/nginx.nix | 4 +- nixosConfigurations/vinzenz-lpt2/nginx.nix | 4 +- 7 files changed, 36 insertions(+), 43 deletions(-) diff --git a/flake.nix b/flake.nix index 0096a201..4d7ec50b 100644 --- a/flake.nix +++ b/flake.nix @@ -120,7 +120,7 @@ additional-modules = [ self.nixosModules.podman ]; }; }; - lib = nixpkgs.lib; + inherit (nixpkgs) lib; forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) devices; supported-systems = lib.attrsets.mapAttrsToList (k: v: v.system) devices; forAllSystems = @@ -143,6 +143,36 @@ ) (builtins.readDir dir)); }; + overlays = { + unstable-packages = final: prev: { + unstable = import nixpkgs-unstable { + inherit (prev) system config; + }; + }; + }; + + nixosModules = (self.lib.importDir ./nixosModules) // { + niri = { + imports = [ niri.nixosModules.niri ]; + nixpkgs.overlays = [ niri.overlays.niri ]; + }; + pkgs-unstable = { + nixpkgs.overlays = [ self.overlays.unstable-packages ]; + }; + pkgs-vscode-extensions = { + nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; + }; + # required modules to use other modules, should not do anything on their own + default = { + imports = [ self.nixosModules.allowed-unfree-list ]; + }; + }; + + homeModules = self.lib.importDir ./homeModules; + homeConfigurations = self.lib.importDir ./homeConfigurations; + + formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); + nixosConfigurations = forDevice ( { device, @@ -153,8 +183,6 @@ let specialArgs = { inherit device; - vinzenzHomeModules = self.homeModules; - vinzenzLib = self.lib; }; in nixpkgs.lib.nixosSystem { @@ -178,7 +206,6 @@ nix.settings.experimental-features = [ "nix-command" "flakes" - "repl-flake" ]; documentation = { @@ -242,36 +269,5 @@ ++ additional-modules; } ); - - overlays = { - unstable-packages = final: prev: { - unstable = import nixpkgs-unstable { - system = prev.system; - config = prev.config; - }; - }; - }; - - nixosModules = (self.lib.importDir ./nixosModules) // { - niri = { - imports = [ niri.nixosModules.niri ]; - nixpkgs.overlays = [ niri.overlays.niri ]; - }; - pkgs-unstable = { - nixpkgs.overlays = [ self.overlays.unstable-packages ]; - }; - pkgs-vscode-extensions = { - nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; - }; - # required modules to use other modules, should not do anything on their own - default = { - imports = [ self.nixosModules.allowed-unfree-list ]; - }; - }; - - homeModules = self.lib.importDir ./homeModules; - homeConfigurations = self.lib.importDir ./homeConfigurations; - - formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); }; } diff --git a/homeConfigurations/vinzenz/editorconfig.nix b/homeConfigurations/vinzenz/editorconfig.nix index 496c7142..1ebffa88 100644 --- a/homeConfigurations/vinzenz/editorconfig.nix +++ b/homeConfigurations/vinzenz/editorconfig.nix @@ -1,4 +1,3 @@ -{ ... }: { config.editorconfig = { enable = true; diff --git a/homeConfigurations/vinzenz/git.nix b/homeConfigurations/vinzenz/git.nix index ddaa8903..537fe61c 100644 --- a/homeConfigurations/vinzenz/git.nix +++ b/homeConfigurations/vinzenz/git.nix @@ -1,4 +1,3 @@ -{ ... }: { config.programs.git = { enable = true; diff --git a/homeConfigurations/vinzenz/ssh.nix b/homeConfigurations/vinzenz/ssh.nix index 98acce9b..20b4baea 100644 --- a/homeConfigurations/vinzenz/ssh.nix +++ b/homeConfigurations/vinzenz/ssh.nix @@ -1,4 +1,3 @@ -{ ... }: { config.programs.ssh = { enable = true; diff --git a/homeConfigurations/vinzenz/zsh.nix b/homeConfigurations/vinzenz/zsh.nix index d7cbcfa7..1278aca9 100644 --- a/homeConfigurations/vinzenz/zsh.nix +++ b/homeConfigurations/vinzenz/zsh.nix @@ -20,7 +20,7 @@ my-direnvallow = "echo \"use nix\" > .envrc && direnv allow"; my-ip4 = "ip addr show | grep 192"; deadnix = "nix run github:astro/deadnix -- "; - statix = "nix run git+https://git.peppe.rs/languages/statix -- "; + statix = "nix run github:oppiliappan/statix -- "; }; history = { diff --git a/nixosConfigurations/hetzner-vpn2/nginx.nix b/nixosConfigurations/hetzner-vpn2/nginx.nix index 85207bc2..2520533f 100644 --- a/nixosConfigurations/hetzner-vpn2/nginx.nix +++ b/nixosConfigurations/hetzner-vpn2/nginx.nix @@ -72,7 +72,7 @@ in addSSL = true; enableACME = true; locations."/" = { - proxyPass = ("http://unix:" + anubis-domain-socket); + proxyPass = "http://unix:" + anubis-domain-socket; }; }; @@ -80,7 +80,7 @@ in root = pkgs.zerforschen-plus-content; listen = [ { - addr = ("unix:" + blog-domain-socket); + addr = "unix:" + blog-domain-socket; } ]; }; diff --git a/nixosConfigurations/vinzenz-lpt2/nginx.nix b/nixosConfigurations/vinzenz-lpt2/nginx.nix index fef3dec0..d5fd6a40 100644 --- a/nixosConfigurations/vinzenz-lpt2/nginx.nix +++ b/nixosConfigurations/vinzenz-lpt2/nginx.nix @@ -29,7 +29,7 @@ in "vinzenz-lpt2" = { locations."/" = { - proxyPass = ("http://unix:" + anubis-domain-socket); + proxyPass = "http://unix:" + anubis-domain-socket; }; }; @@ -37,7 +37,7 @@ in root = pkgs.zerforschen-plus-content; listen = [ { - addr = ("unix:" + blog-domain-socket); + addr = "unix:" + blog-domain-socket; } ]; }; From 7a17930dd4f225cda4047f1df7d650249c91f29b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 20:28:15 +0200 Subject: [PATCH 0343/1295] clean up nginx config --- nixosConfigurations/hetzner-vpn2/nginx.nix | 81 +++++----------------- 1 file changed, 18 insertions(+), 63 deletions(-) diff --git a/nixosConfigurations/hetzner-vpn2/nginx.nix b/nixosConfigurations/hetzner-vpn2/nginx.nix index 2520533f..2e5dc060 100644 --- a/nixosConfigurations/hetzner-vpn2/nginx.nix +++ b/nixosConfigurations/hetzner-vpn2/nginx.nix @@ -9,82 +9,37 @@ in defaults.email = "acme@zerforschen.plus"; }; - security.pam.services.nginx.setEnvironment = false; systemd.services = { - nginx.serviceConfig = { - SupplementaryGroups = [ - "shadow" - "anubis" - ]; - }; - anubis-main.serviceConfig = { - SupplementaryGroups = [ "nginx" ]; - }; + nginx.serviceConfig.SupplementaryGroups = [ "anubis" ]; + anubis-main.serviceConfig.SupplementaryGroups = [ "nginx" ]; }; services = { nginx = { enable = true; - additionalModules = [ pkgs.nginxModules.pam ]; - recommendedProxySettings = true; recommendedTlsSettings = true; recommendedGzipSettings = true; recommendedOptimisation = true; - virtualHosts = - #let - # servicesDomain = "services.zerforschen.plus"; - # mkServiceConfig = - # { host, port }: - # { - # addSSL = true; - # enableACME = true; - # locations."/" = { - # proxyPass = "http://${host}:${toString port}/"; - # extraConfig = '' - # # bind to tailscale ip - # proxy_bind 100.88.118.60; - # # pam auth - # limit_except OPTIONS { - # auth_pam "Password Required"; - # auth_pam_service_name "nginx"; - # } - # ''; - # }; - # }; - # pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; - #in - { - #"code.${servicesDomain}" = lib.mkMerge [ - # (mkServiceConfig { - # host = pc2; - # port = 8542; - # }) - # { locations."/".proxyWebsockets = true; } - #]; - #"view.${servicesDomain}" = mkServiceConfig { - # host = pc2; - # port = 1313; - #}; - - "zerforschen.plus" = { - addSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://unix:" + anubis-domain-socket; - }; - }; - - "blog-in-anubis" = { - root = pkgs.zerforschen-plus-content; - listen = [ - { - addr = "unix:" + blog-domain-socket; - } - ]; + virtualHosts = { + "zerforschen.plus" = { + addSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://unix:" + anubis-domain-socket; }; }; + + "blog-in-anubis" = { + root = pkgs.zerforschen-plus-content; + listen = [ + { + addr = "unix:" + blog-domain-socket; + } + ]; + }; + }; }; anubis.instances.main = { From 1f52f8a4580b80c8d246cfa357a8d35794cac07f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 20:58:56 +0200 Subject: [PATCH 0344/1295] update zerforschen.plus Keeping scrapers out --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index f53b1f64..daba5ba2 100644 --- a/flake.lock +++ b/flake.lock @@ -358,11 +358,11 @@ ] }, "locked": { - "lastModified": 1757847061, - "narHash": "sha256-YW8fpD35tD+1zTkxk0WhP7FJSL15JlFfG7tscgkdI+A=", + "lastModified": 1757962668, + "narHash": "sha256-g7VB6HcA0D1P4PLvQUztX1LIjGeuI97JosivkpuGrlY=", "ref": "refs/heads/main", - "rev": "ddff8c9b206564dd9b9007e4e894afa6f7860fc8", - "revCount": 30, + "rev": "5f50674a3d834c306834068bb0706ceac57ace1f", + "revCount": 31, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From 2c00ad065bc2feafc0d4dba59fdcc829a045fdb0 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 21:38:59 +0200 Subject: [PATCH 0345/1295] update zerforschen.plus --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index daba5ba2..a4044226 100644 --- a/flake.lock +++ b/flake.lock @@ -358,11 +358,11 @@ ] }, "locked": { - "lastModified": 1757962668, - "narHash": "sha256-g7VB6HcA0D1P4PLvQUztX1LIjGeuI97JosivkpuGrlY=", + "lastModified": 1757965108, + "narHash": "sha256-V2U1XbtfvWQ6Bt2dvbUWAlKjqY3zjrbkVveLsyxnq1w=", "ref": "refs/heads/main", - "rev": "5f50674a3d834c306834068bb0706ceac57ace1f", - "revCount": 31, + "rev": "d794fafc25c8fdead19dcbffc4c0b4bb7ff98272", + "revCount": 32, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/zerforschen.plus" }, From bd00284332b8718c21c70d95d54519ac3fde118e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 15 Sep 2025 23:30:28 +0200 Subject: [PATCH 0346/1295] uxe nixpkgs lib to replace importDir --- flake.nix | 24 ++++++++++++------------ hooks/pre-commit | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index 4d7ec50b..679ff614 100644 --- a/flake.nix +++ b/flake.nix @@ -132,17 +132,14 @@ pkgs = nixpkgs.legacyPackages.${system}; } ); + importModuleDir = + directory: + nixpkgs.lib.packagesFromDirectoryRecursive { + inherit directory; + callPackage = path: _args: path; + }; in { - lib = { - importDir = - dir: - (lib.attrsets.mapAttrs' ( - m: _: - lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) { imports = [ "${dir}/${m}" ]; } - ) (builtins.readDir dir)); - }; - overlays = { unstable-packages = final: prev: { unstable = import nixpkgs-unstable { @@ -151,7 +148,7 @@ }; }; - nixosModules = (self.lib.importDir ./nixosModules) // { + nixosModules = (importModuleDir ./nixosModules) // { niri = { imports = [ niri.nixosModules.niri ]; nixpkgs.overlays = [ niri.overlays.niri ]; @@ -168,8 +165,11 @@ }; }; - homeModules = self.lib.importDir ./homeModules; - homeConfigurations = self.lib.importDir ./homeConfigurations; + homeModules = importModuleDir ./homeModules; + homeConfigurations = { + vinzenz = ./homeConfigurations/vinzenz; + ronja = ./homeConfigurations/ronja; + }; formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); diff --git a/hooks/pre-commit b/hooks/pre-commit index 6b6b8708..1760cfee 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -3,4 +3,4 @@ set -euxo pipefail nix fmt -nix flake check --all-systems --show-trace +nix flake check --show-trace From edb4ffcd4a6425a9fce721568e91e332902f65a7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 16 Sep 2025 19:29:09 +0200 Subject: [PATCH 0347/1295] merge default and configuration.nix --- homeConfigurations/vinzenz/configuration.nix | 72 ------------------- homeConfigurations/vinzenz/default.nix | 76 +++++++++++++++++++- 2 files changed, 75 insertions(+), 73 deletions(-) delete mode 100644 homeConfigurations/vinzenz/configuration.nix diff --git a/homeConfigurations/vinzenz/configuration.nix b/homeConfigurations/vinzenz/configuration.nix deleted file mode 100644 index ace80863..00000000 --- a/homeConfigurations/vinzenz/configuration.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ pkgs, ... }: -{ - programs = { - home-manager.enable = true; - fzf.enable = true; - git-credential-oauth.enable = true; - - direnv = { - enable = true; - nix-direnv.enable = true; - enableZshIntegration = true; - }; - - eza = { - enable = true; - git = true; - icons = "auto"; - extraOptions = [ - "--group-directories-first" - "--header" - ]; - }; - - thefuck = { - enable = true; - enableZshIntegration = true; - }; - - chromium.enable = true; - }; - - home.packages = with pkgs; [ - keepassxc - - telegram-desktop - element-desktop - - wireguard-tools - wirelesstools - - kdiff3 - jetbrains-toolbox - - blanket - vlc - - ptyxis - - arduino - arduino-ide - arduino-cli - - servicepoint-cli - servicepoint-simulator - - icu - - nextcloud-client - - lutris - - foliate - ]; - - home.file = { - "policy.json" = { - target = ".config/containers/policy.json"; - text = builtins.readFile ./.config/containers/policy.json; - }; - "idea.properties".text = "idea.filewatcher.executable.path = ${pkgs.fsnotifier}/bin/fsnotifier"; - }; -} diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index 33cfceb3..a0b3e0e1 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -1,6 +1,6 @@ +{ pkgs, ... }: { imports = [ - ./configuration.nix ./editorconfig.nix ./fuzzel.nix ./git.nix @@ -12,4 +12,78 @@ ./waybar.nix ./zsh.nix ]; + + config = { + programs = { + home-manager.enable = true; + fzf.enable = true; + git-credential-oauth.enable = true; + + direnv = { + enable = true; + nix-direnv.enable = true; + enableZshIntegration = true; + }; + + eza = { + enable = true; + git = true; + icons = "auto"; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + }; + + thefuck = { + enable = true; + enableZshIntegration = true; + }; + + chromium.enable = true; + }; + + home.packages = with pkgs; [ + keepassxc + + telegram-desktop + element-desktop + + wireguard-tools + wirelesstools + + kdiff3 + jetbrains-toolbox + + blanket + vlc + + ptyxis + + arduino + arduino-ide + arduino-cli + + servicepoint-cli + servicepoint-simulator + + icu + + nextcloud-client + + lutris + + foliate + + dconf2nix + ]; + + home.file = { + "policy.json" = { + target = ".config/containers/policy.json"; + text = builtins.readFile ./.config/containers/policy.json; + }; + "idea.properties".text = "idea.filewatcher.executable.path = ${pkgs.fsnotifier}/bin/fsnotifier"; + }; + }; } From b715206b7495f5815998aee57d24637a0ef2f086 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 16 Sep 2025 19:46:39 +0200 Subject: [PATCH 0348/1295] two gnome dconf settings --- homeConfigurations/vinzenz/gnome.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeConfigurations/vinzenz/gnome.nix b/homeConfigurations/vinzenz/gnome.nix index 7424363f..ce5416ec 100644 --- a/homeConfigurations/vinzenz/gnome.nix +++ b/homeConfigurations/vinzenz/gnome.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { config = { home.packages = with pkgs; [ @@ -26,6 +26,8 @@ switch-applications = [ "Tab" ]; switch-applications-backward = [ "Tab" ]; }; + "org/gnome/desktop/session".idle-delay = lib.hm.gvariant.mkUint32 300; + "org/gnome/Connections".first-run = false; }; }; } From 6b08d3d86ccf60bf71410b5dd92cfa76a451e0ce Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 16 Sep 2025 19:50:41 +0200 Subject: [PATCH 0349/1295] remove transitive deps from inputs, update flake --- flake.lock | 109 +++++++++++++++++++++++++++++++++++++++++------------ flake.nix | 19 ++-------- 2 files changed, 87 insertions(+), 41 deletions(-) diff --git a/flake.lock b/flake.lock index a4044226..d0fcec85 100644 --- a/flake.lock +++ b/flake.lock @@ -3,6 +3,7 @@ "fenix": { "inputs": { "nixpkgs": [ + "servicepoint-cli", "naersk", "nixpkgs" ], @@ -22,6 +23,29 @@ "type": "github" } }, + "fenix_2": { + "inputs": { + "nixpkgs": [ + "servicepoint-simulator", + "naersk", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src_2" + }, + "locked": { + "lastModified": 1752475459, + "narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=", + "owner": "nix-community", + "repo": "fenix", + "rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -47,11 +71,11 @@ ] }, "locked": { - "lastModified": 1756679287, - "narHash": "sha256-Xd1vOeY9ccDf5VtVK12yM0FS6qqvfUop8UQlxEB+gTQ=", + "lastModified": 1757808926, + "narHash": "sha256-K6PEI5PYY94TVMH0mX3MbZNYFme7oNRKml/85BpRRAo=", "owner": "nix-community", "repo": "home-manager", - "rev": "07fc025fe10487dd80f2ec694f1cd790e752d0e8", + "rev": "f21d9167782c086a33ad53e2311854a8f13c281e", "type": "github" }, "original": { @@ -65,6 +89,29 @@ "inputs": { "fenix": "fenix", "nixpkgs": [ + "servicepoint-cli", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1752689277, + "narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=", + "owner": "nix-community", + "repo": "naersk", + "rev": "0e72363d0938b0208d6c646d10649164c43f4d64", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, + "naersk_2": { + "inputs": { + "fenix": "fenix_2", + "nixpkgs": [ + "servicepoint-simulator", "nixpkgs" ] }, @@ -96,11 +143,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1757698528, - "narHash": "sha256-vXZaxm2LfFrVyuUOKkyWpwR0K2WB7k2oo94HN1o4910=", + "lastModified": 1758038676, + "narHash": "sha256-5BUDFG+HnB4ZBLZSxbQ5tuueOVQDkSHi/8tUsJWlXl8=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "2418edea929640fb5f856bc0a25fb91f54dfc229", + "rev": "addd500206b992b1c9211e0dfecb70c1d0c9821a", "type": "github" }, "original": { @@ -129,11 +176,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1757656821, - "narHash": "sha256-MDaLusQZflxngGMU41g6cqabM7KE8I55UazzAZsjNN0=", + "lastModified": 1758035401, + "narHash": "sha256-yDFq5/uwQV9NetcKduw0A/3XmGN/Z3ovMCTZkUv0B6Y=", "owner": "YaLTeR", "repo": "niri", - "rev": "b7909dbf61c7c1511b9a51ef46e1d503d5ba3d05", + "rev": "08f5c6fecb3c5c81d63a0bf7248c85ae3299a4a5", "type": "github" }, "original": { @@ -180,11 +227,11 @@ ] }, "locked": { - "lastModified": 1757727921, - "narHash": "sha256-xP3XDh1r5gV0tbXstOoIzwX0VBLltBPs+Qq/UvBRU0E=", + "lastModified": 1757987448, + "narHash": "sha256-ltDT7EIfLHV42p99HnDfDviC8jN7tcOed1qsLEFypl8=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "1e79494a0dfb1e81fed3e5bfc3b2371267efdfb6", + "rev": "e496568b0e69d9d54c8cfef96ed1370952ad9786", "type": "github" }, "original": { @@ -195,11 +242,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1757545623, - "narHash": "sha256-mCxPABZ6jRjUQx3bPP4vjA68ETbPLNz9V2pk9tO7pRQ=", + "lastModified": 1757810152, + "narHash": "sha256-Vp9K5ol6h0J90jG7Rm4RWZsCB3x7v5VPx588TQ1dkfs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8cd5ce828d5d1d16feff37340171a98fc3bf6526", + "rev": "9a094440e02a699be5c57453a092a8baf569bdad", "type": "github" }, "original": { @@ -211,11 +258,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1757686808, - "narHash": "sha256-PL+Z3OrNpFNHddbsBaxeojYkWObYc2NlyhTmsmpt+hc=", + "lastModified": 1757967192, + "narHash": "sha256-/aA9A/OBmnuOMgwfzdsXRusqzUpd8rQnQY8jtrHK+To=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "098982b6eca9b809cc2f583e733338f5a36b3ad8", + "rev": "0d7c15863b251a7a50265e57c1dca1a7add2e291", "type": "github" }, "original": { @@ -228,7 +275,6 @@ "root": { "inputs": { "home-manager": "home-manager", - "naersk": "naersk", "niri": "niri", "nix-vscode-extensions": "nix-vscode-extensions", "nixpkgs": "nixpkgs", @@ -255,11 +301,26 @@ "type": "github" } }, + "rust-analyzer-src_2": { + "flake": false, + "locked": { + "lastModified": 1752428706, + "narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "591e3b7624be97e4443ea7b5542c191311aa141d", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "servicepoint-cli": { "inputs": { - "naersk": [ - "naersk" - ], + "naersk": "naersk", "nix-filter": "nix-filter", "nixpkgs": [ "nixpkgs" @@ -281,9 +342,7 @@ }, "servicepoint-simulator": { "inputs": { - "naersk": [ - "naersk" - ], + "naersk": "naersk_2", "nix-filter": "nix-filter_2", "nixpkgs": [ "nixpkgs" diff --git a/flake.nix b/flake.nix index 679ff614..1fa787e6 100644 --- a/flake.nix +++ b/flake.nix @@ -19,32 +19,19 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - naersk = { - url = "github:nix-community/naersk"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - servicepoint-cli = { url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git"; - inputs = { - nixpkgs.follows = "nixpkgs"; - naersk.follows = "naersk"; - }; + inputs.nixpkgs.follows = "nixpkgs"; }; servicepoint-simulator = { url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git"; - inputs = { - nixpkgs.follows = "nixpkgs"; - naersk.follows = "naersk"; - }; + inputs.nixpkgs.follows = "nixpkgs"; }; nix-vscode-extensions = { url = "github:nix-community/nix-vscode-extensions"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; + inputs.nixpkgs.follows = "nixpkgs"; }; }; From 202baf61b6d342fa7a31bca02828acf48db09313 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 18 Sep 2025 18:50:41 +0200 Subject: [PATCH 0350/1295] remove test setup from lpt2 --- nixosConfigurations/vinzenz-lpt2/default.nix | 1 - nixosConfigurations/vinzenz-lpt2/nginx.nix | 66 ------------------- .../vinzenz-lpt2/zerforschen-plus.nix | 38 ----------- 3 files changed, 105 deletions(-) delete mode 100644 nixosConfigurations/vinzenz-lpt2/nginx.nix delete mode 100644 nixosConfigurations/vinzenz-lpt2/zerforschen-plus.nix diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index 58eac820..255dd7aa 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -1,7 +1,6 @@ { imports = [ ./hardware.nix - ./nginx.nix ]; config = { diff --git a/nixosConfigurations/vinzenz-lpt2/nginx.nix b/nixosConfigurations/vinzenz-lpt2/nginx.nix deleted file mode 100644 index d5fd6a40..00000000 --- a/nixosConfigurations/vinzenz-lpt2/nginx.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ pkgs, ... }: -let - blog-domain-socket = "/run/nginx/blog.sock"; - anubis-domain-socket = "/run/anubis/anubis-blog.sock"; -in -{ - users.groups = { - anubis.members = [ "nginx" ]; - nginx.members = [ "anubis" ]; - }; - services = { - nginx = { - enable = true; - - recommendedProxySettings = true; - recommendedTlsSettings = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; - - virtualHosts = { - #"vinzenz-lpt2" = { - # locations."/" = { - # proxyPass = "http://127.0.0.1:3000/"; - # proxyWebsockets = true; - # }; - # - # serverAliases = [ "172.23.42.96" ]; - #}; - - "vinzenz-lpt2" = { - locations."/" = { - proxyPass = "http://unix:" + anubis-domain-socket; - }; - }; - - "vinzenz-lpt2-in-anubis" = { - root = pkgs.zerforschen-plus-content; - listen = [ - { - addr = "unix:" + blog-domain-socket; - } - ]; - }; - }; - }; - - #networking.firewall = { - # allowedTCPPorts = [ - # 80 - # 8001 - # 3000 - # ]; - # allowedUDPPorts = [ 2342 ]; - #}; - - anubis = { - instances.main = { - enable = true; - settings = { - BIND = anubis-domain-socket; - TARGET = "unix://" + blog-domain-socket; - }; - }; - }; - }; -} diff --git a/nixosConfigurations/vinzenz-lpt2/zerforschen-plus.nix b/nixosConfigurations/vinzenz-lpt2/zerforschen-plus.nix deleted file mode 100644 index d2b919db..00000000 --- a/nixosConfigurations/vinzenz-lpt2/zerforschen-plus.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - pkgs, - ... -}: -{ - security.acme = { - acceptTerms = true; - defaults.email = "acme@zerforschen.plus"; - }; - - security.pam.services.nginx.setEnvironment = false; - systemd.services.nginx.serviceConfig = { - SupplementaryGroups = [ "shadow" ]; - }; - - services.nginx = { - enable = true; - additionalModules = [ pkgs.nginxModules.pam ]; - - recommendedProxySettings = true; - recommendedTlsSettings = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; - - virtualHosts = { - "zerforschen.plus" = { - #addSSL = true; - #enableACME = true; - root = pkgs.zerforschen-plus-content; - }; - }; - }; - - #networking.firewall.allowedTCPPorts = [ - # 80 - # 443 - #]; -} From ea35347a4a682efab34fcac258131dbb079a7a0c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 23 Sep 2025 21:26:40 +0200 Subject: [PATCH 0351/1295] diable unused modules --- flake.nix | 2 -- homeConfigurations/vinzenz/default.nix | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 1fa787e6..ea895a6c 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,6 @@ self.nixosModules.gnome self.nixosModules.wine-gaming self.nixosModules.steam - self.nixosModules.printing self.nixosModules.podman self.nixosModules.vinzenz-desktop-settings self.nixosModules.intel-graphics @@ -76,7 +75,6 @@ self.nixosModules.gnome self.nixosModules.wine-gaming self.nixosModules.steam - self.nixosModules.printing self.nixosModules.podman self.nixosModules.vinzenz-desktop-settings self.nixosModules.amd-graphics diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index a0b3e0e1..d0990a7c 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -5,12 +5,12 @@ ./fuzzel.nix ./git.nix ./gnome.nix - #./niri.nix ./ssh.nix - ./swaylock.nix ./vscode.nix - ./waybar.nix ./zsh.nix + #./niri.nix + #./swaylock.nix + #./waybar.nix ]; config = { From dc751016c01685399f26a71114261b48ec302004 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 25 Sep 2025 19:41:17 +0200 Subject: [PATCH 0352/1295] basic p10k module, remove omz --- flake.nix | 1 + homeConfigurations/vinzenz/zsh.nix | 18 +----------------- homeModules/zsh-powerlevel10k.nix | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 homeModules/zsh-powerlevel10k.nix diff --git a/flake.nix b/flake.nix index ea895a6c..863a4c08 100644 --- a/flake.nix +++ b/flake.nix @@ -231,6 +231,7 @@ self.homeModules.zsh-basics self.homeModules.nano self.homeModules.gnome-extensions + self.homeModules.zsh-powerlevel10k ]; home-manager.users = home-manager-users; diff --git a/homeConfigurations/vinzenz/zsh.nix b/homeConfigurations/vinzenz/zsh.nix index 1278aca9..e7dfcd9f 100644 --- a/homeConfigurations/vinzenz/zsh.nix +++ b/homeConfigurations/vinzenz/zsh.nix @@ -2,11 +2,8 @@ { config.programs.zsh = { initContent = '' - # eval "$(direnv hook zsh)"; export PATH=$PATH:/home/vinzenz/.cargo/bin - source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme - source ${./.zsh/p10k.zsh} ''; enableCompletion = true; @@ -28,19 +25,6 @@ path = "${config.xdg.dataHome}/zsh/history"; expireDuplicatesFirst = true; }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = [ - "git" - "sudo" - "systemadmin" - "battery" - "dotnet" - "rust" - "tailscale" - ]; - }; }; + config.programs.zsh-powerlevel10k.enable = true; } diff --git a/homeModules/zsh-powerlevel10k.nix b/homeModules/zsh-powerlevel10k.nix new file mode 100644 index 00000000..83701fc8 --- /dev/null +++ b/homeModules/zsh-powerlevel10k.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + options.programs.zsh-powerlevel10k = { + enable = lib.mkEnableOption "powerlevel10k zsh theme"; + package = lib.mkPackageOption pkgs "zsh-powerlevel10k" { nullable = true; }; + }; + + config = + let + cfg = config.programs.zsh-powerlevel10k; + p10k = if (cfg.package != null) then cfg.package else pkgs.zsh-powerlevel10k; + in + lib.mkIf cfg.enable { + programs.zsh.initContent = '' + source ${p10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme + ''; + }; +} From 58e4784b31d8d630824b7ce724f634f31d825496 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 27 Sep 2025 18:04:26 +0200 Subject: [PATCH 0353/1295] change vscode nix formatter to nixfmt-tree --- homeConfigurations/vinzenz/vscode.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeConfigurations/vinzenz/vscode.nix b/homeConfigurations/vinzenz/vscode.nix index 548ed3e7..c4ff3819 100644 --- a/homeConfigurations/vinzenz/vscode.nix +++ b/homeConfigurations/vinzenz/vscode.nix @@ -59,13 +59,13 @@ "rust-analyzer.checkOnSave.command" = "clippy"; - "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt"; + "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-tree}/bin/nixfmt-tree"; "nix.enableLanguageServer" = true; "nix.serverPath" = "${lib.getBin pkgs.nil}/bin/nil"; "nix.serverSettings" = { "nil" = { "formatting" = { - "command" = [ "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt" ]; + "command" = [ "${lib.getBin pkgs.nixfmt-tree}/bin/nixfmt-tree" ]; }; }; }; From 0c0e10555d1dc74d6381d100d7515ce4cea0470d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 28 Sep 2025 21:08:34 +0200 Subject: [PATCH 0354/1295] add starship --- homeConfigurations/vinzenz/.zsh/p10k.zsh | 1843 ---------------------- homeConfigurations/vinzenz/default.nix | 1 + homeConfigurations/vinzenz/starship.nix | 102 ++ homeConfigurations/vinzenz/zsh.nix | 3 - homeModules/zsh-powerlevel10k.nix | 2 +- 5 files changed, 104 insertions(+), 1847 deletions(-) delete mode 100644 homeConfigurations/vinzenz/.zsh/p10k.zsh create mode 100644 homeConfigurations/vinzenz/starship.nix diff --git a/homeConfigurations/vinzenz/.zsh/p10k.zsh b/homeConfigurations/vinzenz/.zsh/p10k.zsh deleted file mode 100644 index fc3c2b28..00000000 --- a/homeConfigurations/vinzenz/.zsh/p10k.zsh +++ /dev/null @@ -1,1843 +0,0 @@ -# Generated by Powerlevel10k configuration wizard on 2025-08-28 at 17:39 CEST. -# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh. -# Wizard options: nerdfont-v3 + powerline, large icons, rainbow, unicode, 24h time, -# angled separators, sharp heads, flat tails, 2 lines, disconnected, no frame, compact, -# many icons, concise, instant_prompt=verbose. -# Type `p10k configure` to generate another config. -# -# Config for Powerlevel10k with powerline prompt style with colorful background. -# Type `p10k configure` to generate your own config based on it. -# -# Tip: Looking for a nice color? Here's a one-liner to print colormap. -# -# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done - -# Temporarily change options. -'builtin' 'local' '-a' 'p10k_config_opts' -[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') -[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') -[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') -'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' - -() { - emulate -L zsh -o extended_glob - - # Unset all configuration options. This allows you to apply configuration changes without - # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. - unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' - - # Zsh >= 5.1 is required. - [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return - - # The list of segments shown on the left. Fill it with the most important segments. - typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( - # =========================[ Line #1 ]========================= - os_icon # os identifier - dir # current directory - vcs # git status - # =========================[ Line #2 ]========================= - newline # \n - prompt_char # prompt symbol - ) - - # The list of segments shown on the right. Fill it with less important segments. - # Right prompt on the last prompt line (where you are typing your commands) gets - # automatically hidden when the input line reaches it. Right prompt above the - # last prompt line gets hidden if it would overlap with left prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( - # =========================[ Line #1 ]========================= - status # exit code of the last command - command_execution_time # duration of the last command - background_jobs # presence of background jobs - direnv # direnv status (https://direnv.net/) - asdf # asdf version manager (https://github.com/asdf-vm/asdf) - virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) - anaconda # conda environment (https://conda.io/) - pyenv # python environment (https://github.com/pyenv/pyenv) - goenv # go environment (https://github.com/syndbg/goenv) - nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) - nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) - nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) - # node_version # node.js version - # go_version # go version (https://golang.org) - rust_version # rustc version (https://www.rust-lang.org) - dotnet_version # .NET version (https://dotnet.microsoft.com) - # php_version # php version (https://www.php.net/) - # laravel_version # laravel php framework version (https://laravel.com/) - # java_version # java version (https://www.java.com/) - # package # name@version from package.json (https://docs.npmjs.com/files/package.json) - rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) - rvm # ruby version from rvm (https://rvm.io) - fvm # flutter version management (https://github.com/leoafarias/fvm) - luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) - jenv # java version from jenv (https://github.com/jenv/jenv) - plenv # perl version from plenv (https://github.com/tokuhirom/plenv) - perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) - phpenv # php version from phpenv (https://github.com/phpenv/phpenv) - scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) - haskell_stack # haskell version from stack (https://haskellstack.org/) - kubecontext # current kubernetes context (https://kubernetes.io/) - terraform # terraform workspace (https://www.terraform.io) - # terraform_version # terraform version (https://www.terraform.io) - aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) - aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) - azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) - gcloud # google cloud cli account and project (https://cloud.google.com/) - google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) - toolbox # toolbox name (https://github.com/containers/toolbox) - context # user@hostname - nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) - ranger # ranger shell (https://github.com/ranger/ranger) - yazi # yazi shell (https://github.com/sxyazi/yazi) - nnn # nnn shell (https://github.com/jarun/nnn) - lf # lf shell (https://github.com/gokcehan/lf) - xplr # xplr shell (https://github.com/sayanarijit/xplr) - vim_shell # vim shell indicator (:sh) - midnight_commander # midnight commander shell (https://midnight-commander.org/) - nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) - chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) - # vi_mode # vi mode (you don't need this if you've enabled prompt_char) - # vpn_ip # virtual private network indicator - # load # CPU load - # disk_usage # disk usage - # ram # free RAM - # swap # used swap - todo # todo items (https://github.com/todotxt/todo.txt-cli) - timewarrior # timewarrior tracking status (https://timewarrior.net/) - taskwarrior # taskwarrior task count (https://taskwarrior.org/) - per_directory_history # Oh My Zsh per-directory-history local/global indicator - # cpu_arch # CPU architecture - time # current time - # =========================[ Line #2 ]========================= - newline - # ip # ip address and bandwidth usage for a specified network interface - # public_ip # public IP address - # proxy # system-wide http/https/ftp proxy - # battery # internal battery - # wifi # wifi speed - # example # example user-defined segment (see prompt_example function below) - ) - - # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. - typeset -g POWERLEVEL9K_MODE=nerdfont-v3 - # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid - # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. - typeset -g POWERLEVEL9K_ICON_PADDING=moderate - - # When set to true, icons appear before content on both sides of the prompt. When set - # to false, icons go after content. If empty or not set, icons go before content in the left - # prompt and after content in the right prompt. - # - # You can also override it for a specific segment: - # - # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false - # - # Or for a specific segment in specific state: - # - # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false - typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= - - # Add an empty line before each prompt. - typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false - - # Connect left prompt lines with these symbols. You'll probably want to use the same color - # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= - # Connect right prompt lines with these symbols. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= - - # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or - # '─'. The last two make it easier to see the alignment between left and right prompt and to - # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false - # for more compact prompt if using this option. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= - if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then - # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE - # ornaments defined above. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 - # Start filler from the edge of the screen if there are no left segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' - # End filler on the edge of the screen if there are no right segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' - fi - - # Separator between same-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1' - # Separator between same-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3' - # Separator between different-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' - # Separator between different-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' - # To remove a separator between two segments, add "_joined" to the second segment name. - # For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined) - - # The right end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' - # The left end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' - # The left end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='' - # The right end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='' - # Left prompt terminator for lines without any segments. - typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= - - #################################[ os_icon: os identifier ]################################## - # OS identifier color. - typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232 - typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7 - # Custom icon. - # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' - - ################################[ prompt_char: prompt symbol ]################################ - # Transparent background. - typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= - # Green prompt symbol if the last command succeeded. - typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 - # Red prompt symbol if the last command failed. - typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 - # Default prompt symbol. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' - # Prompt symbol in command vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' - # Prompt symbol in visual vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' - # Prompt symbol in overwrite vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' - typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true - # No line terminator if prompt_char is the last segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= - # No line introducer if prompt_char is the first segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= - # No surrounding whitespace. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= - - ##################################[ dir: current directory ]################################## - # Current directory background color. - typeset -g POWERLEVEL9K_DIR_BACKGROUND=4 - # Default current directory foreground color. - typeset -g POWERLEVEL9K_DIR_FOREGROUND=254 - # If directory is too long, shorten some of its segments to the shortest possible unique - # prefix. The shortened directory can be tab-completed to the original. - typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique - # Replace removed segment suffixes with this symbol. - typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= - # Color of the shortened directory segments. - typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250 - # Color of the anchor directory segments. Anchor segments are never shortened. The first - # segment is always an anchor. - typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255 - # Display anchor directory segments in bold. - typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true - # Don't shorten directories that contain any of these files. They are anchors. - local anchor_files=( - .bzr - .citc - .git - .hg - .node-version - .python-version - .go-version - .ruby-version - .lua-version - .java-version - .perl-version - .php-version - .tool-versions - .mise.toml - .shorten_folder_marker - .svn - .terraform - CVS - Cargo.toml - composer.json - go.mod - package.json - stack.yaml - ) - typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" - # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains - # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is - # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) - # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers - # and other directories don't. - # - # Optionally, "first" and "last" can be followed by ":" where is an integer. - # This moves the truncation point to the right (positive offset) or to the left (negative offset) - # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" - # respectively. - typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false - # Don't shorten this many last directory segments. They are anchors. - typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 - # Shorten directory if it's longer than this even if there is space for it. The value can - # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, - # directory will be shortened only when prompt doesn't fit or when other parameters demand it - # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). - # If set to `0`, directory will always be shortened to its minimum length. - typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this - # many columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least - # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 - # If set to true, embed a hyperlink into the directory. Useful for quickly - # opening a directory in the file manager simply by clicking the link. - # Can also be handy when the directory is shortened, as it allows you to see - # the full directory that was used in previous commands. - typeset -g POWERLEVEL9K_DIR_HYPERLINK=false - - # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON - # and POWERLEVEL9K_DIR_CLASSES below. - typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 - - # The default icon shown next to non-writable and non-existent directories when - # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. - # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' - - # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different - # directories. It must be an array with 3 * N elements. Each triplet consists of: - # - # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with - # extended_glob option enabled. - # 2. Directory class for the purpose of styling. - # 3. An empty string. - # - # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. - # - # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories - # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_DIR_CLASSES=( - # '~/work(|/*)' WORK '' - # '~(|/*)' HOME '' - # '*' DEFAULT '') - # - # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one - # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or - # WORK_NON_EXISTENT. - # - # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an - # option to define custom colors and icons for different directory classes. - # - # # Styling for WORK. - # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_BACKGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=254 - # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=250 - # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=255 - # - # # Styling for WORK_NOT_WRITABLE. - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_BACKGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=254 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=250 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=255 - # - # # Styling for WORK_NON_EXISTENT. - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_BACKGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=254 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=250 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=255 - # - # If a styling parameter isn't explicitly defined for some class, it falls back to the classless - # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls - # back to POWERLEVEL9K_DIR_FOREGROUND. - # - # typeset -g POWERLEVEL9K_DIR_CLASSES=() - - # Custom prefix. - # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' - - #####################################[ vcs: git status ]###################################### - # Version control background colors. - typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 - typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 - typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 - typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 - typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 - - # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. - typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' - - # Untracked files icon. It's really a question mark, your font isn't broken. - # Change the value of this parameter to show a different icon. - typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' - - # Formatter for Git status. - # - # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. - # - # You can edit the function to customize how Git status looks. - # - # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: - # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. - function my_git_formatter() { - emulate -L zsh - - if [[ -n $P9K_CONTENT ]]; then - # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from - # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. - typeset -g my_git_format=$P9K_CONTENT - return - fi - - # Styling for different parts of Git status. - local meta='%7F' # white foreground - local clean='%0F' # black foreground - local modified='%0F' # black foreground - local untracked='%0F' # black foreground - local conflicted='%1F' # red foreground - - local res - - if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then - local branch=${(V)VCS_STATUS_LOCAL_BRANCH} - # If local branch name is at most 32 characters long, show it in full. - # Otherwise show the first 12 … the last 12. - # Tip: To always show local branch name in full without truncation, delete the next line. - (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line - res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" - fi - - if [[ -n $VCS_STATUS_TAG - # Show tag only if not on a branch. - # Tip: To always show tag, delete the next line. - && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line - ]]; then - local tag=${(V)VCS_STATUS_TAG} - # If tag name is at most 32 characters long, show it in full. - # Otherwise show the first 12 … the last 12. - # Tip: To always show tag name in full without truncation, delete the next line. - (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line - res+="${meta}#${clean}${tag//\%/%%}" - fi - - # Display the current Git commit if there is no branch and no tag. - # Tip: To always display the current Git commit, delete the next line. - [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line - res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" - - # Show tracking branch name if it differs from local branch. - if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then - res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" - fi - - # Display "wip" if the latest commit's summary contains "wip" or "WIP". - if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then - res+=" ${modified}wip" - fi - - if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then - # ⇣42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" - # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. - (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " - (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" - elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then - # Tip: Uncomment the next line to display '=' if up to date with the remote. - # res+=" ${clean}=" - fi - - # ⇠42 if behind the push remote. - (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" - (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " - # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. - (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" - # *42 if have stashes. - (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" - # 'merge' if the repo is in an unusual state. - [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" - # ~42 if have merge conflicts. - (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" - # +42 if have staged changes. - (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" - # !42 if have unstaged changes. - (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" - # ?42 if have untracked files. It's really a question mark, your font isn't broken. - # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. - # Remove the next line if you don't want to see untracked files at all. - (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" - # "─" if the number of unstaged files is unknown. This can happen due to - # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower - # than the number of files in the Git index, or due to bash.showDirtyState being set to false - # in the repository config. The number of staged and untracked files may also be unknown - # in this case. - (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" - - typeset -g my_git_format=$res - } - functions -M my_git_formatter 2>/dev/null - - # Don't count the number of unstaged, untracked and conflicted files in Git repositories with - # more than this many files in the index. Negative value means infinity. - # - # If you are working in Git repositories with tens of millions of files and seeing performance - # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output - # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's - # config: `git config bash.showDirtyState false`. - typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 - - # Don't show Git status in prompt for repositories whose workdir matches this pattern. - # For example, if set to '~', the Git repository at $HOME/.git will be ignored. - # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. - typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' - - # Disable the default Git status formatting. - typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true - # Install our own Git status formatter. - typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}' - # Enable counters for staged, unstaged, etc. - typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 - - # Custom icon. - # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - # typeset -g POWERLEVEL9K_VCS_PREFIX='on ' - - # Show status of repositories of these types. You can add svn and/or hg if you are - # using them. If you do, your prompt may become slow even when your current directory - # isn't in an svn or hg repository. - typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) - - ##########################[ status: exit code of the last command ]########################### - # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and - # style them independently from the regular OK and ERROR state. - typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true - - # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as - # it will signify success by turning green. - typeset -g POWERLEVEL9K_STATUS_OK=false - typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' - typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 - typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 - - # Status when some part of a pipe command fails but the overall exit status is zero. It may look - # like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 - - # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as - # it will signify error by turning red. - typeset -g POWERLEVEL9K_STATUS_ERROR=false - typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' - typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 - typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 - - # Status when the last command was terminated by a signal. - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true - # Use terse signal names: "INT" instead of "SIGINT(2)". - typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 - - # Status when some part of a pipe command fails and the overall exit status is also non-zero. - # It may look like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 - - ###################[ command_execution_time: duration of the last command ]################### - # Execution time color. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0 - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3 - # Show duration of the last command if takes at least this many seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 - # Show this many fractional digits. Zero means round to seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 - # Duration format: 1d 2h 3m 4s. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' - # Custom icon. - # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took ' - - #######################[ background_jobs: presence of background jobs ]####################### - # Background jobs color. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 - # Don't show the number of background jobs. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false - # Custom icon. - # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ direnv: direnv status (https://direnv.net/) ]######################## - # Direnv color. - typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 - typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### - # Default asdf color. Only used to display tools for which there is no color override (see below). - # Tip: Override these parameters for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND and - # POWERLEVEL9K_ASDF_${TOOL}_BACKGROUND. - typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 - - # There are four parameters that can be used to hide asdf tools. Each parameter describes - # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at - # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to - # hide a tool, it gets shown. - # - # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and - # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: - # - # asdf local python 3.8.1 - # asdf global python 3.8.1 - # - # After running both commands the current python version is 3.8.1 and its source is "local" as - # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, - # it'll hide python version in this case because 3.8.1 is the same as the global version. - # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't - # contain "local". - - # Hide tool versions that don't come from one of these sources. - # - # Available sources: - # - # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" - # - local `asdf current` says "set by /some/not/home/directory/file" - # - global `asdf current` says "set by /home/username/file" - # - # Note: If this parameter is set to (shell local global), it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. - typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) - - # If set to false, hide tool versions that are the same as global. - # - # Note: The name of this parameter doesn't reflect its meaning at all. - # Note: If this parameter is set to true, it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. - typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false - - # If set to false, hide tool versions that are equal to "system". - # - # Note: If this parameter is set to true, it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. - typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true - - # If set to non-empty value, hide tools unless there is a file matching the specified file pattern - # in the current directory, or its parent directory, or its grandparent directory, and so on. - # - # Note: If this parameter is set to empty value, it won't hide tools. - # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. - # - # Example: Hide nodejs version when there is no package.json and no *.js files in the current - # directory, in `..`, in `../..` and so on. - # - # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' - typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= - - # Ruby version from asdf. - typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 - # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Python version from asdf. - typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Go version from asdf. - typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_GOLANG_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Node.js version from asdf. - typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2 - # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Rust version from asdf. - typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208 - # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' - - # .NET Core version from asdf. - typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Flutter version from asdf. - typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Lua version from asdf. - typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Java version from asdf. - typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1 - typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7 - # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Perl version from asdf. - typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Erlang version from asdf. - typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1 - # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Elixir version from asdf. - typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Postgres version from asdf. - typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6 - # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' - - # PHP version from asdf. - typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_PHP_BACKGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Haskell version from asdf. - typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_HASKELL_BACKGROUND=3 - # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Julia version from asdf. - typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2 - # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' - - ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### - # NordVPN connection indicator color. - typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 - typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 - # Hide NordVPN connection indicator when not connected. - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= - # Custom icon. - # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## - # Ranger shell color. - typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 - typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### - # Yazi shell color. - typeset -g POWERLEVEL9K_YAZI_FOREGROUND=3 - typeset -g POWERLEVEL9K_YAZI_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### - # Nnn shell color. - typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 - typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 - # Custom icon. - # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]####################### - # lf shell color. - typeset -g POWERLEVEL9K_LF_FOREGROUND=0 - typeset -g POWERLEVEL9K_LF_BACKGROUND=6 - # Custom icon. - # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## - # xplr shell color. - typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 - typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6 - # Custom icon. - # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########################[ vim_shell: vim shell indicator (:sh) ]########################### - # Vim shell indicator color. - typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 - typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 - # Custom icon. - # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### - # Midnight Commander shell color. - typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 - typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## - # Nix shell color. - typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 - typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 - - # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. - # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false - - # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. - # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## - # chezmoi shell color. - typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=0 - typeset -g POWERLEVEL9K_CHEZMOI_SHELL_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################################[ disk_usage: disk usage ]################################## - # Colors for different levels of disk usage. - typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 - typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0 - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0 - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1 - # Thresholds for different levels of disk usage (percentage points). - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 - # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. - typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false - # Custom icon. - # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### - # Foreground color. - typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 - # Text and color for normal (a.k.a. command) vi mode. - typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL - typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 - # Text and color for visual vi mode. - typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL - typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 - # Text and color for overtype (a.k.a. overwrite and replace) vi mode. - typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE - typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 - # Text and color for insert vi mode. - typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= - typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 - # Custom icon. - # typeset -g POWERLEVEL9K_VI_MODE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################################[ ram: free RAM ]####################################### - # RAM color. - typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 - typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################################[ swap: used swap ]###################################### - # Swap color. - typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 - typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################################[ load: CPU load ]###################################### - # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. - typeset -g POWERLEVEL9K_LOAD_WHICH=5 - # Load color when load is under 50%. - typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 - typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 - # Load color when load is between 50% and 70%. - typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 - typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 - # Load color when load is over 70%. - typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 - typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 - # Custom icon. - # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ - # Todo color. - typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 - typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 - # Hide todo when the total number of tasks is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true - # Hide todo when the number of tasks after filtering is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false - - # Todo format. The following parameters are available within the expansion. - # - # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. - # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. - # - # These variables correspond to the last line of the output of `todo.sh -p ls`: - # - # TODO: 24 of 42 tasks shown - # - # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. - # - # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' - - # Custom icon. - # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ - # Timewarrior color. - typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 - typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 - - # If the tracked task is longer than 24 characters, truncate and append "…". - # Tip: To always display tasks without truncation, delete the following parameter. - # Tip: To hide task names and display just the icon when time tracking is enabled, set the - # value of the following parameter to "". - typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' - - # Custom icon. - # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## - # Taskwarrior color. - typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 - typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 - - # Taskwarrior segment format. The following parameters are available within the expansion. - # - # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. - # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. - # - # Zero values are represented as empty parameters. - # - # The default format: - # - # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' - # - # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' - - # Custom icon. - # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### - # Color when using local/global history. - typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=0 - typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_BACKGROUND=5 - typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=0 - typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_BACKGROUND=3 - - # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. - # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' - # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' - - # Custom icon. - # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################################[ cpu_arch: CPU architecture ]################################ - # CPU architecture color. - typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=0 - typeset -g POWERLEVEL9K_CPU_ARCH_BACKGROUND=3 - - # Hide the segment when on a specific CPU architecture. - # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= - # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################################[ context: user@hostname ]################################## - # Context color when running with privileges. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 - typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0 - # Context color in SSH without privileges. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3 - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0 - # Default context color (no privileges, no SSH). - typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3 - typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0 - - # Context format when running with privileges: user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' - # Context format when in SSH without privileges: user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' - # Default context format (no privileges, no SSH): user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' - - # Don't show context unless running with privileges or in SSH. - # Tip: Remove the next line to always show context. - typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with ' - - ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### - # Python virtual environment color. - typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 - # Don't show Python version next to the virtual environment name. - typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false - # If set to "false", won't show virtualenv if pyenv is already shown. - # If set to "if-different", won't show virtualenv if it's the same as pyenv. - typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false - # Separate environment name from Python version only with a space. - typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################[ anaconda: conda environment (https://conda.io/) ]###################### - # Anaconda environment color. - typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 - typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 - - # Anaconda segment format. The following parameters are available within the expansion. - # - # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. - # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. - # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). - # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). - # - # CONDA_PROMPT_MODIFIER can be configured with the following command: - # - # conda config --set env_prompt '({default_env}) ' - # - # The last argument is a Python format string that can use the following variables: - # - # - prefix The same as CONDA_PREFIX. - # - default_env The same as CONDA_DEFAULT_ENV. - # - name The last segment of CONDA_PREFIX. - # - stacked_env Comma-separated list of names in the environment stack. The first element is - # always the same as default_env. - # - # Note: '({default_env}) ' is the default value of env_prompt. - # - # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER - # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former - # is empty. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' - - # Custom icon. - # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ - # Pyenv color. - typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 - # Hide python version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) - # If set to false, hide python version if it's the same as global: - # $(pyenv version-name) == $(pyenv global). - typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide python version if it's equal to "system". - typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true - - # Pyenv segment format. The following parameters are available within the expansion. - # - # - P9K_CONTENT Current pyenv environment (pyenv version-name). - # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). - # - # The default format has the following logic: - # - # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or - # starts with "$P9K_PYENV_PYTHON_VERSION/". - # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". - typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' - - # Custom icon. - # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ - # Goenv color. - typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 - # Hide go version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) - # If set to false, hide go version if it's the same as global: - # $(goenv version-name) == $(goenv global). - typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide go version if it's equal to "system". - typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## - # Nodenv color. - typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 - typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 - # Hide node version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) - # If set to false, hide node version if it's the same as global: - # $(nodenv version-name) == $(nodenv global). - typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide node version if it's equal to "system". - typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### - # Nvm color. - typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 - typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 - # If set to false, hide node version if it's the same as default: - # $(nvm version current) == $(nvm version default). - typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false - # If set to false, hide node version if it's equal to "system". - typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ - # Nodeenv color. - typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 - typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 - # Don't show Node version next to the environment name. - typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false - # Separate environment name from Node version only with a space. - typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############################[ node_version: node.js version ]############################### - # Node version color. - typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 - typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 - # Show node version only when in a directory tree containing package.json. - typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ go_version: go version (https://golang.org) ]######################## - # Go version color. - typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 - typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 - # Show go version only when in a go project subdirectory. - typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## - # Rust version color. - typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 - typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 - # Show rust version only when in a rust project subdirectory. - typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ - # .NET version color. - typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 - typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 - # Show .NET version only when in a .NET project subdirectory. - typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################[ php_version: php version (https://www.php.net/) ]###################### - # PHP version color. - typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0 - typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5 - # Show PHP version only when in a PHP project subdirectory. - typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### - # Laravel version color. - typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 - typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7 - # Custom icon. - # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## - # Rbenv color. - typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 - # Hide ruby version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) - # If set to false, hide ruby version if it's the same as global: - # $(rbenv version-name) == $(rbenv global). - typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide ruby version if it's equal to "system". - typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ####################[ java_version: java version (https://www.java.com/) ]#################### - # Java version color. - typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1 - typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7 - # Show java version only when in a java project subdirectory. - typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true - # Show brief version. - typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false - # Custom icon. - # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### - # Package color. - typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 - typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 - - # Package format. The following parameters are available within the expansion. - # - # - P9K_PACKAGE_NAME The value of `name` field in package.json. - # - P9K_PACKAGE_VERSION The value of `version` field in package.json. - # - # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' - - # Custom icon. - # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## - # Rvm color. - typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 - typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 - # Don't show @gemset at the end. - typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false - # Don't show ruby- at the front. - typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false - # Custom icon. - # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ - # Fvm color. - typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 - typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### - # Lua color. - typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 - # Hide lua version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) - # If set to false, hide lua version if it's the same as global: - # $(luaenv version-name) == $(luaenv global). - typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide lua version if it's equal to "system". - typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ - # Java color. - typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 - typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 - # Hide java version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) - # If set to false, hide java version if it's the same as global: - # $(jenv version-name) == $(jenv global). - typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide java version if it's equal to "system". - typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ - # Perl color. - typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 - # Hide perl version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) - # If set to false, hide perl version if it's the same as global: - # $(plenv version-name) == $(plenv global). - typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide perl version if it's equal to "system". - typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ - # Perlbrew color. - typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 - # Show perlbrew version only when in a perl project subdirectory. - typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true - # Don't show "perl-" at the front. - typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false - # Custom icon. - # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ - # PHP color. - typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 - # Hide php version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) - # If set to false, hide php version if it's the same as global: - # $(phpenv version-name) == $(phpenv global). - typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide PHP version if it's equal to "system". - typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### - # Scala color. - typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 - # Hide scala version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) - # If set to false, hide scala version if it's the same as global: - # $(scalaenv version-name) == $(scalaenv global). - typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide scala version if it's equal to "system". - typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### - # Haskell color. - typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 - typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3 - - # Hide haskell version if it doesn't come from one of these sources. - # - # shell: version is set by STACK_YAML - # local: version is set by stack.yaml up the directory tree - # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) - typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) - # If set to false, hide haskell version if it's the same as in the implicit global project. - typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true - # Custom icon. - # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ terraform: terraform workspace (https://www.terraform.io) ]################# - # Don't show terraform workspace if it's literally "default". - typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false - # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current terraform workspace gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' OTHER) - # - # If your current terraform workspace is "project_test", its class is TEST because "project_test" - # doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_BACKGROUND=0 - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' OTHER) - typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 - typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 - # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #############[ terraform_version: terraform version (https://www.terraform.io) ]############## - # Terraform version color. - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' - - #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# - # Show kubecontext only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' - - # Kubernetes context classes for the purpose of using different colors, icons and expansions with - # different contexts. - # - # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current kubernetes context gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current kubernetes context is "deathray-testing/default", its class is TEST - # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=0 - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_BACKGROUND=2 - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7 - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5 - # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext - # segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # Within the expansion the following parameters are always available: - # - # - P9K_CONTENT The content that would've been displayed if there was no content - # expansion defined. - # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE - # in the output of `kubectl config get-contexts`. If there is no - # namespace, the parameter is set to "default". - # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the - # output of `kubectl config get-contexts`. - # - # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), - # the following extra parameters are available: - # - # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. - # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. - # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. - # - # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, - # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=gke - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - # - # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=eks - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= - # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' - # Append the current context's namespace if it's not "default". - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' - - # Custom prefix. - # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' - - #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# - # Show aws only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt' - - # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current AWS profile gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current AWS profile is "company_test", its class is TEST - # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 - typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 - # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # AWS segment format. The following parameters are available within the expansion. - # - # - P9K_AWS_PROFILE The name of the current AWS profile. - # - P9K_AWS_REGION The region associated with the current AWS profile. - typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' - - #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# - # AWS Elastic Beanstalk environment color. - typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 - typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## - # Show azure only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show azure. - typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' - - # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current azure account name gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_AZURE_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' OTHER) - # - # If your current azure account is "company_test", its class is TEST because "company_test" - # doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=2 - # typeset -g POWERLEVEL9K_AZURE_TEST_BACKGROUND=0 - # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_AZURE_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' OTHER) - - # Azure account name color. - typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=7 - typeset -g POWERLEVEL9K_AZURE_OTHER_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### - # Show gcloud only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show gcloud. - typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' - # Google cloud color. - typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 - typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 - - # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or - # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative - # enough. You can use the following parameters in the expansions. Each of them corresponds to the - # output of `gcloud` tool. - # - # Parameter | Source - # -------------------------|-------------------------------------------------------------------- - # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' - # P9K_GCLOUD_ACCOUNT | gcloud config get-value account - # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project - # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' - # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. - # - # Obtaining project name requires sending a request to Google servers. This can take a long time - # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud - # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets - # set and gcloud prompt segment transitions to state COMPLETE. - # - # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL - # and COMPLETE. You can also hide gcloud in state PARTIAL by setting - # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and - # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. - typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' - typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' - - # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name - # this often. Negative value disables periodic polling. In this mode project name is retrieved - # only when the current configuration, account or project id changes. - typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 - - # Custom icon. - # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# - # Show google_app_cred only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show google_app_cred. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' - - # Google application credentials classes for the purpose of using different colors, icons and - # expansions with different credentials. - # - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first - # element in each pair defines a pattern against which the current kubernetes context gets - # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion - # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION - # parameters, you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. - # The first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD - # '*:*test*:*' TEST - # '*' DEFAULT) - # - # If your current Google application credentials is "service_account deathray-testing x@y.com", - # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD # These values are examples that are unlikely - # '*:*test*:*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by - # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # You can use the following parameters in the expansion. Each of them corresponds to one of the - # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. - # - # Parameter | JSON key file field - # ---------------------------------+--------------- - # P9K_GOOGLE_APP_CRED_TYPE | type - # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id - # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email - # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' - - ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### - # Toolbox color. - typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0 - typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3 - # Don't display the name of the toolbox if it matches fedora-toolbox-*. - typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' - # Custom icon. - # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in ' - - ###############################[ public_ip: public IP address ]############################### - # Public IP color. - typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 - typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ########################[ vpn_ip: virtual private network indicator ]######################### - # VPN IP color. - typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 - typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 - # When on VPN, show just an icon without the IP address. - # Tip: To display the private IP address when on VPN, remove the next line. - typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= - # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN - # to see the name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)' - # If set to true, show one segment per matching network interface. If set to false, show only - # one segment corresponding to the first matching network interface. - # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. - typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false - # Custom icon. - # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### - # IP color. - typeset -g POWERLEVEL9K_IP_BACKGROUND=4 - typeset -g POWERLEVEL9K_IP_FOREGROUND=0 - # The following parameters are accessible within the expansion: - # - # Parameter | Meaning - # ----------------------+------------------------------------------- - # P9K_IP_IP | IP address - # P9K_IP_INTERFACE | network interface - # P9K_IP_RX_BYTES | total number of bytes received - # P9K_IP_TX_BYTES | total number of bytes sent - # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt - # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt - # P9K_IP_RX_RATE | receive rate (since last prompt) - # P9K_IP_TX_RATE | send rate (since last prompt) - typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+⇡$P9K_IP_TX_RATE }$P9K_IP_IP' - # Show information for the first network interface whose name matches this regular expression. - # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. - typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' - # Custom icon. - # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #########################[ proxy: system-wide http/https/ftp proxy ]########################## - # Proxy color. - typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 - typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################################[ battery: internal battery ]################################# - # Show battery in red when it's below this level and not connected to power supply. - typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 - typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 - # Show battery in green when it's charging or fully charged. - typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 - # Show battery in yellow when it's discharging. - typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 - # Battery pictograms going from low to high level of charge. - typeset -g POWERLEVEL9K_BATTERY_STAGES='\UF008E\UF007A\UF007B\UF007C\UF007D\UF007E\UF007F\UF0080\UF0081\UF0082\UF0079' - # Don't show the remaining time to charge/discharge. - typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false - typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 - - #####################################[ wifi: wifi speed ]##################################### - # WiFi color. - typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 - typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). - # - # # Wifi colors and icons for different signal strength levels (low to high). - # typeset -g my_wifi_fg=(0 0 0 0 0) # <-- change these values - # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values - # - # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' - # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' - # - # The following parameters are accessible within the expansions: - # - # Parameter | Meaning - # ----------------------+--------------- - # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown - # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second - # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 - # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 - # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) - - ####################################[ time: current time ]#################################### - # Current time color. - typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 - typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 - # Format for the current time: 09:51:02. See `man 3 strftime`. - typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' - # If set to true, time will update when you hit enter. This way prompts for the past - # commands will contain the start times of their commands as opposed to the default - # behavior where they contain the end times of their preceding commands. - typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false - # Custom icon. - # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - # typeset -g POWERLEVEL9K_TIME_PREFIX='at ' - - # Example of a user-defined prompt segment. Function prompt_example will be called on every - # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or - # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and yellow text on red background - # greeting the user. - # - # Type `p10k help segment` for documentation and a more sophisticated example. - function prompt_example() { - p10k segment -b 1 -f 3 -i '⭐' -t 'hello, %n' - } - - # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job - # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k#instant-prompt. - # - # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function - # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k - # will replay these calls without actually calling instant_prompt_*. It is imperative that - # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this - # rule is not observed, the content of instant prompt will be incorrect. - # - # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If - # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. - function instant_prompt_example() { - # Since prompt_example always makes the same `p10k segment` calls, we can call it from - # instant_prompt_example. This will give us the same `example` prompt segment in the instant - # and regular prompts. - prompt_example - } - - # User-defined prompt segments can be customized the same way as built-in segments. - typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 - typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1 - # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt - # when accepting a command line. Supported values: - # - # - off: Don't change prompt when accepting a command line. - # - always: Trim down prompt when accepting a command line. - # - same-dir: Trim down prompt when accepting a command line unless this is the first command - # typed after changing current working directory. - typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off - - # Instant prompt mode. - # - # - off: Disable instant prompt. Choose this if you've tried instant prompt and found - # it incompatible with your zsh configuration files. - # - quiet: Enable instant prompt and don't print warnings when detecting console output - # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k#instant-prompt. - # - verbose: Enable instant prompt and print a warning when detecting console output during - # zsh initialization. Choose this if you've never tried instant prompt, haven't - # seen the warning, or if you are unsure what this all means. - typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose - - # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. - # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload - # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you - # really need it. - typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true - - # If p10k is already loaded, reload configuration. - # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. - (( ! $+functions[p10k] )) || p10k reload -} - -# Tell `p10k configure` which file it should overwrite. -typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} - -(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} -'builtin' 'unset' 'p10k_config_opts' diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index d0990a7c..441786b8 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -8,6 +8,7 @@ ./ssh.nix ./vscode.nix ./zsh.nix + ./starship.nix #./niri.nix #./swaylock.nix #./waybar.nix diff --git a/homeConfigurations/vinzenz/starship.nix b/homeConfigurations/vinzenz/starship.nix new file mode 100644 index 00000000..a389fe45 --- /dev/null +++ b/homeConfigurations/vinzenz/starship.nix @@ -0,0 +1,102 @@ +{...}:{ + config.programs.starship = { + enable = true; + enableZshIntegration = true; + settings = { + aws.symbol = " "; + buf.symbol = " "; + bun.symbol = " "; + c.symbol = " "; + cpp.symbol = " "; + cmake.symbol = " "; + conda.symbol = " "; + crystal.symbol = " "; + dart.symbol = " "; + deno.symbol = " "; + directory.read_only = " 󰌾"; + docker_context.symbol = " "; + elixir.symbol = " "; + elm.symbol = " "; + fennel.symbol = " "; + fossil_branch.symbol = " "; + gcloud.symbol = " "; + git_branch.symbol = " "; + git_commit.tag_symbol = "  "; + golang.symbol = " "; + guix_shell.symbol = " "; + haskell.symbol = " "; + haxe.symbol = " "; + hg_branch.symbol = " "; + hostname.ssh_symbol = " "; + java.symbol = " "; + julia.symbol = " "; + kotlin.symbol = " "; + lua.symbol = " "; + memory_usage.symbol = "󰍛 "; + meson.symbol = "󰔷 "; + nim.symbol = "󰆥 "; + nix_shell.symbol = " "; + nodejs.symbol = " "; + ocaml.symbol = " "; + os.symbols = { + Alpaquita = " "; + Alpine = " "; + AlmaLinux = " "; + Amazon = " "; + Android = " "; + Arch = " "; + Artix = " "; + CachyOS = " "; + CentOS = " "; + Debian = " "; + DragonFly = " "; + Emscripten = " "; + EndeavourOS = " "; + Fedora = " "; + FreeBSD = " "; + Garuda = "󰛓 "; + Gentoo = " "; + HardenedBSD = "󰞌 "; + Illumos = "󰈸 "; + Kali = " "; + Linux = " "; + Mabox = " "; + Macos = " "; + Manjaro = " "; + Mariner = " "; + MidnightBSD = " "; + Mint = " "; + NetBSD = " "; + NixOS = " "; + Nobara = " "; + OpenBSD = "󰈺 "; + openSUSE = " "; + OracleLinux = "󰌷 "; + Pop = " "; + Raspbian = " "; + Redhat = " "; + RedHatEnterprise = " "; + RockyLinux = " "; + Redox = "󰀘 "; + Solus = "󰠳 "; + SUSE = " "; + Ubuntu = " "; + Unknown = " "; + Void = " "; + Windows = "󰍲 "; + }; + package.symbol = "󰏗 "; + perl.symbol = " "; + php.symbol = " "; + pijul_channel.symbol = " "; + pixi.symbol = "󰏗 "; + python.symbol = " "; + rlang.symbol = "󰟔 "; + ruby.symbol = " "; + rust.symbol = "󱘗 "; + scala.symbol = " "; + swift.symbol = " "; + zig.symbol = " "; + gradle.symbol = " "; + }; + };} diff --git a/homeConfigurations/vinzenz/zsh.nix b/homeConfigurations/vinzenz/zsh.nix index e7dfcd9f..7b843844 100644 --- a/homeConfigurations/vinzenz/zsh.nix +++ b/homeConfigurations/vinzenz/zsh.nix @@ -3,8 +3,6 @@ config.programs.zsh = { initContent = '' export PATH=$PATH:/home/vinzenz/.cargo/bin - - source ${./.zsh/p10k.zsh} ''; enableCompletion = true; @@ -26,5 +24,4 @@ expireDuplicatesFirst = true; }; }; - config.programs.zsh-powerlevel10k.enable = true; } diff --git a/homeModules/zsh-powerlevel10k.nix b/homeModules/zsh-powerlevel10k.nix index 83701fc8..295fd0c1 100644 --- a/homeModules/zsh-powerlevel10k.nix +++ b/homeModules/zsh-powerlevel10k.nix @@ -16,7 +16,7 @@ p10k = if (cfg.package != null) then cfg.package else pkgs.zsh-powerlevel10k; in lib.mkIf cfg.enable { - programs.zsh.initContent = '' + programs.zsh.initContent = '' source ${p10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme ''; }; From e8e036ec93b563b648be810dce18a82f1dc499ec Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 28 Sep 2025 21:08:48 +0200 Subject: [PATCH 0355/1295] remove pre commit hook --- hooks/pre-commit => check | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename hooks/pre-commit => check (100%) diff --git a/hooks/pre-commit b/check similarity index 100% rename from hooks/pre-commit rename to check From 74bd9ffaa3b5ea57a7f3184ff3cfeba0bf11e633 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 2 Oct 2025 17:01:21 +0200 Subject: [PATCH 0356/1295] move fonts to homeModule --- homeConfigurations/vinzenz/default.nix | 1 + homeConfigurations/vinzenz/fonts.nix | 12 ++++++++++++ nixosModules/vinzenz-desktop-settings.nix | 10 +--------- 3 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 homeConfigurations/vinzenz/fonts.nix diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index 441786b8..4af562bb 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -9,6 +9,7 @@ ./vscode.nix ./zsh.nix ./starship.nix + ./fonts.nix #./niri.nix #./swaylock.nix #./waybar.nix diff --git a/homeConfigurations/vinzenz/fonts.nix b/homeConfigurations/vinzenz/fonts.nix new file mode 100644 index 00000000..6553c2a6 --- /dev/null +++ b/homeConfigurations/vinzenz/fonts.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + fonts.fontconfig = { + enable = true; + defaultFonts.monospace = [ "FiraCode Nerd Font Mono" ]; + }; + home.packages = with pkgs; [ + nerd-fonts.fira-code + roboto-mono + recursive + ]; +} diff --git a/nixosModules/vinzenz-desktop-settings.nix b/nixosModules/vinzenz-desktop-settings.nix index 24b4b4fb..ea02ed99 100644 --- a/nixosModules/vinzenz-desktop-settings.nix +++ b/nixosModules/vinzenz-desktop-settings.nix @@ -7,15 +7,7 @@ libreoffice-qt6 ]; - fonts = { - enableDefaultPackages = true; - fontconfig.defaultFonts.monospace = [ "FiraCode Nerd Font" ]; - packages = with pkgs; [ - nerd-fonts.fira-code - roboto-mono - recursive - ]; - }; + fonts.enableDefaultPackages = true; hardware.logitech.wireless = { enable = true; From f6e68e166c7836fccdd35c5c5e9a0cfef97d212c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 10 Oct 2025 17:33:44 +0200 Subject: [PATCH 0357/1295] a bunch of starship config --- homeConfigurations/vinzenz/starship.nix | 269 +++++++++++++++--------- 1 file changed, 173 insertions(+), 96 deletions(-) diff --git a/homeConfigurations/vinzenz/starship.nix b/homeConfigurations/vinzenz/starship.nix index a389fe45..470870aa 100644 --- a/homeConfigurations/vinzenz/starship.nix +++ b/homeConfigurations/vinzenz/starship.nix @@ -1,102 +1,179 @@ -{...}:{ +{ ... }: +{ config.programs.starship = { enable = true; enableZshIntegration = true; settings = { - aws.symbol = " "; - buf.symbol = " "; - bun.symbol = " "; - c.symbol = " "; - cpp.symbol = " "; - cmake.symbol = " "; - conda.symbol = " "; - crystal.symbol = " "; - dart.symbol = " "; - deno.symbol = " "; - directory.read_only = " 󰌾"; - docker_context.symbol = " "; - elixir.symbol = " "; - elm.symbol = " "; - fennel.symbol = " "; - fossil_branch.symbol = " "; - gcloud.symbol = " "; - git_branch.symbol = " "; - git_commit.tag_symbol = "  "; - golang.symbol = " "; - guix_shell.symbol = " "; - haskell.symbol = " "; - haxe.symbol = " "; - hg_branch.symbol = " "; - hostname.ssh_symbol = " "; - java.symbol = " "; - julia.symbol = " "; - kotlin.symbol = " "; - lua.symbol = " "; - memory_usage.symbol = "󰍛 "; - meson.symbol = "󰔷 "; - nim.symbol = "󰆥 "; - nix_shell.symbol = " "; - nodejs.symbol = " "; - ocaml.symbol = " "; - os.symbols = { - Alpaquita = " "; - Alpine = " "; - AlmaLinux = " "; - Amazon = " "; - Android = " "; - Arch = " "; - Artix = " "; - CachyOS = " "; - CentOS = " "; - Debian = " "; - DragonFly = " "; - Emscripten = " "; - EndeavourOS = " "; - Fedora = " "; - FreeBSD = " "; - Garuda = "󰛓 "; - Gentoo = " "; - HardenedBSD = "󰞌 "; - Illumos = "󰈸 "; - Kali = " "; - Linux = " "; - Mabox = " "; - Macos = " "; - Manjaro = " "; - Mariner = " "; - MidnightBSD = " "; - Mint = " "; - NetBSD = " "; - NixOS = " "; - Nobara = " "; - OpenBSD = "󰈺 "; - openSUSE = " "; - OracleLinux = "󰌷 "; - Pop = " "; - Raspbian = " "; - Redhat = " "; - RedHatEnterprise = " "; - RockyLinux = " "; - Redox = "󰀘 "; - Solus = "󰠳 "; - SUSE = " "; - Ubuntu = " "; - Unknown = " "; - Void = " "; - Windows = "󰍲 "; + "$schema" = "https://starship.rs/config-schema.json"; + + add_newline = true; + format = + "[](fg:color_a)[$username ](bg:color_a fg:text_a)[ ](fg:color_a bg:color_b)" + + "[$os $hostname ($container )](bg:color_b fg:text_b)[ ](fg:color_b bg:color_c)" + + "[$directory ](bg:color_c fg:text_c)[ ](fg:color_c bg:color_d)" + + "([$all ](bg:color_d fg:text_d))" + + "[ ](fg:color_d)" + + "$cmd_duration" + + "$line_break$character$status > "; + + palette = "color_me_surprised"; + palettes.color_me_surprised = { + "color_a" = "red"; + "color_b" = "yellow"; + "color_c" = "green"; + "color_d" = "blue"; + "text" = "white"; + "text_a" = "white"; + "text_b" = "black"; + "text_c" = "black"; + "text_d" = "white"; }; - package.symbol = "󰏗 "; - perl.symbol = " "; - php.symbol = " "; - pijul_channel.symbol = " "; - pixi.symbol = "󰏗 "; - python.symbol = " "; - rlang.symbol = "󰟔 "; - ruby.symbol = " "; - rust.symbol = "󱘗 "; - scala.symbol = " "; - swift.symbol = " "; - zig.symbol = " "; - gradle.symbol = " "; + + character = { + success_symbol = "[](bold fg:green)"; + error_symbol = "[✗](bold fg:color_a)"; + }; + directory = { + format = "$path[$read_only]($read_only_style)"; + truncate_to_repo = true; + truncation_symbol = ".../"; + read_only = "󰌾"; + read_only_style = "fg:color_a bg:green"; + home_symbol = ""; + substitutions = { + "Documents" = "󰈙"; + "Downloads" = ""; + "Music" = "󰝚"; + "Pictures" = ""; + "Developer" = "󰲋"; + }; + }; + hostname = { + disabled = false; + ssh_only = false; + format = "$hostname"; + ssh_symbol = ""; + }; + username = { + format = "$user"; + show_always = true; + }; + git_status = { + ahead = "⇡$count"; + behind = "⇣$count"; + deleted = "x"; + diverged = "⇕⇡$ahead_count⇣$behind_count"; + }; + status = { + disabled = false; + format = "[$symbol$status_common_meaning$status_signal_name$status_maybe_int]($style)"; + map_symbol = true; + pipestatus = true; + symbol = "🔴"; + }; + os = { + disabled = false; + format = "$symbol"; + }; + cmd_duration = { + format = "[󱦟 $duration]($style)"; + }; + + # icons + c.symbol = ""; + aws.symbol = " "; + buf.symbol = ""; + bun.symbol = ""; + cpp.symbol = ""; + cmake.symbol = ""; + conda.symbol = ""; + crystal.symbol = ""; + dart.symbol = ""; + deno.symbol = ""; + docker_context.symbol = ""; + elixir.symbol = ""; + elm.symbol = ""; + fennel.symbol = ""; + fossil_branch.symbol = ""; + gcloud.symbol = " "; + git_branch.symbol = ""; + git_commit.tag_symbol = " "; + golang.symbol = ""; + guix_shell.symbol = ""; + haskell.symbol = ""; + haxe.symbol = ""; + hg_branch.symbol = ""; + java.symbol = ""; + julia.symbol = ""; + kotlin.symbol = ""; + lua.symbol = ""; + memory_usage.symbol = "󰍛"; + meson.symbol = "󰔷"; + nim.symbol = "󰆥"; + nix_shell.symbol = ""; + nodejs.symbol = ""; + ocaml.symbol = ""; + os.symbols = { + Alpaquita = ""; + Alpine = ""; + AlmaLinux = ""; + Amazon = ""; + Android = ""; + Arch = ""; + Artix = ""; + CachyOS = ""; + CentOS = ""; + Debian = ""; + DragonFly = ""; + Emscripten = ""; + EndeavourOS = ""; + Fedora = ""; + FreeBSD = ""; + Garuda = "󰛓"; + Gentoo = ""; + HardenedBSD = "󰞌"; + Illumos = "󰈸"; + Kali = ""; + Linux = ""; + Mabox = ""; + Macos = ""; + Manjaro = ""; + Mariner = ""; + MidnightBSD = ""; + Mint = ""; + NetBSD = ""; + NixOS = ""; + Nobara = ""; + OpenBSD = "󰈺"; + openSUSE = ""; + OracleLinux = "󰌷"; + Pop = ""; + Raspbian = ""; + Redhat = ""; + RedHatEnterprise = ""; + RockyLinux = ""; + Redox = "󰀘"; + Solus = "󰠳"; + SUSE = ""; + Ubuntu = ""; + Unknown = ""; + Void = ""; + Windows = "󰍲"; + }; + package.symbol = "󰏗"; + perl.symbol = ""; + php.symbol = ""; + pijul_channel.symbol = ""; + pixi.symbol = "󰏗"; + python.symbol = ""; + rlang.symbol = "󰟔"; + ruby.symbol = ""; + rust.symbol = "󱘗"; + scala.symbol = ""; + swift.symbol = ""; + zig.symbol = ""; + gradle.symbol = ""; + }; - };} + }; +} From 67d4e65482863dc8c158c5cbe49d71f1cfe619d0 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 10 Oct 2025 17:34:28 +0200 Subject: [PATCH 0358/1295] nix flake update --- flake.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index d0fcec85..f0e3317e 100644 --- a/flake.lock +++ b/flake.lock @@ -71,11 +71,11 @@ ] }, "locked": { - "lastModified": 1757808926, - "narHash": "sha256-K6PEI5PYY94TVMH0mX3MbZNYFme7oNRKml/85BpRRAo=", + "lastModified": 1758463745, + "narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=", "owner": "nix-community", "repo": "home-manager", - "rev": "f21d9167782c086a33ad53e2311854a8f13c281e", + "rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3", "type": "github" }, "original": { @@ -143,11 +143,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1758038676, - "narHash": "sha256-5BUDFG+HnB4ZBLZSxbQ5tuueOVQDkSHi/8tUsJWlXl8=", + "lastModified": 1760106247, + "narHash": "sha256-6eoVSzv2sNlZx3wgIGvwYrbL8X/FpCb/5cw/N/f/v6c=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "addd500206b992b1c9211e0dfecb70c1d0c9821a", + "rev": "8ba0df9f335050044eddae848a7be8d9269ecc76", "type": "github" }, "original": { @@ -176,11 +176,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1758035401, - "narHash": "sha256-yDFq5/uwQV9NetcKduw0A/3XmGN/Z3ovMCTZkUv0B6Y=", + "lastModified": 1759395653, + "narHash": "sha256-sv9J1z6CrTPf9lRJLyCN90fZVdQz7LFeX7pIlInH8BQ=", "owner": "YaLTeR", "repo": "niri", - "rev": "08f5c6fecb3c5c81d63a0bf7248c85ae3299a4a5", + "rev": "ba6e5e082a79901dc89b0d49c5da1b769d652aec", "type": "github" }, "original": { @@ -227,11 +227,11 @@ ] }, "locked": { - "lastModified": 1757987448, - "narHash": "sha256-ltDT7EIfLHV42p99HnDfDviC8jN7tcOed1qsLEFypl8=", + "lastModified": 1760071578, + "narHash": "sha256-MZUsqax6PoXPDzhpLyduHoPY4CYYrzL97uKbsx/iGPE=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "e496568b0e69d9d54c8cfef96ed1370952ad9786", + "rev": "65365fe8c09b6c1b6bba1885a126723815376b1b", "type": "github" }, "original": { @@ -242,11 +242,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1757810152, - "narHash": "sha256-Vp9K5ol6h0J90jG7Rm4RWZsCB3x7v5VPx588TQ1dkfs=", + "lastModified": 1759994382, + "narHash": "sha256-wSK+3UkalDZRVHGCRikZ//CyZUJWDJkBDTQX1+G77Ow=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9a094440e02a699be5c57453a092a8baf569bdad", + "rev": "5da4a26309e796daa7ffca72df93dbe53b8164c7", "type": "github" }, "original": { @@ -258,11 +258,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1757967192, - "narHash": "sha256-/aA9A/OBmnuOMgwfzdsXRusqzUpd8rQnQY8jtrHK+To=", + "lastModified": 1759977445, + "narHash": "sha256-LYr4IDfuihCkFAkSYz5//gT2r1ewcWBYgd5AxPzPLIo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d7c15863b251a7a50265e57c1dca1a7add2e291", + "rev": "2dad7af78a183b6c486702c18af8a9544f298377", "type": "github" }, "original": { @@ -397,11 +397,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1757179758, - "narHash": "sha256-TIvyWzRt1miQj6Cf5Wy8Qz43XIZX7c4vTVwRLAT5S4Y=", + "lastModified": 1759707084, + "narHash": "sha256-0pkftKs6/LReNvxw7DVTN2AJEheZVgyeK0Aarbagi70=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "970728d0d9d1eada342bb8860af214b601139e58", + "rev": "a9188e70bd748118b4d56a529871b9de5adb9988", "type": "github" }, "original": { From b8d7dc7f904f6d3105723a67e0e86d23f3d7468d Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 11 Oct 2025 13:31:43 +0200 Subject: [PATCH 0359/1295] more starship config --- homeConfigurations/vinzenz/starship.nix | 71 ++++++++++++++----------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/homeConfigurations/vinzenz/starship.nix b/homeConfigurations/vinzenz/starship.nix index 470870aa..1725e1a7 100644 --- a/homeConfigurations/vinzenz/starship.nix +++ b/homeConfigurations/vinzenz/starship.nix @@ -8,37 +8,45 @@ add_newline = true; format = - "[](fg:color_a)[$username ](bg:color_a fg:text_a)[ ](fg:color_a bg:color_b)" - + "[$os $hostname ($container )](bg:color_b fg:text_b)[ ](fg:color_b bg:color_c)" - + "[$directory ](bg:color_c fg:text_c)[ ](fg:color_c bg:color_d)" - + "([$all ](bg:color_d fg:text_d))" - + "[ ](fg:color_d)" + "[](fg:color_r)[$username $os $hostname ($container )](bg:color_r fg:text_r)[ ](fg:color_r bg:color_g)" + + "[$directory ](bg:color_g fg:text_g)[ ](fg:color_g bg:color_b)" + + "([($git_state$git_branch$git_commit$git_status)$all](bg:color_b fg:text_b))[ ](fg:color_b)" + "$cmd_duration" + "$line_break$character$status > "; palette = "color_me_surprised"; palettes.color_me_surprised = { - "color_a" = "red"; - "color_b" = "yellow"; - "color_c" = "green"; - "color_d" = "blue"; - "text" = "white"; - "text_a" = "white"; - "text_b" = "black"; - "text_c" = "black"; - "text_d" = "white"; + "color_r" = "red"; + "color_g" = "green"; + "color_b" = "blue"; + "text_r" = "white"; + "text_g" = "black"; + "text_b" = "white"; }; - character = { - success_symbol = "[](bold fg:green)"; - error_symbol = "[✗](bold fg:color_a)"; + username = { + format = "[$user]($style)"; + style_user = "bg:color_r fg:text_r"; + style_root = "bold bg:color_r fg:text_r"; + show_always = true; }; + os = { + disabled = false; + format = "$symbol"; + }; + hostname = { + disabled = false; + ssh_only = false; + format = "$hostname"; + ssh_symbol = ""; + }; + container = { }; directory = { format = "$path[$read_only]($read_only_style)"; truncate_to_repo = true; truncation_symbol = ".../"; read_only = "󰌾"; - read_only_style = "fg:color_a bg:green"; + read_only_style = "fg:color_r bg:green"; home_symbol = ""; substitutions = { "Documents" = "󰈙"; @@ -48,22 +56,27 @@ "Developer" = "󰲋"; }; }; - hostname = { - disabled = false; - ssh_only = false; - format = "$hostname"; - ssh_symbol = ""; + + git_state = { + style = "fg:white bg:color_b"; }; - username = { - format = "$user"; - show_always = true; + git_branch = { + style = "fg:white bg:color_b"; + }; + git_commit = { + style = "fg:white bg:color_b"; }; git_status = { + style = "fg:white bg:color_b"; ahead = "⇡$count"; behind = "⇣$count"; - deleted = "x"; diverged = "⇕⇡$ahead_count⇣$behind_count"; }; + + character = { + success_symbol = "[](bold fg:green)"; + error_symbol = "[✗](bold fg:color_r)"; + }; status = { disabled = false; format = "[$symbol$status_common_meaning$status_signal_name$status_maybe_int]($style)"; @@ -71,10 +84,6 @@ pipestatus = true; symbol = "🔴"; }; - os = { - disabled = false; - format = "$symbol"; - }; cmd_duration = { format = "[󱦟 $duration]($style)"; }; From 7f79da3eb0b9b3dac0b6892e1c8080f0550c76fc Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 12 Oct 2025 00:06:41 +0200 Subject: [PATCH 0360/1295] even more starship config --- homeConfigurations/vinzenz/starship.nix | 36 ++++++++++++++++++++----- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/homeConfigurations/vinzenz/starship.nix b/homeConfigurations/vinzenz/starship.nix index 1725e1a7..1478bf3b 100644 --- a/homeConfigurations/vinzenz/starship.nix +++ b/homeConfigurations/vinzenz/starship.nix @@ -10,7 +10,8 @@ format = "[](fg:color_r)[$username $os $hostname ($container )](bg:color_r fg:text_r)[ ](fg:color_r bg:color_g)" + "[$directory ](bg:color_g fg:text_g)[ ](fg:color_g bg:color_b)" - + "([($git_state$git_branch$git_commit$git_status)$all](bg:color_b fg:text_b))[ ](fg:color_b)" + + "([($git_state$git_branch$git_commit$git_status)" + + "$all](bg:color_b fg:text_b))[ ](fg:color_b)" + "$cmd_duration" + "$line_break$character$status > "; @@ -39,12 +40,18 @@ ssh_only = false; format = "$hostname"; ssh_symbol = ""; + aliases = { + "vinzenz-lpt2" = "lpt"; + "vinzenz-pc2" = "pc"; + }; + }; + container = { + format = "\[$symbol$name\]"; }; - container = { }; directory = { - format = "$path[$read_only]($read_only_style)"; + format = "$path[( $read_only)]($read_only_style)"; truncate_to_repo = true; - truncation_symbol = ".../"; + truncation_symbol = "…/"; read_only = "󰌾"; read_only_style = "fg:color_r bg:green"; home_symbol = ""; @@ -62,17 +69,35 @@ }; git_branch = { style = "fg:white bg:color_b"; + format = "[$symbol $branch(:$remote_branch) ]($style)"; }; git_commit = { + format = "[$hash$tag ]($style)"; style = "fg:white bg:color_b"; }; git_status = { + format = "[$all_status$ahead_behind ]($style)"; style = "fg:white bg:color_b"; ahead = "⇡$count"; behind = "⇣$count"; diverged = "⇕⇡$ahead_count⇣$behind_count"; }; + package = { + symbol = "󰏗"; + format = "$symbol$version "; + version_format = "$\{raw\}"; + }; + rust = { + symbol = "󱘗"; + format = "$symbol$version "; + version_format = "$\{raw\}"; + }; + nix_shell = { + symbol = ""; + format = "$symbol( \($name\))"; + }; + character = { success_symbol = "[](bold fg:green)"; error_symbol = "[✗](bold fg:color_r)"; @@ -119,7 +144,6 @@ memory_usage.symbol = "󰍛"; meson.symbol = "󰔷"; nim.symbol = "󰆥"; - nix_shell.symbol = ""; nodejs.symbol = ""; ocaml.symbol = ""; os.symbols = { @@ -169,7 +193,6 @@ Void = ""; Windows = "󰍲"; }; - package.symbol = "󰏗"; perl.symbol = ""; php.symbol = ""; pijul_channel.symbol = ""; @@ -177,7 +200,6 @@ python.symbol = ""; rlang.symbol = "󰟔"; ruby.symbol = ""; - rust.symbol = "󱘗"; scala.symbol = ""; swift.symbol = ""; zig.symbol = ""; From 8d9f5edc2e489030309f080f568315f336738b83 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 12 Oct 2025 13:00:15 +0200 Subject: [PATCH 0361/1295] the most starship configuration --- homeConfigurations/vinzenz/starship.nix | 164 ++++++++++++++++++++---- 1 file changed, 142 insertions(+), 22 deletions(-) diff --git a/homeConfigurations/vinzenz/starship.nix b/homeConfigurations/vinzenz/starship.nix index 1478bf3b..480c748d 100644 --- a/homeConfigurations/vinzenz/starship.nix +++ b/homeConfigurations/vinzenz/starship.nix @@ -10,19 +10,21 @@ format = "[](fg:color_r)[$username $os $hostname ($container )](bg:color_r fg:text_r)[ ](fg:color_r bg:color_g)" + "[$directory ](bg:color_g fg:text_g)[ ](fg:color_g bg:color_b)" - + "([($git_state$git_branch$git_commit$git_status)" - + "$all](bg:color_b fg:text_b))[ ](fg:color_b)" - + "$cmd_duration" - + "$line_break$character$status > "; + + "([(\\[$git_state$git_branch$git_commit$git_status\\] )" + + "$all](bg:color_b fg:text_b))[](fg:color_b bg:color_y)" + + "([ $cmd_duration$status](bg:color_y fg:text_y))[](fg:color_y)" + + "$line_break$character "; palette = "color_me_surprised"; palettes.color_me_surprised = { - "color_r" = "red"; - "color_g" = "green"; - "color_b" = "blue"; + "color_r" = "#a30262"; + "color_g" = "#d162a4"; + "color_b" = "#5BCEFA"; + "color_y" = "white"; "text_r" = "white"; "text_g" = "black"; - "text_b" = "white"; + "text_b" = "black"; + "text_y" = "black"; }; username = { @@ -30,6 +32,9 @@ style_user = "bg:color_r fg:text_r"; style_root = "bold bg:color_r fg:text_r"; show_always = true; + aliases = { + "vinzenz" = "müde"; + }; }; os = { disabled = false; @@ -65,19 +70,21 @@ }; git_state = { - style = "fg:white bg:color_b"; + style = "fg:text_b bg:color_b"; }; git_branch = { - style = "fg:white bg:color_b"; + style = "fg:text_b bg:color_b"; format = "[$symbol $branch(:$remote_branch) ]($style)"; + symbol = ""; }; git_commit = { format = "[$hash$tag ]($style)"; - style = "fg:white bg:color_b"; + style = "fg:text_b bg:color_b"; + tag_symbol = ""; }; git_status = { - format = "[$all_status$ahead_behind ]($style)"; - style = "fg:white bg:color_b"; + format = "[$all_status$ahead_behind]($style)"; + style = "fg:text_b bg:color_b"; ahead = "⇡$count"; behind = "⇣$count"; diverged = "⇕⇡$ahead_count⇣$behind_count"; @@ -91,26 +98,27 @@ rust = { symbol = "󱘗"; format = "$symbol$version "; - version_format = "$\{raw\}"; + version_format = "$major.$minor"; }; nix_shell = { symbol = ""; format = "$symbol( \($name\))"; }; - character = { - success_symbol = "[](bold fg:green)"; - error_symbol = "[✗](bold fg:color_r)"; - }; status = { disabled = false; format = "[$symbol$status_common_meaning$status_signal_name$status_maybe_int]($style)"; map_symbol = true; pipestatus = true; - symbol = "🔴"; + style = "bg:color_y fg:text_y"; }; cmd_duration = { - format = "[󱦟 $duration]($style)"; + format = "󱦟 $duration "; + }; + + character = { + success_symbol = "[](bold)"; + error_symbol = "[✗](bold fg:color_r)"; }; # icons @@ -130,8 +138,6 @@ fennel.symbol = ""; fossil_branch.symbol = ""; gcloud.symbol = " "; - git_branch.symbol = ""; - git_commit.tag_symbol = " "; golang.symbol = ""; guix_shell.symbol = ""; haskell.symbol = ""; @@ -205,6 +211,120 @@ zig.symbol = ""; gradle.symbol = ""; + palettes = { + catppuccin_mocha = { + rosewater = "#f5e0dc"; + flamingo = "#f2cdcd"; + pink = "#f5c2e7"; + mauve = "#cba6f7"; + red = "#f38ba8"; + maroon = "#eba0ac"; + peach = "#fab387"; + yellow = "#f9e2af"; + green = "#a6e3a1"; + teal = "#94e2d5"; + sky = "#89dceb"; + sapphire = "#74c7ec"; + blue = "#89b4fa"; + lavender = "#b4befe"; + text = "#cdd6f4"; + subtext1 = "#bac2de"; + subtext0 = "#a6adc8"; + overlay2 = "#9399b2"; + overlay1 = "#7f849c"; + overlay0 = "#6c7086"; + surface2 = "#585b70"; + surface1 = "#45475a"; + surface0 = "#313244"; + base = "#1e1e2e"; + mantle = "#181825"; + crust = "#11111b"; + }; + catppuccin_frappe = { + rosewater = "#f2d5cf"; + flamingo = "#eebebe"; + pink = "#f4b8e4"; + mauve = "#ca9ee6"; + red = "#e78284"; + maroon = "#ea999c"; + peach = "#ef9f76"; + yellow = "#e5c890"; + green = "#a6d189"; + teal = "#81c8be"; + sky = "#99d1db"; + sapphire = "#85c1dc"; + blue = "#8caaee"; + lavender = "#babbf1"; + text = "#c6d0f5"; + subtext1 = "#b5bfe2"; + subtext0 = "#a5adce"; + overlay2 = "#949cbb"; + overlay1 = "#838ba7"; + overlay0 = "#737994"; + surface2 = "#626880"; + surface1 = "#51576d"; + surface0 = "#414559"; + base = "#303446"; + mantle = "#292c3c"; + crust = "#232634"; + }; + catppuccin_latte = { + rosewater = "#dc8a78"; + flamingo = "#dd7878"; + pink = "#ea76cb"; + mauve = "#8839ef"; + red = "#d20f39"; + maroon = "#e64553"; + peach = "#fe640b"; + yellow = "#df8e1d"; + green = "#40a02b"; + teal = "#179299"; + sky = "#04a5e5"; + sapphire = "#209fb5"; + blue = "#1e66f5"; + lavender = "#7287fd"; + text = "#4c4f69"; + subtext1 = "#5c5f77"; + subtext0 = "#6c6f85"; + overlay2 = "#7c7f93"; + overlay1 = "#8c8fa1"; + overlay0 = "#9ca0b0"; + surface2 = "#acb0be"; + surface1 = "#bcc0cc"; + surface0 = "#ccd0da"; + base = "#eff1f5"; + mantle = "#e6e9ef"; + crust = "#dce0e8"; + }; + catppuccin_macchiato = { + rosewater = "#f4dbd6"; + flamingo = "#f0c6c6"; + pink = "#f5bde6"; + mauve = "#c6a0f6"; + red = "#ed8796"; + maroon = "#ee99a0"; + peach = "#f5a97f"; + yellow = "#eed49f"; + green = "#a6da95"; + teal = "#8bd5ca"; + sky = "#91d7e3"; + sapphire = "#7dc4e4"; + blue = "#8aadf4"; + lavender = "#b7bdf8"; + text = "#cad3f5"; + subtext1 = "#b8c0e0"; + subtext0 = "#a5adcb"; + overlay2 = "#939ab7"; + overlay1 = "#8087a2"; + overlay0 = "#6e738d"; + surface2 = "#5b6078"; + surface1 = "#494d64"; + surface0 = "#363a4f"; + base = "#24273a"; + mantle = "#1e2030"; + crust = "#181926"; + }; + }; }; }; } From 9c840ba61ddc162e68e6fe0c580737280884d6d5 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 12 Oct 2025 15:16:44 +0200 Subject: [PATCH 0362/1295] add servicepoint-tanks service --- flake.lock | 66 ++++++++++ flake.nix | 15 ++- homeConfigurations/vinzenz/vscode.nix | 1 + nixosConfigurations/vinzenz-lpt2/default.nix | 8 ++ nixosModules/servicepoint-tanks.nix | 121 +++++++++++++++++++ 5 files changed, 207 insertions(+), 4 deletions(-) create mode 100644 nixosModules/servicepoint-tanks.nix diff --git a/flake.lock b/flake.lock index f0e3317e..5b7de926 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,49 @@ { "nodes": { + "binding": { + "inputs": { + "binding": "binding_2", + "nixpkgs": [ + "servicepoint-tanks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1759096792, + "narHash": "sha256-CW4D1yJecw7Id6AxIEJOW3OpcX3Y4Ehng76/YlR1I9w=", + "ref": "refs/heads/main", + "rev": "8df2996504866f3193fbe51860ab173d25724e5e", + "revCount": 307, + "type": "git", + "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-binding-csharp.git" + }, + "original": { + "type": "git", + "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-binding-csharp.git" + } + }, + "binding_2": { + "inputs": { + "nixpkgs": [ + "servicepoint-tanks", + "binding", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1759093963, + "narHash": "sha256-nis9Xps/P1f/v9FC3LoMLGGCOMMbdrOniDSklqLsH8o=", + "ref": "refs/heads/main", + "rev": "44ef4bb6d707c46af1bed6244f17a16f26f246c1", + "revCount": 304, + "type": "git", + "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-binding-uniffi.git" + }, + "original": { + "type": "git", + "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-binding-uniffi.git" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -281,6 +325,7 @@ "nixpkgs-unstable": "nixpkgs-unstable", "servicepoint-cli": "servicepoint-cli", "servicepoint-simulator": "servicepoint-simulator", + "servicepoint-tanks": "servicepoint-tanks", "zerforschen-plus": "zerforschen-plus" } }, @@ -362,6 +407,27 @@ "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git" } }, + "servicepoint-tanks": { + "inputs": { + "binding": "binding", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1760271116, + "narHash": "sha256-cdQwPsIryhPrv3Cr99Wupmlj7zycJWk+tDH24TbpqFY=", + "ref": "refs/heads/main", + "rev": "f814eeedc16455c0c9c2c83e28e227633ae4b52a", + "revCount": 217, + "type": "git", + "url": "https://git.berlin.ccc.de/vinzenz/servicepoint-tanks.git" + }, + "original": { + "type": "git", + "url": "https://git.berlin.ccc.de/vinzenz/servicepoint-tanks.git" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index 863a4c08..b9d02da8 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,11 @@ inputs.nixpkgs-stable.follows = "nixpkgs"; }; + nix-vscode-extensions = { + url = "github:nix-community/nix-vscode-extensions"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + zerforschen-plus = { url = "git+https://git.berlin.ccc.de/vinzenz/zerforschen.plus"; inputs.nixpkgs.follows = "nixpkgs"; @@ -29,8 +34,8 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - nix-vscode-extensions = { - url = "github:nix-community/nix-vscode-extensions"; + servicepoint-tanks = { + url = "git+https://git.berlin.ccc.de/vinzenz/servicepoint-tanks.git"; inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -43,10 +48,10 @@ niri, zerforschen-plus, nixpkgs-unstable, + nix-vscode-extensions, servicepoint-cli, servicepoint-simulator, - nix-vscode-extensions, - ... + servicepoint-tanks, }: let devices = { @@ -247,10 +252,12 @@ self.nixosModules.nix-ld self.nixosModules.quiet-boot self.nixosModules.firmware-updates + self.nixosModules.servicepoint-tanks home-manager.nixosModules.home-manager servicepoint-simulator.nixosModules.default servicepoint-cli.nixosModules.default + servicepoint-tanks.nixosModules.default ]) ++ additional-modules; } diff --git a/homeConfigurations/vinzenz/vscode.nix b/homeConfigurations/vinzenz/vscode.nix index c4ff3819..73a09f30 100644 --- a/homeConfigurations/vinzenz/vscode.nix +++ b/homeConfigurations/vinzenz/vscode.nix @@ -22,6 +22,7 @@ mkhl.direnv muhammad-sammy.csharp davidanson.vscode-markdownlint + #mermaidchart.vscode-mermaid-chart ] ++ (with pkgs.vscode-extensions; [ vadimcn.vscode-lldb diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index 255dd7aa..8d42e681 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -42,5 +42,13 @@ 8776 1337 ]; + + services.servicepoint-tanks = { + enable = true; + urls = [ + "http://localhost:5666" + "http://localhost:5667" + ]; + }; }; } diff --git a/nixosModules/servicepoint-tanks.nix b/nixosModules/servicepoint-tanks.nix new file mode 100644 index 00000000..67709f88 --- /dev/null +++ b/nixosModules/servicepoint-tanks.nix @@ -0,0 +1,121 @@ +{ + pkgs, + config, + lib, + ... +}: +let + cfg = config.services.servicepoint-tanks; + default-user-name = "servicepoint-tanks"; +in +{ + options.services.servicepoint-tanks = { + enable = lib.mkEnableOption "servicepoint-tanks"; + package = lib.mkPackageOption pkgs "servicepoint-tanks" { }; + urls = lib.mkOption { + default = [ "http://localhost:5000" ]; + description = '' + Configures which protocol to bind on which host:port combination. + ''; + type = lib.types.listOf lib.types.str; + example = [ + "http://0.0.0.0" + "http://localhost:5000" + # TODO: allow HTTPS + ]; + }; + user = lib.mkOption { + default = default-user-name; + description = '' + The user under which servicepoint-tanks is run. + + This module utilizes systemd's DynamicUser feature. See the corresponding section in + {manpage}`systemd.exec(5)` for more details. + ''; + type = lib.types.str; + }; + group = lib.mkOption { + default = default-user-name; + description = '' + The group under which servicepoint-tanks is run. + + This module utilizes systemd's DynamicUser feature. See the corresponding section in + {manpage}`systemd.exec(5)` for more details. + ''; + type = lib.types.str; + }; + }; + + config = lib.mkIf cfg.enable { + users = { + users = lib.mkIf (cfg.user == default-user-name) { + "${default-user-name}" = { + isSystemUser = true; + group = cfg.group; + }; + }; + + groups = lib.mkIf (cfg.group == default-user-name) { + "${default-user-name}" = { }; + }; + }; + + systemd.services.sericepoint-tanks = { + description = "Run the servicepoint-tanks server"; + wantedBy = [ "multi-user.target" ]; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + + environment = { + ASPNETCORE_URLS = "${lib.strings.concatStringsSep ";" cfg.urls}"; + }; + + serviceConfig = { + User = cfg.user; + Group = cfg.group; + DynamicUser = true; + + Type = "exec"; + ExecStart = "${lib.getBin cfg.package}/bin/TanksServer"; + + # hardening + NoNewPrivileges = true; + CapabilityBoundingSet = null; + SystemCallFilter = [ + "@system-service" + "~@privileged" + ]; + SystemCallArchitectures = "native"; + AmbientCapabilities = ""; + PrivateMounts = true; + PrivateUsers = true; + PrivateTmp = true; + PrivateDevices = true; + ProtectHome = true; + ProtectClock = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + ProtectSystem = "strict"; + ProtectControlGroups = "strict"; + LockPersonality = true; + RemoveIPC = true; + RestrictRealtime = true; + RestrictSUIDSGID = true; + RestrictNamespaces = true; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + + # TODO: enable unix domain socket bind + # "AF_UNIX" + ]; + + # TODO: try fully AOT build with: + #MemoryDenyWriteExecute = true; + }; + }; + }; +} From f59d3f25bad4f800cd3df1b3b4a41b319aa99eb1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 23 Oct 2025 20:15:13 +0200 Subject: [PATCH 0363/1295] rename user --- nixosModules/user-vinzenz.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixosModules/user-vinzenz.nix b/nixosModules/user-vinzenz.nix index b48e750e..13ccf117 100644 --- a/nixosModules/user-vinzenz.nix +++ b/nixosModules/user-vinzenz.nix @@ -3,7 +3,7 @@ users.users.vinzenz = { isNormalUser = true; name = "vinzenz"; - description = "Vinzenz"; + description = "müde"; home = "/home/vinzenz"; extraGroups = [ "networkmanager" From e3423c9b612d650705fc814ab9c2ed549dc5ad44 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 23 Oct 2025 20:15:48 +0200 Subject: [PATCH 0364/1295] nix flake update, use nixosModule from tanks repo --- flake.lock | 81 ++++++------------- flake.nix | 3 +- nixosModules/nix-ld.nix | 1 + nixosModules/servicepoint-tanks.nix | 121 ---------------------------- 4 files changed, 26 insertions(+), 180 deletions(-) delete mode 100644 nixosModules/servicepoint-tanks.nix diff --git a/flake.lock b/flake.lock index 5b7de926..59dacee6 100644 --- a/flake.lock +++ b/flake.lock @@ -90,24 +90,6 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -187,11 +169,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1760106247, - "narHash": "sha256-6eoVSzv2sNlZx3wgIGvwYrbL8X/FpCb/5cw/N/f/v6c=", + "lastModified": 1761187190, + "narHash": "sha256-5ln16iOeWpEX5MO7M3jzFEBNFE42gpFsCvSvPjtF6tQ=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "8ba0df9f335050044eddae848a7be8d9269ecc76", + "rev": "77a07f5d3b775fba67550c38122ebb8d3ee3ba1c", "type": "github" }, "original": { @@ -220,11 +202,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1759395653, - "narHash": "sha256-sv9J1z6CrTPf9lRJLyCN90fZVdQz7LFeX7pIlInH8BQ=", + "lastModified": 1760940149, + "narHash": "sha256-KbM47vD6E0cx+v4jYQZ8mD5N186AKm2CQlyh34TW58U=", "owner": "YaLTeR", "repo": "niri", - "rev": "ba6e5e082a79901dc89b0d49c5da1b769d652aec", + "rev": "b3245b81a6ed8edfaf5388a74d2e0a23c24941e5", "type": "github" }, "original": { @@ -265,17 +247,16 @@ }, "nix-vscode-extensions": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1760071578, - "narHash": "sha256-MZUsqax6PoXPDzhpLyduHoPY4CYYrzL97uKbsx/iGPE=", + "lastModified": 1761240986, + "narHash": "sha256-EjePxTz1P2cdFCPG+M33CGUpBVkD2W+zllZF0Cv1uDY=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "65365fe8c09b6c1b6bba1885a126723815376b1b", + "rev": "868d9f20e2d57e78cc53598f760c547a516f6ba7", "type": "github" }, "original": { @@ -286,11 +267,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1759994382, - "narHash": "sha256-wSK+3UkalDZRVHGCRikZ//CyZUJWDJkBDTQX1+G77Ow=", + "lastModified": 1761016216, + "narHash": "sha256-G/iC4t/9j/52i/nm+0/4ybBmAF4hzR8CNHC75qEhjHo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5da4a26309e796daa7ffca72df93dbe53b8164c7", + "rev": "481cf557888e05d3128a76f14c76397b7d7cc869", "type": "github" }, "original": { @@ -302,11 +283,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1759977445, - "narHash": "sha256-LYr4IDfuihCkFAkSYz5//gT2r1ewcWBYgd5AxPzPLIo=", + "lastModified": 1760965567, + "narHash": "sha256-0JDOal5P7xzzAibvD0yTE3ptyvoVOAL0rcELmDdtSKg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2dad7af78a183b6c486702c18af8a9544f298377", + "rev": "cb82756ecc37fa623f8cf3e88854f9bf7f64af93", "type": "github" }, "original": { @@ -415,34 +396,20 @@ ] }, "locked": { - "lastModified": 1760271116, - "narHash": "sha256-cdQwPsIryhPrv3Cr99Wupmlj7zycJWk+tDH24TbpqFY=", - "ref": "refs/heads/main", - "rev": "f814eeedc16455c0c9c2c83e28e227633ae4b52a", - "revCount": 217, + "lastModified": 1760288584, + "narHash": "sha256-2eY1f4LV9s5Hc/tb1iuJYPewE4Seyeguf7VdzC9bbbo=", + "ref": "service-improvements", + "rev": "1bb73d664dac78c5d69a02ae67169d76cca7aab4", + "revCount": 218, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/servicepoint-tanks.git" }, "original": { + "ref": "service-improvements", "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/servicepoint-tanks.git" } }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "xwayland-satellite-stable": { "flake": false, "locked": { @@ -463,11 +430,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1759707084, - "narHash": "sha256-0pkftKs6/LReNvxw7DVTN2AJEheZVgyeK0Aarbagi70=", + "lastModified": 1761173223, + "narHash": "sha256-FumZh+fPRaKXkl9Y1uTh5KV7Io/AyOZso+UkqLhLArs=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "a9188e70bd748118b4d56a529871b9de5adb9988", + "rev": "bf745144acda1343934e9a094cf9458a54d57889", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index b9d02da8..b046911f 100644 --- a/flake.nix +++ b/flake.nix @@ -35,7 +35,7 @@ }; servicepoint-tanks = { - url = "git+https://git.berlin.ccc.de/vinzenz/servicepoint-tanks.git"; + url = "git+https://git.berlin.ccc.de/vinzenz/servicepoint-tanks.git?ref=service-improvements"; inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -252,7 +252,6 @@ self.nixosModules.nix-ld self.nixosModules.quiet-boot self.nixosModules.firmware-updates - self.nixosModules.servicepoint-tanks home-manager.nixosModules.home-manager servicepoint-simulator.nixosModules.default diff --git a/nixosModules/nix-ld.nix b/nixosModules/nix-ld.nix index 382aa3d3..0d09078f 100644 --- a/nixosModules/nix-ld.nix +++ b/nixosModules/nix-ld.nix @@ -17,6 +17,7 @@ util-linux xz systemd + icu ]; }; } diff --git a/nixosModules/servicepoint-tanks.nix b/nixosModules/servicepoint-tanks.nix deleted file mode 100644 index 67709f88..00000000 --- a/nixosModules/servicepoint-tanks.nix +++ /dev/null @@ -1,121 +0,0 @@ -{ - pkgs, - config, - lib, - ... -}: -let - cfg = config.services.servicepoint-tanks; - default-user-name = "servicepoint-tanks"; -in -{ - options.services.servicepoint-tanks = { - enable = lib.mkEnableOption "servicepoint-tanks"; - package = lib.mkPackageOption pkgs "servicepoint-tanks" { }; - urls = lib.mkOption { - default = [ "http://localhost:5000" ]; - description = '' - Configures which protocol to bind on which host:port combination. - ''; - type = lib.types.listOf lib.types.str; - example = [ - "http://0.0.0.0" - "http://localhost:5000" - # TODO: allow HTTPS - ]; - }; - user = lib.mkOption { - default = default-user-name; - description = '' - The user under which servicepoint-tanks is run. - - This module utilizes systemd's DynamicUser feature. See the corresponding section in - {manpage}`systemd.exec(5)` for more details. - ''; - type = lib.types.str; - }; - group = lib.mkOption { - default = default-user-name; - description = '' - The group under which servicepoint-tanks is run. - - This module utilizes systemd's DynamicUser feature. See the corresponding section in - {manpage}`systemd.exec(5)` for more details. - ''; - type = lib.types.str; - }; - }; - - config = lib.mkIf cfg.enable { - users = { - users = lib.mkIf (cfg.user == default-user-name) { - "${default-user-name}" = { - isSystemUser = true; - group = cfg.group; - }; - }; - - groups = lib.mkIf (cfg.group == default-user-name) { - "${default-user-name}" = { }; - }; - }; - - systemd.services.sericepoint-tanks = { - description = "Run the servicepoint-tanks server"; - wantedBy = [ "multi-user.target" ]; - after = [ "network-online.target" ]; - wants = [ "network-online.target" ]; - - environment = { - ASPNETCORE_URLS = "${lib.strings.concatStringsSep ";" cfg.urls}"; - }; - - serviceConfig = { - User = cfg.user; - Group = cfg.group; - DynamicUser = true; - - Type = "exec"; - ExecStart = "${lib.getBin cfg.package}/bin/TanksServer"; - - # hardening - NoNewPrivileges = true; - CapabilityBoundingSet = null; - SystemCallFilter = [ - "@system-service" - "~@privileged" - ]; - SystemCallArchitectures = "native"; - AmbientCapabilities = ""; - PrivateMounts = true; - PrivateUsers = true; - PrivateTmp = true; - PrivateDevices = true; - ProtectHome = true; - ProtectClock = true; - ProtectHostname = true; - ProtectKernelLogs = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - ProtectProc = "invisible"; - ProtectSystem = "strict"; - ProtectControlGroups = "strict"; - LockPersonality = true; - RemoveIPC = true; - RestrictRealtime = true; - RestrictSUIDSGID = true; - RestrictNamespaces = true; - RestrictAddressFamilies = [ - "AF_INET" - "AF_INET6" - - # TODO: enable unix domain socket bind - # "AF_UNIX" - ]; - - # TODO: try fully AOT build with: - #MemoryDenyWriteExecute = true; - }; - }; - }; -} From 60dc4b72b0e7269f64cbfddf1e500416cd477f8e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 23 Oct 2025 21:17:58 +0200 Subject: [PATCH 0365/1295] disable servicepoint-tanks --- nixosConfigurations/vinzenz-lpt2/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index 8d42e681..a854e265 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -44,7 +44,7 @@ ]; services.servicepoint-tanks = { - enable = true; + enable = false; urls = [ "http://localhost:5666" "http://localhost:5667" From 00a12701b2721492bf950250153ec1a326b53c30 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 23 Oct 2025 21:36:15 +0200 Subject: [PATCH 0366/1295] switch dotnet version for vscodium --- homeConfigurations/vinzenz/vscode.nix | 3 ++- nixosConfigurations/vinzenz-lpt2/default.nix | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/homeConfigurations/vinzenz/vscode.nix b/homeConfigurations/vinzenz/vscode.nix index 73a09f30..27b77fd6 100644 --- a/homeConfigurations/vinzenz/vscode.nix +++ b/homeConfigurations/vinzenz/vscode.nix @@ -71,7 +71,8 @@ }; }; - "dotnetAcquisitionExtension.sharedExistingDotnetPath" = "${lib.getBin pkgs.dotnet-sdk}/bin/dotnet"; + "dotnetAcquisitionExtension.sharedExistingDotnetPath" = + "${lib.getBin pkgs.dotnetCorePackages.sdk_9_0}/bin/dotnet"; "\[makefile\]" = { "editor.insertSpaces" = false; diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index a854e265..38e9a3f9 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -50,5 +50,8 @@ "http://localhost:5667" ]; }; + nixpkgs.config.permittedInsecurePackages = [ + "mbedtls-2.28.10" + ]; }; } From 7e09f6cb69359bd4b0ac84c76cf663afa7cdf3aa Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 1 Nov 2025 21:32:07 +0100 Subject: [PATCH 0367/1295] vscode enable mouse wheel zoom --- homeConfigurations/vinzenz/vscode.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeConfigurations/vinzenz/vscode.nix b/homeConfigurations/vinzenz/vscode.nix index 27b77fd6..0eec3ca0 100644 --- a/homeConfigurations/vinzenz/vscode.nix +++ b/homeConfigurations/vinzenz/vscode.nix @@ -39,6 +39,8 @@ "editor.formatOnSave" = true; "editor.formatOnSaveMode" = "modificationsIfAvailable"; "editor.minimap.autohide" = true; + "editor.mouseWheelZoom" = true; + "terminal.integrated.mouseWheelZoom" = true; "workbench.startupEditor" = "readme"; "workbench.enableExperiments" = false; From c4fcb26aceb5473f68e9cc3a37dce9ec3bdfc788 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 2 Nov 2025 01:19:27 +0100 Subject: [PATCH 0368/1295] re-enable niri, tweals, update --- flake.lock | 36 +++---- flake.nix | 15 ++- homeConfigurations/vinzenz/default.nix | 6 +- homeConfigurations/vinzenz/niri.nix | 127 ++++++++++++++++++++---- homeConfigurations/vinzenz/starship.nix | 4 +- homeConfigurations/vinzenz/swaylock.nix | 4 +- homeConfigurations/vinzenz/waybar.nix | 27 ----- nixosModules/niri.nix | 7 -- 8 files changed, 142 insertions(+), 84 deletions(-) delete mode 100644 nixosModules/niri.nix diff --git a/flake.lock b/flake.lock index 59dacee6..889ab8ed 100644 --- a/flake.lock +++ b/flake.lock @@ -169,11 +169,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1761187190, - "narHash": "sha256-5ln16iOeWpEX5MO7M3jzFEBNFE42gpFsCvSvPjtF6tQ=", + "lastModified": 1762026425, + "narHash": "sha256-7eDtQrr+CRZ1pLjJ6Bx7Ab9pUIowXJ7ooqEh6p3jIn8=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "77a07f5d3b775fba67550c38122ebb8d3ee3ba1c", + "rev": "342730d4f8e109f3506932d2be1c8f9ab19a7039", "type": "github" }, "original": { @@ -202,11 +202,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1760940149, - "narHash": "sha256-KbM47vD6E0cx+v4jYQZ8mD5N186AKm2CQlyh34TW58U=", + "lastModified": 1761888958, + "narHash": "sha256-YgArUHI81Esn6fOCwVSrMI2G4RI3f3BPbRbPWsJubAc=", "owner": "YaLTeR", "repo": "niri", - "rev": "b3245b81a6ed8edfaf5388a74d2e0a23c24941e5", + "rev": "e2576879216a39e5c45b9d2906531bc2065e724c", "type": "github" }, "original": { @@ -252,11 +252,11 @@ ] }, "locked": { - "lastModified": 1761240986, - "narHash": "sha256-EjePxTz1P2cdFCPG+M33CGUpBVkD2W+zllZF0Cv1uDY=", + "lastModified": 1761962287, + "narHash": "sha256-Wm9p7PpkSy6bgw9NU+NKCy1i3CQCYbTEbsHURaGnINA=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "868d9f20e2d57e78cc53598f760c547a516f6ba7", + "rev": "1a37285c50e143620fad2e9fb322adff5e2df1f2", "type": "github" }, "original": { @@ -267,11 +267,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1761016216, - "narHash": "sha256-G/iC4t/9j/52i/nm+0/4ybBmAF4hzR8CNHC75qEhjHo=", + "lastModified": 1761597516, + "narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "481cf557888e05d3128a76f14c76397b7d7cc869", + "rev": "daf6dc47aa4b44791372d6139ab7b25269184d55", "type": "github" }, "original": { @@ -283,11 +283,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1760965567, - "narHash": "sha256-0JDOal5P7xzzAibvD0yTE3ptyvoVOAL0rcELmDdtSKg=", + "lastModified": 1761880412, + "narHash": "sha256-QoJjGd4NstnyOG4mm4KXF+weBzA2AH/7gn1Pmpfcb0A=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cb82756ecc37fa623f8cf3e88854f9bf7f64af93", + "rev": "a7fc11be66bdfb5cdde611ee5ce381c183da8386", "type": "github" }, "original": { @@ -430,11 +430,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1761173223, - "narHash": "sha256-FumZh+fPRaKXkl9Y1uTh5KV7Io/AyOZso+UkqLhLArs=", + "lastModified": 1761622056, + "narHash": "sha256-fBrUszJXmB4MY+wf3QsCnqWHcz7u7fLq0QMAWCltIQg=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "bf745144acda1343934e9a094cf9458a54d57889", + "rev": "0728d59ff6463a502e001fb090f6eb92dbc04756", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index b046911f..140b27ef 100644 --- a/flake.nix +++ b/flake.nix @@ -139,10 +139,17 @@ }; nixosModules = (importModuleDir ./nixosModules) // { - niri = { - imports = [ niri.nixosModules.niri ]; - nixpkgs.overlays = [ niri.overlays.niri ]; - }; + niri = + { pkgs, ... }: + { + imports = [ niri.nixosModules.niri ]; + nixpkgs.overlays = [ niri.overlays.niri ]; + + programs.niri = { + enable = true; + #package = pkgs.niri-stable; + }; + }; pkgs-unstable = { nixpkgs.overlays = [ self.overlays.unstable-packages ]; }; diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index 4af562bb..5c81477b 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -10,9 +10,9 @@ ./zsh.nix ./starship.nix ./fonts.nix - #./niri.nix - #./swaylock.nix - #./waybar.nix + ./niri.nix + ./swaylock.nix + ./waybar.nix ]; config = { diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix index 3562ae1c..8e18812c 100644 --- a/homeConfigurations/vinzenz/niri.nix +++ b/homeConfigurations/vinzenz/niri.nix @@ -1,6 +1,7 @@ { pkgs, config, + lib, ... }: { @@ -19,15 +20,113 @@ services.mako.enable = true; programs.niri.settings = { - input.keyboard.xkb.layout = "de"; - outputs."eDP-1" = { scale = 1.0; variable-refresh-rate = true; background-color = "#000000"; }; - layout.gaps = 8; + layout = + let + pink_light = "#d162a4"; + pink_dark = "#a30262"; + blue_light = "#5BCEFA"; + blue_dark = "#4a6bb1"; + gradient-active = { + from = pink_light; + to = blue_light; + angle = 45; + in' = "oklab"; + }; + gradient-inactive = { + from = pink_dark; + to = blue_dark; + angle = 45; + in' = "oklab"; + }; + gradient-urgent = { + from = pink_dark; + to = pink_light; + angle = 45; + in' = "oklab"; + }; + in + { + gaps = 18; + #default-column-display = "tabbed"; + border = { + enable = true; + width = 6; + active.gradient = gradient-active; + inactive.gradient = gradient-inactive; + urgent.gradient = gradient-urgent; + }; + focus-ring = { + enable = true; + active.gradient = gradient-active; + inactive.gradient = gradient-inactive; + urgent.gradient = gradient-urgent; + }; + shadow = { + enable = false; + color = "white"; + inactive-color = pink_dark; + draw-behind-window = true; + spread = 5; + softness = 10; + offset = { + x = 0; + y = 0; + }; + }; + insert-hint = { + enable = true; + display.color = pink_dark; + }; + struts = { + left = 3; + right = 3; + top = 3; + bottom = 3; + }; + tab-indicator = { + place-within-column = true; + active.gradient = gradient-inactive; + inactive.gradient = gradient-inactive; + urgent.gradient = gradient-inactive; + }; + }; + + cursor.theme = "Adwaita"; + + input = { + touchpad.tap = true; + keyboard = { + xkb = { + layout = "de"; + options = "compose:caps"; + }; + numlock = true; + }; + }; + + prefer-no-csd = true; + + window-rules = [ + { + clip-to-geometry = true; + geometry-corner-radius = + let + radius = 4.; + in + { + top-left = radius; + bottom-left = radius; + top-right = radius; + bottom-right = radius; + }; + } + ]; # defaults taken from https://github.com/sodiboo/niri-flake/issues/483 binds = { @@ -46,9 +145,9 @@ "Mod+Shift+Numbersign".action.show-hotkey-overlay = { }; # Suggested binds for running programs: terminal, app launcher, screen locker. - "Mod+T".action.spawn = "alacritty"; + "Mod+T".action.spawn = "${lib.getBin pkgs.gnome-terminal}/bin/gnome-terminal"; "Mod+D".action.spawn = "fuzzel"; - "Super+Alt+L".action.spawn = "${config.programs.swaylock.package}/bin/swaylock"; + "Super+Alt+L".action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; # You can also use a shell. Do this if you need pipes, multiple commands, etc. # Note: the entire command goes as a single argument in the end. @@ -99,19 +198,11 @@ "Mod+Down".action.focus-window-down = { }; "Mod+Up".action.focus-window-up = { }; "Mod+Right".action.focus-column-right = { }; - "Mod+H".action.focus-column-left = { }; - "Mod+J".action.focus-window-down = { }; - "Mod+K".action.focus-window-up = { }; - "Mod+L".action.focus-column-right = { }; "Mod+Ctrl+Left".action.move-column-left = { }; "Mod+Ctrl+Down".action.move-window-down = { }; "Mod+Ctrl+Up".action.move-window-up = { }; "Mod+Ctrl+Right".action.move-column-right = { }; - "Mod+Ctrl+H".action.move-column-left = { }; - "Mod+Ctrl+J".action.move-window-down = { }; - "Mod+Ctrl+K".action.move-window-up = { }; - "Mod+Ctrl+L".action.move-column-right = { }; # Alternative commands that move across workspaces when reaching # the first or last window in a column. @@ -129,19 +220,11 @@ "Mod+Shift+Down".action.focus-monitor-down = { }; "Mod+Shift+Up".action.focus-monitor-up = { }; "Mod+Shift+Right".action.focus-monitor-right = { }; - "Mod+Shift+H".action.focus-monitor-left = { }; - "Mod+Shift+J".action.focus-monitor-down = { }; - "Mod+Shift+K".action.focus-monitor-up = { }; - "Mod+Shift+L".action.focus-monitor-right = { }; "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = { }; "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = { }; "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = { }; "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = { }; - "Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = { }; - "Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = { }; - "Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = { }; - "Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = { }; # Alternatively, there are commands to move just a single window: # Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } @@ -292,6 +375,8 @@ # Powers off the monitors. To turn them back on, do any input like # moving the mouse or pressing any other key. "Mod+Shift+P".action.power-off-monitors = { }; + + "Mod+W".action.toggle-column-tabbed-display = { }; }; }; }; diff --git a/homeConfigurations/vinzenz/starship.nix b/homeConfigurations/vinzenz/starship.nix index 480c748d..003e0223 100644 --- a/homeConfigurations/vinzenz/starship.nix +++ b/homeConfigurations/vinzenz/starship.nix @@ -20,11 +20,11 @@ "color_r" = "#a30262"; "color_g" = "#d162a4"; "color_b" = "#5BCEFA"; - "color_y" = "white"; + "color_y" = "#4a6bb1"; "text_r" = "white"; "text_g" = "black"; "text_b" = "black"; - "text_y" = "black"; + "text_y" = "white"; }; username = { diff --git a/homeConfigurations/vinzenz/swaylock.nix b/homeConfigurations/vinzenz/swaylock.nix index 9255f041..2e298a6c 100644 --- a/homeConfigurations/vinzenz/swaylock.nix +++ b/homeConfigurations/vinzenz/swaylock.nix @@ -17,7 +17,7 @@ indicator-radius = 400; show-failed-attempts = true; ignore-empty-password = true; - grace = 2; + grace = 3.5; color = "000000"; indicator-thickness = 20; }; @@ -28,7 +28,7 @@ systemdTarget = "graphical-session.target"; timeouts = [ { - timeout = 30; + timeout = 60; command = "${config.programs.swaylock.package}/bin/swaylock"; } { diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix index af276ac6..26112fd5 100644 --- a/homeConfigurations/vinzenz/waybar.nix +++ b/homeConfigurations/vinzenz/waybar.nix @@ -1,13 +1,11 @@ { pkgs, device, - config, ... }: { home.packages = with pkgs; [ playerctl - cava ]; programs.waybar = { @@ -36,7 +34,6 @@ modules-right = [ "mpris" "image" - "cava" "gamemode" "temperature" @@ -136,30 +133,6 @@ "" ]; }; - cava = { - framerate = 15; - autosens = 1; - method = "pipewire"; - sleep_timer = 3; - source = "auto"; - bar_delimiter = 0; - bars = 12; - input_delay = 2; - hide_on_silence = true; - format-icons = [ - "" - "" - "" - "" - "" - "" - "" - "" - ]; - actions = { - "on-click-right" = "mode"; - }; - }; disk = { format = "{free}/{total}"; }; diff --git a/nixosModules/niri.nix b/nixosModules/niri.nix deleted file mode 100644 index 42af7344..00000000 --- a/nixosModules/niri.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - programs.niri = { - enable = true; - package = pkgs.niri-stable; - }; -} From 947ab5664da157795f2feb53eea0669294c04441 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 2 Nov 2025 20:18:16 +0100 Subject: [PATCH 0369/1295] more niri changes --- homeConfigurations/vinzenz/niri.nix | 50 ++++++++++++++++++--------- homeConfigurations/vinzenz/vscode.nix | 5 ++- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix index 8e18812c..21b1778d 100644 --- a/homeConfigurations/vinzenz/niri.nix +++ b/homeConfigurations/vinzenz/niri.nix @@ -32,31 +32,30 @@ pink_dark = "#a30262"; blue_light = "#5BCEFA"; blue_dark = "#4a6bb1"; - gradient-active = { + gradient-common = { + angle = 90; + in' = "oklab"; + }; + gradient-active = gradient-common // { from = pink_light; to = blue_light; - angle = 45; - in' = "oklab"; }; - gradient-inactive = { + gradient-inactive = gradient-common // { from = pink_dark; to = blue_dark; - angle = 45; - in' = "oklab"; }; - gradient-urgent = { + gradient-urgent = gradient-common // { from = pink_dark; to = pink_light; - angle = 45; - in' = "oklab"; }; + gap-size = 10; in { - gaps = 18; + gaps = gap-size; #default-column-display = "tabbed"; border = { enable = true; - width = 6; + width = gap-size / 2; active.gradient = gradient-active; inactive.gradient = gradient-inactive; urgent.gradient = gradient-urgent; @@ -83,12 +82,16 @@ enable = true; display.color = pink_dark; }; - struts = { - left = 3; - right = 3; - top = 3; - bottom = 3; - }; + struts = + let + strut-inset = 4; + in + { + left = strut-inset; + right = strut-inset; + top = strut-inset; + bottom = strut-inset; + }; tab-indicator = { place-within-column = true; active.gradient = gradient-inactive; @@ -126,6 +129,19 @@ bottom-right = radius; }; } + { + matches = [ + { + app-id = "steam"; + title = "^notificationtoasts_\\d+_desktop$"; + } + ]; + default-floating-position = { + x = 10; + y = 10; + relative-to = "bottom-right"; + }; + } ]; # defaults taken from https://github.com/sodiboo/niri-flake/issues/483 diff --git a/homeConfigurations/vinzenz/vscode.nix b/homeConfigurations/vinzenz/vscode.nix index 0eec3ca0..3ddfa78b 100644 --- a/homeConfigurations/vinzenz/vscode.nix +++ b/homeConfigurations/vinzenz/vscode.nix @@ -1,7 +1,10 @@ { pkgs, lib, ... }: { config = { - home.sessionVariables.NIXOS_OZONE_WL = "1"; + home.sessionVariables = { + NIXOS_OZONE_WL = "1"; + ELECTRON_OZONE_PLATFORM_HINT = "auto"; + }; programs.vscode = { enable = true; package = pkgs.vscodium; From a5fc6397499e00b99d8f816e6889b1e09f1ebb13 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 2 Nov 2025 20:33:14 +0100 Subject: [PATCH 0370/1295] even more niri settings --- homeConfigurations/vinzenz/niri.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix index 21b1778d..84598612 100644 --- a/homeConfigurations/vinzenz/niri.nix +++ b/homeConfigurations/vinzenz/niri.nix @@ -20,10 +20,18 @@ services.mako.enable = true; programs.niri.settings = { - outputs."eDP-1" = { - scale = 1.0; - variable-refresh-rate = true; - background-color = "#000000"; + outputs = { + "BOE 0x0A3B Unknown" = { + scale = 1.0; + variable-refresh-rate = true; + }; + "Dell Inc. DELL P2719H 39VHKS2" = { + scale = 1.0; + }; + "LG Electronics LG ULTRAGEAR 106NTYT27386" = { + scale = 1.0; + variable-refresh-rate = true; + }; }; layout = @@ -51,6 +59,7 @@ gap-size = 10; in { + background-color = "#000000"; gaps = gap-size; #default-column-display = "tabbed"; border = { From 2d4accf81fbb4e71f97f203c069ad473dbdf3e24 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 2 Nov 2025 20:53:00 +0100 Subject: [PATCH 0371/1295] nix flake update --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 889ab8ed..2a6ee849 100644 --- a/flake.lock +++ b/flake.lock @@ -252,11 +252,11 @@ ] }, "locked": { - "lastModified": 1761962287, - "narHash": "sha256-Wm9p7PpkSy6bgw9NU+NKCy1i3CQCYbTEbsHURaGnINA=", + "lastModified": 1762048816, + "narHash": "sha256-gAGed5eYA6WTVQSMELyi+168A9N2UNEjwXn5xm0czsk=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "1a37285c50e143620fad2e9fb322adff5e2df1f2", + "rev": "c8261cd60b0623635b4b88ae0f75ac3bfeddf260", "type": "github" }, "original": { @@ -267,11 +267,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1761597516, - "narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=", + "lastModified": 1761999846, + "narHash": "sha256-IYlYnp4O4dzEpL77BD/lj5NnJy2J8qbHkNSFiPBCbqo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "daf6dc47aa4b44791372d6139ab7b25269184d55", + "rev": "3de8f8d73e35724bf9abef41f1bdbedda1e14a31", "type": "github" }, "original": { From 9272269c1e954a13b346ba2249bc822d6f1e76dd Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 2 Nov 2025 20:56:05 +0100 Subject: [PATCH 0372/1295] more niri settings - fix terminal hotkey --- homeConfigurations/vinzenz/fuzzel.nix | 7 ++++--- homeConfigurations/vinzenz/niri.nix | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/homeConfigurations/vinzenz/fuzzel.nix b/homeConfigurations/vinzenz/fuzzel.nix index db700e89..faf38143 100644 --- a/homeConfigurations/vinzenz/fuzzel.nix +++ b/homeConfigurations/vinzenz/fuzzel.nix @@ -1,13 +1,14 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { config.programs.fuzzel = { enable = true; settings = { main = { - terminal = "${pkgs.alacritty}/bin/alacritty"; + terminal = "${lib.getBin pkgs.gnome-console}/bin/kgx"; icon-theme = "Adwaita"; counter = true; - font = "sans:size=10"; + font = "sans:size=11"; + launch-prefix = "niri msg action spawn --"; }; colors = { border = "0003B3FF"; diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix index 84598612..03376a76 100644 --- a/homeConfigurations/vinzenz/niri.nix +++ b/homeConfigurations/vinzenz/niri.nix @@ -170,7 +170,7 @@ "Mod+Shift+Numbersign".action.show-hotkey-overlay = { }; # Suggested binds for running programs: terminal, app launcher, screen locker. - "Mod+T".action.spawn = "${lib.getBin pkgs.gnome-terminal}/bin/gnome-terminal"; + "Mod+T".action.spawn = "${lib.getBin pkgs.gnome-console}/bin/kgx"; "Mod+D".action.spawn = "fuzzel"; "Super+Alt+L".action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; From 3427ab393628f12c79d65fca6754f9ee72493c77 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 2 Nov 2025 21:22:05 +0100 Subject: [PATCH 0373/1295] niri - disable tutorial, allow respawning swaylock --- homeConfigurations/vinzenz/niri.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix index 03376a76..8e4daa2c 100644 --- a/homeConfigurations/vinzenz/niri.nix +++ b/homeConfigurations/vinzenz/niri.nix @@ -123,6 +123,7 @@ }; prefer-no-csd = true; + hotkey-overlay.skip-at-startup = true; window-rules = [ { @@ -172,7 +173,10 @@ # Suggested binds for running programs: terminal, app launcher, screen locker. "Mod+T".action.spawn = "${lib.getBin pkgs.gnome-console}/bin/kgx"; "Mod+D".action.spawn = "fuzzel"; - "Super+Alt+L".action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; + "Super+Alt+L" = { + action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; + allow-when-locked=true; + }; # You can also use a shell. Do this if you need pipes, multiple commands, etc. # Note: the entire command goes as a single argument in the end. From 9873894d2b2fcef51487057919f316c715679d9b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 2 Nov 2025 22:42:48 +0100 Subject: [PATCH 0374/1295] niri - re-enable csd, adwaita corder radius --- homeConfigurations/vinzenz/niri.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix index 8e4daa2c..a6f01258 100644 --- a/homeConfigurations/vinzenz/niri.nix +++ b/homeConfigurations/vinzenz/niri.nix @@ -122,7 +122,7 @@ }; }; - prefer-no-csd = true; + #prefer-no-csd = true; hotkey-overlay.skip-at-startup = true; window-rules = [ @@ -130,7 +130,7 @@ clip-to-geometry = true; geometry-corner-radius = let - radius = 4.; + radius = 15.; in { top-left = radius; @@ -406,6 +406,7 @@ "Mod+Shift+P".action.power-off-monitors = { }; "Mod+W".action.toggle-column-tabbed-display = { }; + "Mod+O".action.toggle-overview = {}; }; }; }; From 87ed370e262b1994283ca05c72e615ff25fc93f0 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 3 Nov 2025 22:30:46 +0100 Subject: [PATCH 0375/1295] add thunderbird+fractal, remove ptyxis+blanket --- homeConfigurations/vinzenz/default.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index 5c81477b..50287b7f 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -47,6 +47,9 @@ home.packages = with pkgs; [ keepassxc + nextcloud-client + thunderbird + fractal telegram-desktop element-desktop @@ -57,10 +60,8 @@ kdiff3 jetbrains-toolbox - blanket vlc - - ptyxis + lutris arduino arduino-ide @@ -71,10 +72,6 @@ icu - nextcloud-client - - lutris - foliate dconf2nix From c4edc838307cfd59722774957a31c91f919d2555 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 5 Nov 2025 20:43:31 +0100 Subject: [PATCH 0376/1295] fix zsh ctrl+arrow does not work --- homeConfigurations/vinzenz/zsh.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeConfigurations/vinzenz/zsh.nix b/homeConfigurations/vinzenz/zsh.nix index 7b843844..f2fc674d 100644 --- a/homeConfigurations/vinzenz/zsh.nix +++ b/homeConfigurations/vinzenz/zsh.nix @@ -3,6 +3,9 @@ config.programs.zsh = { initContent = '' export PATH=$PATH:/home/vinzenz/.cargo/bin + + bindkey "^[[1;5C" forward-word + bindkey "^[[1;5D" backward-word ''; enableCompletion = true; From 8bd0bf167f1fc58b02cb4aadda6288067413c88f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 5 Nov 2025 21:56:32 +0100 Subject: [PATCH 0377/1295] some first waybar styling based on default style.css --- homeConfigurations/vinzenz/waybar.css | 340 ++++++++++++++++++++++++++ homeConfigurations/vinzenz/waybar.nix | 1 + 2 files changed, 341 insertions(+) create mode 100644 homeConfigurations/vinzenz/waybar.css diff --git a/homeConfigurations/vinzenz/waybar.css b/homeConfigurations/vinzenz/waybar.css new file mode 100644 index 00000000..39b0038a --- /dev/null +++ b/homeConfigurations/vinzenz/waybar.css @@ -0,0 +1,340 @@ +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: FontAwesome, sans-serif; + font-size: 13px; + border: none; + border-radius: 0; + color: #dcdfe1; +} + +#waybar { + background-color: rgba(0, 0, 0, 0); + border: none; + box-shadow: none; +} + +window#waybar { + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +#workspaces, +#window, +#tray { + background-color: rgba(15, 27, 53, 0.9); + padding: 4px 6px; + margin-top: 6px; + margin-left: 6px; + margin-right: 6px; + border-radius: 15px; + border-width: 0px; +} + + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + background: inherit; + box-shadow: inset 0 -3px #ffffff; +} + +/* you can set a style on hover for any module like this */ +#pulseaudio:hover { + background-color: #a37800; +} + +#workspaces button { + padding: 0 5px; + background-color: transparent; + color: #ffffff; +} + +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); +} + +#workspaces button.focused, +#workspaces button.active { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#scratchpad, +#power-profiles-daemon, +#mpd { + padding: 0 10px; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left>widget:first-child>#workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right>widget:last-child>#workspaces { + margin-right: 0; +} + +#clock { + background-color: #64727D; +} + +#battery { + background-color: #ffffff; + color: #000000; +} + +#battery.charging, +#battery.plugged { + color: #ffffff; + background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +/* Using steps() instead of linear as a timing function to limit cpu usage */ +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: steps(12); + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#power-profiles-daemon { + padding-right: 15px; +} + +#power-profiles-daemon.performance { + background-color: #f53c3c; + color: #ffffff; +} + +#power-profiles-daemon.balanced { + background-color: #2980b9; + color: #ffffff; +} + +#power-profiles-daemon.power-saver { + background-color: #2ecc71; + color: #000000; +} + +label:focus { + background-color: #000000; +} + +#cpu { + background-color: #2ecc71; + color: #000000; +} + +#memory { + background-color: #9b59b6; +} + +#disk { + background-color: #964B00; +} + +#backlight { + background-color: #90b1b1; +} + +#network { + background-color: #2980b9; +} + +#network.disconnected { + background-color: #f53c3c; +} + +#pulseaudio { + background-color: #f1c40f; + color: #000000; +} + +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#wireplumber { + background-color: #fff0f5; + color: #000000; +} + +#wireplumber.muted { + background-color: #f53c3c; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #2980b9; +} + +#tray>.passive { + -gtk-icon-effect: dim; +} + +#tray>.needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#idle_inhibitor { + background-color: #2d3436; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#mpd { + background-color: #66cc99; + color: #2a5c45; +} + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + background-color: #90b1b1; +} + +#mpd.paused { + background-color: #51a37a; +} + +#language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state>label { + padding: 0 5px; +} + +#keyboard-state>label.locked { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad.empty { + background-color: transparent; +} + +#privacy { + padding: 0; +} + +#privacy-item { + padding: 0 5px; + color: white; +} + +#privacy-item.screenshare { + background-color: #cf5700; +} + +#privacy-item.audio-in { + background-color: #1ca000; +} + +#privacy-item.audio-out { + background-color: #0069d4; +} diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix index 26112fd5..ded0540b 100644 --- a/homeConfigurations/vinzenz/waybar.nix +++ b/homeConfigurations/vinzenz/waybar.nix @@ -12,6 +12,7 @@ enable = true; systemd.enable = true; systemd.target = "graphical-session.target"; + style = ./waybar.css; settings = { mainBar = { layer = "top"; From 908bc2dc8f39659745d314565134f9f08477423c Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 8 Nov 2025 15:13:06 +0100 Subject: [PATCH 0378/1295] waybar: remove backgrounds, border radius --- homeConfigurations/vinzenz/waybar.css | 57 ++++++++++++++------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/homeConfigurations/vinzenz/waybar.css b/homeConfigurations/vinzenz/waybar.css index 39b0038a..516adb04 100644 --- a/homeConfigurations/vinzenz/waybar.css +++ b/homeConfigurations/vinzenz/waybar.css @@ -2,18 +2,14 @@ /* `otf-font-awesome` is required to be installed for icons */ font-family: FontAwesome, sans-serif; font-size: 13px; - border: none; - border-radius: 0; color: #dcdfe1; } -#waybar { - background-color: rgba(0, 0, 0, 0); - border: none; - box-shadow: none; -} - window#waybar { + background: black; + /* border: none; */ + box-shadow: none; + color: #ffffff; transition-property: background-color; transition-duration: .5s; @@ -31,20 +27,30 @@ window#waybar.chromium { background-color: #000000; border: none; } +/* +window#waybar .modules-left, +window#waybar .modules-center, +window#waybar .modules-right { + border: 1px solid; + border-radius: 15px; + border-image-source: linear-gradient(90deg, #d162a4, #5BCEFA); +} + */ +box.horizontal { + padding: 4px 4px 0px 4px; +} #workspaces, #window, #tray { background-color: rgba(15, 27, 53, 0.9); padding: 4px 6px; - margin-top: 6px; margin-left: 6px; margin-right: 6px; border-radius: 15px; border-width: 0px; } - button { /* Use box-shadow instead of border so the text isn't offset */ box-shadow: inset 0 -3px transparent; @@ -68,6 +74,7 @@ button:hover { padding: 0 5px; background-color: transparent; color: #ffffff; + border-radius: 15px; } #workspaces button:hover { @@ -77,7 +84,6 @@ button:hover { #workspaces button.focused, #workspaces button.active { background-color: #64727D; - box-shadow: inset 0 -3px #ffffff; } #workspaces button.urgent { @@ -100,7 +106,6 @@ button:hover { #pulseaudio, #wireplumber, #custom-media, -#tray, #mode, #idle_inhibitor, #scratchpad, @@ -124,7 +129,7 @@ button:hover { .modules-right>widget:last-child>#workspaces { margin-right: 0; } - +/* #clock { background-color: #64727D; } @@ -139,7 +144,7 @@ button:hover { color: #ffffff; background-color: #26A65B; } - + */ @keyframes blink { to { background-color: #ffffff; @@ -163,20 +168,17 @@ button:hover { } #power-profiles-daemon.performance { - background-color: #f53c3c; - color: #ffffff; + color: #f53c3c; } #power-profiles-daemon.balanced { - background-color: #2980b9; - color: #ffffff; + color: #2980b9; } #power-profiles-daemon.power-saver { - background-color: #2ecc71; - color: #000000; + color: #2ecc71; } - +/* label:focus { background-color: #000000; } @@ -224,7 +226,6 @@ label:focus { #wireplumber.muted { background-color: #f53c3c; } - #custom-media { background-color: #66cc99; color: #2a5c45; @@ -251,6 +252,7 @@ label:focus { background-color: #2980b9; } + */ #tray>.passive { -gtk-icon-effect: dim; } @@ -259,7 +261,7 @@ label:focus { -gtk-icon-effect: highlight; background-color: #eb4d4b; } - +/* #idle_inhibitor { background-color: #2d3436; } @@ -285,18 +287,19 @@ label:focus { #mpd.paused { background-color: #51a37a; } +*/ -#language { +#language {/* background: #00b093; - color: #740864; + color: #740864; */ padding: 0 5px; margin: 0 5px; min-width: 16px; } -#keyboard-state { +#keyboard-state {/* background: #97e1ad; - color: #000000; + color: #000000; */ padding: 0 0px; margin: 0 5px; min-width: 16px; From 9218e7099935815c14cf6b1b687ccb3413362467 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 9 Nov 2025 14:47:03 +0100 Subject: [PATCH 0379/1295] add treefmt config to also format css and json --- flake.lock | 21 +++ flake.nix | 26 ++- .../vinzenz/.config/containers/policy.json | 40 ++-- homeConfigurations/vinzenz/vscode.nix | 4 + homeConfigurations/vinzenz/waybar.css | 172 +++++++++--------- 5 files changed, 156 insertions(+), 107 deletions(-) diff --git a/flake.lock b/flake.lock index 2a6ee849..7911ae46 100644 --- a/flake.lock +++ b/flake.lock @@ -307,6 +307,7 @@ "servicepoint-cli": "servicepoint-cli", "servicepoint-simulator": "servicepoint-simulator", "servicepoint-tanks": "servicepoint-tanks", + "treefmt-nix": "treefmt-nix", "zerforschen-plus": "zerforschen-plus" } }, @@ -410,6 +411,26 @@ "url": "https://git.berlin.ccc.de/vinzenz/servicepoint-tanks.git" } }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1762410071, + "narHash": "sha256-aF5fvoZeoXNPxT0bejFUBXeUjXfHLSL7g+mjR/p5TEg=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "97a30861b13c3731a84e09405414398fbf3e109f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "xwayland-satellite-stable": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 140b27ef..5b04ab0b 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + zerforschen-plus = { url = "git+https://git.berlin.ccc.de/vinzenz/zerforschen.plus"; inputs.nixpkgs.follows = "nixpkgs"; @@ -49,6 +54,7 @@ zerforschen-plus, nixpkgs-unstable, nix-vscode-extensions, + treefmt-nix, servicepoint-cli, servicepoint-simulator, servicepoint-tanks, @@ -113,6 +119,14 @@ inherit (nixpkgs) lib; forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) devices; supported-systems = lib.attrsets.mapAttrsToList (k: v: v.system) devices; + treefmt-config = { + projectRootFile = "flake.nix"; + programs = { + nixfmt.enable = true; + jsonfmt.enable = true; + prettier.enable = true; + }; + }; forAllSystems = f: lib.genAttrs supported-systems ( @@ -120,6 +134,7 @@ f rec { inherit system; pkgs = nixpkgs.legacyPackages.${system}; + treefmt-eval = treefmt-nix.lib.evalModule pkgs treefmt-config; } ); importModuleDir = @@ -168,8 +183,6 @@ ronja = ./homeConfigurations/ronja; }; - formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); - nixosConfigurations = forDevice ( { device, @@ -268,5 +281,14 @@ ++ additional-modules; } ); + + formatter = forAllSystems ({ treefmt-eval, ... }: treefmt-eval.config.build.wrapper); + + checks = forAllSystems ( + { treefmt-eval, ... }: + { + formatting = treefmt-eval.config.build.check self; + } + ); }; } diff --git a/homeConfigurations/vinzenz/.config/containers/policy.json b/homeConfigurations/vinzenz/.config/containers/policy.json index d1f9b603..245b3df4 100644 --- a/homeConfigurations/vinzenz/.config/containers/policy.json +++ b/homeConfigurations/vinzenz/.config/containers/policy.json @@ -1,23 +1,23 @@ { - "default": [ - { - "type": "reject" - } - ], - "transports": { - "docker-daemon": { - "": [ - { - "type": "insecureAcceptAnything" - } - ] - }, - "docker": { - "docker.io/library/debian": [ - { - "type": "insecureAcceptAnything" - } - ] - } + "default": [ + { + "type": "reject" } + ], + "transports": { + "docker-daemon": { + "": [ + { + "type": "insecureAcceptAnything" + } + ] + }, + "docker": { + "docker.io/library/debian": [ + { + "type": "insecureAcceptAnything" + } + ] + } + } } diff --git a/homeConfigurations/vinzenz/vscode.nix b/homeConfigurations/vinzenz/vscode.nix index 3ddfa78b..481d02fa 100644 --- a/homeConfigurations/vinzenz/vscode.nix +++ b/homeConfigurations/vinzenz/vscode.nix @@ -87,6 +87,10 @@ "\[nix\]" = { "editor.formatOnSave" = false; }; + + "\[css\]" = { + "editor.formatOnSave" = false; + }; }; }; }; diff --git a/homeConfigurations/vinzenz/waybar.css b/homeConfigurations/vinzenz/waybar.css index 516adb04..2a33940f 100644 --- a/homeConfigurations/vinzenz/waybar.css +++ b/homeConfigurations/vinzenz/waybar.css @@ -1,31 +1,31 @@ * { - /* `otf-font-awesome` is required to be installed for icons */ - font-family: FontAwesome, sans-serif; - font-size: 13px; - color: #dcdfe1; + /* `otf-font-awesome` is required to be installed for icons */ + font-family: FontAwesome, sans-serif; + font-size: 13px; + color: #dcdfe1; } window#waybar { - background: black; - /* border: none; */ - box-shadow: none; + background: black; + /* border: none; */ + box-shadow: none; - color: #ffffff; - transition-property: background-color; - transition-duration: .5s; + color: #ffffff; + transition-property: background-color; + transition-duration: 0.5s; } window#waybar.hidden { - opacity: 0.2; + opacity: 0.2; } window#waybar.termite { - background-color: #3F3F3F; + background-color: #3f3f3f; } window#waybar.chromium { - background-color: #000000; - border: none; + background-color: #000000; + border: none; } /* window#waybar .modules-left, @@ -37,62 +37,62 @@ window#waybar .modules-right { } */ box.horizontal { - padding: 4px 4px 0px 4px; + padding: 4px 4px 0px 4px; } #workspaces, #window, #tray { - background-color: rgba(15, 27, 53, 0.9); - padding: 4px 6px; - margin-left: 6px; - margin-right: 6px; - border-radius: 15px; - border-width: 0px; + background-color: rgba(15, 27, 53, 0.9); + padding: 4px 6px; + margin-left: 6px; + margin-right: 6px; + border-radius: 15px; + border-width: 0px; } button { - /* Use box-shadow instead of border so the text isn't offset */ - box-shadow: inset 0 -3px transparent; - /* Avoid rounded borders under each button name */ - border: none; - border-radius: 0; + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; } /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ button:hover { - background: inherit; - box-shadow: inset 0 -3px #ffffff; + background: inherit; + box-shadow: inset 0 -3px #ffffff; } /* you can set a style on hover for any module like this */ #pulseaudio:hover { - background-color: #a37800; + background-color: #a37800; } #workspaces button { - padding: 0 5px; - background-color: transparent; - color: #ffffff; - border-radius: 15px; + padding: 0 5px; + background-color: transparent; + color: #ffffff; + border-radius: 15px; } #workspaces button:hover { - background: rgba(0, 0, 0, 0.2); + background: rgba(0, 0, 0, 0.2); } #workspaces button.focused, #workspaces button.active { - background-color: #64727D; + background-color: #64727d; } #workspaces button.urgent { - background-color: #eb4d4b; + background-color: #eb4d4b; } #mode { - background-color: #64727D; - box-shadow: inset 0 -3px #ffffff; + background-color: #64727d; + box-shadow: inset 0 -3px #ffffff; } #clock, @@ -111,23 +111,23 @@ button:hover { #scratchpad, #power-profiles-daemon, #mpd { - padding: 0 10px; - color: #ffffff; + padding: 0 10px; + color: #ffffff; } #window, #workspaces { - margin: 0 4px; + margin: 0 4px; } /* If workspaces is the leftmost module, omit left margin */ -.modules-left>widget:first-child>#workspaces { - margin-left: 0; +.modules-left > widget:first-child > #workspaces { + margin-left: 0; } /* If workspaces is the rightmost module, omit right margin */ -.modules-right>widget:last-child>#workspaces { - margin-right: 0; +.modules-right > widget:last-child > #workspaces { + margin-right: 0; } /* #clock { @@ -146,37 +146,37 @@ button:hover { } */ @keyframes blink { - to { - background-color: #ffffff; - color: #000000; - } + to { + background-color: #ffffff; + color: #000000; + } } /* Using steps() instead of linear as a timing function to limit cpu usage */ #battery.critical:not(.charging) { - background-color: #f53c3c; - color: #ffffff; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: steps(12); - animation-iteration-count: infinite; - animation-direction: alternate; + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: steps(12); + animation-iteration-count: infinite; + animation-direction: alternate; } #power-profiles-daemon { - padding-right: 15px; + padding-right: 15px; } #power-profiles-daemon.performance { - color: #f53c3c; + color: #f53c3c; } #power-profiles-daemon.balanced { - color: #2980b9; + color: #2980b9; } #power-profiles-daemon.power-saver { - color: #2ecc71; + color: #2ecc71; } /* label:focus { @@ -253,13 +253,13 @@ label:focus { } */ -#tray>.passive { - -gtk-icon-effect: dim; +#tray > .passive { + -gtk-icon-effect: dim; } -#tray>.needs-attention { - -gtk-icon-effect: highlight; - background-color: #eb4d4b; +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; } /* #idle_inhibitor { @@ -289,55 +289,57 @@ label:focus { } */ -#language {/* +#language { + /* background: #00b093; color: #740864; */ - padding: 0 5px; - margin: 0 5px; - min-width: 16px; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; } -#keyboard-state {/* +#keyboard-state { + /* background: #97e1ad; color: #000000; */ - padding: 0 0px; - margin: 0 5px; - min-width: 16px; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; } -#keyboard-state>label { - padding: 0 5px; +#keyboard-state > label { + padding: 0 5px; } -#keyboard-state>label.locked { - background: rgba(0, 0, 0, 0.2); +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); } #scratchpad { - background: rgba(0, 0, 0, 0.2); + background: rgba(0, 0, 0, 0.2); } #scratchpad.empty { - background-color: transparent; + background-color: transparent; } #privacy { - padding: 0; + padding: 0; } #privacy-item { - padding: 0 5px; - color: white; + padding: 0 5px; + color: white; } #privacy-item.screenshare { - background-color: #cf5700; + background-color: #cf5700; } #privacy-item.audio-in { - background-color: #1ca000; + background-color: #1ca000; } #privacy-item.audio-out { - background-color: #0069d4; + background-color: #0069d4; } From 0679372363a5741729da136783f6423f5e622eaa Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 9 Nov 2025 15:06:18 +0100 Subject: [PATCH 0380/1295] waybar: remove cpu bars, re add power menu --- homeConfigurations/vinzenz/niri.nix | 6 +- homeConfigurations/vinzenz/waybar.nix | 82 +++++++++++---------------- 2 files changed, 37 insertions(+), 51 deletions(-) diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix index a6f01258..64cb58fc 100644 --- a/homeConfigurations/vinzenz/niri.nix +++ b/homeConfigurations/vinzenz/niri.nix @@ -172,10 +172,10 @@ # Suggested binds for running programs: terminal, app launcher, screen locker. "Mod+T".action.spawn = "${lib.getBin pkgs.gnome-console}/bin/kgx"; - "Mod+D".action.spawn = "fuzzel"; + "Mod+D".action.spawn = "${lib.getBin config.programs.fuzzel.package}/bin/fuzzel"; "Super+Alt+L" = { action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; - allow-when-locked=true; + allow-when-locked = true; }; # You can also use a shell. Do this if you need pipes, multiple commands, etc. @@ -406,7 +406,7 @@ "Mod+Shift+P".action.power-off-monitors = { }; "Mod+W".action.toggle-column-tabbed-display = { }; - "Mod+O".action.toggle-overview = {}; + "Mod+O".action.toggle-overview = { }; }; }; }; diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix index ded0540b..da1516bf 100644 --- a/homeConfigurations/vinzenz/waybar.nix +++ b/homeConfigurations/vinzenz/waybar.nix @@ -1,6 +1,7 @@ { pkgs, - device, + lib, + config, ... }: { @@ -34,7 +35,7 @@ ]; modules-right = [ "mpris" - "image" + #"image" "gamemode" "temperature" @@ -48,7 +49,7 @@ "power-profiles-daemon" "battery" "idle_inhibitor" - #"group/group-power" + "group/group-power" ]; "niri/workspaces" = { format = "{icon}"; @@ -114,25 +115,7 @@ }; cpu = { interval = 1; - format = - "{usage:3}%@{avg_frequency:4} " - + (builtins.getAttr device { - "vinzenz-lpt2" = - "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}{icon16}{icon17}{icon18}{icon19}"; - "vinzenz-pc2" = - "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}"; - }) - + " "; - format-icons = [ - "" - "" - "" - "" - "" - "" - "" - "" - ]; + format = "{usage:3}%@{avg_frequency:4}"; }; disk = { format = "{free}/{total}"; @@ -152,25 +135,28 @@ ]; }; "custom/quit" = { - "format" = "󰗼"; + "format" = "󰗼 "; "tooltip" = false; - "on-click" = "hyprctl dispatch exit"; + "on-click" = "niri msg action quit"; min-width = 20; }; "custom/lock" = { - "format" = "󰍁"; + "format" = "󰍁 "; "tooltip" = false; - "on-click" = "swaylock"; + "on-click" = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; + min-width = 20; }; "custom/reboot" = { - "format" = "󰜉"; + "format" = "󰜉 "; "tooltip" = false; - "on-click" = "reboot"; + "on-click" = "systemctl reboot"; + min-width = 20; }; "custom/power" = { - "format" = ""; + "format" = " "; "tooltip" = false; - "on-click" = "shutdown now"; + "on-click" = "systemctl shutdown"; + min-width = 20; }; idle_inhibitor = { format = "{icon}"; @@ -179,24 +165,24 @@ deactivated = ""; }; }; - image = - let - albumArtScript = pkgs.writeShellScriptBin "album-art.sh" '' - #!${pkgs.bash}/bin/bash - album_art=$(playerctl metadata mpris:artUrl) - if [[ -z $album_art ]] - then - exit - fi - curl -s "''${album_art}" --output "/tmp/cover.jpeg" - echo "/tmp/cover.jpeg" - ''; - in - { - exec = "${albumArtScript}/bin/album-art.sh"; - interval = 15; - on-click = "playerctl play-pause"; - }; + #image = + # let + # albumArtScript = pkgs.writeShellScriptBin "album-art.sh" '' + # #!${pkgs.bash}/bin/bash + # album_art=$(playerctl metadata mpris:artUrl) + # if [[ -z $album_art ]] + # then + # exit + # fi + # curl -s "''${album_art}" --output "/tmp/cover.jpeg" + # echo "/tmp/cover.jpeg" + # ''; + # in + # { + # exec = "${albumArtScript}/bin/album-art.sh"; + # interval = 15; + # on-click = "playerctl play-pause"; + # }; mpris = { format = "{title} "; tooltip-format = "{player} ({status}) {dynamic}"; From d83096186fd887f68dfe30e570440d029fb05b91 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 11 Nov 2025 12:08:04 +0100 Subject: [PATCH 0381/1295] keep-sorted, small tweaks to niri session --- flake.nix | 46 +++++++++++++++----------- homeConfigurations/vinzenz/default.nix | 14 +++++--- homeConfigurations/vinzenz/mako.nix | 3 ++ homeConfigurations/vinzenz/niri.nix | 4 --- 4 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 homeConfigurations/vinzenz/mako.nix diff --git a/flake.nix b/flake.nix index 5b04ab0b..5f12c875 100644 --- a/flake.nix +++ b/flake.nix @@ -125,6 +125,7 @@ nixfmt.enable = true; jsonfmt.enable = true; prettier.enable = true; + keep-sorted.enable = true; }; }; forAllSystems = @@ -226,17 +227,18 @@ ./nixosConfigurations/${device} - self.nixosModules.default - self.nixosModules.lix-is-nix - self.nixosModules.globalinstalls - self.nixosModules.autoupdate - self.nixosModules.openssh - self.nixosModules.tailscale + # keep-sorted start self.nixosModules.allowed-unfree-list + self.nixosModules.autoupdate + self.nixosModules.default self.nixosModules.extra-caches + self.nixosModules.globalinstalls + self.nixosModules.lix-is-nix + self.nixosModules.openssh self.nixosModules.systemd-boot - + self.nixosModules.tailscale zerforschen-plus.nixosModules.default + # keep-sorted end ] ++ (nixpkgs.lib.optionals (home-manager-users != { }) [ { @@ -250,33 +252,37 @@ home-manager.sharedModules = [ { home.stateVersion = "22.11"; } + # keep-sorted start self.homeModules.adwaita self.homeModules.git + self.homeModules.gnome-extensions + self.homeModules.nano self.homeModules.templates self.homeModules.zsh-basics - self.homeModules.nano - self.homeModules.gnome-extensions self.homeModules.zsh-powerlevel10k + # keep-sorted end ]; home-manager.users = home-manager-users; } - self.nixosModules.pkgs-unstable - self.nixosModules.pkgs-vscode-extensions - self.nixosModules.niri - self.nixosModules.kdeconnect - self.nixosModules.en-de - self.nixosModules.gnome - self.nixosModules.modern-desktop - self.nixosModules.nix-ld - self.nixosModules.quiet-boot - self.nixosModules.firmware-updates + # keep-sorted start home-manager.nixosModules.home-manager - servicepoint-simulator.nixosModules.default + self.nixosModules.en-de + self.nixosModules.firmware-updates + self.nixosModules.gnome + self.nixosModules.kdeconnect + self.nixosModules.modern-desktop + self.nixosModules.niri + self.nixosModules.nix-ld + self.nixosModules.pkgs-unstable + self.nixosModules.pkgs-vscode-extensions + self.nixosModules.quiet-boot servicepoint-cli.nixosModules.default + servicepoint-simulator.nixosModules.default servicepoint-tanks.nixosModules.default + # keep-sorted end ]) ++ additional-modules; } diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index 50287b7f..4a2ff598 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -1,18 +1,21 @@ { pkgs, ... }: { imports = [ + # keep-sorted start ./editorconfig.nix + ./fonts.nix ./fuzzel.nix ./git.nix ./gnome.nix - ./ssh.nix - ./vscode.nix - ./zsh.nix - ./starship.nix - ./fonts.nix + ./mako.nix ./niri.nix + ./ssh.nix + ./starship.nix ./swaylock.nix + ./vscode.nix ./waybar.nix + ./zsh.nix + # keep-sorted end ]; config = { @@ -56,6 +59,7 @@ wireguard-tools wirelesstools + tailscale kdiff3 jetbrains-toolbox diff --git a/homeConfigurations/vinzenz/mako.nix b/homeConfigurations/vinzenz/mako.nix new file mode 100644 index 00000000..b8052a45 --- /dev/null +++ b/homeConfigurations/vinzenz/mako.nix @@ -0,0 +1,3 @@ +{ + services.mako.enable = true; +} diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix index 64cb58fc..ba835c97 100644 --- a/homeConfigurations/vinzenz/niri.nix +++ b/homeConfigurations/vinzenz/niri.nix @@ -9,7 +9,6 @@ home.sessionVariables.NIXOS_OZONE_WL = "1"; home.packages = with pkgs; [ xwayland-satellite - alacritty ]; qt.style = { @@ -17,8 +16,6 @@ name = "adwaita-dark"; }; - services.mako.enable = true; - programs.niri.settings = { outputs = { "BOE 0x0A3B Unknown" = { @@ -61,7 +58,6 @@ { background-color = "#000000"; gaps = gap-size; - #default-column-display = "tabbed"; border = { enable = true; width = gap-size / 2; From f005a7976a168cb17de43edf22f7ab54886457fb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 11 Nov 2025 13:15:22 +0100 Subject: [PATCH 0382/1295] inputs: add stylix, dedup transitive deps --- flake.lock | 436 +++++++++++++++++++++++++++++++++++++++++------------ flake.nix | 96 +++++++++--- 2 files changed, 416 insertions(+), 116 deletions(-) diff --git a/flake.lock b/flake.lock index 7911ae46..b381ea70 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,73 @@ { "nodes": { + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1746562888, + "narHash": "sha256-YgNJQyB5dQiwavdDFBMNKk1wyS77AtdgDk/VtU6wEaI=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "806a1777a5db2a1ef9d5d6f493ef2381047f2b89", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1754405784, + "narHash": "sha256-l9xHIy+85FN+bEo6yquq2IjD1rSg9fjfjpyGP1W8YXo=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "23ae20a0093dca0d7b39d76ba2401af0ccf9c561", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "rev": "23ae20a0093dca0d7b39d76ba2401af0ccf9c561", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1748408240, + "narHash": "sha256-9M2b1rMyMzJK0eusea0x3lyh3mu5nMeEDSc4RZkGm+g=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "6c711ab1a9db6f51e2f6887cc3345530b33e152e", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, "binding": { "inputs": { "binding": "binding_2", @@ -47,7 +115,6 @@ "fenix": { "inputs": { "nixpkgs": [ - "servicepoint-cli", "naersk", "nixpkgs" ], @@ -67,26 +134,70 @@ "type": "github" } }, - "fenix_2": { - "inputs": { - "nixpkgs": [ - "servicepoint-simulator", - "naersk", - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src_2" - }, + "firefox-gnome-theme": { + "flake": false, "locked": { - "lastModified": 1752475459, - "narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=", - "owner": "nix-community", - "repo": "fenix", - "rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f", + "lastModified": 1748383148, + "narHash": "sha256-pGvD/RGuuPf/4oogsfeRaeMm6ipUIznI2QSILKjKzeA=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "4eb2714fbed2b80e234312611a947d6cb7d70caf", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "fenix", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1762810396, + "narHash": "sha256-dxFVgQPG+R72dkhXTtqUm7KpxElw3u6E+YlQ2WaDgt8=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "0bdadb1b265fb4143a75bd1ec7d8c915898a9923", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1744584021, + "narHash": "sha256-0RJ4mJzf+klKF4Fuoc8VN8dpQQtZnKksFmR2jhWE1Ew=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "52c517c8f6c199a1d6f5118fae500ef69ea845ae", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "48.1", + "repo": "gnome-shell", "type": "github" } }, @@ -115,29 +226,6 @@ "inputs": { "fenix": "fenix", "nixpkgs": [ - "servicepoint-cli", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1752689277, - "narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=", - "owner": "nix-community", - "repo": "naersk", - "rev": "0e72363d0938b0208d6c646d10649164c43f4d64", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "naersk", - "type": "github" - } - }, - "naersk_2": { - "inputs": { - "fenix": "fenix_2", - "nixpkgs": [ - "servicepoint-simulator", "nixpkgs" ] }, @@ -169,11 +257,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1762026425, - "narHash": "sha256-7eDtQrr+CRZ1pLjJ6Bx7Ab9pUIowXJ7ooqEh6p3jIn8=", + "lastModified": 1762857797, + "narHash": "sha256-puoFJGlbL6khrQKozCO6Wgpq/IhA2Sfnz+ui/87lbQQ=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "342730d4f8e109f3506932d2be1c8f9ab19a7039", + "rev": "2ff3443b4226f6721a43b75e76b6ca59caa34fec", "type": "github" }, "original": { @@ -202,11 +290,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1761888958, - "narHash": "sha256-YgArUHI81Esn6fOCwVSrMI2G4RI3f3BPbRbPWsJubAc=", + "lastModified": 1762854265, + "narHash": "sha256-iykTzCzU8hI7b8LvAquYY4Asl2xj3AcLzWZv6rm8MGY=", "owner": "YaLTeR", "repo": "niri", - "rev": "e2576879216a39e5c45b9d2906531bc2065e724c", + "rev": "fb2f67c8a036f674e9101e15a7bb1cf61524ebde", "type": "github" }, "original": { @@ -217,26 +305,11 @@ }, "nix-filter": { "locked": { - "lastModified": 1731533336, - "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", + "lastModified": 1757882181, + "narHash": "sha256-+cCxYIh2UNalTz364p+QYmWHs0P+6wDhiWR4jDIKQIU=", "owner": "numtide", "repo": "nix-filter", - "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "nix-filter", - "type": "github" - } - }, - "nix-filter_2": { - "locked": { - "lastModified": 1731533336, - "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", + "rev": "59c44d1909c72441144b93cf0f054be7fe764de5", "type": "github" }, "original": { @@ -252,11 +325,11 @@ ] }, "locked": { - "lastModified": 1762048816, - "narHash": "sha256-gAGed5eYA6WTVQSMELyi+168A9N2UNEjwXn5xm0czsk=", + "lastModified": 1762826252, + "narHash": "sha256-7VqX6Z8Pq5DzVV5YM7o92vC6goNGtucCv71dXwpy01Q=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "c8261cd60b0623635b4b88ae0f75ac3bfeddf260", + "rev": "f10a42469c4db9b4ae7b3cd3a5c0d8bffb4a8b98", "type": "github" }, "original": { @@ -267,11 +340,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1761999846, - "narHash": "sha256-IYlYnp4O4dzEpL77BD/lj5NnJy2J8qbHkNSFiPBCbqo=", + "lastModified": 1762756533, + "narHash": "sha256-HiRDeUOD1VLklHeOmaKDzf+8Hb7vSWPVFcWwaTrpm+U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de8f8d73e35724bf9abef41f1bdbedda1e14a31", + "rev": "c2448301fb856e351aab33e64c33a3fc8bcf637d", "type": "github" }, "original": { @@ -281,13 +354,28 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1761765539, + "narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "719359f4562934ae99f5443f20aa06c2ffff91fc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs-unstable": { "locked": { - "lastModified": 1761880412, - "narHash": "sha256-QoJjGd4NstnyOG4mm4KXF+weBzA2AH/7gn1Pmpfcb0A=", + "lastModified": 1762482733, + "narHash": "sha256-g/da4FzvckvbiZT075Sb1/YDNDr+tGQgh4N8i5ceYMg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a7fc11be66bdfb5cdde611ee5ce381c183da8386", + "rev": "e1ebeec86b771e9d387dd02d82ffdc77ac753abc", "type": "github" }, "original": { @@ -297,16 +385,44 @@ "type": "github" } }, + "nur": { + "inputs": { + "flake-parts": [ + "flake-parts" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1762858278, + "narHash": "sha256-BYeYJFonJRt9xg6UYXpvVGK5j4NEOXHETRffPQT7drM=", + "owner": "nix-community", + "repo": "NUR", + "rev": "a053db755b35970d6a0ebd97aaceb8f629faa8e7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "root": { "inputs": { + "flake-parts": "flake-parts", "home-manager": "home-manager", + "naersk": "naersk", "niri": "niri", + "nix-filter": "nix-filter", "nix-vscode-extensions": "nix-vscode-extensions", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", + "nur": "nur", "servicepoint-cli": "servicepoint-cli", "servicepoint-simulator": "servicepoint-simulator", "servicepoint-tanks": "servicepoint-tanks", + "stylix": "stylix", "treefmt-nix": "treefmt-nix", "zerforschen-plus": "zerforschen-plus" } @@ -328,27 +444,14 @@ "type": "github" } }, - "rust-analyzer-src_2": { - "flake": false, - "locked": { - "lastModified": 1752428706, - "narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "591e3b7624be97e4443ea7b5542c191311aa141d", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - }, "servicepoint-cli": { "inputs": { - "naersk": "naersk", - "nix-filter": "nix-filter", + "naersk": [ + "naersk" + ], + "nix-filter": [ + "nix-filter" + ], "nixpkgs": [ "nixpkgs" ] @@ -369,8 +472,12 @@ }, "servicepoint-simulator": { "inputs": { - "naersk": "naersk_2", - "nix-filter": "nix-filter_2", + "naersk": [ + "naersk" + ], + "nix-filter": [ + "nix-filter" + ], "nixpkgs": [ "nixpkgs" ] @@ -411,6 +518,141 @@ "url": "https://git.berlin.ccc.de/vinzenz/servicepoint-tanks.git" } }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-parts": [ + "flake-parts" + ], + "gnome-shell": "gnome-shell", + "nixpkgs": [ + "nixpkgs" + ], + "nur": [ + "nur" + ], + "systems": "systems", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-schemes": "tinted-schemes", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1762295027, + "narHash": "sha256-5z5cGrp9F8g8iyQrM8WkB6pAwP4AaicljKZ15gx+X9Y=", + "owner": "nix-community", + "repo": "stylix", + "rev": "91b9a270523361268ba6a8772152fde31103869f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.05", + "repo": "stylix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1735730497, + "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "type": "github" + } + }, + "tinted-schemes": { + "flake": false, + "locked": { + "lastModified": 1750770351, + "narHash": "sha256-LI+BnRoFNRa2ffbe3dcuIRYAUcGklBx0+EcFxlHj0SY=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "5a775c6ffd6e6125947b393872cde95867d85a2a", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1751159871, + "narHash": "sha256-UOHBN1fgHIEzvPmdNMHaDvdRMgLmEJh2hNmDrp3d3LE=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "bded5e24407cec9d01bd47a317d15b9223a1546c", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1751158968, + "narHash": "sha256-ksOyv7D3SRRtebpXxgpG4TK8gZSKFc4TIZpR+C98jX8=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "86a470d94204f7652b906ab0d378e4231a5b3384", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -451,11 +693,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1761622056, - "narHash": "sha256-fBrUszJXmB4MY+wf3QsCnqWHcz7u7fLq0QMAWCltIQg=", + "lastModified": 1762747449, + "narHash": "sha256-Z1TKiux8K09a93w4PFDFsj8HFugXNy3iCC3Z8MpR5Rk=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "0728d59ff6463a502e001fb090f6eb92dbc04756", + "rev": "6338574bc5c036487486acde264f38f39ea15fad", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 5f12c875..4b9be45c 100644 --- a/flake.nix +++ b/flake.nix @@ -8,41 +8,69 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + #keep-sorted start block=yes + flake-parts = { + url = "github:hercules-ci/flake-parts"; + #inputs.nixpkgs.follows = "nixpkgs"; + }; + naersk = { + url = "github:nix-community/naersk"; + inputs.nixpkgs.follows = "nixpkgs"; + }; niri = { url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs-stable.follows = "nixpkgs"; }; - + nix-filter.url = "github:numtide/nix-filter"; nix-vscode-extensions = { url = "github:nix-community/nix-vscode-extensions"; inputs.nixpkgs.follows = "nixpkgs"; }; - - treefmt-nix = { - url = "github:numtide/treefmt-nix"; - inputs.nixpkgs.follows = "nixpkgs"; + nur = { + url = "github:nix-community/NUR"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-parts.follows = "flake-parts"; + }; }; - - zerforschen-plus = { - url = "git+https://git.berlin.ccc.de/vinzenz/zerforschen.plus"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - servicepoint-cli = { url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git"; - inputs.nixpkgs.follows = "nixpkgs"; + inputs = { + nixpkgs.follows = "nixpkgs"; + naersk.follows = "naersk"; + nix-filter.follows = "nix-filter"; + }; }; - servicepoint-simulator = { url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git"; - inputs.nixpkgs.follows = "nixpkgs"; + inputs = { + nixpkgs.follows = "nixpkgs"; + naersk.follows = "naersk"; + nix-filter.follows = "nix-filter"; + }; }; - servicepoint-tanks = { url = "git+https://git.berlin.ccc.de/vinzenz/servicepoint-tanks.git?ref=service-improvements"; inputs.nixpkgs.follows = "nixpkgs"; }; + stylix = { + url = "github:nix-community/stylix/release-25.05"; + inputs = { + nixpkgs.follows = "nixpkgs"; + nur.follows = "nur"; + flake-parts.follows = "flake-parts"; + }; + }; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + zerforschen-plus = { + url = "git+https://git.berlin.ccc.de/vinzenz/zerforschen.plus"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + #keep-sorted end }; outputs = @@ -50,14 +78,18 @@ self, nixpkgs, home-manager, + # keep-sorted start niri, - zerforschen-plus, - nixpkgs-unstable, nix-vscode-extensions, - treefmt-nix, + nixpkgs-unstable, servicepoint-cli, servicepoint-simulator, servicepoint-tanks, + stylix, + treefmt-nix, + zerforschen-plus, + # keep-sorted end + ... }: let devices = { @@ -266,8 +298,33 @@ home-manager.users = home-manager-users; } - # keep-sorted start + ( + { pkgs, ... }: + { + stylix = { + enable = true; + base16Scheme = "${pkgs.base16-schemes}/share/themes/edge-dark.yaml"; + polarity = "dark"; + targets = { + gnome.enable = false; + }; + fonts = { + monospace = { + name = "FiraCode Nerd Font Mono"; + package = pkgs.nerd-fonts.fira-code; + }; + }; + /* + homeManagerIntegration = { + autoImport = false; + followSystem = false; + }; + */ + }; + } + ) + # keep-sorted start home-manager.nixosModules.home-manager self.nixosModules.en-de self.nixosModules.firmware-updates @@ -282,6 +339,7 @@ servicepoint-cli.nixosModules.default servicepoint-simulator.nixosModules.default servicepoint-tanks.nixosModules.default + stylix.nixosModules.stylix # keep-sorted end ]) ++ additional-modules; From 8ceebd9b2250c61caafef36345d46ee363df022f Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 11 Nov 2025 15:23:24 +0100 Subject: [PATCH 0383/1295] stylix: initial config --- flake.nix | 28 +----- homeConfigurations/ronja/vscode.nix | 1 - homeConfigurations/vinzenz/fonts.nix | 7 +- homeConfigurations/vinzenz/fuzzel.nix | 14 --- homeConfigurations/vinzenz/starship.nix | 120 +----------------------- homeConfigurations/vinzenz/vscode.nix | 1 - homeConfigurations/vinzenz/waybar.nix | 2 +- homeModules/adwaita.nix | 12 --- nixosModules/stylix.nix | 35 +++++++ 9 files changed, 42 insertions(+), 178 deletions(-) delete mode 100644 homeModules/adwaita.nix create mode 100644 nixosModules/stylix.nix diff --git a/flake.nix b/flake.nix index 4b9be45c..9d1a457e 100644 --- a/flake.nix +++ b/flake.nix @@ -285,7 +285,6 @@ home-manager.sharedModules = [ { home.stateVersion = "22.11"; } # keep-sorted start - self.homeModules.adwaita self.homeModules.git self.homeModules.gnome-extensions self.homeModules.nano @@ -298,32 +297,6 @@ home-manager.users = home-manager-users; } - ( - { pkgs, ... }: - { - stylix = { - enable = true; - base16Scheme = "${pkgs.base16-schemes}/share/themes/edge-dark.yaml"; - polarity = "dark"; - targets = { - gnome.enable = false; - }; - fonts = { - monospace = { - name = "FiraCode Nerd Font Mono"; - package = pkgs.nerd-fonts.fira-code; - }; - }; - /* - homeManagerIntegration = { - autoImport = false; - followSystem = false; - }; - */ - }; - } - ) - # keep-sorted start home-manager.nixosModules.home-manager self.nixosModules.en-de @@ -336,6 +309,7 @@ self.nixosModules.pkgs-unstable self.nixosModules.pkgs-vscode-extensions self.nixosModules.quiet-boot + self.nixosModules.stylix servicepoint-cli.nixosModules.default servicepoint-simulator.nixosModules.default servicepoint-tanks.nixosModules.default diff --git a/homeConfigurations/ronja/vscode.nix b/homeConfigurations/ronja/vscode.nix index 5a4ac7f1..5226411e 100644 --- a/homeConfigurations/ronja/vscode.nix +++ b/homeConfigurations/ronja/vscode.nix @@ -27,7 +27,6 @@ "files.autoSaveWhenNoErrors" = true; "files.autoSaveWorkspaceFilesOnly" = true; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; "editor.fontLigatures" = true; "editor.formatOnSave" = true; "editor.formatOnSaveMode" = "modificationsIfAvailable"; diff --git a/homeConfigurations/vinzenz/fonts.nix b/homeConfigurations/vinzenz/fonts.nix index 6553c2a6..ebda6739 100644 --- a/homeConfigurations/vinzenz/fonts.nix +++ b/homeConfigurations/vinzenz/fonts.nix @@ -1,12 +1,9 @@ { pkgs, ... }: { - fonts.fontconfig = { - enable = true; - defaultFonts.monospace = [ "FiraCode Nerd Font Mono" ]; - }; + fonts.fontconfig.enable = true; home.packages = with pkgs; [ - nerd-fonts.fira-code roboto-mono recursive + font-awesome ]; } diff --git a/homeConfigurations/vinzenz/fuzzel.nix b/homeConfigurations/vinzenz/fuzzel.nix index faf38143..bf337080 100644 --- a/homeConfigurations/vinzenz/fuzzel.nix +++ b/homeConfigurations/vinzenz/fuzzel.nix @@ -7,22 +7,8 @@ terminal = "${lib.getBin pkgs.gnome-console}/bin/kgx"; icon-theme = "Adwaita"; counter = true; - font = "sans:size=11"; launch-prefix = "niri msg action spawn --"; }; - colors = { - border = "0003B3FF"; - background = "0F0F0FFF"; - text = "657b83ff"; - prompt = "586e75ff"; - placeholder = "93a1a1ff"; - input = "657b83ff"; - match = "cb4b16ff"; - selection = "eee8d5ff"; - selection-text = "586e75ff"; - selection-match = "cb4b16ff"; - counter = "93a1a1ff"; - }; border = { radius = 30; width = 3; diff --git a/homeConfigurations/vinzenz/starship.nix b/homeConfigurations/vinzenz/starship.nix index 003e0223..458058de 100644 --- a/homeConfigurations/vinzenz/starship.nix +++ b/homeConfigurations/vinzenz/starship.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, ... }: { config.programs.starship = { enable = true; @@ -15,7 +15,8 @@ + "([ $cmd_duration$status](bg:color_y fg:text_y))[](fg:color_y)" + "$line_break$character "; - palette = "color_me_surprised"; + # TODO: replace with base16 theme + palette = lib.mkForce "color_me_surprised"; palettes.color_me_surprised = { "color_r" = "#a30262"; "color_g" = "#d162a4"; @@ -210,121 +211,6 @@ swift.symbol = ""; zig.symbol = ""; gradle.symbol = ""; - - palettes = { - catppuccin_mocha = { - rosewater = "#f5e0dc"; - flamingo = "#f2cdcd"; - pink = "#f5c2e7"; - mauve = "#cba6f7"; - red = "#f38ba8"; - maroon = "#eba0ac"; - peach = "#fab387"; - yellow = "#f9e2af"; - green = "#a6e3a1"; - teal = "#94e2d5"; - sky = "#89dceb"; - sapphire = "#74c7ec"; - blue = "#89b4fa"; - lavender = "#b4befe"; - text = "#cdd6f4"; - subtext1 = "#bac2de"; - subtext0 = "#a6adc8"; - overlay2 = "#9399b2"; - overlay1 = "#7f849c"; - overlay0 = "#6c7086"; - surface2 = "#585b70"; - surface1 = "#45475a"; - surface0 = "#313244"; - base = "#1e1e2e"; - mantle = "#181825"; - crust = "#11111b"; - }; - catppuccin_frappe = { - rosewater = "#f2d5cf"; - flamingo = "#eebebe"; - pink = "#f4b8e4"; - mauve = "#ca9ee6"; - red = "#e78284"; - maroon = "#ea999c"; - peach = "#ef9f76"; - yellow = "#e5c890"; - green = "#a6d189"; - teal = "#81c8be"; - sky = "#99d1db"; - sapphire = "#85c1dc"; - blue = "#8caaee"; - lavender = "#babbf1"; - text = "#c6d0f5"; - subtext1 = "#b5bfe2"; - subtext0 = "#a5adce"; - overlay2 = "#949cbb"; - overlay1 = "#838ba7"; - overlay0 = "#737994"; - surface2 = "#626880"; - surface1 = "#51576d"; - surface0 = "#414559"; - base = "#303446"; - mantle = "#292c3c"; - crust = "#232634"; - }; - catppuccin_latte = { - rosewater = "#dc8a78"; - flamingo = "#dd7878"; - pink = "#ea76cb"; - mauve = "#8839ef"; - red = "#d20f39"; - maroon = "#e64553"; - peach = "#fe640b"; - yellow = "#df8e1d"; - green = "#40a02b"; - teal = "#179299"; - sky = "#04a5e5"; - sapphire = "#209fb5"; - blue = "#1e66f5"; - lavender = "#7287fd"; - text = "#4c4f69"; - subtext1 = "#5c5f77"; - subtext0 = "#6c6f85"; - overlay2 = "#7c7f93"; - overlay1 = "#8c8fa1"; - overlay0 = "#9ca0b0"; - surface2 = "#acb0be"; - surface1 = "#bcc0cc"; - surface0 = "#ccd0da"; - base = "#eff1f5"; - mantle = "#e6e9ef"; - crust = "#dce0e8"; - }; - catppuccin_macchiato = { - rosewater = "#f4dbd6"; - flamingo = "#f0c6c6"; - pink = "#f5bde6"; - mauve = "#c6a0f6"; - red = "#ed8796"; - maroon = "#ee99a0"; - peach = "#f5a97f"; - yellow = "#eed49f"; - green = "#a6da95"; - teal = "#8bd5ca"; - sky = "#91d7e3"; - sapphire = "#7dc4e4"; - blue = "#8aadf4"; - lavender = "#b7bdf8"; - text = "#cad3f5"; - subtext1 = "#b8c0e0"; - subtext0 = "#a5adcb"; - overlay2 = "#939ab7"; - overlay1 = "#8087a2"; - overlay0 = "#6e738d"; - surface2 = "#5b6078"; - surface1 = "#494d64"; - surface0 = "#363a4f"; - base = "#24273a"; - mantle = "#1e2030"; - crust = "#181926"; - }; - }; }; }; } diff --git a/homeConfigurations/vinzenz/vscode.nix b/homeConfigurations/vinzenz/vscode.nix index 481d02fa..80bb9679 100644 --- a/homeConfigurations/vinzenz/vscode.nix +++ b/homeConfigurations/vinzenz/vscode.nix @@ -37,7 +37,6 @@ "files.autoSaveWhenNoErrors" = true; "files.autoSaveWorkspaceFilesOnly" = true; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; "editor.fontLigatures" = true; "editor.formatOnSave" = true; "editor.formatOnSaveMode" = "modificationsIfAvailable"; diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix index da1516bf..44d70992 100644 --- a/homeConfigurations/vinzenz/waybar.nix +++ b/homeConfigurations/vinzenz/waybar.nix @@ -13,7 +13,7 @@ enable = true; systemd.enable = true; systemd.target = "graphical-session.target"; - style = ./waybar.css; + style = lib.mkAfter (builtins.readFile ./waybar.css); settings = { mainBar = { layer = "top"; diff --git a/homeModules/adwaita.nix b/homeModules/adwaita.nix deleted file mode 100644 index 96d24c73..00000000 --- a/homeModules/adwaita.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: -{ - gtk = { - enable = true; - iconTheme.name = "Adwaita"; - cursorTheme.name = "Adwaita"; - theme = { - name = "adw-gtk3-dark"; - package = pkgs.adw-gtk3; - }; - }; -} diff --git a/nixosModules/stylix.nix b/nixosModules/stylix.nix new file mode 100644 index 00000000..fe10652f --- /dev/null +++ b/nixosModules/stylix.nix @@ -0,0 +1,35 @@ +{ pkgs, ... }: +{ + stylix = { + enable = true; + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + polarity = "dark"; + targets = { + gnome.enable = false; + gtk.enable = false; + gtksourceview.enable = false; + fontconfig.enable = true; + }; + fonts = { + sansSerif = { + name = "Inter"; + package = pkgs.inter; + }; + monospace = { + name = "FiraCode Nerd Font Mono"; + package = pkgs.nerd-fonts.fira-code; + }; + }; + icons = { + enable = true; + dark = "Adwaita"; + light = "Adwaita"; + package = pkgs.adwaita-icon-theme; + }; + cursor = { + name = "Adwaita"; + size = 16; + package = pkgs.adwaita-icon-theme; + }; + }; +} From 4267f9e95120718ba540c3b092e46a58e6b529ee Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 11 Nov 2025 16:45:46 +0100 Subject: [PATCH 0384/1295] remove check --- check | 6 ------ 1 file changed, 6 deletions(-) delete mode 100755 check diff --git a/check b/check deleted file mode 100755 index 1760cfee..00000000 --- a/check +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail - -nix fmt - -nix flake check --show-trace From c0b36e1e1f6a706c6af7c2dacd50456986a6d357 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 11 Nov 2025 17:14:37 +0100 Subject: [PATCH 0385/1295] add trayscale --- homeConfigurations/vinzenz/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index 4a2ff598..34ea693a 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -88,5 +88,7 @@ }; "idea.properties".text = "idea.filewatcher.executable.path = ${pkgs.fsnotifier}/bin/fsnotifier"; }; + + services.trayscale.enable = true; }; } From e8f183276d9a1e30067b71eaaaf66c3cc1de1415 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 11 Nov 2025 17:24:45 +0100 Subject: [PATCH 0386/1295] mako: border radius and timeout --- homeConfigurations/vinzenz/mako.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/homeConfigurations/vinzenz/mako.nix b/homeConfigurations/vinzenz/mako.nix index b8052a45..c4bbcac9 100644 --- a/homeConfigurations/vinzenz/mako.nix +++ b/homeConfigurations/vinzenz/mako.nix @@ -1,3 +1,9 @@ { - services.mako.enable = true; + services.mako = { + enable = true; + settings = { + border-radius = 15; + default-timeout = 30 * 1000; + }; + }; } From 71e616f64d511756f47303eb465cadfb98141573 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 12 Nov 2025 00:30:41 +0100 Subject: [PATCH 0387/1295] swap mako with swaync --- homeConfigurations/vinzenz/default.nix | 2 +- homeConfigurations/vinzenz/mako.nix | 9 ------ homeConfigurations/vinzenz/swaync.nix | 6 ++++ homeConfigurations/vinzenz/waybar.nix | 43 +++++++++++++++++++++++--- 4 files changed, 45 insertions(+), 15 deletions(-) delete mode 100644 homeConfigurations/vinzenz/mako.nix create mode 100644 homeConfigurations/vinzenz/swaync.nix diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index 34ea693a..cdc5fdec 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -7,11 +7,11 @@ ./fuzzel.nix ./git.nix ./gnome.nix - ./mako.nix ./niri.nix ./ssh.nix ./starship.nix ./swaylock.nix + ./swaync.nix ./vscode.nix ./waybar.nix ./zsh.nix diff --git a/homeConfigurations/vinzenz/mako.nix b/homeConfigurations/vinzenz/mako.nix deleted file mode 100644 index c4bbcac9..00000000 --- a/homeConfigurations/vinzenz/mako.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - services.mako = { - enable = true; - settings = { - border-radius = 15; - default-timeout = 30 * 1000; - }; - }; -} diff --git a/homeConfigurations/vinzenz/swaync.nix b/homeConfigurations/vinzenz/swaync.nix new file mode 100644 index 00000000..8221c5ed --- /dev/null +++ b/homeConfigurations/vinzenz/swaync.nix @@ -0,0 +1,6 @@ +{ + services.swaync = { + enable = true; + settings = { }; + }; +} diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix index 44d70992..f117cb72 100644 --- a/homeConfigurations/vinzenz/waybar.nix +++ b/homeConfigurations/vinzenz/waybar.nix @@ -38,19 +38,29 @@ #"image" "gamemode" - "temperature" - "cpu" - "memory" - "disk" + "group/status-infos" + "wireplumber" "bluetooth" "backlight" "network" "power-profiles-daemon" - "battery" + "custom/swaync" "idle_inhibitor" "group/group-power" + ]; + + "group/status-infos" = { + orientation = "inherit"; + modules = [ + "battery" + "temperature" + "cpu" + "memory" + "disk" + ]; + }; "niri/workspaces" = { format = "{icon}"; }; @@ -225,6 +235,29 @@ tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%"; }; + "custom/swaync" = + let + swaync-client = "${lib.getBin config.services.swaync.package}/bin/swaync-client"; + in + { + tooltip = true; + format = "{0}{icon} "; + format-icons = { + notification = "󱅫"; + none = "󰂜"; + dnd-notification = "󰂠"; + dnd-none = "󰪓"; + inhibited-notification = "󰂛"; + inhibited-none = "󰪑"; + dnd-inhibited-notification = "󰂛"; + dnd-inhibited-none = "󰪑"; + }; + return-type = "json"; + exec = "${swaync-client} --subscribe-waybar"; + on-click = "${swaync-client} --toggle-panel --skip-wait"; + on-click-right = "${swaync-client} --toggle-dnd --skip-wait"; + escape = true; + }; }; }; }; From 88e15931b0204d2e4b2e416137a0375a1752f932 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 12 Nov 2025 00:58:10 +0100 Subject: [PATCH 0388/1295] waybar: group items --- homeConfigurations/vinzenz/waybar.nix | 30 ++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix index f117cb72..4de0a61b 100644 --- a/homeConfigurations/vinzenz/waybar.nix +++ b/homeConfigurations/vinzenz/waybar.nix @@ -26,7 +26,6 @@ spacing = "8"; modules-left = [ "niri/workspaces" - "tray" "niri/window" ]; modules-center = [ @@ -34,23 +33,26 @@ "clock" ]; modules-right = [ - "mpris" #"image" - "gamemode" - "group/status-infos" - - "wireplumber" - "bluetooth" - "backlight" - "network" - "power-profiles-daemon" - "custom/swaync" - "idle_inhibitor" + "tray" + "group/system-tray" "group/group-power" - ]; + "group/system-tray" = { + orientation = "inherit"; + modules = [ + "mpris" + "wireplumber" + "bluetooth" + "backlight" + "network" + "power-profiles-daemon" + "custom/swaync" + "idle_inhibitor" + ]; + }; "group/status-infos" = { orientation = "inherit"; modules = [ @@ -61,10 +63,10 @@ "disk" ]; }; + "niri/workspaces" = { format = "{icon}"; }; - "niri/window" = { separate-outputs = true; icon = true; From 1e056167120fc1be141414580d62216f4ae3dcd1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Wed, 12 Nov 2025 15:11:27 +0100 Subject: [PATCH 0389/1295] waybar: shorter mpris --- homeConfigurations/vinzenz/waybar.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix index 4de0a61b..9376427a 100644 --- a/homeConfigurations/vinzenz/waybar.nix +++ b/homeConfigurations/vinzenz/waybar.nix @@ -196,8 +196,13 @@ # on-click = "playerctl play-pause"; # }; mpris = { - format = "{title} "; - tooltip-format = "{player} ({status}) {dynamic}"; + format = "{status_icon} {player} "; + tooltip-format = "{player} ({status_icon} {status}) {dynamic}"; + status-icons = { + playing = ""; + paused = "󰏤"; + stopped = "󰓛"; + }; }; memory = { format = "{}% "; @@ -227,6 +232,7 @@ }; tray = { spacing = 4; + show-passive-items = true; }; bluetooth = { format = "  {status} "; From 311571156439df289f740ac1540af0e5127a64df Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 13 Nov 2025 12:52:14 +0100 Subject: [PATCH 0390/1295] waybar: battery tweaks --- homeConfigurations/vinzenz/waybar.nix | 48 ++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix index 9376427a..a26ed9d4 100644 --- a/homeConfigurations/vinzenz/waybar.nix +++ b/homeConfigurations/vinzenz/waybar.nix @@ -112,12 +112,50 @@ battery = { format = "{capacity}% {icon}"; format-icons = [ - "" - "" - "" - "" - "" + "󰂎" # 0% + "󰁺" # 10% + "󰁻" # 20% + "󰁼" # 30% + "󰁽" # 40% + "󰁾" # 50% + "󰁿" # 60% + "󰂀" # 70% + "󰂁" # 80% + "󰂂" # 90% + "󱟢" # 100% ]; + states = { + warning = 25; + critical = 15; + }; + events = + let + mkNotifySendCommand = + { + summary, + urgency ? null, + body ? null, + icon ? null, + }: + let + body-part = if body != null then "'${body}'" else ""; + urgency-part = if urgency != null then "--urgency ${urgency}" else ""; + icon-part = if icon != null then "--icon ${icon}" else ""; + in + "${lib.getBin pkgs.libnotify}/bin/notify-send ${urgency-part} ${icon-part} '${summary}' ${body-part}"; + in + { + on-discharging-warning = mkNotifySendCommand { + summary = "Low Battery"; + icon = "battery-caution"; + }; + on-discharging-critical = mkNotifySendCommand { + urgency = "critical"; + summary = "Very Low Battery"; + body = "Connect to power now!"; + icon = "battery-low"; + }; + }; }; backlight = { device = "intel_backlight"; From ad07823b87d4b3d8e636e01615dc5957119ffe77 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 13 Nov 2025 15:24:00 +0100 Subject: [PATCH 0391/1295] stylix: sans-serif Inter waybar: change font to system sans-serif --- homeConfigurations/vinzenz/fonts.nix | 1 - homeConfigurations/vinzenz/waybar.css | 4 ++-- nixosModules/stylix.nix | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/homeConfigurations/vinzenz/fonts.nix b/homeConfigurations/vinzenz/fonts.nix index ebda6739..2d001a7a 100644 --- a/homeConfigurations/vinzenz/fonts.nix +++ b/homeConfigurations/vinzenz/fonts.nix @@ -4,6 +4,5 @@ home.packages = with pkgs; [ roboto-mono recursive - font-awesome ]; } diff --git a/homeConfigurations/vinzenz/waybar.css b/homeConfigurations/vinzenz/waybar.css index 2a33940f..9d6ab8c3 100644 --- a/homeConfigurations/vinzenz/waybar.css +++ b/homeConfigurations/vinzenz/waybar.css @@ -1,7 +1,7 @@ * { /* `otf-font-awesome` is required to be installed for icons */ - font-family: FontAwesome, sans-serif; - font-size: 13px; + font-family: sans-serif; + font-size: 10pt; color: #dcdfe1; } diff --git a/nixosModules/stylix.nix b/nixosModules/stylix.nix index fe10652f..6d5f97c1 100644 --- a/nixosModules/stylix.nix +++ b/nixosModules/stylix.nix @@ -12,8 +12,8 @@ }; fonts = { sansSerif = { - name = "Inter"; - package = pkgs.inter; + name = "Inter Nerd Font"; + package = pkgs.inter-nerdfont; }; monospace = { name = "FiraCode Nerd Font Mono"; From 3066bce807c7467af285e0d534ce61434e50c227 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 14 Nov 2025 01:09:25 +0100 Subject: [PATCH 0392/1295] waybar: theme, remove unused code --- homeConfigurations/vinzenz/waybar.css | 203 +++++--------------------- 1 file changed, 40 insertions(+), 163 deletions(-) diff --git a/homeConfigurations/vinzenz/waybar.css b/homeConfigurations/vinzenz/waybar.css index 9d6ab8c3..590e26dc 100644 --- a/homeConfigurations/vinzenz/waybar.css +++ b/homeConfigurations/vinzenz/waybar.css @@ -1,18 +1,28 @@ +/* #region stylix overrides*/ +.modules-left #workspaces button, +.modules-left #workspaces button.focused, +.modules-left #workspaces button.active, +.modules-center #workspaces button, +.modules-center #workspaces button.focused, +.modules-center #workspaces button.active, +.modules-right #workspaces button, +.modules-right #workspaces button.focused, +.modules-right #workspaces button.active { + border-bottom: unset; +} +/* #endregion */ + * { - /* `otf-font-awesome` is required to be installed for icons */ font-family: sans-serif; - font-size: 10pt; - color: #dcdfe1; } window#waybar { - background: black; - /* border: none; */ - box-shadow: none; - - color: #ffffff; + /* background: black; + border: none; + box-shadow: none; */ transition-property: background-color; transition-duration: 0.5s; + background: transparent; } window#waybar.hidden { @@ -27,47 +37,36 @@ window#waybar.chromium { background-color: #000000; border: none; } -/* -window#waybar .modules-left, -window#waybar .modules-center, -window#waybar .modules-right { - border: 1px solid; - border-radius: 15px; - border-image-source: linear-gradient(90deg, #d162a4, #5BCEFA); + +.modules-left, +.modules-center, +.modules-right { + border: 0px solid #fff; + padding-bottom: 5px; + background-clip: content-box, padding-box; + background-image: + linear-gradient(90deg, @base01, @base01), + linear-gradient(90deg, #a30262, #4a6bb1); } - */ -box.horizontal { - padding: 4px 4px 0px 4px; + +.modules-center, +.modules-left { + border-bottom-right-radius: 15px; + padding-right: 5px; +} + +.modules-center, +.modules-right { + border-bottom-left-radius: 15px; + padding-left: 5px; } #workspaces, #window, #tray { - background-color: rgba(15, 27, 53, 0.9); padding: 4px 6px; margin-left: 6px; margin-right: 6px; - border-radius: 15px; - border-width: 0px; -} - -button { - /* Use box-shadow instead of border so the text isn't offset */ - box-shadow: inset 0 -3px transparent; - /* Avoid rounded borders under each button name */ - border: none; - border-radius: 0; -} - -/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ -button:hover { - background: inherit; - box-shadow: inset 0 -3px #ffffff; -} - -/* you can set a style on hover for any module like this */ -#pulseaudio:hover { - background-color: #a37800; } #workspaces button { @@ -83,7 +82,7 @@ button:hover { #workspaces button.focused, #workspaces button.active { - background-color: #64727d; + background-color: @base03; } #workspaces button.urgent { @@ -129,22 +128,7 @@ button:hover { .modules-right > widget:last-child > #workspaces { margin-right: 0; } -/* -#clock { - background-color: #64727D; -} -#battery { - background-color: #ffffff; - color: #000000; -} - -#battery.charging, -#battery.plugged { - color: #ffffff; - background-color: #26A65B; -} - */ @keyframes blink { to { background-color: #ffffff; @@ -178,81 +162,7 @@ button:hover { #power-profiles-daemon.power-saver { color: #2ecc71; } -/* -label:focus { - background-color: #000000; -} -#cpu { - background-color: #2ecc71; - color: #000000; -} - -#memory { - background-color: #9b59b6; -} - -#disk { - background-color: #964B00; -} - -#backlight { - background-color: #90b1b1; -} - -#network { - background-color: #2980b9; -} - -#network.disconnected { - background-color: #f53c3c; -} - -#pulseaudio { - background-color: #f1c40f; - color: #000000; -} - -#pulseaudio.muted { - background-color: #90b1b1; - color: #2a5c45; -} - -#wireplumber { - background-color: #fff0f5; - color: #000000; -} - -#wireplumber.muted { - background-color: #f53c3c; -} -#custom-media { - background-color: #66cc99; - color: #2a5c45; - min-width: 100px; -} - -#custom-media.custom-spotify { - background-color: #66cc99; -} - -#custom-media.custom-vlc { - background-color: #ffa000; -} - -#temperature { - background-color: #f0932b; -} - -#temperature.critical { - background-color: #eb4d4b; -} - -#tray { - background-color: #2980b9; -} - - */ #tray > .passive { -gtk-icon-effect: dim; } @@ -261,47 +171,14 @@ label:focus { -gtk-icon-effect: highlight; background-color: #eb4d4b; } -/* -#idle_inhibitor { - background-color: #2d3436; -} - -#idle_inhibitor.activated { - background-color: #ecf0f1; - color: #2d3436; -} - -#mpd { - background-color: #66cc99; - color: #2a5c45; -} - -#mpd.disconnected { - background-color: #f53c3c; -} - -#mpd.stopped { - background-color: #90b1b1; -} - -#mpd.paused { - background-color: #51a37a; -} -*/ #language { - /* - background: #00b093; - color: #740864; */ padding: 0 5px; margin: 0 5px; min-width: 16px; } #keyboard-state { - /* - background: #97e1ad; - color: #000000; */ padding: 0 0px; margin: 0 5px; min-width: 16px; From de330e6334db6978f64cf74072d7554997fe1f57 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 14 Nov 2025 02:05:29 +0100 Subject: [PATCH 0393/1295] waybar: move notifications to middle --- homeConfigurations/vinzenz/swaync.nix | 4 +++- homeConfigurations/vinzenz/waybar.nix | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/homeConfigurations/vinzenz/swaync.nix b/homeConfigurations/vinzenz/swaync.nix index 8221c5ed..9cf6c569 100644 --- a/homeConfigurations/vinzenz/swaync.nix +++ b/homeConfigurations/vinzenz/swaync.nix @@ -1,6 +1,8 @@ { services.swaync = { enable = true; - settings = { }; + settings = { + positionX = "center"; + }; }; } diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix index a26ed9d4..87cfb219 100644 --- a/homeConfigurations/vinzenz/waybar.nix +++ b/homeConfigurations/vinzenz/waybar.nix @@ -26,16 +26,17 @@ spacing = "8"; modules-left = [ "niri/workspaces" + "tray" "niri/window" ]; modules-center = [ "privacy" "clock" + "custom/swaync" ]; modules-right = [ #"image" "group/status-infos" - "tray" "group/system-tray" "group/group-power" ]; @@ -49,7 +50,6 @@ "backlight" "network" "power-profiles-daemon" - "custom/swaync" "idle_inhibitor" ]; }; @@ -136,24 +136,28 @@ urgency ? null, body ? null, icon ? null, + category ? null, }: let body-part = if body != null then "'${body}'" else ""; urgency-part = if urgency != null then "--urgency ${urgency}" else ""; icon-part = if icon != null then "--icon ${icon}" else ""; + category-part = if category != null then "--category ${category}" else ""; in - "${lib.getBin pkgs.libnotify}/bin/notify-send ${urgency-part} ${icon-part} '${summary}' ${body-part}"; + "${lib.getBin pkgs.libnotify}/bin/notify-send ${urgency-part} ${icon-part} ${category-part} '${summary}' ${body-part}"; in { on-discharging-warning = mkNotifySendCommand { summary = "Low Battery"; icon = "battery-caution"; + category = "device"; }; on-discharging-critical = mkNotifySendCommand { urgency = "critical"; summary = "Very Low Battery"; body = "Connect to power now!"; icon = "battery-low"; + category = "device"; }; }; }; @@ -287,7 +291,7 @@ in { tooltip = true; - format = "{0}{icon} "; + format = "{icon} {0} "; format-icons = { notification = "󱅫"; none = "󰂜"; From 4bd718ca0477606c627b53c3e44fff48814c78a3 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 14 Nov 2025 22:15:40 +0100 Subject: [PATCH 0394/1295] swaylock: catppucchino theme --- homeConfigurations/vinzenz/swaylock.nix | 32 ++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/homeConfigurations/vinzenz/swaylock.nix b/homeConfigurations/vinzenz/swaylock.nix index 2e298a6c..08a5cd24 100644 --- a/homeConfigurations/vinzenz/swaylock.nix +++ b/homeConfigurations/vinzenz/swaylock.nix @@ -18,8 +18,38 @@ show-failed-attempts = true; ignore-empty-password = true; grace = 3.5; - color = "000000"; indicator-thickness = 20; + + # https://github.com/catppuccin/swaylock/blob/main/themes/mocha.conf + color = "1e1e2e"; + bs-hl-color = "f5e0dc"; + caps-lock-bs-hl-color = "f5e0dc"; + caps-lock-key-hl-color = "a6e3a1"; + inside-color = "00000000"; + inside-clear-color = "00000000"; + inside-caps-lock-color = "00000000"; + inside-ver-color = "00000000"; + inside-wrong-color = "00000000"; + key-hl-color = "a6e3a1"; + layout-bg-color = "00000000"; + layout-border-color = "00000000"; + layout-text-color = "cdd6f4"; + line-color = "00000000"; + line-clear-color = "00000000"; + line-caps-lock-color = "00000000"; + line-ver-color = "00000000"; + line-wrong-color = "00000000"; + ring-color = "b4befe"; + ring-clear-color = "f5e0dc"; + ring-caps-lock-color = "fab387"; + ring-ver-color = "89b4fa"; + ring-wrong-color = "eba0ac"; + separator-color = "00000000"; + text-color = "cdd6f4"; + text-clear-color = "f5e0dc"; + text-caps-lock-color = "fab387"; + text-ver-color = "89b4fa"; + text-wrong-color = "eba0ac"; }; }; From 7eb0fbb69c03e6fb5399cbcfb80695f2bb07d591 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 14 Nov 2025 22:19:42 +0100 Subject: [PATCH 0395/1295] waync: activate more modules, smaller size --- homeConfigurations/vinzenz/swaync.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/homeConfigurations/vinzenz/swaync.nix b/homeConfigurations/vinzenz/swaync.nix index 9cf6c569..93be7757 100644 --- a/homeConfigurations/vinzenz/swaync.nix +++ b/homeConfigurations/vinzenz/swaync.nix @@ -1,8 +1,24 @@ +{ pkgs, ... }: { services.swaync = { enable = true; settings = { + "$schema" = "${pkgs.swaynotificationcenter}/etc/xdg/swaync/configSchema.json"; + + hide-on-clear = true; + positionX = "center"; + fit-to-screen = false; + control-center-height = 750; + + widgets = [ + "mpris" + "volume" + "title" + "dnd" + "inhibitors" + "notifications" + ]; }; }; } From dc9c268c4d765239785c476985cac59fe564052e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Fri, 14 Nov 2025 22:20:00 +0100 Subject: [PATCH 0396/1295] niri: disable focus ring --- homeConfigurations/vinzenz/niri.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix index ba835c97..4213ec38 100644 --- a/homeConfigurations/vinzenz/niri.nix +++ b/homeConfigurations/vinzenz/niri.nix @@ -66,7 +66,7 @@ urgent.gradient = gradient-urgent; }; focus-ring = { - enable = true; + enable = false; active.gradient = gradient-active; inactive.gradient = gradient-inactive; urgent.gradient = gradient-urgent; From 67f2675c7d0792cb8bedf53045facd5ee47c222e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Nov 2025 10:55:48 +0100 Subject: [PATCH 0397/1295] unset default desktopSession --- nixosModules/gnome.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixosModules/gnome.nix b/nixosModules/gnome.nix index 7a6f9201..9c31f629 100644 --- a/nixosModules/gnome.nix +++ b/nixosModules/gnome.nix @@ -26,8 +26,6 @@ excludePackages = [ pkgs.xterm ]; }; - displayManager.defaultSession = "gnome"; - gnome = { tinysparql.enable = false; localsearch.enable = false; From 02c5171e04df5ec52da2dbd8d6fccd1fb2abf3dd Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Nov 2025 11:08:03 +0100 Subject: [PATCH 0398/1295] quiet-boot: graphical LUKS prompt, catppuccin theme --- nixosModules/quiet-boot.nix | 18 ++++++++++++++++-- nixosModules/stylix.nix | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/nixosModules/quiet-boot.nix b/nixosModules/quiet-boot.nix index 8dbcd572..d9b59c83 100644 --- a/nixosModules/quiet-boot.nix +++ b/nixosModules/quiet-boot.nix @@ -1,11 +1,25 @@ +{ pkgs, ... }: { boot = { kernelParams = [ "quiet" "udev.log_level=3" + "udev.log_priority=3" + "rd.systemd.show_status=auto" ]; consoleLogLevel = 0; - initrd.verbose = false; - plymouth.enable = true; + initrd = { + verbose = false; + systemd.enable = true; # required fpr graphical LUKS prompt + }; + plymouth = { + enable = true; + theme = "catppuccin-mocha"; + themePackages = [ + (pkgs.catppuccin-plymouth.override { + variant = "mocha"; + }) + ]; + }; }; } diff --git a/nixosModules/stylix.nix b/nixosModules/stylix.nix index 6d5f97c1..62bc062b 100644 --- a/nixosModules/stylix.nix +++ b/nixosModules/stylix.nix @@ -9,6 +9,7 @@ gtk.enable = false; gtksourceview.enable = false; fontconfig.enable = true; + plymouth.enable = false; }; fonts = { sansSerif = { From c972ff1e191bb48e6c07091d65591ab4e6f8e811 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Nov 2025 14:13:00 +0100 Subject: [PATCH 0399/1295] lpt2: secure boot using lanzaboote --- flake.lock | 148 +++++++++++++++++++++++++++++++++++ flake.nix | 7 ++ nixosModules/secure-boot.nix | 28 +++++++ 3 files changed, 183 insertions(+) create mode 100644 nixosModules/secure-boot.nix diff --git a/flake.lock b/flake.lock index b381ea70..58342745 100644 --- a/flake.lock +++ b/flake.lock @@ -112,6 +112,21 @@ "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-binding-uniffi.git" } }, + "crane": { + "locked": { + "lastModified": 1754269165, + "narHash": "sha256-0tcS8FHd4QjbCVoxN9jI+PjHgA4vc/IjkUSp+N3zy0U=", + "owner": "ipetkov", + "repo": "crane", + "rev": "444e81206df3f7d92780680e45858e31d2f07a08", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -150,6 +165,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -168,6 +199,27 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "lanzaboote", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754091436, + "narHash": "sha256-XKqDMN1/Qj1DKivQvscI4vmHfDfvYR2pfuFOJiCeewM=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "67df8c627c2c39c41dbec76a1f201929929ab0bd", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "fromYaml": { "flake": false, "locked": { @@ -184,6 +236,28 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "lanzaboote", + "pre-commit-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "gnome-shell": { "flake": false, "locked": { @@ -222,6 +296,32 @@ "type": "github" } }, + "lanzaboote": { + "inputs": { + "crane": "crane", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks-nix": "pre-commit-hooks-nix", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1762205063, + "narHash": "sha256-If6vQ+KvtKs3ARBO9G3l+4wFSCYtRBrwX1z+I+B61wQ=", + "owner": "nix-community", + "repo": "lanzaboote", + "rev": "88b8a563ff5704f4e8d8e5118fb911fa2110ca05", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "v0.4.3", + "repo": "lanzaboote", + "type": "github" + } + }, "naersk": { "inputs": { "fenix": "fenix", @@ -408,10 +508,37 @@ "type": "github" } }, + "pre-commit-hooks-nix": { + "inputs": { + "flake-compat": [ + "lanzaboote", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "lanzaboote", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750779888, + "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "flake-parts": "flake-parts", "home-manager": "home-manager", + "lanzaboote": "lanzaboote", "naersk": "naersk", "niri": "niri", "nix-filter": "nix-filter", @@ -444,6 +571,27 @@ "type": "github" } }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "lanzaboote", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1761791894, + "narHash": "sha256-myRIDh+PxaREz+z9LzbqBJF+SnTFJwkthKDX9zMyddY=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "59c45eb69d9222a4362673141e00ff77842cd219", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "servicepoint-cli": { "inputs": { "naersk": [ diff --git a/flake.nix b/flake.nix index 9d1a457e..1f361fde 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,10 @@ url = "github:hercules-ci/flake-parts"; #inputs.nixpkgs.follows = "nixpkgs"; }; + lanzaboote = { + url = "github:nix-community/lanzaboote/v0.4.3"; + inputs.nixpkgs.follows = "nixpkgs"; + }; naersk = { url = "github:nix-community/naersk"; inputs.nixpkgs.follows = "nixpkgs"; @@ -79,6 +83,7 @@ nixpkgs, home-manager, # keep-sorted start + lanzaboote, niri, nix-vscode-extensions, nixpkgs-unstable, @@ -104,6 +109,7 @@ self.nixosModules.podman self.nixosModules.vinzenz-desktop-settings self.nixosModules.intel-graphics + self.nixosModules.secure-boot ]; home-manager-users = { inherit (self.homeConfigurations) vinzenz; @@ -260,6 +266,7 @@ ./nixosConfigurations/${device} # keep-sorted start + lanzaboote.nixosModules.lanzaboote self.nixosModules.allowed-unfree-list self.nixosModules.autoupdate self.nixosModules.default diff --git a/nixosModules/secure-boot.nix b/nixosModules/secure-boot.nix new file mode 100644 index 00000000..7a483b15 --- /dev/null +++ b/nixosModules/secure-boot.nix @@ -0,0 +1,28 @@ +{ pkgs, lib, ... }: +{ + # https://github.com/nix-community/lanzaboote/blob/70be03ab23d0988224e152f5b52e2fbf44a6d8ee/docs/QUICK_START.md + # To enroll: + # 1. Put Secure Boot in Setup mode + # 2. sudo sbctl create-keys + # 3. import this module, rebuild + # 4. sudo sbctl verify + # 5. sudo sbctl enroll-keys --microsoft + # 6, reboot + # 7. sudo sbctl status + + environment.systemPackages = [ + # For debugging and troubleshooting Secure Boot. + 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 + # for now. + boot.loader.systemd-boot.enable = lib.mkForce false; + + boot.lanzaboote = { + enable = true; + pkiBundle = "/var/lib/sbctl"; + }; +} From 549c87dc6dfeed9ee8c32e55b3978a8013690e3e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Nov 2025 17:33:30 +0100 Subject: [PATCH 0400/1295] stylix: generate bg; add wpaperd --- homeConfigurations/vinzenz/niri.nix | 6 ++++-- nixosModules/stylix.nix | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix index 4213ec38..4c382d2d 100644 --- a/homeConfigurations/vinzenz/niri.nix +++ b/homeConfigurations/vinzenz/niri.nix @@ -16,6 +16,8 @@ name = "adwaita-dark"; }; + services.wpaperd.enable = true; + programs.niri.settings = { outputs = { "BOE 0x0A3B Unknown" = { @@ -53,10 +55,10 @@ from = pink_dark; to = pink_light; }; - gap-size = 10; + gap-size = 8; in { - background-color = "#000000"; + background-color = "transparent"; gaps = gap-size; border = { enable = true; diff --git a/nixosModules/stylix.nix b/nixosModules/stylix.nix index 62bc062b..66fcc96e 100644 --- a/nixosModules/stylix.nix +++ b/nixosModules/stylix.nix @@ -1,8 +1,9 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + image = config.lib.stylix.pixel "base00"; polarity = "dark"; targets = { gnome.enable = false; From 1a6942fd6eb5d70a41ffd9ac5d68a770c94e1ab3 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Nov 2025 18:56:51 +0100 Subject: [PATCH 0401/1295] swaylock: usw stylix theme --- homeConfigurations/vinzenz/swaylock.nix | 37 ++++--------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/homeConfigurations/vinzenz/swaylock.nix b/homeConfigurations/vinzenz/swaylock.nix index 08a5cd24..1b756ff9 100644 --- a/homeConfigurations/vinzenz/swaylock.nix +++ b/homeConfigurations/vinzenz/swaylock.nix @@ -2,12 +2,16 @@ { pkgs, config, ... }: { config = { + stylix.targets.swaylock = { + enable = true; + useWallpaper = true; + }; programs.swaylock = { enable = true; package = pkgs.swaylock-effects; # https://github.com/jirutka/swaylock-effects/blob/master/swaylock.1.scd settings = { - screenshot = true; + screenshot = false; effect-blur = "9x9"; effect-vignette = "0.2:0.2"; fade-in = 0.5; @@ -19,37 +23,6 @@ ignore-empty-password = true; grace = 3.5; indicator-thickness = 20; - - # https://github.com/catppuccin/swaylock/blob/main/themes/mocha.conf - color = "1e1e2e"; - bs-hl-color = "f5e0dc"; - caps-lock-bs-hl-color = "f5e0dc"; - caps-lock-key-hl-color = "a6e3a1"; - inside-color = "00000000"; - inside-clear-color = "00000000"; - inside-caps-lock-color = "00000000"; - inside-ver-color = "00000000"; - inside-wrong-color = "00000000"; - key-hl-color = "a6e3a1"; - layout-bg-color = "00000000"; - layout-border-color = "00000000"; - layout-text-color = "cdd6f4"; - line-color = "00000000"; - line-clear-color = "00000000"; - line-caps-lock-color = "00000000"; - line-ver-color = "00000000"; - line-wrong-color = "00000000"; - ring-color = "b4befe"; - ring-clear-color = "f5e0dc"; - ring-caps-lock-color = "fab387"; - ring-ver-color = "89b4fa"; - ring-wrong-color = "eba0ac"; - separator-color = "00000000"; - text-color = "cdd6f4"; - text-clear-color = "f5e0dc"; - text-caps-lock-color = "fab387"; - text-ver-color = "89b4fa"; - text-wrong-color = "eba0ac"; }; }; From 35c1d07e4983b5d87a483cc2e3df629e3f6cb417 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Nov 2025 18:57:42 +0100 Subject: [PATCH 0402/1295] waybar: wlogout, weather --- homeConfigurations/vinzenz/default.nix | 1 + homeConfigurations/vinzenz/waybar.nix | 56 ++++++++------------------ homeConfigurations/vinzenz/wlogout.nix | 34 ++++++++++++++++ 3 files changed, 51 insertions(+), 40 deletions(-) create mode 100644 homeConfigurations/vinzenz/wlogout.nix diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index cdc5fdec..785afe72 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -14,6 +14,7 @@ ./swaync.nix ./vscode.nix ./waybar.nix + ./wlogout.nix ./zsh.nix # keep-sorted end ]; diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix index 87cfb219..73c0ef87 100644 --- a/homeConfigurations/vinzenz/waybar.nix +++ b/homeConfigurations/vinzenz/waybar.nix @@ -38,7 +38,7 @@ #"image" "group/status-infos" "group/system-tray" - "group/group-power" + "custom/wlogout" ]; "group/system-tray" = { @@ -57,6 +57,7 @@ orientation = "inherit"; modules = [ "battery" + "custom/weather" "temperature" "cpu" "memory" @@ -163,7 +164,7 @@ }; backlight = { device = "intel_backlight"; - format = "{percent}% "; + format = "{percent}%  "; on-scroll-down = "light -U 1"; on-scroll-up = "light -A 1"; }; @@ -174,46 +175,14 @@ disk = { format = "{free}/{total}"; }; - "group/group-power" = { - "orientation" = "inherit"; - "drawer" = { - "transition-duration" = 500; - "children-class" = "not-power"; - "transition-left-to-right" = false; - }; - "modules" = [ - "custom/power" # First element is the "group leader" and won't ever be hidden - "custom/quit" - "custom/lock" - "custom/reboot" - ]; - }; - "custom/quit" = { - "format" = "󰗼 "; - "tooltip" = false; - "on-click" = "niri msg action quit"; - min-width = 20; - }; - "custom/lock" = { - "format" = "󰍁 "; - "tooltip" = false; - "on-click" = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; - min-width = 20; - }; - "custom/reboot" = { - "format" = "󰜉 "; - "tooltip" = false; - "on-click" = "systemctl reboot"; - min-width = 20; - }; - "custom/power" = { - "format" = " "; - "tooltip" = false; - "on-click" = "systemctl shutdown"; + "custom/wlogout" = { + format = " "; + tooltip = false; + on-click = "wlogout"; min-width = 20; }; idle_inhibitor = { - format = "{icon}"; + format = "{icon} "; format-icons = { activated = ""; deactivated = ""; @@ -247,7 +216,7 @@ }; }; memory = { - format = "{}% "; + format = "{}%  "; }; power-profiles-daemon = { format = "{icon}"; @@ -308,6 +277,13 @@ on-click-right = "${swaync-client} --toggle-dnd --skip-wait"; escape = true; }; + "custom/weather" = { + format = "{}°"; + tooltip = true; + interval = 3600; + exec = "${lib.getBin pkgs.wttrbar}/bin/wttrbar --nerd"; + return-type = "json"; + }; }; }; }; diff --git a/homeConfigurations/vinzenz/wlogout.nix b/homeConfigurations/vinzenz/wlogout.nix new file mode 100644 index 00000000..bfd39f57 --- /dev/null +++ b/homeConfigurations/vinzenz/wlogout.nix @@ -0,0 +1,34 @@ +{ + config.programs.wlogout = { + enable = true; + style = '' + * { + /*background-image: none;*/ + box-shadow: none; + } + + window { + background-color: rgba(30, 30, 46, 0.90); + } + + button { + border-radius: 0; + border-color: #cba6f7; + text-decoration-color: #cdd6f4; + color: #cdd6f4; + background-color: #181825; + border-style: solid; + border-width: 1px; + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + } + + button:focus, button:active, button:hover { + /* 20% Overlay 2, 80% mantle */ + background-color: rgb(48, 50, 66); + outline-style: none; + } + ''; + }; +} From 9efeb49b13b50d14cb80a329d27aa8ccdcdfef9b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Nov 2025 19:01:16 +0100 Subject: [PATCH 0403/1295] waybar: smaller border --- homeConfigurations/vinzenz/waybar.css | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/homeConfigurations/vinzenz/waybar.css b/homeConfigurations/vinzenz/waybar.css index 590e26dc..0210f6f9 100644 --- a/homeConfigurations/vinzenz/waybar.css +++ b/homeConfigurations/vinzenz/waybar.css @@ -17,9 +17,6 @@ } window#waybar { - /* background: black; - border: none; - box-shadow: none; */ transition-property: background-color; transition-duration: 0.5s; background: transparent; @@ -42,7 +39,7 @@ window#waybar.chromium { .modules-center, .modules-right { border: 0px solid #fff; - padding-bottom: 5px; + padding-bottom: 4px; background-clip: content-box, padding-box; background-image: linear-gradient(90deg, @base01, @base01), @@ -52,13 +49,17 @@ window#waybar.chromium { .modules-center, .modules-left { border-bottom-right-radius: 15px; - padding-right: 5px; + padding-right: 4px; } .modules-center, .modules-right { border-bottom-left-radius: 15px; - padding-left: 5px; + padding-left: 4px; +} + +widget { + margin: 0px 4px; } #workspaces, From ec2f549a31cb3a412842fa8e5c6cc0d36186ba27 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 16 Nov 2025 17:40:06 +0100 Subject: [PATCH 0404/1295] stylix: override colors --- nixosModules/stylix.nix | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/nixosModules/stylix.nix b/nixosModules/stylix.nix index 66fcc96e..33ab6eee 100644 --- a/nixosModules/stylix.nix +++ b/nixosModules/stylix.nix @@ -3,6 +3,55 @@ stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + override = { + scheme = "Catppuccin Mocha Pride"; + + base09 = "#6f9dff"; + base0A = "#d162a4"; + base0B = "#a8c9ff"; + base0C = "#a30262"; + + # pink_light = "#d162a4"; + # pink_dark = "#a30262"; + # blue_light = "#5BCEFA"; + # blue_dark = "#4a6bb1"; + + # original values + # base00: "#1e1e2e" # base - + # base01: "#181825" # mantle + # base02: "#313244" # surface0 + # base03: "#45475a" # surface1 + # base04: "#585b70" # surface2 + # base05: "#cdd6f4" # text + # base06: "#f5e0dc" # rosewater + # base07: "#b4befe" # lavender + # base08: "#f38ba8" # red + # base09: "#fab387" # peach + # base0A: "#f9e2af" # yellow + # base0B: "#a6e3a1" # green + # base0C: "#94e2d5" # teal + # base0D: "#89b4fa" # blue + # base0E: "#cba6f7" # mauve + # base0F: "#f2cdcd" # flamingo + + # https://github.com/chriskempson/base16/blob/main/styling.md + # base00 - Default Background + # base01 - Lighter Background (Used for status bars, line number and folding marks) + # base02 - Selection Background + # base03 - Comments, Invisibles, Line Highlighting + # base04 - Dark Foreground (Used for status bars) + # base05 - Default Foreground, Caret, Delimiters, Operators + # base06 - Light Foreground (Not often used) + # base07 - Light Background (Not often used) + # base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted + # base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url + # base0A - Classes, Markup Bold, Search Text Background + # base0B - Strings, Inherited Class, Markup Code, Diff Inserted + # base0C - Support, Regular Expressions, Escape Characters, Markup Quotes + # base0D - Functions, Methods, Attribute IDs, Headings + # base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed + # base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. + }; image = config.lib.stylix.pixel "base00"; polarity = "dark"; targets = { From 8c34764004476fc90503a304796ddae9b5287373 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 16 Nov 2025 21:46:58 +0100 Subject: [PATCH 0405/1295] niri: stylix colors --- homeConfigurations/vinzenz/niri.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix index 4c382d2d..ba55d2e8 100644 --- a/homeConfigurations/vinzenz/niri.nix +++ b/homeConfigurations/vinzenz/niri.nix @@ -35,10 +35,11 @@ layout = let - pink_light = "#d162a4"; - pink_dark = "#a30262"; - blue_light = "#5BCEFA"; - blue_dark = "#4a6bb1"; + colors = config.lib.stylix.colors.withHashtag; + pink_light = colors.base0A; + pink_dark = colors.base0C; + blue_light = colors.base0B; + blue_dark = colors.base09; gradient-common = { angle = 90; in' = "oklab"; From 03995a050a8fe939d38bb99edf260d73a7a7f584 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 17 Nov 2025 14:36:31 +0100 Subject: [PATCH 0406/1295] pc2: enable secure boot --- flake.nix | 1 + nixosModules/secure-boot.nix | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 1f361fde..5a9e6082 100644 --- a/flake.nix +++ b/flake.nix @@ -127,6 +127,7 @@ self.nixosModules.podman self.nixosModules.vinzenz-desktop-settings self.nixosModules.amd-graphics + self.nixosModules.secure-boot ]; home-manager-users = { inherit (self.homeConfigurations) vinzenz ronja; diff --git a/nixosModules/secure-boot.nix b/nixosModules/secure-boot.nix index 7a483b15..9bf2c930 100644 --- a/nixosModules/secure-boot.nix +++ b/nixosModules/secure-boot.nix @@ -2,9 +2,9 @@ { # https://github.com/nix-community/lanzaboote/blob/70be03ab23d0988224e152f5b52e2fbf44a6d8ee/docs/QUICK_START.md # To enroll: - # 1. Put Secure Boot in Setup mode - # 2. sudo sbctl create-keys - # 3. import this module, rebuild + # 1. sudo sbctl create-keys + # 2. import this module, rebuild + # 3. Put Secure Boot in Setup mode # 4. sudo sbctl verify # 5. sudo sbctl enroll-keys --microsoft # 6, reboot From 34fbd2c10b9b8bb1b956a6b4874cdd99b5691118 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 17 Nov 2025 23:04:33 +0100 Subject: [PATCH 0407/1295] vscodium: catppucchin icons --- homeConfigurations/vinzenz/vscode.nix | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/homeConfigurations/vinzenz/vscode.nix b/homeConfigurations/vinzenz/vscode.nix index 80bb9679..a32a4332 100644 --- a/homeConfigurations/vinzenz/vscode.nix +++ b/homeConfigurations/vinzenz/vscode.nix @@ -13,19 +13,20 @@ extensions = with pkgs.nix-vscode-extensions.open-vsx; [ - jnoortheen.nix-ide - ms-python.python + # keep-sorted start + catppuccin.catppuccin-vsc-icons + davidanson.vscode-markdownlint editorconfig.editorconfig - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - rust-lang.rust-analyzer - tamasfe.even-better-toml + jnoortheen.nix-ide llvm-vs-code-extensions.vscode-clangd mkhl.direnv + ms-python.python muhammad-sammy.csharp - davidanson.vscode-markdownlint - #mermaidchart.vscode-mermaid-chart + redhat.vscode-yaml + rust-lang.rust-analyzer + tamasfe.even-better-toml + yzhang.markdown-all-in-one + # keep-sorted end ] ++ (with pkgs.vscode-extensions; [ vadimcn.vscode-lldb @@ -46,7 +47,7 @@ "workbench.startupEditor" = "readme"; "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; + "workbench.iconTheme" = "catppuchin-mocha"; "update.mode" = "none"; "extensions.autoUpdate" = false; From a1de7362499c2374df5cb39f7bc8c0ade3cd7181 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 20 Nov 2025 23:39:49 +0100 Subject: [PATCH 0408/1295] element-desktop: catppuchin theme --- homeConfigurations/vinzenz/default.nix | 5 +- homeConfigurations/vinzenz/element.nix | 187 +++++++++++++++++++++++++ 2 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 homeConfigurations/vinzenz/element.nix diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index 785afe72..8082e10c 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -3,6 +3,7 @@ imports = [ # keep-sorted start ./editorconfig.nix + ./element.nix ./fonts.nix ./fuzzel.nix ./git.nix @@ -54,9 +55,7 @@ nextcloud-client thunderbird fractal - telegram-desktop - element-desktop wireguard-tools wirelesstools @@ -80,6 +79,8 @@ foliate dconf2nix + + gnome-terminal ]; home.file = { diff --git a/homeConfigurations/vinzenz/element.nix b/homeConfigurations/vinzenz/element.nix new file mode 100644 index 00000000..e2a7474f --- /dev/null +++ b/homeConfigurations/vinzenz/element.nix @@ -0,0 +1,187 @@ +{ + programs.element-desktop = { + enable = true; + settings = { + # https://github.com/element-hq/element-web/blob/develop/docs/config.md + # https://github.com/catppuccin/element + "show_labs_settings" = true; + "setting_defaults" = { + default_theme = "custom-Catppuccin Latte (Mauve)"; + "custom_themes" = [ + { + "name" = "Catppuccin Latte (Mauve)"; + "is_dark" = false; + "colors" = { + "accent-color" = "#8839ef"; + "primary-color" = "#8839ef"; + "warning-color" = "#d20f39"; + "alert" = "#df8e1d"; + "sidebar-color" = "#dce0e8"; + "roomlist-background-color" = "#e6e9ef"; + "roomlist-text-color" = "#4c4f69"; + "roomlist-text-secondary-color" = "#7c7f93"; + "roomlist-highlights-color" = "#bcc0cc"; + "roomlist-separator-color" = "#8c8fa1"; + "timeline-background-color" = "#eff1f5"; + "timeline-text-color" = "#4c4f69"; + "secondary-content" = "#4c4f69"; + "tertiary-content" = "#4c4f69"; + "timeline-text-secondary-color" = "#6c6f85"; + "timeline-highlights-color" = "#e6e9ef"; + "reaction-row-button-selected-bg-color" = "#bcc0cc"; + "menu-selected-color" = "#bcc0cc"; + "focus-bg-color" = "#acb0be"; + "room-highlight-color" = "#04a5e5"; + "togglesw-off-color" = "#7c7f93"; + "other-user-pill-bg-color" = "#04a5e5"; + "username-colors" = [ + "#8839ef" + "#e64553" + "#fe640b" + "#40a02b" + "#179299" + "#04a5e5" + "#209fb5" + "#7287fd" + ]; + "avatar-background-colors" = [ + "#1e66f5" + "#8839ef" + "#40a02b" + ]; + }; + } + { + "name" = "Catppuccin Frappé (Mauve)"; + "is_dark" = true; + "colors" = { + "accent-color" = "#ca9ee6"; + "primary-color" = "#ca9ee6"; + "warning-color" = "#e78284"; + "alert" = "#e5c890"; + "sidebar-color" = "#232634"; + "roomlist-background-color" = "#292c3c"; + "roomlist-text-color" = "#c6d0f5"; + "roomlist-text-secondary-color" = "#949cbb"; + "roomlist-highlights-color" = "#51576d"; + "roomlist-separator-color" = "#838ba7"; + "timeline-background-color" = "#303446"; + "timeline-text-color" = "#c6d0f5"; + "secondary-content" = "#c6d0f5"; + "tertiary-content" = "#c6d0f5"; + "timeline-text-secondary-color" = "#a5adce"; + "timeline-highlights-color" = "#292c3c"; + "reaction-row-button-selected-bg-color" = "#51576d"; + "menu-selected-color" = "#51576d"; + "focus-bg-color" = "#626880"; + "room-highlight-color" = "#99d1db"; + "togglesw-off-color" = "#949cbb"; + "other-user-pill-bg-color" = "#99d1db"; + "username-colors" = [ + "#ca9ee6" + "#ea999c" + "#ef9f76" + "#a6d189" + "#81c8be" + "#99d1db" + "#85c1dc" + "#babbf1" + ]; + "avatar-background-colors" = [ + "#8caaee" + "#ca9ee6" + "#a6d189" + ]; + }; + } + { + "name" = "Catppuccin Macchiato (Mauve)"; + "is_dark" = true; + "colors" = { + "accent-color" = "#c6a0f6"; + "primary-color" = "#c6a0f6"; + "warning-color" = "#ed8796"; + "alert" = "#eed49f"; + "sidebar-color" = "#181926"; + "roomlist-background-color" = "#1e2030"; + "roomlist-text-color" = "#cad3f5"; + "roomlist-text-secondary-color" = "#939ab7"; + "roomlist-highlights-color" = "#494d64"; + "roomlist-separator-color" = "#8087a2"; + "timeline-background-color" = "#24273a"; + "timeline-text-color" = "#cad3f5"; + "secondary-content" = "#cad3f5"; + "tertiary-content" = "#cad3f5"; + "timeline-text-secondary-color" = "#a5adcb"; + "timeline-highlights-color" = "#1e2030"; + "reaction-row-button-selected-bg-color" = "#494d64"; + "menu-selected-color" = "#494d64"; + "focus-bg-color" = "#5b6078"; + "room-highlight-color" = "#91d7e3"; + "togglesw-off-color" = "#939ab7"; + "other-user-pill-bg-color" = "#91d7e3"; + "username-colors" = [ + "#c6a0f6" + "#ee99a0" + "#f5a97f" + "#a6da95" + "#8bd5ca" + "#91d7e3" + "#7dc4e4" + "#b7bdf8" + ]; + "avatar-background-colors" = [ + "#8aadf4" + "#c6a0f6" + "#a6da95" + ]; + }; + } + { + "name" = "Catppuccin Mocha (Mauve)"; + "is_dark" = true; + "colors" = { + "accent-color" = "#cba6f7"; + "primary-color" = "#cba6f7"; + "warning-color" = "#f38ba8"; + "alert" = "#f9e2af"; + "sidebar-color" = "#11111b"; + "roomlist-background-color" = "#181825"; + "roomlist-text-color" = "#cdd6f4"; + "roomlist-text-secondary-color" = "#9399b2"; + "roomlist-highlights-color" = "#45475a"; + "roomlist-separator-color" = "#7f849c"; + "timeline-background-color" = "#1e1e2e"; + "timeline-text-color" = "#cdd6f4"; + "secondary-content" = "#cdd6f4"; + "tertiary-content" = "#cdd6f4"; + "timeline-text-secondary-color" = "#a6adc8"; + "timeline-highlights-color" = "#181825"; + "reaction-row-button-selected-bg-color" = "#45475a"; + "menu-selected-color" = "#45475a"; + "focus-bg-color" = "#585b70"; + "room-highlight-color" = "#89dceb"; + "togglesw-off-color" = "#9399b2"; + "other-user-pill-bg-color" = "#89dceb"; + "username-colors" = [ + "#cba6f7" + "#eba0ac" + "#fab387" + "#a6e3a1" + "#94e2d5" + "#89dceb" + "#74c7ec" + "#b4befe" + ]; + "avatar-background-colors" = [ + "#89b4fa" + "#cba6f7" + "#a6e3a1" + ]; + }; + } + ]; + }; + }; + }; +} From f2e9573384ae117ee93c3d5875bbbe561ed1a6f4 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 20 Nov 2025 23:46:08 +0100 Subject: [PATCH 0409/1295] waybar: replace custom battery with upower+poweralertd --- homeConfigurations/vinzenz/default.nix | 5 ++++- homeConfigurations/vinzenz/waybar.nix | 14 ++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index 8082e10c..a8a0d28f 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -91,6 +91,9 @@ "idea.properties".text = "idea.filewatcher.executable.path = ${pkgs.fsnotifier}/bin/fsnotifier"; }; - services.trayscale.enable = true; + services = { + trayscale.enable = true; + poweralertd.enable = true; + }; }; } diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix index 73c0ef87..b04fd5b9 100644 --- a/homeConfigurations/vinzenz/waybar.nix +++ b/homeConfigurations/vinzenz/waybar.nix @@ -11,8 +11,10 @@ programs.waybar = { enable = true; - systemd.enable = true; - systemd.target = "graphical-session.target"; + systemd = { + enable = true; + target = "graphical-session.target"; + }; style = lib.mkAfter (builtins.readFile ./waybar.css); settings = { mainBar = { @@ -35,9 +37,9 @@ "custom/swaync" ]; modules-right = [ + "group/system-tray" #"image" "group/status-infos" - "group/system-tray" "custom/wlogout" ]; @@ -56,12 +58,13 @@ "group/status-infos" = { orientation = "inherit"; modules = [ - "battery" "custom/weather" "temperature" "cpu" "memory" "disk" + # "battery" + "upower" ]; }; @@ -110,6 +113,9 @@ on-scroll-down = "shift_up"; }; }; + upower = { + icon-size = 14; + }; battery = { format = "{capacity}% {icon}"; format-icons = [ From a21527750c63841e2a12ada8078565607b958649 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 29 Nov 2025 10:21:13 +0100 Subject: [PATCH 0410/1295] swaync: hide media sessions if none are running --- homeConfigurations/vinzenz/swaync.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeConfigurations/vinzenz/swaync.nix b/homeConfigurations/vinzenz/swaync.nix index 93be7757..113aac0d 100644 --- a/homeConfigurations/vinzenz/swaync.nix +++ b/homeConfigurations/vinzenz/swaync.nix @@ -19,6 +19,10 @@ "inhibitors" "notifications" ]; + + widget-config = { + mpris.autohide = true; + }; }; }; } From 9a5fd746e43d243130501cc8151d5536541f7ffd Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 29 Nov 2025 10:21:22 +0100 Subject: [PATCH 0411/1295] nix flake update --- flake.lock | 72 +++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/flake.lock b/flake.lock index 58342745..eb56fae3 100644 --- a/flake.lock +++ b/flake.lock @@ -186,11 +186,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1762810396, - "narHash": "sha256-dxFVgQPG+R72dkhXTtqUm7KpxElw3u6E+YlQ2WaDgt8=", + "lastModified": 1763759067, + "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "0bdadb1b265fb4143a75bd1ec7d8c915898a9923", + "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", "type": "github" }, "original": { @@ -282,11 +282,11 @@ ] }, "locked": { - "lastModified": 1758463745, - "narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=", + "lastModified": 1763992789, + "narHash": "sha256-WHkdBlw6oyxXIra/vQPYLtqY+3G8dUVZM8bEXk0t8x4=", "owner": "nix-community", "repo": "home-manager", - "rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3", + "rev": "44831a7eaba4360fb81f2acc5ea6de5fde90aaa3", "type": "github" }, "original": { @@ -330,11 +330,11 @@ ] }, "locked": { - "lastModified": 1752689277, - "narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=", + "lastModified": 1763384566, + "narHash": "sha256-r+wgI+WvNaSdxQmqaM58lVNvJYJ16zoq+tKN20cLst4=", "owner": "nix-community", "repo": "naersk", - "rev": "0e72363d0938b0208d6c646d10649164c43f4d64", + "rev": "d4155d6ebb70fbe2314959842f744aa7cabbbf6a", "type": "github" }, "original": { @@ -357,11 +357,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1762857797, - "narHash": "sha256-puoFJGlbL6khrQKozCO6Wgpq/IhA2Sfnz+ui/87lbQQ=", + "lastModified": 1764405884, + "narHash": "sha256-TnvBRPmcpcyinvLgsitHS7w5soSa6yNBfRYEI2TK1Ts=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "2ff3443b4226f6721a43b75e76b6ca59caa34fec", + "rev": "10aae4855ee275f7d80d85f4328c24265fb20f1f", "type": "github" }, "original": { @@ -390,11 +390,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1762854265, - "narHash": "sha256-iykTzCzU8hI7b8LvAquYY4Asl2xj3AcLzWZv6rm8MGY=", + "lastModified": 1764399944, + "narHash": "sha256-FC9eYtSmplgxllCX4/3hJq5J3sXWKLSc7at8ZUxycVw=", "owner": "YaLTeR", "repo": "niri", - "rev": "fb2f67c8a036f674e9101e15a7bb1cf61524ebde", + "rev": "b35bcae35b3f9665043c335e55ed5828af77db85", "type": "github" }, "original": { @@ -425,11 +425,11 @@ ] }, "locked": { - "lastModified": 1762826252, - "narHash": "sha256-7VqX6Z8Pq5DzVV5YM7o92vC6goNGtucCv71dXwpy01Q=", + "lastModified": 1764381338, + "narHash": "sha256-EBguntbfHsbikHdk9v/2lAyrLzjaZf6tEZeRymXAfJA=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "f10a42469c4db9b4ae7b3cd3a5c0d8bffb4a8b98", + "rev": "600e16b6baf213d9192a0035ff15618305fcea60", "type": "github" }, "original": { @@ -440,11 +440,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1762756533, - "narHash": "sha256-HiRDeUOD1VLklHeOmaKDzf+8Hb7vSWPVFcWwaTrpm+U=", + "lastModified": 1764316264, + "narHash": "sha256-82L+EJU+40+FIdeG4gmUlOF1jeSwlf2AwMarrpdHF6o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c2448301fb856e351aab33e64c33a3fc8bcf637d", + "rev": "9a7b80b6f82a71ea04270d7ba11b48855681c4b0", "type": "github" }, "original": { @@ -471,11 +471,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1762482733, - "narHash": "sha256-g/da4FzvckvbiZT075Sb1/YDNDr+tGQgh4N8i5ceYMg=", + "lastModified": 1764352606, + "narHash": "sha256-ZwPqcETKhoQ+TS40+hFr5CY4wzcNGKhi6l8w2HmmxKc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e1ebeec86b771e9d387dd02d82ffdc77ac753abc", + "rev": "24e915b36ca87d32777d766da3a3f4e3ce22cc98", "type": "github" }, "original": { @@ -495,11 +495,11 @@ ] }, "locked": { - "lastModified": 1762858278, - "narHash": "sha256-BYeYJFonJRt9xg6UYXpvVGK5j4NEOXHETRffPQT7drM=", + "lastModified": 1764404323, + "narHash": "sha256-lyAJQNdm/ZRfH6mDXLIA8/g2tCuHlHEfthC0UA+BLFs=", "owner": "nix-community", "repo": "NUR", - "rev": "a053db755b35970d6a0ebd97aaceb8f629faa8e7", + "rev": "5a7ff5a222e1422c4f129f64e10ebecf78ace9f8", "type": "github" }, "original": { @@ -691,11 +691,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1762295027, - "narHash": "sha256-5z5cGrp9F8g8iyQrM8WkB6pAwP4AaicljKZ15gx+X9Y=", + "lastModified": 1763845106, + "narHash": "sha256-S3HH655nydKoLTuqX8qcJidZH0PiWGB/YcoPomH1DaQ=", "owner": "nix-community", "repo": "stylix", - "rev": "91b9a270523361268ba6a8772152fde31103869f", + "rev": "b9b8173a6e31c6d06f328307ddbdf7d6af82b7ad", "type": "github" }, "original": { @@ -808,11 +808,11 @@ ] }, "locked": { - "lastModified": 1762410071, - "narHash": "sha256-aF5fvoZeoXNPxT0bejFUBXeUjXfHLSL7g+mjR/p5TEg=", + "lastModified": 1762938485, + "narHash": "sha256-AlEObg0syDl+Spi4LsZIBrjw+snSVU4T8MOeuZJUJjM=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "97a30861b13c3731a84e09405414398fbf3e109f", + "rev": "5b4ee75aeefd1e2d5a1cc43cf6ba65eba75e83e4", "type": "github" }, "original": { @@ -841,11 +841,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1762747449, - "narHash": "sha256-Z1TKiux8K09a93w4PFDFsj8HFugXNy3iCC3Z8MpR5Rk=", + "lastModified": 1764366786, + "narHash": "sha256-yVCJ4Qe/JkdKDu0DddFdAQgDQVeF12nxH7zv3jtooV4=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "6338574bc5c036487486acde264f38f39ea15fad", + "rev": "b362a3873710a42f7ac2d8ba03772d8290733934", "type": "github" }, "original": { From 417d65062bb098d2243e4c22f6de1db6604be95e Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 1 Dec 2025 17:30:51 +0100 Subject: [PATCH 0412/1295] upgrade to nixos 25.11 - thefuck has been removed, use pay-repects instead - 'glxinfo' has been renamed to/replaced by 'mesa-demos' - options have been moved out of the 'xserver' namespace - use default mesa drivers, remove amdvlk - systemd global config has been moved and is not string-based anymore - git settings have been moved to sub-attrset - ssh default options generate a warning now but are not needed -> disable - unpin nixpkgs version for servicepoint flakes --- flake.lock | 78 +++++++++++++++------- flake.nix | 12 ++-- homeConfigurations/vinzenz/default.nix | 2 +- homeConfigurations/vinzenz/git.nix | 16 +++-- homeConfigurations/vinzenz/ssh.nix | 1 + homeModules/git.nix | 2 +- nixosConfigurations/hetzner-vpn2/nginx.nix | 4 +- nixosModules/amd-graphics.nix | 5 -- nixosModules/gnome.nix | 23 +++---- nixosModules/kdeconnect.nix | 2 +- nixosModules/modern-desktop.nix | 4 +- nixosModules/wine-gaming.nix | 2 +- 12 files changed, 89 insertions(+), 62 deletions(-) diff --git a/flake.lock b/flake.lock index eb56fae3..f908edd0 100644 --- a/flake.lock +++ b/flake.lock @@ -261,18 +261,20 @@ "gnome-shell": { "flake": false, "locked": { - "lastModified": 1744584021, - "narHash": "sha256-0RJ4mJzf+klKF4Fuoc8VN8dpQQtZnKksFmR2jhWE1Ew=", + "host": "gitlab.gnome.org", + "lastModified": 1764524476, + "narHash": "sha256-bTmNn3Q4tMQ0J/P0O5BfTQwqEnCiQIzOGef9/aqAZvk=", "owner": "GNOME", "repo": "gnome-shell", - "rev": "52c517c8f6c199a1d6f5118fae500ef69ea845ae", - "type": "github" + "rev": "c0e1ad9f0f703fd0519033b8f46c3267aab51a22", + "type": "gitlab" }, "original": { + "host": "gitlab.gnome.org", "owner": "GNOME", - "ref": "48.1", + "ref": "gnome-49", "repo": "gnome-shell", - "type": "github" + "type": "gitlab" } }, "home-manager": { @@ -282,16 +284,16 @@ ] }, "locked": { - "lastModified": 1763992789, - "narHash": "sha256-WHkdBlw6oyxXIra/vQPYLtqY+3G8dUVZM8bEXk0t8x4=", + "lastModified": 1764536451, + "narHash": "sha256-BgtcUkBfItu9/yU14IgUaj4rYOanTOUZjUfBP20/ZB4=", "owner": "nix-community", "repo": "home-manager", - "rev": "44831a7eaba4360fb81f2acc5ea6de5fde90aaa3", + "rev": "3fdd076e08049a9c7a83149b270440d9787d2df5", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", + "ref": "release-25.11", "repo": "home-manager", "type": "github" } @@ -440,16 +442,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1764316264, - "narHash": "sha256-82L+EJU+40+FIdeG4gmUlOF1jeSwlf2AwMarrpdHF6o=", + "lastModified": 1764522689, + "narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9a7b80b6f82a71ea04270d7ba11b48855681c4b0", + "rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-25.05", + "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } @@ -485,6 +487,38 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1764560356, + "narHash": "sha256-M5aFEFPppI4UhdOxwdmceJ9bDJC4T6C6CzCK1E2FZyo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6c8f0cca84510cc79e09ea99a299c9bc17d03cb6", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1764560356, + "narHash": "sha256-M5aFEFPppI4UhdOxwdmceJ9bDJC4T6C6CzCK1E2FZyo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6c8f0cca84510cc79e09ea99a299c9bc17d03cb6", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "inputs": { "flake-parts": [ @@ -600,9 +634,7 @@ "nix-filter": [ "nix-filter" ], - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1757763404, @@ -626,9 +658,7 @@ "nix-filter": [ "nix-filter" ], - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1757763091, @@ -691,16 +721,16 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1763845106, - "narHash": "sha256-S3HH655nydKoLTuqX8qcJidZH0PiWGB/YcoPomH1DaQ=", + "lastModified": 1764600318, + "narHash": "sha256-PtJfp13TUHZ24Z3ybeb2W3pOr+SEjI3xkcTumgGT28E=", "owner": "nix-community", "repo": "stylix", - "rev": "b9b8173a6e31c6d06f328307ddbdf7d6af82b7ad", + "rev": "c9760a6a2ba532e6d0dcae804b7cb62ec7198f70", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", + "ref": "release-25.11", "repo": "stylix", "type": "github" } diff --git a/flake.nix b/flake.nix index 5a9e6082..e9971711 100644 --- a/flake.nix +++ b/flake.nix @@ -1,10 +1,10 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; home-manager = { - url = "github:nix-community/home-manager/release-25.05"; + url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -41,7 +41,8 @@ servicepoint-cli = { url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git"; inputs = { - nixpkgs.follows = "nixpkgs"; + # TODO: update flake to 25.11 + # nixpkgs.follows = "nixpkgs"; naersk.follows = "naersk"; nix-filter.follows = "nix-filter"; }; @@ -49,7 +50,8 @@ servicepoint-simulator = { url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git"; inputs = { - nixpkgs.follows = "nixpkgs"; + # TODO: update flake to 25.11 + # nixpkgs.follows = "nixpkgs"; naersk.follows = "naersk"; nix-filter.follows = "nix-filter"; }; @@ -59,7 +61,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; stylix = { - url = "github:nix-community/stylix/release-25.05"; + url = "github:nix-community/stylix/release-25.11"; inputs = { nixpkgs.follows = "nixpkgs"; nur.follows = "nur"; diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix index a8a0d28f..48477295 100644 --- a/homeConfigurations/vinzenz/default.nix +++ b/homeConfigurations/vinzenz/default.nix @@ -42,7 +42,7 @@ ]; }; - thefuck = { + pay-respects = { enable = true; enableZshIntegration = true; }; diff --git a/homeConfigurations/vinzenz/git.nix b/homeConfigurations/vinzenz/git.nix index 537fe61c..df51eda5 100644 --- a/homeConfigurations/vinzenz/git.nix +++ b/homeConfigurations/vinzenz/git.nix @@ -1,15 +1,17 @@ { config.programs.git = { enable = true; - userName = "Vinzenz Schroeter"; - userEmail = "vinzenz.f.s@gmail.com"; + settings = { + user = { + name = "Vinzenz Schroeter"; + email = "vinzenz.f.s@gmail.com"; + }; - aliases = { - prettylog = "log --pretty=oneline --graph"; - spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; - }; + aliases = { + prettylog = "log --pretty=oneline --graph"; + spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; + }; - extraConfig = { pull.ff = "only"; merge.tool = "kdiff3"; push.autoSetupRemote = "true"; diff --git a/homeConfigurations/vinzenz/ssh.nix b/homeConfigurations/vinzenz/ssh.nix index 20b4baea..8643fc95 100644 --- a/homeConfigurations/vinzenz/ssh.nix +++ b/homeConfigurations/vinzenz/ssh.nix @@ -1,6 +1,7 @@ { config.programs.ssh = { enable = true; + enableDefaultConfig = false; matchBlocks = { "vpn2" = { host = "vpn2 hetzner-vpn2"; diff --git a/homeModules/git.nix b/homeModules/git.nix index 76afcebf..5da1ba72 100644 --- a/homeModules/git.nix +++ b/homeModules/git.nix @@ -2,7 +2,7 @@ programs = { git = { enable = true; - extraConfig.init.defaultBranch = "main"; + settings.init.defaultBranch = "main"; }; gh = { diff --git a/nixosConfigurations/hetzner-vpn2/nginx.nix b/nixosConfigurations/hetzner-vpn2/nginx.nix index 2e5dc060..126e690d 100644 --- a/nixosConfigurations/hetzner-vpn2/nginx.nix +++ b/nixosConfigurations/hetzner-vpn2/nginx.nix @@ -1,7 +1,7 @@ { pkgs, ... }: let blog-domain-socket = "/run/nginx/blog.sock"; - anubis-domain-socket = "/run/anubis/anubis-blog.sock"; + anubis-domain-socket = "/run/anubis/anubis-blog/anubis.sock"; in { security.acme = { @@ -42,7 +42,7 @@ in }; }; - anubis.instances.main = { + anubis.instances.blog = { enable = true; settings = { BIND = anubis-domain-socket; diff --git a/nixosModules/amd-graphics.nix b/nixosModules/amd-graphics.nix index cca63931..9bc386c4 100644 --- a/nixosModules/amd-graphics.nix +++ b/nixosModules/amd-graphics.nix @@ -7,11 +7,6 @@ graphics.enable = true; amdgpu = { opencl.enable = true; - amdvlk = { - # TODO: this creates black borders around GNOME apps - # enable = true; - # support32Bit.enable = config.hardware.graphics.enable32Bit; - }; overdrive.enable = true; }; }; diff --git a/nixosModules/gnome.nix b/nixosModules/gnome.nix index 9c31f629..ead61d04 100644 --- a/nixosModules/gnome.nix +++ b/nixosModules/gnome.nix @@ -12,18 +12,17 @@ config = lib.mkMerge [ { services = { - xserver = { - # Enable the GNOME Desktop Environment. - desktopManager.gnome = { - enable = true; - extraGSettingsOverridePackages = [ pkgs.mutter ]; - extraGSettingsOverrides = '' - [org.gnome.mutter] - experimental-features=['scale-monitor-framebuffer'] - ''; - }; - displayManager.gdm.enable = true; - excludePackages = [ pkgs.xterm ]; + xserver.excludePackages = [ pkgs.xterm ]; + + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome = { + enable = true; + extraGSettingsOverridePackages = [ pkgs.mutter ]; + extraGSettingsOverrides = '' + [org.gnome.mutter] + experimental-features=['scale-monitor-framebuffer'] + ''; }; gnome = { diff --git a/nixosModules/kdeconnect.nix b/nixosModules/kdeconnect.nix index 16b669f0..1a3c2f11 100644 --- a/nixosModules/kdeconnect.nix +++ b/nixosModules/kdeconnect.nix @@ -31,7 +31,7 @@ ]; } - (lib.mkIf config.services.xserver.desktopManager.gnome.enable { + (lib.mkIf config.services.desktopManager.gnome.enable { # replace kdeconnect with gsconnect programs.kdeconnect.package = pkgs.gnomeExtensions.gsconnect; diff --git a/nixosModules/modern-desktop.nix b/nixosModules/modern-desktop.nix index f1879bda..6f3ccacd 100644 --- a/nixosModules/modern-desktop.nix +++ b/nixosModules/modern-desktop.nix @@ -28,9 +28,7 @@ services.NetworkManager-wait-online.enable = false; # prevent stuck units from preventing shutdown (default is 120s) - extraConfig = '' - DefaultTimeoutStopSec=10s - ''; + settings.Manager.DefaultTimeoutStopSec = "10s"; }; programs = { diff --git a/nixosModules/wine-gaming.nix b/nixosModules/wine-gaming.nix index 2b9cb514..84111141 100644 --- a/nixosModules/wine-gaming.nix +++ b/nixosModules/wine-gaming.nix @@ -17,6 +17,6 @@ dxvk mangohud vulkan-tools - glxinfo + mesa-demos ]; } From 18b97a9285cb3a9c5f058dcb8ce5a0ea7796c984 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 8 Dec 2025 19:47:58 +0100 Subject: [PATCH 0413/1295] servicepoint-cli: update to nixos 25.11 compatible flake --- flake.lock | 33 +++++++++++---------------------- flake.nix | 4 ++-- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index f908edd0..c388be80 100644 --- a/flake.lock +++ b/flake.lock @@ -503,22 +503,6 @@ "type": "github" } }, - "nixpkgs_3": { - "locked": { - "lastModified": 1764560356, - "narHash": "sha256-M5aFEFPppI4UhdOxwdmceJ9bDJC4T6C6CzCK1E2FZyo=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "6c8f0cca84510cc79e09ea99a299c9bc17d03cb6", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-25.05", - "repo": "nixpkgs", - "type": "github" - } - }, "nur": { "inputs": { "flake-parts": [ @@ -634,14 +618,19 @@ "nix-filter": [ "nix-filter" ], - "nixpkgs": "nixpkgs_2" + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": [ + "treefmt-nix" + ] }, "locked": { - "lastModified": 1757763404, - "narHash": "sha256-a1h+58wDOtbQXrHoZwLwB7PhXwFhBXRHhNRhAQGq/oY=", + "lastModified": 1764875421, + "narHash": "sha256-ZO9wiokPhropwsU3BfIgjm1bc59SIyqrfjfnFCM2Q68=", "ref": "refs/heads/main", - "rev": "07a5fbca27ec941c841ad93f2ac65bc529225a51", - "revCount": 46, + "rev": "fa892558f123c5d5395663fa666466c73b997245", + "revCount": 48, "type": "git", "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git" }, @@ -658,7 +647,7 @@ "nix-filter": [ "nix-filter" ], - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1757763091, diff --git a/flake.nix b/flake.nix index e9971711..792b7709 100644 --- a/flake.nix +++ b/flake.nix @@ -41,10 +41,10 @@ servicepoint-cli = { url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git"; inputs = { - # TODO: update flake to 25.11 - # nixpkgs.follows = "nixpkgs"; + nixpkgs.follows = "nixpkgs"; naersk.follows = "naersk"; nix-filter.follows = "nix-filter"; + treefmt-nix.follows = "treefmt-nix"; }; }; servicepoint-simulator = { From d55f7dc490305c9887167d5c2b2423bfcba39328 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 8 Dec 2025 20:48:52 +0100 Subject: [PATCH 0414/1295] prometheus: basic metric export --- flake.nix | 1 + nixosModules/prometheus-node.nix | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 nixosModules/prometheus-node.nix diff --git a/flake.nix b/flake.nix index 792b7709..cdc2bf43 100644 --- a/flake.nix +++ b/flake.nix @@ -277,6 +277,7 @@ self.nixosModules.globalinstalls self.nixosModules.lix-is-nix self.nixosModules.openssh + self.nixosModules.prometheus-node self.nixosModules.systemd-boot self.nixosModules.tailscale zerforschen-plus.nixosModules.default diff --git a/nixosModules/prometheus-node.nix b/nixosModules/prometheus-node.nix new file mode 100644 index 00000000..576db81e --- /dev/null +++ b/nixosModules/prometheus-node.nix @@ -0,0 +1,20 @@ +{ + services.prometheus.exporters = { + node = { + enable = true; + openFirewall = true; + port = 9190; + enabledCollectors = [ + # keep-sorted start + "cgroups" + "interrupts" + "softirqs" + "swap" + "systemd" + "tcpstat" + "wifi" + # keep-sorted end + ]; + }; + }; +} From 254b7bca19c3463b248ed781c059d6c7646923dd Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 8 Dec 2025 20:55:32 +0100 Subject: [PATCH 0415/1295] forgejo-runner: fix nixos 25.11 package name --- nixosConfigurations/forgejo-runner-1/forgejo-runner.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixosConfigurations/forgejo-runner-1/forgejo-runner.nix b/nixosConfigurations/forgejo-runner-1/forgejo-runner.nix index 4edc17e1..df9fb2b7 100644 --- a/nixosConfigurations/forgejo-runner-1/forgejo-runner.nix +++ b/nixosConfigurations/forgejo-runner-1/forgejo-runner.nix @@ -8,7 +8,7 @@ # https://wiki.nixos.org/wiki/Forgejo services.gitea-actions-runner = { - package = pkgs.forgejo-actions-runner; + package = pkgs.forgejo-runner; instances.default = { enable = true; name = "cccb"; From ef731dca1811fd9cefcf88aa5ab7b116c86690e3 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 8 Dec 2025 21:01:59 +0100 Subject: [PATCH 0416/1295] anubis: export metrics --- nixosConfigurations/hetzner-vpn2/nginx.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nixosConfigurations/hetzner-vpn2/nginx.nix b/nixosConfigurations/hetzner-vpn2/nginx.nix index 126e690d..8f1beadc 100644 --- a/nixosConfigurations/hetzner-vpn2/nginx.nix +++ b/nixosConfigurations/hetzner-vpn2/nginx.nix @@ -2,6 +2,7 @@ let blog-domain-socket = "/run/nginx/blog.sock"; anubis-domain-socket = "/run/anubis/anubis-blog/anubis.sock"; + anubis-metrics-socket = "/run/anubis/anubis-blog/anubis-metrics.sock"; in { security.acme = { @@ -26,8 +27,9 @@ in "zerforschen.plus" = { addSSL = true; enableACME = true; - locations."/" = { - proxyPass = "http://unix:" + anubis-domain-socket; + locations = { + "/".proxyPass = "http://unix:" + anubis-domain-socket; + "/_metrics".proxyPass = "http://unix:" + anubis-metrics-socket; }; }; @@ -47,6 +49,7 @@ in settings = { BIND = anubis-domain-socket; TARGET = "unix://" + blog-domain-socket; + METRICS_BIND = anubis-metrics-socket; }; }; }; From 5e51d713e8af3534b20bcf6e0af5f5673d5ba766 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 8 Dec 2025 21:17:58 +0100 Subject: [PATCH 0417/1295] anubis: rename instance --- nixosConfigurations/hetzner-vpn2/nginx.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixosConfigurations/hetzner-vpn2/nginx.nix b/nixosConfigurations/hetzner-vpn2/nginx.nix index 8f1beadc..87e0c017 100644 --- a/nixosConfigurations/hetzner-vpn2/nginx.nix +++ b/nixosConfigurations/hetzner-vpn2/nginx.nix @@ -1,8 +1,8 @@ { pkgs, ... }: let blog-domain-socket = "/run/nginx/blog.sock"; - anubis-domain-socket = "/run/anubis/anubis-blog/anubis.sock"; - anubis-metrics-socket = "/run/anubis/anubis-blog/anubis-metrics.sock"; + anubis-domain-socket = "/run/anubis/anubis-main/anubis.sock"; + anubis-metrics-socket = "/run/anubis/anubis-main/anubis-metrics.sock"; in { security.acme = { @@ -44,7 +44,7 @@ in }; }; - anubis.instances.blog = { + anubis.instances.main = { enable = true; settings = { BIND = anubis-domain-socket; From e04f33e50cc7c10603d42f816baa0c62aea189b4 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 8 Dec 2025 21:37:57 +0100 Subject: [PATCH 0418/1295] anubis: fix metrics --- nixosConfigurations/hetzner-vpn2/nginx.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixosConfigurations/hetzner-vpn2/nginx.nix b/nixosConfigurations/hetzner-vpn2/nginx.nix index 87e0c017..aa399aa8 100644 --- a/nixosConfigurations/hetzner-vpn2/nginx.nix +++ b/nixosConfigurations/hetzner-vpn2/nginx.nix @@ -28,8 +28,8 @@ in addSSL = true; enableACME = true; locations = { + "/_metrics".proxyPass = "http://unix:" + anubis-metrics-socket + ":/metrics"; "/".proxyPass = "http://unix:" + anubis-domain-socket; - "/_metrics".proxyPass = "http://unix:" + anubis-metrics-socket; }; }; From 0bb00184501291c0766efbf664ab6838240224e2 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 11 Dec 2025 20:27:18 +0100 Subject: [PATCH 0419/1295] move host specific module imports into hosts default.nix --- flake.nix | 39 ++----------------- .../forgejo-runner-1/default.nix | 2 + nixosConfigurations/ronja-pc/default.nix | 6 +++ nixosConfigurations/vinzenz-lpt2/default.nix | 9 +++++ nixosConfigurations/vinzenz-pc2/default.nix | 16 +++++--- 5 files changed, 30 insertions(+), 42 deletions(-) diff --git a/flake.nix b/flake.nix index cdc2bf43..6667dad3 100644 --- a/flake.nix +++ b/flake.nix @@ -102,49 +102,18 @@ devices = { vinzenz-lpt2 = { system = "x86_64-linux"; - additional-modules = [ - self.nixosModules.user-vinzenz - - self.nixosModules.gnome - self.nixosModules.wine-gaming - self.nixosModules.steam - self.nixosModules.podman - self.nixosModules.vinzenz-desktop-settings - self.nixosModules.intel-graphics - self.nixosModules.secure-boot - ]; home-manager-users = { inherit (self.homeConfigurations) vinzenz; }; }; vinzenz-pc2 = { system = "x86_64-linux"; - additional-modules = [ - self.nixosModules.user-vinzenz - self.nixosModules.user-ronja - - self.nixosModules.gnome - self.nixosModules.wine-gaming - self.nixosModules.steam - self.nixosModules.podman - self.nixosModules.vinzenz-desktop-settings - self.nixosModules.amd-graphics - self.nixosModules.secure-boot - ]; home-manager-users = { - inherit (self.homeConfigurations) vinzenz ronja; + inherit (self.homeConfigurations) vinzenz; }; }; ronja-pc = { system = "x86_64-linux"; - additional-modules = [ - self.nixosModules.user-ronja - - self.nixosModules.gnome - self.nixosModules.steam - self.nixosModules.wine-gaming - self.nixosModules.vinzenz-desktop-settings - ]; home-manager-users = { inherit (self.homeConfigurations) ronja; }; @@ -154,7 +123,6 @@ }; forgejo-runner-1 = { system = "aarch64-linux"; - additional-modules = [ self.nixosModules.podman ]; }; }; inherit (nixpkgs) lib; @@ -230,11 +198,11 @@ device, system, home-manager-users ? { }, - additional-modules ? [ ], }: let specialArgs = { inherit device; + my-nixos-modules = self.nixosModules; }; in nixpkgs.lib.nixosSystem { @@ -326,8 +294,7 @@ servicepoint-tanks.nixosModules.default stylix.nixosModules.stylix # keep-sorted end - ]) - ++ additional-modules; + ]); } ); diff --git a/nixosConfigurations/forgejo-runner-1/default.nix b/nixosConfigurations/forgejo-runner-1/default.nix index f9d3c3f3..16cf0e54 100644 --- a/nixosConfigurations/forgejo-runner-1/default.nix +++ b/nixosConfigurations/forgejo-runner-1/default.nix @@ -1,7 +1,9 @@ +{ my-nixos-modules, ... }: { imports = [ ./hardware.nix ./forgejo-runner.nix + my-nixos-modules.podman ]; config = { diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index dd22382c..18058a5a 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -1,11 +1,17 @@ { config, pkgs, + my-nixos-modules, ... }: { imports = [ ./hardware.nix + my-nixos-modules.user-ronja + my-nixos-modules.gnome + my-nixos-modules.steam + my-nixos-modules.wine-gaming + my-nixos-modules.vinzenz-desktop-settings ]; config = { diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index 38e9a3f9..1478a41e 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -1,6 +1,15 @@ +{ my-nixos-modules, ... }: { imports = [ ./hardware.nix + my-nixos-modules.user-vinzenz + my-nixos-modules.gnome + my-nixos-modules.wine-gaming + my-nixos-modules.steam + my-nixos-modules.podman + my-nixos-modules.vinzenz-desktop-settings + my-nixos-modules.intel-graphics + my-nixos-modules.secure-boot ]; config = { diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix index 23505b1a..6ebbc160 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -1,9 +1,18 @@ -{ pkgs, ... }: +{ pkgs, my-nixos-modules, ... }: { imports = [ ./hardware.nix ./vscode-server.nix ./hass.nix + + my-nixos-modules.user-vinzenz + my-nixos-modules.gnome + my-nixos-modules.wine-gaming + my-nixos-modules.steam + my-nixos-modules.podman + my-nixos-modules.vinzenz-desktop-settings + my-nixos-modules.amd-graphics + my-nixos-modules.secure-boot ]; config = { @@ -27,11 +36,6 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' ]; - users.users.ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' - ]; - environment.systemPackages = with pkgs; [ lact ]; networking.firewall.allowedUDPPorts = [ From 6bfa995c4d29917fb47bf26a9949fdf132891739 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 11 Dec 2025 22:13:32 +0100 Subject: [PATCH 0420/1295] move more stuf out of flake.nix --- flake.nix | 100 +++--------------- nixosConfigurations/epimetheus/default.nix | 8 ++ .../forgejo-runner-1/default.nix | 4 +- nixosConfigurations/ronja-pc/default.nix | 12 +-- nixosConfigurations/vinzenz-lpt2/default.nix | 18 ++-- nixosConfigurations/vinzenz-pc2/default.nix | 18 ++-- nixosModules/global-settings-desktop.nix | 57 ++++++++++ nixosModules/global-settings.nix | 47 ++++++++ nixosModules/openssh.nix | 2 +- nixosModules/pxvirt-guest.nix | 26 +++++ 10 files changed, 180 insertions(+), 112 deletions(-) create mode 100644 nixosConfigurations/epimetheus/default.nix create mode 100644 nixosModules/global-settings-desktop.nix create mode 100644 nixosModules/global-settings.nix create mode 100644 nixosModules/pxvirt-guest.nix diff --git a/flake.nix b/flake.nix index 6667dad3..0af55eb8 100644 --- a/flake.nix +++ b/flake.nix @@ -80,7 +80,7 @@ }; outputs = - { + inputs@{ self, nixpkgs, home-manager, @@ -124,6 +124,9 @@ forgejo-runner-1 = { system = "aarch64-linux"; }; + epimetheus = { + system = "aarch64-linux"; + }; }; inherit (nixpkgs) lib; forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) devices; @@ -200,101 +203,28 @@ home-manager-users ? { }, }: let - specialArgs = { - inherit device; - my-nixos-modules = self.nixosModules; + specialArgs = inputs // { + inherit device home-manager-users; }; in nixpkgs.lib.nixosSystem { inherit system specialArgs; modules = [ { - networking.hostName = device; + imports = [ + ./nixosConfigurations/${device} + self.nixosModules.global-settings + ] + ++ (lib.optionals (home-manager-users != { }) [ + self.nixosModules.global-settings-desktop + ]); + nixpkgs = { inherit system; hostPlatform = lib.mkDefault system; }; - system = { - stateVersion = "22.11"; - autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; - }; - - nixpkgs.overlays = [ - self.overlays.unstable-packages - ]; - - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - documentation = { - info.enable = false; # info pages and the info command - doc.enable = false; # documentation distributed in packages' /share/doc - }; } - - ./nixosConfigurations/${device} - - # keep-sorted start - lanzaboote.nixosModules.lanzaboote - self.nixosModules.allowed-unfree-list - self.nixosModules.autoupdate - self.nixosModules.default - self.nixosModules.extra-caches - self.nixosModules.globalinstalls - self.nixosModules.lix-is-nix - self.nixosModules.openssh - self.nixosModules.prometheus-node - self.nixosModules.systemd-boot - self.nixosModules.tailscale - zerforschen-plus.nixosModules.default - # keep-sorted end - ] - ++ (nixpkgs.lib.optionals (home-manager-users != { }) [ - { - home-manager = { - extraSpecialArgs = specialArgs; - useGlobalPkgs = true; - useUserPackages = true; - }; - - time.timeZone = "Europe/Berlin"; - - home-manager.sharedModules = [ - { home.stateVersion = "22.11"; } - # keep-sorted start - self.homeModules.git - self.homeModules.gnome-extensions - self.homeModules.nano - self.homeModules.templates - self.homeModules.zsh-basics - self.homeModules.zsh-powerlevel10k - # keep-sorted end - ]; - - home-manager.users = home-manager-users; - } - - # keep-sorted start - home-manager.nixosModules.home-manager - self.nixosModules.en-de - self.nixosModules.firmware-updates - self.nixosModules.gnome - self.nixosModules.kdeconnect - self.nixosModules.modern-desktop - self.nixosModules.niri - self.nixosModules.nix-ld - self.nixosModules.pkgs-unstable - self.nixosModules.pkgs-vscode-extensions - self.nixosModules.quiet-boot - self.nixosModules.stylix - servicepoint-cli.nixosModules.default - servicepoint-simulator.nixosModules.default - servicepoint-tanks.nixosModules.default - stylix.nixosModules.stylix - # keep-sorted end - ]); + ]; } ); diff --git a/nixosConfigurations/epimetheus/default.nix b/nixosConfigurations/epimetheus/default.nix new file mode 100644 index 00000000..02c6ae8b --- /dev/null +++ b/nixosConfigurations/epimetheus/default.nix @@ -0,0 +1,8 @@ +{ self, ... }: +{ + imports = [ self.nixosModules.pxvirt-guest ]; + + config = { + + }; +} diff --git a/nixosConfigurations/forgejo-runner-1/default.nix b/nixosConfigurations/forgejo-runner-1/default.nix index 16cf0e54..a8adb694 100644 --- a/nixosConfigurations/forgejo-runner-1/default.nix +++ b/nixosConfigurations/forgejo-runner-1/default.nix @@ -1,9 +1,9 @@ -{ my-nixos-modules, ... }: +{ self, ... }: { imports = [ ./hardware.nix ./forgejo-runner.nix - my-nixos-modules.podman + self.nixosModules.podman ]; config = { diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index 18058a5a..7630611c 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -1,17 +1,17 @@ { config, pkgs, - my-nixos-modules, + self, ... }: { imports = [ ./hardware.nix - my-nixos-modules.user-ronja - my-nixos-modules.gnome - my-nixos-modules.steam - my-nixos-modules.wine-gaming - my-nixos-modules.vinzenz-desktop-settings + self.nixosModules.user-ronja + self.nixosModules.gnome + self.nixosModules.steam + self.nixosModules.wine-gaming + self.nixosModules.vinzenz-desktop-settings ]; config = { diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index 1478a41e..1c08898e 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -1,15 +1,15 @@ -{ my-nixos-modules, ... }: +{ self, ... }: { imports = [ ./hardware.nix - my-nixos-modules.user-vinzenz - my-nixos-modules.gnome - my-nixos-modules.wine-gaming - my-nixos-modules.steam - my-nixos-modules.podman - my-nixos-modules.vinzenz-desktop-settings - my-nixos-modules.intel-graphics - my-nixos-modules.secure-boot + self.nixosModules.user-vinzenz + self.nixosModules.gnome + self.nixosModules.wine-gaming + self.nixosModules.steam + self.nixosModules.podman + self.nixosModules.vinzenz-desktop-settings + self.nixosModules.intel-graphics + self.nixosModules.secure-boot ]; config = { diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix index 6ebbc160..5f68511e 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -1,18 +1,18 @@ -{ pkgs, my-nixos-modules, ... }: +{ pkgs, self, ... }: { imports = [ ./hardware.nix ./vscode-server.nix ./hass.nix - my-nixos-modules.user-vinzenz - my-nixos-modules.gnome - my-nixos-modules.wine-gaming - my-nixos-modules.steam - my-nixos-modules.podman - my-nixos-modules.vinzenz-desktop-settings - my-nixos-modules.amd-graphics - my-nixos-modules.secure-boot + self.nixosModules.user-vinzenz + self.nixosModules.gnome + self.nixosModules.wine-gaming + self.nixosModules.steam + self.nixosModules.podman + self.nixosModules.vinzenz-desktop-settings + self.nixosModules.amd-graphics + self.nixosModules.secure-boot ]; config = { diff --git a/nixosModules/global-settings-desktop.nix b/nixosModules/global-settings-desktop.nix new file mode 100644 index 00000000..a92a5d2a --- /dev/null +++ b/nixosModules/global-settings-desktop.nix @@ -0,0 +1,57 @@ +{ + home-manager-users, + self, + home-manager, + servicepoint-cli, + servicepoint-simulator, + servicepoint-tanks, + stylix, + specialArgs, + ... +}: +{ + imports = [ + { + home-manager = { + extraSpecialArgs = specialArgs; + useGlobalPkgs = true; + useUserPackages = true; + }; + + time.timeZone = "Europe/Berlin"; + + home-manager.sharedModules = [ + { home.stateVersion = "22.11"; } + # keep-sorted start + self.homeModules.git + self.homeModules.gnome-extensions + self.homeModules.nano + self.homeModules.templates + self.homeModules.zsh-basics + self.homeModules.zsh-powerlevel10k + # keep-sorted end + ]; + + home-manager.users = home-manager-users; + } + + # keep-sorted start + home-manager.nixosModules.home-manager + self.nixosModules.en-de + self.nixosModules.firmware-updates + self.nixosModules.gnome + self.nixosModules.kdeconnect + self.nixosModules.modern-desktop + self.nixosModules.niri + self.nixosModules.nix-ld + self.nixosModules.pkgs-unstable + self.nixosModules.pkgs-vscode-extensions + self.nixosModules.quiet-boot + self.nixosModules.stylix + servicepoint-cli.nixosModules.default + servicepoint-simulator.nixosModules.default + servicepoint-tanks.nixosModules.default + stylix.nixosModules.stylix + # keep-sorted end + ]; +} diff --git a/nixosModules/global-settings.nix b/nixosModules/global-settings.nix new file mode 100644 index 00000000..77bddaed --- /dev/null +++ b/nixosModules/global-settings.nix @@ -0,0 +1,47 @@ +{ + device, + self, + lanzaboote, + zerforschen-plus, + ... +}: +{ + imports = [ + # keep-sorted start + lanzaboote.nixosModules.lanzaboote + self.nixosModules.allowed-unfree-list + self.nixosModules.autoupdate + self.nixosModules.default + self.nixosModules.extra-caches + self.nixosModules.globalinstalls + self.nixosModules.lix-is-nix + self.nixosModules.openssh + self.nixosModules.prometheus-node + self.nixosModules.systemd-boot + self.nixosModules.tailscale + zerforschen-plus.nixosModules.default + # keep-sorted end + ]; + + config = { + networking.hostName = device; + system = { + stateVersion = "22.11"; + autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; + }; + + nixpkgs.overlays = [ + self.overlays.unstable-packages + ]; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + documentation = { + info.enable = false; # info pages and the info command + doc.enable = false; # documentation distributed in packages' /share/doc + }; + }; +} diff --git a/nixosModules/openssh.nix b/nixosModules/openssh.nix index ed24fe29..7ff8b18f 100644 --- a/nixosModules/openssh.nix +++ b/nixosModules/openssh.nix @@ -3,7 +3,7 @@ enable = true; openFirewall = true; settings = { - PermitRootLogin = "without-password"; + PermitRootLogin = "prohibit-password"; PasswordAuthentication = false; KbdInteractiveAuthentication = false; }; diff --git a/nixosModules/pxvirt-guest.nix b/nixosModules/pxvirt-guest.nix new file mode 100644 index 00000000..067a0ece --- /dev/null +++ b/nixosModules/pxvirt-guest.nix @@ -0,0 +1,26 @@ +{ modulesPath, lib, ... }: +{ + imports = [ (modulesPath + "/virtualisation/proxmox-lxc.nix") ]; + + config = { + # TODO is this needed? + # nix.settings.sandbox = false; + + proxmoxLXC = { + manageNetwork = false; + privileged = false; + }; + + # Let Proxmox host handle fstrim + services.fstrim.enable = false; + + # TODO is this needed + # Cache DNS lookups to improve performance + services.resolved.extraConfig = '' + Cache=true + CacheFromLocalhost=true + ''; + + boot.loader.systemd-boot.enable = lib.mkForce false; + }; +} From 33f5a07af15ee0db93c754fa909b4bfd87b78f60 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 3 Jan 2026 18:45:55 +0100 Subject: [PATCH 0421/1295] generate pxvirt lxc template tar --- flake.lock | 37 ++++++++++++++++++++ flake.nix | 22 ++++++++++++ nixosConfigurations/vinzenz-lpt2/default.nix | 2 ++ 3 files changed, 61 insertions(+) diff --git a/flake.lock b/flake.lock index c388be80..f7947959 100644 --- a/flake.lock +++ b/flake.lock @@ -440,6 +440,42 @@ "type": "github" } }, + "nixlib": { + "locked": { + "lastModified": 1736643958, + "narHash": "sha256-tmpqTSWVRJVhpvfSN9KXBvKEXplrwKnSZNAoNPf/S/s=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "1418bc28a52126761c02dd3d89b2d8ca0f521181", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixos-generators": { + "inputs": { + "nixlib": "nixlib", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1764234087, + "narHash": "sha256-NHF7QWa0ZPT8hsJrvijREW3+nifmF2rTXgS2v0tpcEA=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "032a1878682fafe829edfcf5fdfad635a2efe748", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1764522689, @@ -561,6 +597,7 @@ "niri": "niri", "nix-filter": "nix-filter", "nix-vscode-extensions": "nix-vscode-extensions", + "nixos-generators": "nixos-generators", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", diff --git a/flake.nix b/flake.nix index 0af55eb8..58941722 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,10 @@ url = "github:nix-community/nix-vscode-extensions"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixos-generators = { + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nur = { url = "github:nix-community/NUR"; inputs = { @@ -88,6 +92,7 @@ lanzaboote, niri, nix-vscode-extensions, + nixos-generators, nixpkgs-unstable, servicepoint-cli, servicepoint-simulator, @@ -236,5 +241,22 @@ formatting = treefmt-eval.config.build.check self; } ); + + packages = forAllSystems ( + { ... }: + { + nixos-aarch64-pxvirt-lxc-template = nixos-generators.nixosGenerate { + system = "aarch64-linux"; + format = "proxmox-lxc"; + specialArgs = inputs // { + device = "nixos-aarch64-pxvirt-lxc-template"; + }; + modules = [ + self.nixosModules.global-settings + self.nixosModules.pxvirt-guest + ]; + }; + } + ); }; } diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index 1c08898e..61452252 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -62,5 +62,7 @@ nixpkgs.config.permittedInsecurePackages = [ "mbedtls-2.28.10" ]; + + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; }; } From 8120c37364722ce945f77582f1ce9e8834655850 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 8 Jan 2026 21:51:06 +0100 Subject: [PATCH 0422/1295] remove powerlevel10k module --- homeModules/zsh-powerlevel10k.nix | 23 ------------ nixosModules/global-settings-desktop.nix | 47 ++++++++++++------------ 2 files changed, 23 insertions(+), 47 deletions(-) delete mode 100644 homeModules/zsh-powerlevel10k.nix diff --git a/homeModules/zsh-powerlevel10k.nix b/homeModules/zsh-powerlevel10k.nix deleted file mode 100644 index 295fd0c1..00000000 --- a/homeModules/zsh-powerlevel10k.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - options.programs.zsh-powerlevel10k = { - enable = lib.mkEnableOption "powerlevel10k zsh theme"; - package = lib.mkPackageOption pkgs "zsh-powerlevel10k" { nullable = true; }; - }; - - config = - let - cfg = config.programs.zsh-powerlevel10k; - p10k = if (cfg.package != null) then cfg.package else pkgs.zsh-powerlevel10k; - in - lib.mkIf cfg.enable { - programs.zsh.initContent = '' - source ${p10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme - ''; - }; -} diff --git a/nixosModules/global-settings-desktop.nix b/nixosModules/global-settings-desktop.nix index a92a5d2a..eda369d8 100644 --- a/nixosModules/global-settings-desktop.nix +++ b/nixosModules/global-settings-desktop.nix @@ -11,30 +11,6 @@ }: { imports = [ - { - home-manager = { - extraSpecialArgs = specialArgs; - useGlobalPkgs = true; - useUserPackages = true; - }; - - time.timeZone = "Europe/Berlin"; - - home-manager.sharedModules = [ - { home.stateVersion = "22.11"; } - # keep-sorted start - self.homeModules.git - self.homeModules.gnome-extensions - self.homeModules.nano - self.homeModules.templates - self.homeModules.zsh-basics - self.homeModules.zsh-powerlevel10k - # keep-sorted end - ]; - - home-manager.users = home-manager-users; - } - # keep-sorted start home-manager.nixosModules.home-manager self.nixosModules.en-de @@ -54,4 +30,27 @@ stylix.nixosModules.stylix # keep-sorted end ]; + + config = { + home-manager = { + extraSpecialArgs = specialArgs; + useGlobalPkgs = true; + useUserPackages = true; + }; + + time.timeZone = "Europe/Berlin"; + + home-manager.sharedModules = [ + { home.stateVersion = "22.11"; } + # keep-sorted start + self.homeModules.git + self.homeModules.gnome-extensions + self.homeModules.nano + self.homeModules.templates + self.homeModules.zsh-basics + # keep-sorted end + ]; + + home-manager.users = home-manager-users; + }; } From 0414f6ac073ce4f9809f1e65276c0e8451390ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 15 Jan 2026 23:11:25 +0100 Subject: [PATCH 0423/1295] git user change --- homeConfigurations/vinzenz/git.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeConfigurations/vinzenz/git.nix b/homeConfigurations/vinzenz/git.nix index df51eda5..ba7cd61c 100644 --- a/homeConfigurations/vinzenz/git.nix +++ b/homeConfigurations/vinzenz/git.nix @@ -3,8 +3,8 @@ enable = true; settings = { user = { - name = "Vinzenz Schroeter"; - email = "vinzenz.f.s@gmail.com"; + name = "müde"; + email = "git@darkest.space"; }; aliases = { From 244b337a2675dcff8063e12adf49cb74a15075fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 15 Jan 2026 23:23:03 +0100 Subject: [PATCH 0424/1295] nix flake update --- flake.lock | 128 ++++++++++++++++++++++++++--------------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/flake.lock b/flake.lock index f7947959..d4bab49a 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1746562888, - "narHash": "sha256-YgNJQyB5dQiwavdDFBMNKk1wyS77AtdgDk/VtU6wEaI=", + "lastModified": 1755819240, + "narHash": "sha256-qcMhnL7aGAuFuutH4rq9fvAhCpJWVHLcHVZLtPctPlo=", "owner": "SenchoPens", "repo": "base16.nix", - "rev": "806a1777a5db2a1ef9d5d6f493ef2381047f2b89", + "rev": "75ed5e5e3fce37df22e49125181fa37899c3ccd6", "type": "github" }, "original": { @@ -21,28 +21,28 @@ "base16-fish": { "flake": false, "locked": { - "lastModified": 1754405784, - "narHash": "sha256-l9xHIy+85FN+bEo6yquq2IjD1rSg9fjfjpyGP1W8YXo=", + "lastModified": 1765809053, + "narHash": "sha256-XCUQLoLfBJ8saWms2HCIj4NEN+xNsWBlU1NrEPcQG4s=", "owner": "tomyun", "repo": "base16-fish", - "rev": "23ae20a0093dca0d7b39d76ba2401af0ccf9c561", + "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", "type": "github" }, "original": { "owner": "tomyun", "repo": "base16-fish", - "rev": "23ae20a0093dca0d7b39d76ba2401af0ccf9c561", + "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", "type": "github" } }, "base16-helix": { "flake": false, "locked": { - "lastModified": 1748408240, - "narHash": "sha256-9M2b1rMyMzJK0eusea0x3lyh3mu5nMeEDSc4RZkGm+g=", + "lastModified": 1760703920, + "narHash": "sha256-m82fGUYns4uHd+ZTdoLX2vlHikzwzdu2s2rYM2bNwzw=", "owner": "tinted-theming", "repo": "base16-helix", - "rev": "6c711ab1a9db6f51e2f6887cc3345530b33e152e", + "rev": "d646af9b7d14bff08824538164af99d0c521b185", "type": "github" }, "original": { @@ -152,11 +152,11 @@ "firefox-gnome-theme": { "flake": false, "locked": { - "lastModified": 1748383148, - "narHash": "sha256-pGvD/RGuuPf/4oogsfeRaeMm6ipUIznI2QSILKjKzeA=", + "lastModified": 1764873433, + "narHash": "sha256-1XPewtGMi+9wN9Ispoluxunw/RwozuTRVuuQOmxzt+A=", "owner": "rafaelmardojai", "repo": "firefox-gnome-theme", - "rev": "4eb2714fbed2b80e234312611a947d6cb7d70caf", + "rev": "f7ffd917ac0d253dbd6a3bf3da06888f57c69f92", "type": "github" }, "original": { @@ -186,11 +186,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1763759067, - "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", + "lastModified": 1768135262, + "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", + "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac", "type": "github" }, "original": { @@ -262,11 +262,11 @@ "flake": false, "locked": { "host": "gitlab.gnome.org", - "lastModified": 1764524476, - "narHash": "sha256-bTmNn3Q4tMQ0J/P0O5BfTQwqEnCiQIzOGef9/aqAZvk=", + "lastModified": 1767737596, + "narHash": "sha256-eFujfIUQDgWnSJBablOuG+32hCai192yRdrNHTv0a+s=", "owner": "GNOME", "repo": "gnome-shell", - "rev": "c0e1ad9f0f703fd0519033b8f46c3267aab51a22", + "rev": "ef02db02bf0ff342734d525b5767814770d85b49", "type": "gitlab" }, "original": { @@ -284,11 +284,11 @@ ] }, "locked": { - "lastModified": 1764536451, - "narHash": "sha256-BgtcUkBfItu9/yU14IgUaj4rYOanTOUZjUfBP20/ZB4=", + "lastModified": 1767910483, + "narHash": "sha256-MOU5YdVu4DVwuT5ztXgQpPuRRBjSjUGIdUzOQr9iQOY=", "owner": "nix-community", "repo": "home-manager", - "rev": "3fdd076e08049a9c7a83149b270440d9787d2df5", + "rev": "82fb7dedaad83e5e279127a38ef410bcfac6d77c", "type": "github" }, "original": { @@ -359,11 +359,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1764405884, - "narHash": "sha256-TnvBRPmcpcyinvLgsitHS7w5soSa6yNBfRYEI2TK1Ts=", + "lastModified": 1768492302, + "narHash": "sha256-MJ5zfUO7UZYARxy9EOpSooE961eH3K75CGOn84thbQM=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "10aae4855ee275f7d80d85f4328c24265fb20f1f", + "rev": "cbf53d0b9c9531d654e7dbcf1f9117a221ad5c58", "type": "github" }, "original": { @@ -392,11 +392,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1764399944, - "narHash": "sha256-FC9eYtSmplgxllCX4/3hJq5J3sXWKLSc7at8ZUxycVw=", + "lastModified": 1768487377, + "narHash": "sha256-+WOpoDSvYJds8zCMlwDHKBivxSViM5n1J1Jo9Lcf19Y=", "owner": "YaLTeR", "repo": "niri", - "rev": "b35bcae35b3f9665043c335e55ed5828af77db85", + "rev": "87e2dd0361172a48cb3ac8e5b3f6f701c758700d", "type": "github" }, "original": { @@ -427,11 +427,11 @@ ] }, "locked": { - "lastModified": 1764381338, - "narHash": "sha256-EBguntbfHsbikHdk9v/2lAyrLzjaZf6tEZeRymXAfJA=", + "lastModified": 1768443224, + "narHash": "sha256-U2UHV+8Ygba2eFhFSnl15wMuKqNR884V2mo2fLO9wy0=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "600e16b6baf213d9192a0035ff15618305fcea60", + "rev": "151bb82df60a9ffcd2fef1116e4c9baf133b3ec5", "type": "github" }, "original": { @@ -478,11 +478,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1764522689, - "narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=", + "lastModified": 1768323494, + "narHash": "sha256-yBXJLE6WCtrGo7LKiB6NOt6nisBEEkguC/lq/rP3zRQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f", + "rev": "2c3e5ec5df46d3aeee2a1da0bfedd74e21f4bf3a", "type": "github" }, "original": { @@ -494,11 +494,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1761765539, - "narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=", + "lastModified": 1765674936, + "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "719359f4562934ae99f5443f20aa06c2ffff91fc", + "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85", "type": "github" }, "original": { @@ -509,11 +509,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1764352606, - "narHash": "sha256-ZwPqcETKhoQ+TS40+hFr5CY4wzcNGKhi6l8w2HmmxKc=", + "lastModified": 1768395095, + "narHash": "sha256-ZhuYJbwbZT32QA95tSkXd9zXHcdZj90EzHpEXBMabaw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "24e915b36ca87d32777d766da3a3f4e3ce22cc98", + "rev": "13868c071cc73a5e9f610c47d7bb08e5da64fdd5", "type": "github" }, "original": { @@ -525,11 +525,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1764560356, - "narHash": "sha256-M5aFEFPppI4UhdOxwdmceJ9bDJC4T6C6CzCK1E2FZyo=", + "lastModified": 1757545623, + "narHash": "sha256-mCxPABZ6jRjUQx3bPP4vjA68ETbPLNz9V2pk9tO7pRQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6c8f0cca84510cc79e09ea99a299c9bc17d03cb6", + "rev": "8cd5ce828d5d1d16feff37340171a98fc3bf6526", "type": "github" }, "original": { @@ -549,11 +549,11 @@ ] }, "locked": { - "lastModified": 1764404323, - "narHash": "sha256-lyAJQNdm/ZRfH6mDXLIA8/g2tCuHlHEfthC0UA+BLFs=", + "lastModified": 1768513652, + "narHash": "sha256-gumQwI3+cmzXJNZQpL8NfjNoi+E+8yv8t0t30I2PQ7U=", "owner": "nix-community", "repo": "NUR", - "rev": "5a7ff5a222e1422c4f129f64e10ebecf78ace9f8", + "rev": "321a80b638edab9533f254070e8cf3acc37c0b8a", "type": "github" }, "original": { @@ -747,11 +747,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1764600318, - "narHash": "sha256-PtJfp13TUHZ24Z3ybeb2W3pOr+SEjI3xkcTumgGT28E=", + "lastModified": 1768493544, + "narHash": "sha256-9qk2W/6GJWLAFXNruK/zdJ0bm3bfP50vJFbtuAjQpa4=", "owner": "nix-community", "repo": "stylix", - "rev": "c9760a6a2ba532e6d0dcae804b7cb62ec7198f70", + "rev": "362306faaa7459bebf8eabf135879785f3da9bd2", "type": "github" }, "original": { @@ -812,11 +812,11 @@ "tinted-schemes": { "flake": false, "locked": { - "lastModified": 1750770351, - "narHash": "sha256-LI+BnRoFNRa2ffbe3dcuIRYAUcGklBx0+EcFxlHj0SY=", + "lastModified": 1767817087, + "narHash": "sha256-eGE8OYoK6HzhJt/7bOiNV2cx01IdIrHL7gXgjkHRdNo=", "owner": "tinted-theming", "repo": "schemes", - "rev": "5a775c6ffd6e6125947b393872cde95867d85a2a", + "rev": "bd99656235aab343e3d597bf196df9bc67429507", "type": "github" }, "original": { @@ -828,11 +828,11 @@ "tinted-tmux": { "flake": false, "locked": { - "lastModified": 1751159871, - "narHash": "sha256-UOHBN1fgHIEzvPmdNMHaDvdRMgLmEJh2hNmDrp3d3LE=", + "lastModified": 1767489635, + "narHash": "sha256-e6nnFnWXKBCJjCv4QG4bbcouJ6y3yeT70V9MofL32lU=", "owner": "tinted-theming", "repo": "tinted-tmux", - "rev": "bded5e24407cec9d01bd47a317d15b9223a1546c", + "rev": "3c32729ccae99be44fe8a125d20be06f8d7d8184", "type": "github" }, "original": { @@ -844,11 +844,11 @@ "tinted-zed": { "flake": false, "locked": { - "lastModified": 1751158968, - "narHash": "sha256-ksOyv7D3SRRtebpXxgpG4TK8gZSKFc4TIZpR+C98jX8=", + "lastModified": 1767488740, + "narHash": "sha256-wVOj0qyil8m+ouSsVZcNjl5ZR+1GdOOAooAatQXHbuU=", "owner": "tinted-theming", "repo": "base16-zed", - "rev": "86a470d94204f7652b906ab0d378e4231a5b3384", + "rev": "11abb0b282ad3786a2aae088d3a01c60916f2e40", "type": "github" }, "original": { @@ -864,11 +864,11 @@ ] }, "locked": { - "lastModified": 1762938485, - "narHash": "sha256-AlEObg0syDl+Spi4LsZIBrjw+snSVU4T8MOeuZJUJjM=", + "lastModified": 1768158989, + "narHash": "sha256-67vyT1+xClLldnumAzCTBvU0jLZ1YBcf4vANRWP3+Ak=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "5b4ee75aeefd1e2d5a1cc43cf6ba65eba75e83e4", + "rev": "e96d59dff5c0d7fddb9d113ba108f03c3ef99eca", "type": "github" }, "original": { @@ -897,11 +897,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1764366786, - "narHash": "sha256-yVCJ4Qe/JkdKDu0DddFdAQgDQVeF12nxH7zv3jtooV4=", + "lastModified": 1768106915, + "narHash": "sha256-HlLo9zH4ULRXlmlIK948cHmdVhxyHgTHxGaoCRlW4k8=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "b362a3873710a42f7ac2d8ba03772d8290733934", + "rev": "72245e108f3b03c3c4474d2de9de2d1830849603", "type": "github" }, "original": { From 6f6a9ad4586cc8e7b508d86a9d7df90d42df5130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 23 Jan 2026 18:49:47 +0100 Subject: [PATCH 0425/1295] update flake, remove commented out keys, disable vscode-server --- flake.lock | 54 +++++++++---------- nixosConfigurations/hetzner-vpn2/default.nix | 17 +++--- nixosConfigurations/vinzenz-lpt2/default.nix | 4 -- .../vinzenz-pc2/vscode-server.nix | 2 +- 4 files changed, 34 insertions(+), 43 deletions(-) diff --git a/flake.lock b/flake.lock index d4bab49a..e0df6e3a 100644 --- a/flake.lock +++ b/flake.lock @@ -284,11 +284,11 @@ ] }, "locked": { - "lastModified": 1767910483, - "narHash": "sha256-MOU5YdVu4DVwuT5ztXgQpPuRRBjSjUGIdUzOQr9iQOY=", + "lastModified": 1768949235, + "narHash": "sha256-TtjKgXyg1lMfh374w5uxutd6Vx2P/hU81aEhTxrO2cg=", "owner": "nix-community", "repo": "home-manager", - "rev": "82fb7dedaad83e5e279127a38ef410bcfac6d77c", + "rev": "75ed713570ca17427119e7e204ab3590cc3bf2a5", "type": "github" }, "original": { @@ -332,11 +332,11 @@ ] }, "locked": { - "lastModified": 1763384566, - "narHash": "sha256-r+wgI+WvNaSdxQmqaM58lVNvJYJ16zoq+tKN20cLst4=", + "lastModified": 1768908532, + "narHash": "sha256-HIdLXEFaUVE8FiaCPJbCfBMsnF+mVtDub8Jwj2BD+mk=", "owner": "nix-community", "repo": "naersk", - "rev": "d4155d6ebb70fbe2314959842f744aa7cabbbf6a", + "rev": "8d97452673640eb7fabe428e8b6a425bc355008b", "type": "github" }, "original": { @@ -359,11 +359,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1768492302, - "narHash": "sha256-MJ5zfUO7UZYARxy9EOpSooE961eH3K75CGOn84thbQM=", + "lastModified": 1769170609, + "narHash": "sha256-LiyaKNga2z/iG4pNr86iQLySEDoOytEzTCblxzRjnCk=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "cbf53d0b9c9531d654e7dbcf1f9117a221ad5c58", + "rev": "08d6e6adf34b0af12be7eaeacc0b4c1a8580b3da", "type": "github" }, "original": { @@ -392,11 +392,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1768487377, - "narHash": "sha256-+WOpoDSvYJds8zCMlwDHKBivxSViM5n1J1Jo9Lcf19Y=", + "lastModified": 1768678265, + "narHash": "sha256-Ub8eed4DsfIDWyg30xEe+8bSxL/z5Af/gCjmvJ0V/Hs=", "owner": "YaLTeR", "repo": "niri", - "rev": "87e2dd0361172a48cb3ac8e5b3f6f701c758700d", + "rev": "d7184a04b904e07113f4623610775ae78d32394c", "type": "github" }, "original": { @@ -427,11 +427,11 @@ ] }, "locked": { - "lastModified": 1768443224, - "narHash": "sha256-U2UHV+8Ygba2eFhFSnl15wMuKqNR884V2mo2fLO9wy0=", + "lastModified": 1769134548, + "narHash": "sha256-16UWbfkIEaG728vwCdXM5C/8f1NLqBwZc039p8Yj9CA=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "151bb82df60a9ffcd2fef1116e4c9baf133b3ec5", + "rev": "969bb9a90fa1365e8b5028d1b67dbd439b268675", "type": "github" }, "original": { @@ -478,11 +478,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1768323494, - "narHash": "sha256-yBXJLE6WCtrGo7LKiB6NOt6nisBEEkguC/lq/rP3zRQ=", + "lastModified": 1769089682, + "narHash": "sha256-9yA/LIuAVQq0lXelrZPjLuLVuZdm03p8tfmHhnDIkms=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2c3e5ec5df46d3aeee2a1da0bfedd74e21f4bf3a", + "rev": "078d69f03934859a181e81ba987c2bb033eebfc5", "type": "github" }, "original": { @@ -509,11 +509,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1768395095, - "narHash": "sha256-ZhuYJbwbZT32QA95tSkXd9zXHcdZj90EzHpEXBMabaw=", + "lastModified": 1768875095, + "narHash": "sha256-dYP3DjiL7oIiiq3H65tGIXXIT1Waiadmv93JS0sS+8A=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "13868c071cc73a5e9f610c47d7bb08e5da64fdd5", + "rev": "ed142ab1b3a092c4d149245d0c4126a5d7ea00b0", "type": "github" }, "original": { @@ -549,11 +549,11 @@ ] }, "locked": { - "lastModified": 1768513652, - "narHash": "sha256-gumQwI3+cmzXJNZQpL8NfjNoi+E+8yv8t0t30I2PQ7U=", + "lastModified": 1769190062, + "narHash": "sha256-HXy1M80RWBW7cIIMQ/bBV/pMa3NmK6MYOOz/kA4bHIw=", "owner": "nix-community", "repo": "NUR", - "rev": "321a80b638edab9533f254070e8cf3acc37c0b8a", + "rev": "82023efed13ef3c1bfe99f0cd669139b4a2d2694", "type": "github" }, "original": { @@ -897,11 +897,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1768106915, - "narHash": "sha256-HlLo9zH4ULRXlmlIK948cHmdVhxyHgTHxGaoCRlW4k8=", + "lastModified": 1768765571, + "narHash": "sha256-C1JbyJ3ftogmN3vmLNfyPtnJw2wY64TiUTIhFtk1Leg=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "72245e108f3b03c3c4474d2de9de2d1830849603", + "rev": "ed1cef792b4def3321ff9ab5479df09609f17a69", "type": "github" }, "original": { diff --git a/nixosConfigurations/hetzner-vpn2/default.nix b/nixosConfigurations/hetzner-vpn2/default.nix index 591dc20e..591a359c 100644 --- a/nixosConfigurations/hetzner-vpn2/default.nix +++ b/nixosConfigurations/hetzner-vpn2/default.nix @@ -10,17 +10,12 @@ services.tailscale.useRoutingFeatures = "both"; - users.users = { - root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - #ronja.openssh.authorizedKeys.keys = [ - # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - #]; - }; + users.users.root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; system.autoUpgrade.allowReboot = true; }; diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index 61452252..9478f6ae 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -32,10 +32,6 @@ ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' ]; - #users.users.ronja.openssh.authorizedKeys.keys = [ - # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - #]; - programs = { adb.enable = true; light = { diff --git a/nixosConfigurations/vinzenz-pc2/vscode-server.nix b/nixosConfigurations/vinzenz-pc2/vscode-server.nix index 6632b1f6..7c38e32e 100644 --- a/nixosConfigurations/vinzenz-pc2/vscode-server.nix +++ b/nixosConfigurations/vinzenz-pc2/vscode-server.nix @@ -1,7 +1,7 @@ { pkgs, ... }: { services.openvscode-server = { - enable = true; + enable = false; package = pkgs.unstable.openvscode-server; telemetryLevel = "off"; port = 8542; From 1b9e61f630fe2eb449c6debfc9b5249df728a983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 23 Jan 2026 19:14:51 +0100 Subject: [PATCH 0426/1295] nix fmt --- nixosConfigurations/forgejo-runner-1/default.nix | 6 +++--- nixosConfigurations/hetzner-vpn2/default.nix | 8 ++++---- nixosConfigurations/vinzenz-lpt2/default.nix | 4 ++-- nixosConfigurations/vinzenz-pc2/default.nix | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/nixosConfigurations/forgejo-runner-1/default.nix b/nixosConfigurations/forgejo-runner-1/default.nix index a8adb694..c64882bf 100644 --- a/nixosConfigurations/forgejo-runner-1/default.nix +++ b/nixosConfigurations/forgejo-runner-1/default.nix @@ -14,9 +14,9 @@ users.users = { root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming" ]; }; }; diff --git a/nixosConfigurations/hetzner-vpn2/default.nix b/nixosConfigurations/hetzner-vpn2/default.nix index 591a359c..5aeb629d 100644 --- a/nixosConfigurations/hetzner-vpn2/default.nix +++ b/nixosConfigurations/hetzner-vpn2/default.nix @@ -11,10 +11,10 @@ services.tailscale.useRoutingFeatures = "both"; users.users.root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming" ]; system.autoUpgrade.allowReboot = true; diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index 9478f6ae..8b2c909a 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -28,8 +28,8 @@ console.keyMap = "de"; users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming" ]; programs = { diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix index 5f68511e..2c1fb294 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -31,9 +31,9 @@ console.keyMap = "de"; users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming" ]; environment.systemPackages = with pkgs; [ lact ]; From 82631191ea15ba34ef16f2cbb6501d986527f0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 1 Feb 2026 12:23:07 +0100 Subject: [PATCH 0427/1295] user rename --- flake.nix | 10 +++++----- .../.config/containers/policy.json | 0 homeConfigurations/{vinzenz => muede}/default.nix | 0 .../{vinzenz => muede}/editorconfig.nix | 0 homeConfigurations/{vinzenz => muede}/element.nix | 0 homeConfigurations/{vinzenz => muede}/fonts.nix | 0 homeConfigurations/{vinzenz => muede}/fuzzel.nix | 0 homeConfigurations/{vinzenz => muede}/git.nix | 0 homeConfigurations/{vinzenz => muede}/gnome.nix | 0 homeConfigurations/{vinzenz => muede}/niri.nix | 0 homeConfigurations/{vinzenz => muede}/ssh.nix | 0 homeConfigurations/{vinzenz => muede}/starship.nix | 7 ++----- homeConfigurations/{vinzenz => muede}/swaylock.nix | 0 homeConfigurations/{vinzenz => muede}/swaync.nix | 0 homeConfigurations/{vinzenz => muede}/vscode.nix | 0 homeConfigurations/{vinzenz => muede}/waybar.css | 0 homeConfigurations/{vinzenz => muede}/waybar.nix | 0 homeConfigurations/{vinzenz => muede}/wlogout.nix | 0 homeConfigurations/{vinzenz => muede}/zsh.nix | 2 +- homeModules/gnome-extensions.nix | 4 ++-- nixosConfigurations/forgejo-runner-1/default.nix | 6 +++--- nixosConfigurations/hetzner-vpn2/default.nix | 6 +++--- .../{vinzenz-lpt2 => muede-lpt2}/default.nix | 12 +++++++----- .../{vinzenz-lpt2 => muede-lpt2}/hardware.nix | 0 .../{vinzenz-pc2 => muede-pc2}/default.nix | 12 +++++++----- .../{vinzenz-pc2 => muede-pc2}/fstab.nix | 0 .../{vinzenz-pc2 => muede-pc2}/hardware.nix | 0 .../{vinzenz-pc2 => muede-pc2}/hass.nix | 0 .../{vinzenz-pc2 => muede-pc2}/vscode-server.nix | 0 nixosConfigurations/ronja-pc/default.nix | 2 +- nixosModules/gnome.nix | 4 ++-- ...sktop-settings.nix => muede-desktop-settings.nix} | 0 nixosModules/{user-vinzenz.nix => user-muede.nix} | 7 +++---- 33 files changed, 36 insertions(+), 36 deletions(-) rename homeConfigurations/{vinzenz => muede}/.config/containers/policy.json (100%) rename homeConfigurations/{vinzenz => muede}/default.nix (100%) rename homeConfigurations/{vinzenz => muede}/editorconfig.nix (100%) rename homeConfigurations/{vinzenz => muede}/element.nix (100%) rename homeConfigurations/{vinzenz => muede}/fonts.nix (100%) rename homeConfigurations/{vinzenz => muede}/fuzzel.nix (100%) rename homeConfigurations/{vinzenz => muede}/git.nix (100%) rename homeConfigurations/{vinzenz => muede}/gnome.nix (100%) rename homeConfigurations/{vinzenz => muede}/niri.nix (100%) rename homeConfigurations/{vinzenz => muede}/ssh.nix (100%) rename homeConfigurations/{vinzenz => muede}/starship.nix (97%) rename homeConfigurations/{vinzenz => muede}/swaylock.nix (100%) rename homeConfigurations/{vinzenz => muede}/swaync.nix (100%) rename homeConfigurations/{vinzenz => muede}/vscode.nix (100%) rename homeConfigurations/{vinzenz => muede}/waybar.css (100%) rename homeConfigurations/{vinzenz => muede}/waybar.nix (100%) rename homeConfigurations/{vinzenz => muede}/wlogout.nix (100%) rename homeConfigurations/{vinzenz => muede}/zsh.nix (94%) rename nixosConfigurations/{vinzenz-lpt2 => muede-lpt2}/default.nix (82%) rename nixosConfigurations/{vinzenz-lpt2 => muede-lpt2}/hardware.nix (100%) rename nixosConfigurations/{vinzenz-pc2 => muede-pc2}/default.nix (78%) rename nixosConfigurations/{vinzenz-pc2 => muede-pc2}/fstab.nix (100%) rename nixosConfigurations/{vinzenz-pc2 => muede-pc2}/hardware.nix (100%) rename nixosConfigurations/{vinzenz-pc2 => muede-pc2}/hass.nix (100%) rename nixosConfigurations/{vinzenz-pc2 => muede-pc2}/vscode-server.nix (100%) rename nixosModules/{vinzenz-desktop-settings.nix => muede-desktop-settings.nix} (100%) rename nixosModules/{user-vinzenz.nix => user-muede.nix} (79%) diff --git a/flake.nix b/flake.nix index 58941722..e864fc6c 100644 --- a/flake.nix +++ b/flake.nix @@ -105,16 +105,16 @@ }: let devices = { - vinzenz-lpt2 = { + muede-lpt2 = { system = "x86_64-linux"; home-manager-users = { - inherit (self.homeConfigurations) vinzenz; + inherit (self.homeConfigurations) muede; }; }; - vinzenz-pc2 = { + muede-pc2 = { system = "x86_64-linux"; home-manager-users = { - inherit (self.homeConfigurations) vinzenz; + inherit (self.homeConfigurations) muede; }; }; ronja-pc = { @@ -197,7 +197,7 @@ homeModules = importModuleDir ./homeModules; homeConfigurations = { - vinzenz = ./homeConfigurations/vinzenz; + muede = ./homeConfigurations/muede; ronja = ./homeConfigurations/ronja; }; diff --git a/homeConfigurations/vinzenz/.config/containers/policy.json b/homeConfigurations/muede/.config/containers/policy.json similarity index 100% rename from homeConfigurations/vinzenz/.config/containers/policy.json rename to homeConfigurations/muede/.config/containers/policy.json diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/muede/default.nix similarity index 100% rename from homeConfigurations/vinzenz/default.nix rename to homeConfigurations/muede/default.nix diff --git a/homeConfigurations/vinzenz/editorconfig.nix b/homeConfigurations/muede/editorconfig.nix similarity index 100% rename from homeConfigurations/vinzenz/editorconfig.nix rename to homeConfigurations/muede/editorconfig.nix diff --git a/homeConfigurations/vinzenz/element.nix b/homeConfigurations/muede/element.nix similarity index 100% rename from homeConfigurations/vinzenz/element.nix rename to homeConfigurations/muede/element.nix diff --git a/homeConfigurations/vinzenz/fonts.nix b/homeConfigurations/muede/fonts.nix similarity index 100% rename from homeConfigurations/vinzenz/fonts.nix rename to homeConfigurations/muede/fonts.nix diff --git a/homeConfigurations/vinzenz/fuzzel.nix b/homeConfigurations/muede/fuzzel.nix similarity index 100% rename from homeConfigurations/vinzenz/fuzzel.nix rename to homeConfigurations/muede/fuzzel.nix diff --git a/homeConfigurations/vinzenz/git.nix b/homeConfigurations/muede/git.nix similarity index 100% rename from homeConfigurations/vinzenz/git.nix rename to homeConfigurations/muede/git.nix diff --git a/homeConfigurations/vinzenz/gnome.nix b/homeConfigurations/muede/gnome.nix similarity index 100% rename from homeConfigurations/vinzenz/gnome.nix rename to homeConfigurations/muede/gnome.nix diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/muede/niri.nix similarity index 100% rename from homeConfigurations/vinzenz/niri.nix rename to homeConfigurations/muede/niri.nix diff --git a/homeConfigurations/vinzenz/ssh.nix b/homeConfigurations/muede/ssh.nix similarity index 100% rename from homeConfigurations/vinzenz/ssh.nix rename to homeConfigurations/muede/ssh.nix diff --git a/homeConfigurations/vinzenz/starship.nix b/homeConfigurations/muede/starship.nix similarity index 97% rename from homeConfigurations/vinzenz/starship.nix rename to homeConfigurations/muede/starship.nix index 458058de..1550aac7 100644 --- a/homeConfigurations/vinzenz/starship.nix +++ b/homeConfigurations/muede/starship.nix @@ -33,9 +33,6 @@ style_user = "bg:color_r fg:text_r"; style_root = "bold bg:color_r fg:text_r"; show_always = true; - aliases = { - "vinzenz" = "müde"; - }; }; os = { disabled = false; @@ -47,8 +44,8 @@ format = "$hostname"; ssh_symbol = ""; aliases = { - "vinzenz-lpt2" = "lpt"; - "vinzenz-pc2" = "pc"; + "muede-lpt2" = "lpt"; + "muede-pc2" = "pc"; }; }; container = { diff --git a/homeConfigurations/vinzenz/swaylock.nix b/homeConfigurations/muede/swaylock.nix similarity index 100% rename from homeConfigurations/vinzenz/swaylock.nix rename to homeConfigurations/muede/swaylock.nix diff --git a/homeConfigurations/vinzenz/swaync.nix b/homeConfigurations/muede/swaync.nix similarity index 100% rename from homeConfigurations/vinzenz/swaync.nix rename to homeConfigurations/muede/swaync.nix diff --git a/homeConfigurations/vinzenz/vscode.nix b/homeConfigurations/muede/vscode.nix similarity index 100% rename from homeConfigurations/vinzenz/vscode.nix rename to homeConfigurations/muede/vscode.nix diff --git a/homeConfigurations/vinzenz/waybar.css b/homeConfigurations/muede/waybar.css similarity index 100% rename from homeConfigurations/vinzenz/waybar.css rename to homeConfigurations/muede/waybar.css diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/muede/waybar.nix similarity index 100% rename from homeConfigurations/vinzenz/waybar.nix rename to homeConfigurations/muede/waybar.nix diff --git a/homeConfigurations/vinzenz/wlogout.nix b/homeConfigurations/muede/wlogout.nix similarity index 100% rename from homeConfigurations/vinzenz/wlogout.nix rename to homeConfigurations/muede/wlogout.nix diff --git a/homeConfigurations/vinzenz/zsh.nix b/homeConfigurations/muede/zsh.nix similarity index 94% rename from homeConfigurations/vinzenz/zsh.nix rename to homeConfigurations/muede/zsh.nix index f2fc674d..16f00e1f 100644 --- a/homeConfigurations/vinzenz/zsh.nix +++ b/homeConfigurations/muede/zsh.nix @@ -2,7 +2,7 @@ { config.programs.zsh = { initContent = '' - export PATH=$PATH:/home/vinzenz/.cargo/bin + export PATH=$PATH:$HOME/.cargo/bin bindkey "^[[1;5C" forward-word bindkey "^[[1;5D" backward-word diff --git a/homeModules/gnome-extensions.nix b/homeModules/gnome-extensions.nix index 9c30c409..0e6ca16d 100644 --- a/homeModules/gnome-extensions.nix +++ b/homeModules/gnome-extensions.nix @@ -6,7 +6,7 @@ ... }: { - options.vinzenz.gnome-extensions = + options.muede.gnome-extensions = let mkDefaultEnabledOption = name: @@ -40,7 +40,7 @@ config = let - cfg = config.vinzenz.gnome-extensions; + cfg = config.muede.gnome-extensions; in lib.mkIf cfg.enable ( lib.mkMerge [ diff --git a/nixosConfigurations/forgejo-runner-1/default.nix b/nixosConfigurations/forgejo-runner-1/default.nix index c64882bf..41964305 100644 --- a/nixosConfigurations/forgejo-runner-1/default.nix +++ b/nixosConfigurations/forgejo-runner-1/default.nix @@ -14,9 +14,9 @@ users.users = { root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY pixel-JuiceSSH" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv pc2 home roaming" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC lpt2-roaming" ]; }; }; diff --git a/nixosConfigurations/hetzner-vpn2/default.nix b/nixosConfigurations/hetzner-vpn2/default.nix index 5aeb629d..59747637 100644 --- a/nixosConfigurations/hetzner-vpn2/default.nix +++ b/nixosConfigurations/hetzner-vpn2/default.nix @@ -12,9 +12,9 @@ users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY pixel-JuiceSSH" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv pc2 home roaming" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC lpt2-roaming" ]; system.autoUpgrade.allowReboot = true; diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix similarity index 82% rename from nixosConfigurations/vinzenz-lpt2/default.nix rename to nixosConfigurations/muede-lpt2/default.nix index 8b2c909a..61ef827c 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -2,12 +2,12 @@ { imports = [ ./hardware.nix - self.nixosModules.user-vinzenz + self.nixosModules.user-muede self.nixosModules.gnome self.nixosModules.wine-gaming self.nixosModules.steam self.nixosModules.podman - self.nixosModules.vinzenz-desktop-settings + self.nixosModules.muede-desktop-settings self.nixosModules.intel-graphics self.nixosModules.secure-boot ]; @@ -27,9 +27,9 @@ # Configure console keymap console.keyMap = "de"; - users.users.vinzenz.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming" + users.users.muede.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY pixel-JuiceSSH" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv pc2 home roaming" ]; programs = { @@ -60,5 +60,7 @@ ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + + users.users.muede.home = "/home/vinzenz"; }; } diff --git a/nixosConfigurations/vinzenz-lpt2/hardware.nix b/nixosConfigurations/muede-lpt2/hardware.nix similarity index 100% rename from nixosConfigurations/vinzenz-lpt2/hardware.nix rename to nixosConfigurations/muede-lpt2/hardware.nix diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/muede-pc2/default.nix similarity index 78% rename from nixosConfigurations/vinzenz-pc2/default.nix rename to nixosConfigurations/muede-pc2/default.nix index 2c1fb294..886757f8 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/muede-pc2/default.nix @@ -5,12 +5,12 @@ ./vscode-server.nix ./hass.nix - self.nixosModules.user-vinzenz + self.nixosModules.user-muede self.nixosModules.gnome self.nixosModules.wine-gaming self.nixosModules.steam self.nixosModules.podman - self.nixosModules.vinzenz-desktop-settings + self.nixosModules.muede-desktop-settings self.nixosModules.amd-graphics self.nixosModules.secure-boot ]; @@ -30,10 +30,10 @@ # Configure console keymap console.keyMap = "de"; - users.users.vinzenz.openssh.authorizedKeys.keys = [ + users.users.muede.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY pixel-JuiceSSH" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC lpt2-roaming" ]; environment.systemPackages = with pkgs; [ lact ]; @@ -42,5 +42,7 @@ # Factorio 34197 ]; + + users.users.muede.home = "/home/vinzenz"; }; } diff --git a/nixosConfigurations/vinzenz-pc2/fstab.nix b/nixosConfigurations/muede-pc2/fstab.nix similarity index 100% rename from nixosConfigurations/vinzenz-pc2/fstab.nix rename to nixosConfigurations/muede-pc2/fstab.nix diff --git a/nixosConfigurations/vinzenz-pc2/hardware.nix b/nixosConfigurations/muede-pc2/hardware.nix similarity index 100% rename from nixosConfigurations/vinzenz-pc2/hardware.nix rename to nixosConfigurations/muede-pc2/hardware.nix diff --git a/nixosConfigurations/vinzenz-pc2/hass.nix b/nixosConfigurations/muede-pc2/hass.nix similarity index 100% rename from nixosConfigurations/vinzenz-pc2/hass.nix rename to nixosConfigurations/muede-pc2/hass.nix diff --git a/nixosConfigurations/vinzenz-pc2/vscode-server.nix b/nixosConfigurations/muede-pc2/vscode-server.nix similarity index 100% rename from nixosConfigurations/vinzenz-pc2/vscode-server.nix rename to nixosConfigurations/muede-pc2/vscode-server.nix diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index 7630611c..8e1eb52d 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -11,7 +11,7 @@ self.nixosModules.gnome self.nixosModules.steam self.nixosModules.wine-gaming - self.nixosModules.vinzenz-desktop-settings + self.nixosModules.muede-desktop-settings ]; config = { diff --git a/nixosModules/gnome.nix b/nixosModules/gnome.nix index ead61d04..260fbbd9 100644 --- a/nixosModules/gnome.nix +++ b/nixosModules/gnome.nix @@ -5,7 +5,7 @@ ... }: { - options.vinzenz = { + options.muede = { keep-gnome-default-apps = lib.mkEnableOption "keep gnome default apps"; }; @@ -37,7 +37,7 @@ gpaste.enable = true; }; } - (lib.mkIf (!config.vinzenz.keep-gnome-default-apps) { + (lib.mkIf (!config.muede.keep-gnome-default-apps) { environment.gnome.excludePackages = with pkgs; [ cheese # photo booth epiphany # web browser diff --git a/nixosModules/vinzenz-desktop-settings.nix b/nixosModules/muede-desktop-settings.nix similarity index 100% rename from nixosModules/vinzenz-desktop-settings.nix rename to nixosModules/muede-desktop-settings.nix diff --git a/nixosModules/user-vinzenz.nix b/nixosModules/user-muede.nix similarity index 79% rename from nixosModules/user-vinzenz.nix rename to nixosModules/user-muede.nix index 13ccf117..959be07a 100644 --- a/nixosModules/user-vinzenz.nix +++ b/nixosModules/user-muede.nix @@ -1,10 +1,9 @@ { pkgs, ... }: { - users.users.vinzenz = { + users.users.muede = { isNormalUser = true; - name = "vinzenz"; + name = "muede"; description = "müde"; - home = "/home/vinzenz"; extraGroups = [ "networkmanager" "wheel" @@ -21,7 +20,7 @@ autoSubUidGidRange = true; }; - nix.settings.trusted-users = [ "vinzenz" ]; + nix.settings.trusted-users = [ "muede" ]; allowedUnfreePackages = [ "rider" From 1f5f86ed2968086b8fd4fa72f5e6ad834b15fcd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 1 Feb 2026 19:23:35 +0100 Subject: [PATCH 0428/1295] fixed uid --- nixosModules/user-muede.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixosModules/user-muede.nix b/nixosModules/user-muede.nix index 959be07a..19e4d820 100644 --- a/nixosModules/user-muede.nix +++ b/nixosModules/user-muede.nix @@ -2,6 +2,7 @@ { users.users.muede = { isNormalUser = true; + uid = 1000; name = "muede"; description = "müde"; extraGroups = [ From 5fc4be420744bf5b996fe520dac39c9ba0604ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 1 Feb 2026 19:23:43 +0100 Subject: [PATCH 0429/1295] nix flake update --- flake.lock | 72 +++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/flake.lock b/flake.lock index e0df6e3a..50229550 100644 --- a/flake.lock +++ b/flake.lock @@ -284,11 +284,11 @@ ] }, "locked": { - "lastModified": 1768949235, - "narHash": "sha256-TtjKgXyg1lMfh374w5uxutd6Vx2P/hU81aEhTxrO2cg=", + "lastModified": 1769580047, + "narHash": "sha256-tNqCP/+2+peAXXQ2V8RwsBkenlfWMERb+Uy6xmevyhM=", "owner": "nix-community", "repo": "home-manager", - "rev": "75ed713570ca17427119e7e204ab3590cc3bf2a5", + "rev": "366d78c2856de6ab3411c15c1cb4fb4c2bf5c826", "type": "github" }, "original": { @@ -332,11 +332,11 @@ ] }, "locked": { - "lastModified": 1768908532, - "narHash": "sha256-HIdLXEFaUVE8FiaCPJbCfBMsnF+mVtDub8Jwj2BD+mk=", + "lastModified": 1769799857, + "narHash": "sha256-88IFXZ7Sa1vxbz5pty0Io5qEaMQMMUPMonLa3Ls/ss4=", "owner": "nix-community", "repo": "naersk", - "rev": "8d97452673640eb7fabe428e8b6a425bc355008b", + "rev": "9d4ed44d8b8cecdceb1d6fd76e74123d90ae6339", "type": "github" }, "original": { @@ -359,11 +359,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1769170609, - "narHash": "sha256-LiyaKNga2z/iG4pNr86iQLySEDoOytEzTCblxzRjnCk=", + "lastModified": 1769948416, + "narHash": "sha256-auvybZw7/95ln7J01VUqg6i7zvCpspgR1miG7WwiQBg=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "08d6e6adf34b0af12be7eaeacc0b4c1a8580b3da", + "rev": "0ddfba5c5475a415c56123d700f3ceb5744c32fd", "type": "github" }, "original": { @@ -392,11 +392,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1768678265, - "narHash": "sha256-Ub8eed4DsfIDWyg30xEe+8bSxL/z5Af/gCjmvJ0V/Hs=", + "lastModified": 1769577126, + "narHash": "sha256-v9vz9Rj4MGwPuhGELdvpRKl2HH+xvkgat6VwL0L86Fg=", "owner": "YaLTeR", "repo": "niri", - "rev": "d7184a04b904e07113f4623610775ae78d32394c", + "rev": "f30db163b5748e8cf95c05aba77d0d3736f40543", "type": "github" }, "original": { @@ -427,11 +427,11 @@ ] }, "locked": { - "lastModified": 1769134548, - "narHash": "sha256-16UWbfkIEaG728vwCdXM5C/8f1NLqBwZc039p8Yj9CA=", + "lastModified": 1769914816, + "narHash": "sha256-GXK/ub/LfBFEEBO2M+HhqWu3VW042pWw145Y+jYEMT0=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "969bb9a90fa1365e8b5028d1b67dbd439b268675", + "rev": "8eebcb40d2658badb78b4162868ffcc1006b59f3", "type": "github" }, "original": { @@ -463,11 +463,11 @@ ] }, "locked": { - "lastModified": 1764234087, - "narHash": "sha256-NHF7QWa0ZPT8hsJrvijREW3+nifmF2rTXgS2v0tpcEA=", + "lastModified": 1769813415, + "narHash": "sha256-nnVmNNKBi1YiBNPhKclNYDORoHkuKipoz7EtVnXO50A=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "032a1878682fafe829edfcf5fdfad635a2efe748", + "rev": "8946737ff703382fda7623b9fab071d037e897d5", "type": "github" }, "original": { @@ -478,11 +478,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1769089682, - "narHash": "sha256-9yA/LIuAVQq0lXelrZPjLuLVuZdm03p8tfmHhnDIkms=", + "lastModified": 1769741972, + "narHash": "sha256-RxSg1EioTWNpoLaykiT1UQKTo/K0PPdLqCyQgNjNqWs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "078d69f03934859a181e81ba987c2bb033eebfc5", + "rev": "63590ac958a8af30ebd52c7a0309d8c52a94dd77", "type": "github" }, "original": { @@ -509,11 +509,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1768875095, - "narHash": "sha256-dYP3DjiL7oIiiq3H65tGIXXIT1Waiadmv93JS0sS+8A=", + "lastModified": 1769740369, + "narHash": "sha256-xKPyJoMoXfXpDM5DFDZDsi9PHArf2k5BJjvReYXoFpM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ed142ab1b3a092c4d149245d0c4126a5d7ea00b0", + "rev": "6308c3b21396534d8aaeac46179c14c439a89b8a", "type": "github" }, "original": { @@ -549,11 +549,11 @@ ] }, "locked": { - "lastModified": 1769190062, - "narHash": "sha256-HXy1M80RWBW7cIIMQ/bBV/pMa3NmK6MYOOz/kA4bHIw=", + "lastModified": 1769947836, + "narHash": "sha256-CYSecY7oPzVkQmorHjI5lTWdwGpwqP62z+YJmObxYQ4=", "owner": "nix-community", "repo": "NUR", - "rev": "82023efed13ef3c1bfe99f0cd669139b4a2d2694", + "rev": "0d28d95d7bf9e852b4e6b514955dceef2e4921a5", "type": "github" }, "original": { @@ -747,11 +747,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1768493544, - "narHash": "sha256-9qk2W/6GJWLAFXNruK/zdJ0bm3bfP50vJFbtuAjQpa4=", + "lastModified": 1769885983, + "narHash": "sha256-jLS7410B58f+3WfZ4PQ28aaaTONnmxlfAbDPdNuciLc=", "owner": "nix-community", "repo": "stylix", - "rev": "362306faaa7459bebf8eabf135879785f3da9bd2", + "rev": "fe06391a1e1905fc7e6c13443ea439a89695ca69", "type": "github" }, "original": { @@ -864,11 +864,11 @@ ] }, "locked": { - "lastModified": 1768158989, - "narHash": "sha256-67vyT1+xClLldnumAzCTBvU0jLZ1YBcf4vANRWP3+Ak=", + "lastModified": 1769691507, + "narHash": "sha256-8aAYwyVzSSwIhP2glDhw/G0i5+wOrren3v6WmxkVonM=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "e96d59dff5c0d7fddb9d113ba108f03c3ef99eca", + "rev": "28b19c5844cc6e2257801d43f2772a4b4c050a1b", "type": "github" }, "original": { @@ -897,11 +897,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1768765571, - "narHash": "sha256-C1JbyJ3ftogmN3vmLNfyPtnJw2wY64TiUTIhFtk1Leg=", + "lastModified": 1769713942, + "narHash": "sha256-0BtCSO2qzYK/akRDsERqRVLknCYD3FYErc+szreSHUo=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "ed1cef792b4def3321ff9ab5479df09609f17a69", + "rev": "37ec78ee26e158b71f42e113e0e7dd9d5eb6bdb0", "type": "github" }, "original": { From 9d5cb1e98c2227417775fd1fa704777dec79e7f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 1 Feb 2026 19:24:33 +0100 Subject: [PATCH 0430/1295] pc2: disable vscode-server and hass --- nixosConfigurations/muede-pc2/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixosConfigurations/muede-pc2/default.nix b/nixosConfigurations/muede-pc2/default.nix index 886757f8..5062ada8 100644 --- a/nixosConfigurations/muede-pc2/default.nix +++ b/nixosConfigurations/muede-pc2/default.nix @@ -2,8 +2,8 @@ { imports = [ ./hardware.nix - ./vscode-server.nix - ./hass.nix +# ./vscode-server.nix +# ./hass.nix self.nixosModules.user-muede self.nixosModules.gnome From 7901ac306527cc40d5b23d4314ffba99b4b32658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 1 Feb 2026 20:05:04 +0100 Subject: [PATCH 0431/1295] lpt2: move home --- nixosConfigurations/muede-lpt2/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index 61ef827c..dcb580fc 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -60,7 +60,5 @@ ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; - - users.users.muede.home = "/home/vinzenz"; }; } From c09b746466c69d75f0941debd72b58061e707a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 1 Feb 2026 20:14:54 +0100 Subject: [PATCH 0432/1295] pc2: move home --- nixosConfigurations/muede-pc2/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixosConfigurations/muede-pc2/default.nix b/nixosConfigurations/muede-pc2/default.nix index 5062ada8..742fa9f3 100644 --- a/nixosConfigurations/muede-pc2/default.nix +++ b/nixosConfigurations/muede-pc2/default.nix @@ -42,7 +42,5 @@ # Factorio 34197 ]; - - users.users.muede.home = "/home/vinzenz"; }; } From e3583cf85a10c7f526f35e0ab335a581230130a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sat, 7 Feb 2026 20:05:37 +0100 Subject: [PATCH 0433/1295] nix flake update --- flake.lock | 72 +++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/flake.lock b/flake.lock index 50229550..1e2104ce 100644 --- a/flake.lock +++ b/flake.lock @@ -186,11 +186,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1768135262, - "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=", + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", "type": "github" }, "original": { @@ -284,11 +284,11 @@ ] }, "locked": { - "lastModified": 1769580047, - "narHash": "sha256-tNqCP/+2+peAXXQ2V8RwsBkenlfWMERb+Uy6xmevyhM=", + "lastModified": 1770260404, + "narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=", "owner": "nix-community", "repo": "home-manager", - "rev": "366d78c2856de6ab3411c15c1cb4fb4c2bf5c826", + "rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b", "type": "github" }, "original": { @@ -359,11 +359,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1769948416, - "narHash": "sha256-auvybZw7/95ln7J01VUqg6i7zvCpspgR1miG7WwiQBg=", + "lastModified": 1770400632, + "narHash": "sha256-TsOt49sYfzmxSTj2wKHKK2ZToCByLJLxPbwbu1brDt0=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "0ddfba5c5475a415c56123d700f3ceb5744c32fd", + "rev": "652dbeb0ac2c481dee5b57be972c6fd6feb38adc", "type": "github" }, "original": { @@ -392,11 +392,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1769577126, - "narHash": "sha256-v9vz9Rj4MGwPuhGELdvpRKl2HH+xvkgat6VwL0L86Fg=", + "lastModified": 1770394936, + "narHash": "sha256-Pa0fkyLYUR+pZh7phPENDUo4mJIweaAm0uV83iUUlX8=", "owner": "YaLTeR", "repo": "niri", - "rev": "f30db163b5748e8cf95c05aba77d0d3736f40543", + "rev": "549148d27779d024255a84535b42b947f1c2a113", "type": "github" }, "original": { @@ -427,11 +427,11 @@ ] }, "locked": { - "lastModified": 1769914816, - "narHash": "sha256-GXK/ub/LfBFEEBO2M+HhqWu3VW042pWw145Y+jYEMT0=", + "lastModified": 1770431965, + "narHash": "sha256-vVMfSjrmeYGfT+dj5eLZ8xNnJP62gvdW32IFQk606wM=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "8eebcb40d2658badb78b4162868ffcc1006b59f3", + "rev": "2b53743c0c65c6c525952fce502fe6eaa0913300", "type": "github" }, "original": { @@ -478,11 +478,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1769741972, - "narHash": "sha256-RxSg1EioTWNpoLaykiT1UQKTo/K0PPdLqCyQgNjNqWs=", + "lastModified": 1770464364, + "narHash": "sha256-z5NJPSBwsLf/OfD8WTmh79tlSU8XgIbwmk6qB1/TFzY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "63590ac958a8af30ebd52c7a0309d8c52a94dd77", + "rev": "23d72dabcb3b12469f57b37170fcbc1789bd7457", "type": "github" }, "original": { @@ -494,11 +494,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1765674936, - "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=", + "lastModified": 1769909678, + "narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85", + "rev": "72716169fe93074c333e8d0173151350670b824c", "type": "github" }, "original": { @@ -509,11 +509,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1769740369, - "narHash": "sha256-xKPyJoMoXfXpDM5DFDZDsi9PHArf2k5BJjvReYXoFpM=", + "lastModified": 1770380644, + "narHash": "sha256-P7dWMHRUWG5m4G+06jDyThXO7kwSk46C1kgjEWcybkE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6308c3b21396534d8aaeac46179c14c439a89b8a", + "rev": "ae67888ff7ef9dff69b3cf0cc0fbfbcd3a722abe", "type": "github" }, "original": { @@ -549,11 +549,11 @@ ] }, "locked": { - "lastModified": 1769947836, - "narHash": "sha256-CYSecY7oPzVkQmorHjI5lTWdwGpwqP62z+YJmObxYQ4=", + "lastModified": 1770486118, + "narHash": "sha256-eto9txBNwwlQmi445yHZ+x+7mMbyYnbcSn5jG+WJpQU=", "owner": "nix-community", "repo": "NUR", - "rev": "0d28d95d7bf9e852b4e6b514955dceef2e4921a5", + "rev": "efe9288eff027bbef3bc02ff23937751d20f64c1", "type": "github" }, "original": { @@ -747,11 +747,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1769885983, - "narHash": "sha256-jLS7410B58f+3WfZ4PQ28aaaTONnmxlfAbDPdNuciLc=", + "lastModified": 1770308890, + "narHash": "sha256-7bx8Bn9B2g/loBaz+uLwdKI2rUW+RhDPyP/MqAgvrxU=", "owner": "nix-community", "repo": "stylix", - "rev": "fe06391a1e1905fc7e6c13443ea439a89695ca69", + "rev": "7e7fa955abac04a8e118b1cedf930a8fd41c34a6", "type": "github" }, "original": { @@ -864,11 +864,11 @@ ] }, "locked": { - "lastModified": 1769691507, - "narHash": "sha256-8aAYwyVzSSwIhP2glDhw/G0i5+wOrren3v6WmxkVonM=", + "lastModified": 1770228511, + "narHash": "sha256-wQ6NJSuFqAEmIg2VMnLdCnUc0b7vslUohqqGGD+Fyxk=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "28b19c5844cc6e2257801d43f2772a4b4c050a1b", + "rev": "337a4fe074be1042a35086f15481d763b8ddc0e7", "type": "github" }, "original": { @@ -897,11 +897,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1769713942, - "narHash": "sha256-0BtCSO2qzYK/akRDsERqRVLknCYD3FYErc+szreSHUo=", + "lastModified": 1770167989, + "narHash": "sha256-rE2WTxKHe3KMG/Zr5YUNeKHkZfWwSFl7yJXrOKnunHg=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "37ec78ee26e158b71f42e113e0e7dd9d5eb6bdb0", + "rev": "0947c4685f6237d4f8045482ce0c62feab40b6c4", "type": "github" }, "original": { From a00f15adfc74ffbf6da88e8974e81dc4eaf12fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 8 Feb 2026 15:13:39 +0100 Subject: [PATCH 0434/1295] waybar: pill style widgets, whole width bar --- homeConfigurations/muede/waybar.css | 360 +++++++++++++++++++--------- homeConfigurations/muede/waybar.nix | 59 ++--- 2 files changed, 264 insertions(+), 155 deletions(-) diff --git a/homeConfigurations/muede/waybar.css b/homeConfigurations/muede/waybar.css index 0210f6f9..a5bd155f 100644 --- a/homeConfigurations/muede/waybar.css +++ b/homeConfigurations/muede/waybar.css @@ -13,90 +13,31 @@ /* #endregion */ * { - font-family: sans-serif; + font-family: monospace sans-serif; + font-size: 12px; + } window#waybar { transition-property: background-color; transition-duration: 0.5s; - background: transparent; -} - -window#waybar.hidden { - opacity: 0.2; -} - -window#waybar.termite { - background-color: #3f3f3f; -} - -window#waybar.chromium { - background-color: #000000; - border: none; + /* Gradient border spanning the entire waybar window */ + border-bottom: 4px solid transparent; + background-clip: padding-box, border-box; + background-origin: padding-box, border-box; + background-image: + linear-gradient(90deg, @base01, @base00, @base01, @base00, @base01), + linear-gradient(90deg, @base0C, @base0D, @base0A, @base0D, @base0C); } .modules-left, .modules-center, .modules-right { - border: 0px solid #fff; - padding-bottom: 4px; - background-clip: content-box, padding-box; - background-image: - linear-gradient(90deg, @base01, @base01), - linear-gradient(90deg, #a30262, #4a6bb1); -} - -.modules-center, -.modules-left { - border-bottom-right-radius: 15px; - padding-right: 4px; -} - -.modules-center, -.modules-right { - border-bottom-left-radius: 15px; - padding-left: 4px; -} - -widget { - margin: 0px 4px; -} - -#workspaces, -#window, -#tray { - padding: 4px 6px; - margin-left: 6px; - margin-right: 6px; -} - -#workspaces button { - padding: 0 5px; - background-color: transparent; - color: #ffffff; - border-radius: 15px; -} - -#workspaces button:hover { - background: rgba(0, 0, 0, 0.2); -} - -#workspaces button.focused, -#workspaces button.active { - background-color: @base03; -} - -#workspaces button.urgent { - background-color: #eb4d4b; -} - -#mode { - background-color: #64727d; - box-shadow: inset 0 -3px #ffffff; + padding: 0px 4px 8px 4px; } +/* Common pill styling for all widgets */ #clock, -#battery, #cpu, #memory, #disk, @@ -107,17 +48,154 @@ widget { #wireplumber, #custom-media, #mode, -#idle_inhibitor, #scratchpad, +#mpd, +#custom-weather, +#battery, #power-profiles-daemon, -#mpd { - padding: 0 10px; - color: #ffffff; +#idle_inhibitor, +#custom-swaync, +#bluetooth, +#mpris, +#upower, +#workspaces, +#window, +#tray { + margin: 0px 4px; + padding: 0px 6px; + background: linear-gradient(135deg, @base02, @base01); + border-radius: 16px; + border: 1px solid; + transition: all 0.3s ease; } +/* special treatment for weird sized widgets */ +#custom-wlogout { + padding: 0px 10px 0px 8px; +} +#power-profiles-daemon, +#idle_inhibitor { + padding: 0px 14px 0px 8px; +} + +/* Individual widget colors */ +#workspaces, #window, -#workspaces { - margin: 0 4px; +#tray { + border-color: @base0D; +} + +#workspaces button { + padding: 0 6px; + background-color: transparent; + color: @base05; + border-radius: 12px; + border: none; + transition: all 0.3s ease; +} + +#workspaces button:hover { + background: @base03; +} + +#workspaces button.focused, +#workspaces button.active { + background-color: @base03; + color: @base07; +} + +#workspaces button.urgent { + background-color: @base08; + color: @base00; +} + +#clock { + color: @base07; + border-color: @base0D; +} + +#cpu { + color: @base09; + border-color: @base09; +} + +#memory { + color: @base0E; + border-color: @base0E; +} + +#disk { + color: @base0D; + border-color: @base0D; +} + +#temperature { + color: @base08; + border-color: @base08; +} + +#backlight { + color: @base0A; + border-color: @base0A; +} + +#network { + color: @base0B; + border-color: @base0B; +} + +#pulseaudio, +#wireplumber { + color: @base0D; + border-color: @base0D; +} + +#custom-media { + color: @base0E; + border-color: @base0E; +} + +#mode { + color: @base05; + border-color: @base03; + box-shadow: inset 0 -3px @base05; +} + +#mpd { + color: @base0E; + border-color: @base0E; +} + +#custom-weather { + color: @base0B; + border-color: @base0B; +} + +#battery, +#power-profiles-daemon, +#idle_inhibitor { + color: @base05; + border-color: @base03; +} + +#custom-swaync { + color: @base0E; + border-color: @base0E; +} + +#bluetooth { + color: @base0D; + border-color: @base0D; +} + +#mpris { + color: @base0E; + border-color: @base0E; +} + +#upower { + color: @base0B; + border-color: @base0B; } /* If workspaces is the leftmost module, omit left margin */ @@ -130,6 +208,19 @@ widget { margin-right: 0; } +/* Battery states with colored glows */ +#battery.charging { + box-shadow: 0 0 10px rgba(168, 201, 255, 0.6); + border-color: @base0B; + color: @base0B; +} + +#battery.warning:not(.charging) { + box-shadow: 0 0 10px rgba(209, 98, 164, 0.6); + border-color: @base0A; + color: @base0A; +} + @keyframes blink { to { background-color: #ffffff; @@ -137,31 +228,65 @@ widget { } } -/* Using steps() instead of linear as a timing function to limit cpu usage */ #battery.critical:not(.charging) { - background-color: #f53c3c; - color: #ffffff; + box-shadow: 0 0 10px rgba(243, 139, 168, 0.8); + border-color: @base08; + color: @base08; animation-name: blink; animation-duration: 0.5s; + /* Using steps() instead of linear as a timing function to limit cpu usage */ animation-timing-function: steps(12); animation-iteration-count: infinite; animation-direction: alternate; } -#power-profiles-daemon { - padding-right: 15px; +/* Bluetooth connected state */ +#bluetooth.connected { + box-shadow: 0 0 10px rgba(137, 180, 250, 0.5); } +/* Power profiles with state-appropriate glows */ #power-profiles-daemon.performance { - color: #f53c3c; + box-shadow: 0 0 10px rgba(243, 139, 168, 0.6); + border-color: @base08; + color: @base08; } #power-profiles-daemon.balanced { - color: #2980b9; + box-shadow: 0 0 10px rgba(137, 180, 250, 0.6); + border-color: @base0D; + color: @base0D; } #power-profiles-daemon.power-saver { - color: #2ecc71; + box-shadow: 0 0 10px rgba(168, 201, 255, 0.6); + border-color: @base0B; + color: @base0B; +} + +/* Idle inhibitor with state glow */ +#idle_inhibitor.activated { + box-shadow: 0 0 10px rgba(137, 180, 250, 0.6); + border-color: @base0D; + color: @base0D; +} + +/* MPD states with glows */ +#mpd.playing { + box-shadow: 0 0 10px rgba(168, 201, 255, 0.5); + border-color: @base0B; + color: @base0B; +} + +#mpd.paused { + box-shadow: 0 0 10px rgba(203, 166, 247, 0.5); + border-color: @base0E; + color: @base0E; +} + +#mpd.disconnected, +#mpd.stopped { + color: @base04; } #tray > .passive { @@ -170,35 +295,8 @@ widget { #tray > .needs-attention { -gtk-icon-effect: highlight; - background-color: #eb4d4b; -} - -#language { - padding: 0 5px; - margin: 0 5px; - min-width: 16px; -} - -#keyboard-state { - padding: 0 0px; - margin: 0 5px; - min-width: 16px; -} - -#keyboard-state > label { - padding: 0 5px; -} - -#keyboard-state > label.locked { - background: rgba(0, 0, 0, 0.2); -} - -#scratchpad { - background: rgba(0, 0, 0, 0.2); -} - -#scratchpad.empty { - background-color: transparent; + box-shadow: 0 0 10px rgba(243, 139, 168, 0.8); + border-color: @base08; } #privacy { @@ -206,18 +304,42 @@ widget { } #privacy-item { - padding: 0 5px; - color: white; + /*padding: 4px 10px; + margin: 4px 6px 6px 6px;*/ + color: @base05; + background: linear-gradient(135deg, @base02, @base01); + border-radius: 16px; + transition: all 0.3s ease; } #privacy-item.screenshare { - background-color: #cf5700; + box-shadow: 0 0 10px rgba(209, 98, 164, 0.6); + border-color: @base0A; + color: @base0A; } #privacy-item.audio-in { - background-color: #1ca000; + box-shadow: 0 0 10px rgba(168, 201, 255, 0.6); + border-color: @base0B; + color: @base0B; } #privacy-item.audio-out { - background-color: #0069d4; + box-shadow: 0 0 10px rgba(137, 180, 250, 0.6); + border-color: @base0D; + color: @base0D; +} + +/* Custom wlogout button */ +#custom-wlogout { + color: @base08; + background: linear-gradient(135deg, @base02, @base01); + border-radius: 16px; + border: 1px solid @base08; + transition: all 0.3s ease; +} + +#custom-wlogout:hover { + box-shadow: 0 0 10px rgba(243, 139, 168, 0.5); + border-color: @base08; } diff --git a/homeConfigurations/muede/waybar.nix b/homeConfigurations/muede/waybar.nix index b04fd5b9..4cf95328 100644 --- a/homeConfigurations/muede/waybar.nix +++ b/homeConfigurations/muede/waybar.nix @@ -37,37 +37,24 @@ "custom/swaync" ]; modules-right = [ - "group/system-tray" + "mpris" + "wireplumber" + "bluetooth" + "backlight" + "network" + "power-profiles-daemon" + "idle_inhibitor" #"image" - "group/status-infos" + "custom/weather" + "temperature" + "cpu" + "memory" + "disk" + # "battery" + "upower" "custom/wlogout" ]; - "group/system-tray" = { - orientation = "inherit"; - modules = [ - "mpris" - "wireplumber" - "bluetooth" - "backlight" - "network" - "power-profiles-daemon" - "idle_inhibitor" - ]; - }; - "group/status-infos" = { - orientation = "inherit"; - modules = [ - "custom/weather" - "temperature" - "cpu" - "memory" - "disk" - # "battery" - "upower" - ]; - }; - "niri/workspaces" = { format = "{icon}"; }; @@ -117,7 +104,7 @@ icon-size = 14; }; battery = { - format = "{capacity}% {icon}"; + format = "{icon} {capacity}%"; format-icons = [ "󰂎" # 0% "󰁺" # 10% @@ -176,19 +163,19 @@ }; cpu = { interval = 1; - format = "{usage:3}%@{avg_frequency:4}"; + format = " {usage:>3}%@{avg_frequency:>3.2f}"; }; disk = { format = "{free}/{total}"; }; "custom/wlogout" = { - format = " "; + format = ""; tooltip = false; on-click = "wlogout"; min-width = 20; }; idle_inhibitor = { - format = "{icon} "; + format = "{icon}"; format-icons = { activated = ""; deactivated = ""; @@ -213,7 +200,7 @@ # on-click = "playerctl play-pause"; # }; mpris = { - format = "{status_icon} {player} "; + format = "{status_icon} {player}"; tooltip-format = "{player} ({status_icon} {status}) {dynamic}"; status-icons = { playing = ""; @@ -222,7 +209,7 @@ }; }; memory = { - format = "{}%  "; + format = " {}%"; }; power-profiles-daemon = { format = "{icon}"; @@ -236,7 +223,7 @@ }; }; wireplumber = { - format = "{volume}% {icon}"; + format = "{icon} {volume}%"; format-muted = ""; format-icons = [ "" @@ -245,7 +232,7 @@ ]; }; temperature = { - format = "{temperatureC}°C "; + format = " {temperatureC}°C"; }; tray = { spacing = 4; @@ -266,7 +253,7 @@ in { tooltip = true; - format = "{icon} {0} "; + format = "{icon} {0}"; format-icons = { notification = "󱅫"; none = "󰂜"; From 74809ee2bb8ab221e701995bbf69158f5de4e159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 8 Feb 2026 17:43:33 +0100 Subject: [PATCH 0435/1295] waybar: theme tweaks --- homeConfigurations/muede/niri.nix | 2 +- homeConfigurations/muede/waybar.css | 87 ++++++++++++----------------- homeConfigurations/muede/waybar.nix | 27 ++++----- 3 files changed, 51 insertions(+), 65 deletions(-) diff --git a/homeConfigurations/muede/niri.nix b/homeConfigurations/muede/niri.nix index ba55d2e8..d88db90c 100644 --- a/homeConfigurations/muede/niri.nix +++ b/homeConfigurations/muede/niri.nix @@ -56,7 +56,7 @@ from = pink_dark; to = pink_light; }; - gap-size = 8; + gap-size = 6; in { background-color = "transparent"; diff --git a/homeConfigurations/muede/waybar.css b/homeConfigurations/muede/waybar.css index a5bd155f..79e7671e 100644 --- a/homeConfigurations/muede/waybar.css +++ b/homeConfigurations/muede/waybar.css @@ -13,27 +13,20 @@ /* #endregion */ * { - font-family: monospace sans-serif; - font-size: 12px; - + font-family: monospace; + font-size: 13px; } window#waybar { transition-property: background-color; transition-duration: 0.5s; /* Gradient border spanning the entire waybar window */ - border-bottom: 4px solid transparent; + border-bottom: 3px solid transparent; background-clip: padding-box, border-box; background-origin: padding-box, border-box; background-image: - linear-gradient(90deg, @base01, @base00, @base01, @base00, @base01), - linear-gradient(90deg, @base0C, @base0D, @base0A, @base0D, @base0C); -} - -.modules-left, -.modules-center, -.modules-right { - padding: 0px 4px 8px 4px; + linear-gradient(135deg, @base00, @base01), + linear-gradient(135deg, @base0C, @base09); } /* Common pill styling for all widgets */ @@ -60,22 +53,27 @@ window#waybar { #upower, #workspaces, #window, -#tray { - margin: 0px 4px; - padding: 0px 6px; +#tray, +#custom-wlogout, +#privacy-item { + margin: 0px 4px 6px; + padding: 0px 8px; background: linear-gradient(135deg, @base02, @base01); - border-radius: 16px; - border: 1px solid; + border-radius: 15px; + border: 2px solid; transition: all 0.3s ease; } /* special treatment for weird sized widgets */ -#custom-wlogout { - padding: 0px 10px 0px 8px; -} +#custom-wlogout, #power-profiles-daemon, #idle_inhibitor { - padding: 0px 14px 0px 8px; + padding: 0px 10px 0px 8px; +} + +#workspaces { + padding-left: 0; + padding-right: 0; } /* Individual widget colors */ @@ -89,7 +87,7 @@ window#waybar { padding: 0 6px; background-color: transparent; color: @base05; - border-radius: 12px; + border-radius: 15px; border: none; transition: all 0.3s ease; } @@ -210,13 +208,13 @@ window#waybar { /* Battery states with colored glows */ #battery.charging { - box-shadow: 0 0 10px rgba(168, 201, 255, 0.6); + box-shadow: 0 0 6px rgba(168, 201, 255, 0.6); border-color: @base0B; color: @base0B; } #battery.warning:not(.charging) { - box-shadow: 0 0 10px rgba(209, 98, 164, 0.6); + box-shadow: 0 0 6px rgba(209, 98, 164, 0.6); border-color: @base0A; color: @base0A; } @@ -229,7 +227,7 @@ window#waybar { } #battery.critical:not(.charging) { - box-shadow: 0 0 10px rgba(243, 139, 168, 0.8); + box-shadow: 0 0 6px rgba(243, 139, 168, 0.8); border-color: @base08; color: @base08; animation-name: blink; @@ -242,44 +240,44 @@ window#waybar { /* Bluetooth connected state */ #bluetooth.connected { - box-shadow: 0 0 10px rgba(137, 180, 250, 0.5); + box-shadow: 0 0 6px rgba(137, 180, 250, 0.5); } /* Power profiles with state-appropriate glows */ #power-profiles-daemon.performance { - box-shadow: 0 0 10px rgba(243, 139, 168, 0.6); + box-shadow: 0 0 6px rgba(243, 139, 168, 0.6); border-color: @base08; color: @base08; } #power-profiles-daemon.balanced { - box-shadow: 0 0 10px rgba(137, 180, 250, 0.6); + box-shadow: 0 0 6px rgba(137, 180, 250, 0.6); border-color: @base0D; color: @base0D; } #power-profiles-daemon.power-saver { - box-shadow: 0 0 10px rgba(168, 201, 255, 0.6); + box-shadow: 0 0 6px rgba(168, 201, 255, 0.6); border-color: @base0B; color: @base0B; } /* Idle inhibitor with state glow */ #idle_inhibitor.activated { - box-shadow: 0 0 10px rgba(137, 180, 250, 0.6); + box-shadow: 0 0 6px rgba(137, 180, 250, 0.6); border-color: @base0D; color: @base0D; } /* MPD states with glows */ #mpd.playing { - box-shadow: 0 0 10px rgba(168, 201, 255, 0.5); + box-shadow: 0 0 6px rgba(168, 201, 255, 0.5); border-color: @base0B; color: @base0B; } #mpd.paused { - box-shadow: 0 0 10px rgba(203, 166, 247, 0.5); + box-shadow: 0 0 6px rgba(203, 166, 247, 0.5); border-color: @base0E; color: @base0E; } @@ -295,7 +293,7 @@ window#waybar { #tray > .needs-attention { -gtk-icon-effect: highlight; - box-shadow: 0 0 10px rgba(243, 139, 168, 0.8); + box-shadow: 0 0 6px rgba(243, 139, 168, 0.8); border-color: @base08; } @@ -303,29 +301,20 @@ window#waybar { padding: 0; } -#privacy-item { - /*padding: 4px 10px; - margin: 4px 6px 6px 6px;*/ - color: @base05; - background: linear-gradient(135deg, @base02, @base01); - border-radius: 16px; - transition: all 0.3s ease; -} - #privacy-item.screenshare { - box-shadow: 0 0 10px rgba(209, 98, 164, 0.6); + box-shadow: 0 0 6px rgba(209, 98, 164, 0.6); border-color: @base0A; color: @base0A; } #privacy-item.audio-in { - box-shadow: 0 0 10px rgba(168, 201, 255, 0.6); + box-shadow: 0 0 6px rgba(168, 201, 255, 0.6); border-color: @base0B; color: @base0B; } #privacy-item.audio-out { - box-shadow: 0 0 10px rgba(137, 180, 250, 0.6); + box-shadow: 0 0 6px rgba(137, 180, 250, 0.6); border-color: @base0D; color: @base0D; } @@ -333,13 +322,9 @@ window#waybar { /* Custom wlogout button */ #custom-wlogout { color: @base08; - background: linear-gradient(135deg, @base02, @base01); - border-radius: 16px; - border: 1px solid @base08; - transition: all 0.3s ease; + border-color: @base08; } #custom-wlogout:hover { - box-shadow: 0 0 10px rgba(243, 139, 168, 0.5); - border-color: @base08; + box-shadow: 0 0 6px rgba(243, 139, 168, 0.5); } diff --git a/homeConfigurations/muede/waybar.nix b/homeConfigurations/muede/waybar.nix index 4cf95328..1f014e2f 100644 --- a/homeConfigurations/muede/waybar.nix +++ b/homeConfigurations/muede/waybar.nix @@ -63,17 +63,17 @@ icon = true; }; network = { - interface = "wlo1"; + #interface = "wlo1"; format = "{ifname}"; - format-wifi = " "; - format-ethernet = "󰈀 "; - format-linked = "󱘖 "; - format-disconnected = "󰣽 "; + format-wifi = " {essid}"; + format-ethernet = "󰈀"; + format-linked = "󱘖"; + format-disconnected = "󰣽"; tooltip-format = "{ifname} via {gwaddr}"; tooltip-format-wifi = "{essid} ({signalStrength}%)"; tooltip-format-ethernet = "{ifname} {ipaddr}/{cidr}"; tooltip-format-disconnected = "Disconnected"; - max-length = 50; + max-length = 20; }; clock = { format = "{:%a, %d. %b %H:%M}"; @@ -163,10 +163,11 @@ }; cpu = { interval = 1; - format = " {usage:>3}%@{avg_frequency:>3.2f}"; + format = " {usage:>2}%@{avg_frequency:>3.2f}"; }; disk = { - format = "{free}/{total}"; + format = " {percentage_free}% {specific_total:>2.1f}"; + unit = "TB"; }; "custom/wlogout" = { format = ""; @@ -209,7 +210,7 @@ }; }; memory = { - format = " {}%"; + format = " {}%"; }; power-profiles-daemon = { format = "{icon}"; @@ -239,9 +240,9 @@ show-passive-items = true; }; bluetooth = { - format = "  {status} "; - format-connected = "  {device_alias} "; - format-connected-battery = "  {device_alias} {device_battery_percentage}% "; + format = " {status}"; + format-connected = " {device_alias}"; + format-connected-battery = " {device_alias} {device_battery_percentage}%"; tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected"; tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}"; tooltip-format-enumerate-connected = "{device_alias}\t{device_address}"; @@ -271,7 +272,7 @@ escape = true; }; "custom/weather" = { - format = "{}°"; + format = "{}"; tooltip = true; interval = 3600; exec = "${lib.getBin pkgs.wttrbar}/bin/wttrbar --nerd"; From 00ca7b0a01c25fb6be139b59e3eb75c5ee78a3db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 20 Feb 2026 22:10:20 +0100 Subject: [PATCH 0436/1295] nix flake update --- flake.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index 1e2104ce..297204d0 100644 --- a/flake.lock +++ b/flake.lock @@ -359,11 +359,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1770400632, - "narHash": "sha256-TsOt49sYfzmxSTj2wKHKK2ZToCByLJLxPbwbu1brDt0=", + "lastModified": 1771514840, + "narHash": "sha256-t3WbZvwoDj/75YDX/nwkZuxanZLZaWr9meSfKswaN6g=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "652dbeb0ac2c481dee5b57be972c6fd6feb38adc", + "rev": "4f69ab280e9bb34e2c0b67fdfa6f0978a170ef56", "type": "github" }, "original": { @@ -392,11 +392,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1770394936, - "narHash": "sha256-Pa0fkyLYUR+pZh7phPENDUo4mJIweaAm0uV83iUUlX8=", + "lastModified": 1771305475, + "narHash": "sha256-lqweVTwHhYc+9T33cysp38gVwxaibGJHriOPZXWyhCY=", "owner": "YaLTeR", "repo": "niri", - "rev": "549148d27779d024255a84535b42b947f1c2a113", + "rev": "a2a52911757cb3b497db9407592f9b4c439571ea", "type": "github" }, "original": { @@ -427,11 +427,11 @@ ] }, "locked": { - "lastModified": 1770431965, - "narHash": "sha256-vVMfSjrmeYGfT+dj5eLZ8xNnJP62gvdW32IFQk606wM=", + "lastModified": 1771555311, + "narHash": "sha256-aFjIc57eYBx5jgyLcHujraPf6b/p9RWxzvOGnHML5h0=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "2b53743c0c65c6c525952fce502fe6eaa0913300", + "rev": "88fc33a8a8868de1ac41362fb62341513904dc0f", "type": "github" }, "original": { @@ -478,11 +478,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1770464364, - "narHash": "sha256-z5NJPSBwsLf/OfD8WTmh79tlSU8XgIbwmk6qB1/TFzY=", + "lastModified": 1771419570, + "narHash": "sha256-bxAlQgre3pcQcaRUm/8A0v/X8d2nhfraWSFqVmMcBcU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "23d72dabcb3b12469f57b37170fcbc1789bd7457", + "rev": "6d41bc27aaf7b6a3ba6b169db3bd5d6159cfaa47", "type": "github" }, "original": { @@ -509,11 +509,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1770380644, - "narHash": "sha256-P7dWMHRUWG5m4G+06jDyThXO7kwSk46C1kgjEWcybkE=", + "lastModified": 1771207753, + "narHash": "sha256-b9uG8yN50DRQ6A7JdZBfzq718ryYrlmGgqkRm9OOwCE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ae67888ff7ef9dff69b3cf0cc0fbfbcd3a722abe", + "rev": "d1c15b7d5806069da59e819999d70e1cec0760bf", "type": "github" }, "original": { @@ -549,11 +549,11 @@ ] }, "locked": { - "lastModified": 1770486118, - "narHash": "sha256-eto9txBNwwlQmi445yHZ+x+7mMbyYnbcSn5jG+WJpQU=", + "lastModified": 1771620573, + "narHash": "sha256-EnAmfSplNKGQsf2NB/IySJi2uJ756+yCBl2jNvnbvCs=", "owner": "nix-community", "repo": "NUR", - "rev": "efe9288eff027bbef3bc02ff23937751d20f64c1", + "rev": "55ea501d235d485f2943b71050407ab8ec256043", "type": "github" }, "original": { @@ -747,11 +747,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1770308890, - "narHash": "sha256-7bx8Bn9B2g/loBaz+uLwdKI2rUW+RhDPyP/MqAgvrxU=", + "lastModified": 1771429540, + "narHash": "sha256-YKytDx8LOPOvE+dip1ja+1nbIpDVdqTaFbP4MaXwveM=", "owner": "nix-community", "repo": "stylix", - "rev": "7e7fa955abac04a8e118b1cedf930a8fd41c34a6", + "rev": "1a5c9d8be82127aeccc929f60b952e8a3df6b63c", "type": "github" }, "original": { @@ -897,11 +897,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1770167989, - "narHash": "sha256-rE2WTxKHe3KMG/Zr5YUNeKHkZfWwSFl7yJXrOKnunHg=", + "lastModified": 1771195969, + "narHash": "sha256-BUE41HjLIGPjq3U8VXPjf8asH8GaMI7FYdgrIHKFMXA=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "0947c4685f6237d4f8045482ce0c62feab40b6c4", + "rev": "536bd32efc935bf876d6de385ec18a1b715c9358", "type": "github" }, "original": { From 95c202eabd31624a7fff56bd07eb87793c69a5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sat, 21 Feb 2026 23:28:48 +0100 Subject: [PATCH 0437/1295] update servicepoint-cli --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 297204d0..5579220b 100644 --- a/flake.lock +++ b/flake.lock @@ -663,11 +663,11 @@ ] }, "locked": { - "lastModified": 1764875421, - "narHash": "sha256-ZO9wiokPhropwsU3BfIgjm1bc59SIyqrfjfnFCM2Q68=", + "lastModified": 1771709842, + "narHash": "sha256-zbKj2waitgCFE/I4DcV4lWMRkQ7gDOa9QgPXVTao5+g=", "ref": "refs/heads/main", - "rev": "fa892558f123c5d5395663fa666466c73b997245", - "revCount": 48, + "rev": "6c731e3f5ac0fc63e3cf1e727856f3a3327fddfb", + "revCount": 52, "type": "git", "url": "https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git" }, From 866b51811135b69991b9b65093cb40b94985ac54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 22 Feb 2026 12:32:16 +0100 Subject: [PATCH 0438/1295] move most git config into home --- homeConfigurations/muede/default.nix | 1 - homeConfigurations/muede/git.nix | 48 ++++++++++++++++------------ homeModules/git.nix | 13 ++------ 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index 48477295..7b4b6888 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -24,7 +24,6 @@ programs = { home-manager.enable = true; fzf.enable = true; - git-credential-oauth.enable = true; direnv = { enable = true; diff --git a/homeConfigurations/muede/git.nix b/homeConfigurations/muede/git.nix index ba7cd61c..97c84779 100644 --- a/homeConfigurations/muede/git.nix +++ b/homeConfigurations/muede/git.nix @@ -1,27 +1,35 @@ { - config.programs.git = { - enable = true; - settings = { - user = { - name = "müde"; - email = "git@darkest.space"; + programs = { + git = { + enable = true; + settings = { + user = { + name = "müde"; + email = "git@darkest.space"; + }; + + aliases = { + prettylog = "log --pretty=oneline --graph"; + spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; + }; + + pull.ff = "only"; + merge.tool = "kdiff3"; + push.autoSetupRemote = "true"; + credential.credentialStore = "cache"; }; - aliases = { - prettylog = "log --pretty=oneline --graph"; - spring-clean = "!git branch --merged | xargs -n 1 -r git branch -d"; - }; - - pull.ff = "only"; - merge.tool = "kdiff3"; - push.autoSetupRemote = "true"; - credential.credentialStore = "cache"; + ignores = [ + ".direnv" + ".idea" + ".envrc" + ]; }; - ignores = [ - ".direnv" - ".idea" - ".envrc" - ]; + git-credential-oauth.enable = true; + gh = { + enable = true; + gitCredentialHelper.enable = true; + }; }; } diff --git a/homeModules/git.nix b/homeModules/git.nix index 5da1ba72..2c66c82b 100644 --- a/homeModules/git.nix +++ b/homeModules/git.nix @@ -1,13 +1,6 @@ { - programs = { - git = { - enable = true; - settings.init.defaultBranch = "main"; - }; - - gh = { - enable = true; - gitCredentialHelper.enable = true; - }; + programs.git = { + enable = true; + settings.init.defaultBranch = "main"; }; } From e9e3eea3d0ff628a889525b9beed1eeca736baea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 22 Feb 2026 14:34:19 +0100 Subject: [PATCH 0439/1295] move podman policy to home manager config, add arch btw --- .../muede/.config/containers/policy.json | 23 ------------------- homeConfigurations/muede/default.nix | 5 +--- homeConfigurations/muede/podman.nix | 18 +++++++++++++++ 3 files changed, 19 insertions(+), 27 deletions(-) delete mode 100644 homeConfigurations/muede/.config/containers/policy.json create mode 100644 homeConfigurations/muede/podman.nix diff --git a/homeConfigurations/muede/.config/containers/policy.json b/homeConfigurations/muede/.config/containers/policy.json deleted file mode 100644 index 245b3df4..00000000 --- a/homeConfigurations/muede/.config/containers/policy.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "default": [ - { - "type": "reject" - } - ], - "transports": { - "docker-daemon": { - "": [ - { - "type": "insecureAcceptAnything" - } - ] - }, - "docker": { - "docker.io/library/debian": [ - { - "type": "insecureAcceptAnything" - } - ] - } - } -} diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index 7b4b6888..4b5e1ec6 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -9,6 +9,7 @@ ./git.nix ./gnome.nix ./niri.nix + ./podman.nix ./ssh.nix ./starship.nix ./swaylock.nix @@ -83,10 +84,6 @@ ]; home.file = { - "policy.json" = { - target = ".config/containers/policy.json"; - text = builtins.readFile ./.config/containers/policy.json; - }; "idea.properties".text = "idea.filewatcher.executable.path = ${pkgs.fsnotifier}/bin/fsnotifier"; }; diff --git a/homeConfigurations/muede/podman.nix b/homeConfigurations/muede/podman.nix new file mode 100644 index 00000000..ea5b090e --- /dev/null +++ b/homeConfigurations/muede/podman.nix @@ -0,0 +1,18 @@ +{ + services.podman = { + settings = { + policy = { + default = [ { type = "reject"; } ]; + transports = { + docker-daemon = { + "" = [ { type = "insecureAcceptAnything"; } ]; + }; + docker = { + "docker.io/library/debian" = [ { type = "insecureAcceptAnything"; } ]; + "docker.io/library/rust" = [ { type = "insecureAcceptAnything"; } ]; + }; + }; + }; + }; + }; +} From 22436fccae75aab9325a97789748ca0f03eab58b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 15 Mar 2026 11:59:24 +0100 Subject: [PATCH 0440/1295] vscode: ignore .git and .direnv in search --- homeConfigurations/muede/vscode.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeConfigurations/muede/vscode.nix b/homeConfigurations/muede/vscode.nix index a32a4332..b7e01ab3 100644 --- a/homeConfigurations/muede/vscode.nix +++ b/homeConfigurations/muede/vscode.nix @@ -37,6 +37,10 @@ "files.autoSave" = "afterDelay"; "files.autoSaveWhenNoErrors" = true; "files.autoSaveWorkspaceFilesOnly" = true; + "files.exclude" = [ + ".git" + ".direnv" + ]; "editor.fontLigatures" = true; "editor.formatOnSave" = true; From 26a4d3374215b9dbf376cc56d9bb4fd22940b805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 15 Mar 2026 12:00:44 +0100 Subject: [PATCH 0441/1295] nix flake update --- flake.lock | 72 +++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/flake.lock b/flake.lock index 5579220b..2665279f 100644 --- a/flake.lock +++ b/flake.lock @@ -186,11 +186,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1769996383, - "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", "type": "github" }, "original": { @@ -284,11 +284,11 @@ ] }, "locked": { - "lastModified": 1770260404, - "narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=", + "lastModified": 1773264488, + "narHash": "sha256-rK0507bDuWBrZo+0zts9bCs/+RRUEHuvFE5DHWPxX/Q=", "owner": "nix-community", "repo": "home-manager", - "rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b", + "rev": "5c0f63f8d55040a7eed69df7e3fcdd15dfb5a04c", "type": "github" }, "original": { @@ -359,11 +359,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1771514840, - "narHash": "sha256-t3WbZvwoDj/75YDX/nwkZuxanZLZaWr9meSfKswaN6g=", + "lastModified": 1773501701, + "narHash": "sha256-+0LBAEm8F5h9Nm+hdS07aoS1W4oTtW6c8lltb66oOYQ=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "4f69ab280e9bb34e2c0b67fdfa6f0978a170ef56", + "rev": "39ac039250a4a32bf8691405cac04864fc66a70d", "type": "github" }, "original": { @@ -392,11 +392,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1771305475, - "narHash": "sha256-lqweVTwHhYc+9T33cysp38gVwxaibGJHriOPZXWyhCY=", + "lastModified": 1773130184, + "narHash": "sha256-3bwx4WqCB06yfQIGB+OgIckOkEDyKxiTD5pOo4Xz2rI=", "owner": "YaLTeR", "repo": "niri", - "rev": "a2a52911757cb3b497db9407592f9b4c439571ea", + "rev": "b07bde3ee82dd73115e6b949e4f3f63695da35ea", "type": "github" }, "original": { @@ -427,11 +427,11 @@ ] }, "locked": { - "lastModified": 1771555311, - "narHash": "sha256-aFjIc57eYBx5jgyLcHujraPf6b/p9RWxzvOGnHML5h0=", + "lastModified": 1773543606, + "narHash": "sha256-phMmtcMDGos4O82iEE3qFl58jp7fp1mu2liDE0A11gQ=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "88fc33a8a8868de1ac41362fb62341513904dc0f", + "rev": "014e1925a28b3e53f90883530ce6ff80e2da238a", "type": "github" }, "original": { @@ -478,11 +478,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1771419570, - "narHash": "sha256-bxAlQgre3pcQcaRUm/8A0v/X8d2nhfraWSFqVmMcBcU=", + "lastModified": 1773375660, + "narHash": "sha256-SEzUWw2Rf5Ki3bcM26nSKgbeoqi2uYy8IHVBqOKjX3w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6d41bc27aaf7b6a3ba6b169db3bd5d6159cfaa47", + "rev": "3e20095fe3c6cbb1ddcef89b26969a69a1570776", "type": "github" }, "original": { @@ -494,11 +494,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1769909678, - "narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=", + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "72716169fe93074c333e8d0173151350670b824c", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", "type": "github" }, "original": { @@ -509,11 +509,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1771207753, - "narHash": "sha256-b9uG8yN50DRQ6A7JdZBfzq718ryYrlmGgqkRm9OOwCE=", + "lastModified": 1773507054, + "narHash": "sha256-Q8U5VXgrcxmCxPtCCJCIZkcAX3FCZwGh1GNVIXxMND0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d1c15b7d5806069da59e819999d70e1cec0760bf", + "rev": "e80236013dc8b77aa49ca90e7a12d86f5d8d64c9", "type": "github" }, "original": { @@ -549,11 +549,11 @@ ] }, "locked": { - "lastModified": 1771620573, - "narHash": "sha256-EnAmfSplNKGQsf2NB/IySJi2uJ756+yCBl2jNvnbvCs=", + "lastModified": 1773570788, + "narHash": "sha256-WarFHtdyYB1tCDNCPIfazfXWKGpmW5lpYhxqC+IfX/E=", "owner": "nix-community", "repo": "NUR", - "rev": "55ea501d235d485f2943b71050407ab8ec256043", + "rev": "ca9c5ddc6cd9671fadff5da08e26255d55030179", "type": "github" }, "original": { @@ -747,11 +747,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1771429540, - "narHash": "sha256-YKytDx8LOPOvE+dip1ja+1nbIpDVdqTaFbP4MaXwveM=", + "lastModified": 1771788390, + "narHash": "sha256-RzBpBwn93GWxLjacTte+ngwwg0L/BVOg4G/sSIeK3Rw=", "owner": "nix-community", "repo": "stylix", - "rev": "1a5c9d8be82127aeccc929f60b952e8a3df6b63c", + "rev": "ebb238f14d6f930068be4718472da3105fd5d3bf", "type": "github" }, "original": { @@ -864,11 +864,11 @@ ] }, "locked": { - "lastModified": 1770228511, - "narHash": "sha256-wQ6NJSuFqAEmIg2VMnLdCnUc0b7vslUohqqGGD+Fyxk=", + "lastModified": 1773297127, + "narHash": "sha256-6E/yhXP7Oy/NbXtf1ktzmU8SdVqJQ09HC/48ebEGBpk=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "337a4fe074be1042a35086f15481d763b8ddc0e7", + "rev": "71b125cd05fbfd78cab3e070b73544abe24c5016", "type": "github" }, "original": { @@ -897,11 +897,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1771195969, - "narHash": "sha256-BUE41HjLIGPjq3U8VXPjf8asH8GaMI7FYdgrIHKFMXA=", + "lastModified": 1773499041, + "narHash": "sha256-XZ4/tVdLeAYDgKe4JD4C7yYUKydMxwt8c2j6APFWcIc=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "536bd32efc935bf876d6de385ec18a1b715c9358", + "rev": "309d8e2a29953f7465dc14c939e2afe4682c0aa9", "type": "github" }, "original": { From 98da73dceb3fbce2705f876af68dba35d488b04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 9 Apr 2026 17:31:53 +0200 Subject: [PATCH 0442/1295] swaylock: move niri lock hotkey --- homeConfigurations/muede/niri.nix | 4 ---- homeConfigurations/muede/swaylock.nix | 11 ++++++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/homeConfigurations/muede/niri.nix b/homeConfigurations/muede/niri.nix index d88db90c..4eebab75 100644 --- a/homeConfigurations/muede/niri.nix +++ b/homeConfigurations/muede/niri.nix @@ -172,10 +172,6 @@ # Suggested binds for running programs: terminal, app launcher, screen locker. "Mod+T".action.spawn = "${lib.getBin pkgs.gnome-console}/bin/kgx"; "Mod+D".action.spawn = "${lib.getBin config.programs.fuzzel.package}/bin/fuzzel"; - "Super+Alt+L" = { - action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; - allow-when-locked = true; - }; # You can also use a shell. Do this if you need pipes, multiple commands, etc. # Note: the entire command goes as a single argument in the end. diff --git a/homeConfigurations/muede/swaylock.nix b/homeConfigurations/muede/swaylock.nix index 1b756ff9..8ff67473 100644 --- a/homeConfigurations/muede/swaylock.nix +++ b/homeConfigurations/muede/swaylock.nix @@ -1,11 +1,11 @@ # based on https://codeberg.org/kiara/cfg/src/commit/b9c472acd78c9c08dfe8b6a643c5c82cc5828433/home-manager/kiara/swaylock.nix# -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: { - config = { stylix.targets.swaylock = { enable = true; useWallpaper = true; }; + programs.swaylock = { enable = true; package = pkgs.swaylock-effects; @@ -50,5 +50,10 @@ } ]; }; - }; + + + programs.niri.settings.binds."Super+Alt+L" = { + action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; + allow-when-locked = true; + }; } From aeba29ef356ca13da13cfe3abfa686dd0697269a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 10 Apr 2026 11:44:33 +0200 Subject: [PATCH 0443/1295] nix flake update --- flake.lock | 72 +++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/flake.lock b/flake.lock index 2665279f..e1d289b3 100644 --- a/flake.lock +++ b/flake.lock @@ -186,11 +186,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1772408722, - "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "lastModified": 1775087534, + "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b", "type": "github" }, "original": { @@ -284,11 +284,11 @@ ] }, "locked": { - "lastModified": 1773264488, - "narHash": "sha256-rK0507bDuWBrZo+0zts9bCs/+RRUEHuvFE5DHWPxX/Q=", + "lastModified": 1775425411, + "narHash": "sha256-KY6HsebJHEe5nHOWP7ur09mb0drGxYSzE3rQxy62rJo=", "owner": "nix-community", "repo": "home-manager", - "rev": "5c0f63f8d55040a7eed69df7e3fcdd15dfb5a04c", + "rev": "0d02ec1d0a05f88ef9e74b516842900c41f0f2fe", "type": "github" }, "original": { @@ -359,11 +359,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1773501701, - "narHash": "sha256-+0LBAEm8F5h9Nm+hdS07aoS1W4oTtW6c8lltb66oOYQ=", + "lastModified": 1775710668, + "narHash": "sha256-pi2TWoWZR22vzr5RBAgIdl1LDwgLX+fh+Hqngt/Kkt8=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "39ac039250a4a32bf8691405cac04864fc66a70d", + "rev": "bef414577a6a745543989716df478afec96486bd", "type": "github" }, "original": { @@ -392,11 +392,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1773130184, - "narHash": "sha256-3bwx4WqCB06yfQIGB+OgIckOkEDyKxiTD5pOo4Xz2rI=", + "lastModified": 1775561155, + "narHash": "sha256-TK2IrqQivRcwqJa0suZMbcsN17CtA8Uu0v7CDnLATb0=", "owner": "YaLTeR", "repo": "niri", - "rev": "b07bde3ee82dd73115e6b949e4f3f63695da35ea", + "rev": "599db847f857b8a7ff78ce02f15acab5d5d9fee1", "type": "github" }, "original": { @@ -427,11 +427,11 @@ ] }, "locked": { - "lastModified": 1773543606, - "narHash": "sha256-phMmtcMDGos4O82iEE3qFl58jp7fp1mu2liDE0A11gQ=", + "lastModified": 1775703285, + "narHash": "sha256-Dck/lX920n3ClC6U2m3fWaXgoGrtJpnqfGCdiOb8Gf4=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "014e1925a28b3e53f90883530ce6ff80e2da238a", + "rev": "c2281bf25d05ecb8155319456340afd34bea28ec", "type": "github" }, "original": { @@ -478,11 +478,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1773375660, - "narHash": "sha256-SEzUWw2Rf5Ki3bcM26nSKgbeoqi2uYy8IHVBqOKjX3w=", + "lastModified": 1775595990, + "narHash": "sha256-OEf7YqhF9IjJFYZJyuhAypgU+VsRB5lD4DuiMws5Ltc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3e20095fe3c6cbb1ddcef89b26969a69a1570776", + "rev": "4e92bbcdb030f3b4782be4751dc08e6b6cb6ccf2", "type": "github" }, "original": { @@ -494,11 +494,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1772328832, - "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", + "lastModified": 1774748309, + "narHash": "sha256-+U7gF3qxzwD5TZuANzZPeJTZRHS29OFQgkQ2kiTJBIQ=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", + "rev": "333c4e0545a6da976206c74db8773a1645b5870a", "type": "github" }, "original": { @@ -509,11 +509,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1773507054, - "narHash": "sha256-Q8U5VXgrcxmCxPtCCJCIZkcAX3FCZwGh1GNVIXxMND0=", + "lastModified": 1775701739, + "narHash": "sha256-2FWWY1rr/+pGUJK1npcVcsWNEblzmKs6VxD3VEvwJSs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e80236013dc8b77aa49ca90e7a12d86f5d8d64c9", + "rev": "0f7663154ff2fec150f9dbf5f81ec2785dc1e0db", "type": "github" }, "original": { @@ -549,11 +549,11 @@ ] }, "locked": { - "lastModified": 1773570788, - "narHash": "sha256-WarFHtdyYB1tCDNCPIfazfXWKGpmW5lpYhxqC+IfX/E=", + "lastModified": 1775746236, + "narHash": "sha256-wCMkv45LNU6gjWbl53WE4LAHU3Q3dNFU4dRWdlGW1PE=", "owner": "nix-community", "repo": "NUR", - "rev": "ca9c5ddc6cd9671fadff5da08e26255d55030179", + "rev": "1088e4c4f5f40c9ce5e5181ae501576f72f1bce8", "type": "github" }, "original": { @@ -747,11 +747,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1771788390, - "narHash": "sha256-RzBpBwn93GWxLjacTte+ngwwg0L/BVOg4G/sSIeK3Rw=", + "lastModified": 1775509805, + "narHash": "sha256-CxmSn6FihFw7RvqLGGAdQUhbdBfdok946bg8ubvTfa4=", "owner": "nix-community", "repo": "stylix", - "rev": "ebb238f14d6f930068be4718472da3105fd5d3bf", + "rev": "83e8a81710ddd56fb5112da54e0395de51bbcd3a", "type": "github" }, "original": { @@ -864,11 +864,11 @@ ] }, "locked": { - "lastModified": 1773297127, - "narHash": "sha256-6E/yhXP7Oy/NbXtf1ktzmU8SdVqJQ09HC/48ebEGBpk=", + "lastModified": 1775636079, + "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "71b125cd05fbfd78cab3e070b73544abe24c5016", + "rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba", "type": "github" }, "original": { @@ -897,11 +897,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1773499041, - "narHash": "sha256-XZ4/tVdLeAYDgKe4JD4C7yYUKydMxwt8c2j6APFWcIc=", + "lastModified": 1773622265, + "narHash": "sha256-wToKwH7IgWdGLMSIWksEDs4eumR6UbbsuPQ42r0oTXQ=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "309d8e2a29953f7465dc14c939e2afe4682c0aa9", + "rev": "a879e5e0896a326adc79c474bf457b8b99011027", "type": "github" }, "original": { From 39496b44a01b4ce526e04b39a3aabd315062e881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 10 Apr 2026 11:44:58 +0200 Subject: [PATCH 0444/1295] git credential helper globally --- nixosModules/globalinstalls.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixosModules/globalinstalls.nix b/nixosModules/globalinstalls.nix index 47fb343a..146d4013 100644 --- a/nixosModules/globalinstalls.nix +++ b/nixosModules/globalinstalls.nix @@ -8,6 +8,7 @@ screen tldr nix-output-monitor + git-credential-oauth ]; programs = { @@ -20,4 +21,10 @@ syntaxHighlight = true; }; }; + + environment.etc."gitconfig".text = '' + [credential] + helper = oauth + credentialStore = cache + ''; } From fb7d4981b1d9a01def8bb18069fdbe201cf6e5dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 10 Apr 2026 11:45:31 +0200 Subject: [PATCH 0445/1295] misc installs --- homeConfigurations/muede/default.nix | 6 ++++++ nixosModules/muede-desktop-settings.nix | 1 + nixosModules/user-muede.nix | 2 ++ 3 files changed, 9 insertions(+) diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index 4b5e1ec6..9face221 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -81,6 +81,12 @@ dconf2nix gnome-terminal + + gparted + + geary + + claude-code ]; home.file = { diff --git a/nixosModules/muede-desktop-settings.nix b/nixosModules/muede-desktop-settings.nix index ea02ed99..27e790b0 100644 --- a/nixosModules/muede-desktop-settings.nix +++ b/nixosModules/muede-desktop-settings.nix @@ -5,6 +5,7 @@ environment.systemPackages = with pkgs; [ lm_sensors libreoffice-qt6 + usbutils ]; fonts.enableDefaultPackages = true; diff --git a/nixosModules/user-muede.nix b/nixosModules/user-muede.nix index 19e4d820..498c5a8f 100644 --- a/nixosModules/user-muede.nix +++ b/nixosModules/user-muede.nix @@ -31,5 +31,7 @@ "anydesk" "vscode-extension-ms-dotnettools-csharp" + + "claude-code" ]; } From f30165eada5a9fddea3ac89260bfc770bd7957ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 10 Apr 2026 11:49:11 +0200 Subject: [PATCH 0446/1295] add damocles container --- flake.nix | 3 +++ nixosConfigurations/damocles/default.nix | 18 ++++++++++++++++++ nixosConfigurations/muede-lpt2/default.nix | 6 ++++++ 3 files changed, 27 insertions(+) create mode 100644 nixosConfigurations/damocles/default.nix diff --git a/flake.nix b/flake.nix index e864fc6c..2a7ad86f 100644 --- a/flake.nix +++ b/flake.nix @@ -132,6 +132,9 @@ epimetheus = { system = "aarch64-linux"; }; + damocles = { + system = "x86_64-linux"; + }; }; inherit (nixpkgs) lib; forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) devices; diff --git a/nixosConfigurations/damocles/default.nix b/nixosConfigurations/damocles/default.nix new file mode 100644 index 00000000..36ef5b9c --- /dev/null +++ b/nixosConfigurations/damocles/default.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: +{ + boot.isContainer = true; + + allowedUnfreePackages = [ "claude-code" ]; + + environment.systemPackages = with pkgs; [ + unstable.claude-code + git + ]; + + users.users.muede = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + }; + + security.sudo.wheelNeedsPassword = false; +} diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index dcb580fc..29f97bcb 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -60,5 +60,11 @@ ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + + containers.damocles = { + autoStart = false; + privateNetwork = false; + path = self.nixosConfigurations.damocles.config.system.build.toplevel; + }; }; } From 30b2b8668b00cb2c7d498251483060af009618bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 12 Apr 2026 21:37:14 +0200 Subject: [PATCH 0447/1295] only eval unstable if needed --- nixosConfigurations/damocles/default.nix | 4 +++- nixosModules/global-settings-desktop.nix | 1 - nixosModules/global-settings.nix | 4 ---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/nixosConfigurations/damocles/default.nix b/nixosConfigurations/damocles/default.nix index 36ef5b9c..69ebb1aa 100644 --- a/nixosConfigurations/damocles/default.nix +++ b/nixosConfigurations/damocles/default.nix @@ -1,5 +1,7 @@ -{ pkgs, ... }: +{ pkgs, self, ... }: { + nixpkgs.overlays = [ self.overlays.unstable-packages ]; + boot.isContainer = true; allowedUnfreePackages = [ "claude-code" ]; diff --git a/nixosModules/global-settings-desktop.nix b/nixosModules/global-settings-desktop.nix index eda369d8..5f8bbf7f 100644 --- a/nixosModules/global-settings-desktop.nix +++ b/nixosModules/global-settings-desktop.nix @@ -20,7 +20,6 @@ self.nixosModules.modern-desktop self.nixosModules.niri self.nixosModules.nix-ld - self.nixosModules.pkgs-unstable self.nixosModules.pkgs-vscode-extensions self.nixosModules.quiet-boot self.nixosModules.stylix diff --git a/nixosModules/global-settings.nix b/nixosModules/global-settings.nix index 77bddaed..cd92140f 100644 --- a/nixosModules/global-settings.nix +++ b/nixosModules/global-settings.nix @@ -30,10 +30,6 @@ autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; }; - nixpkgs.overlays = [ - self.overlays.unstable-packages - ]; - nix.settings.experimental-features = [ "nix-command" "flakes" From dc70f474a9ed16e4ae608ce348d52630fcee3fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 12 Apr 2026 11:33:12 +0200 Subject: [PATCH 0448/1295] replace waybar and wlogout with nova-shell --- flake.lock | 67 ++++- flake.nix | 10 +- foo.diff | 295 ++++++++++++++++++++++ homeConfigurations/muede/default.nix | 13 +- homeConfigurations/muede/swaylock.nix | 110 ++++---- homeConfigurations/muede/waybar.css | 4 +- nixosConfigurations/damocles/default.nix | 1 + nixosConfigurations/muede-pc2/default.nix | 4 +- 8 files changed, 441 insertions(+), 63 deletions(-) create mode 100644 foo.diff diff --git a/flake.lock b/flake.lock index e1d289b3..9773037f 100644 --- a/flake.lock +++ b/flake.lock @@ -539,6 +539,28 @@ "type": "github" } }, + "nova-shell": { + "inputs": { + "nixpkgs": [ + "nixpkgs-unstable" + ], + "quickshell": "quickshell", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1776022066, + "narHash": "sha256-EVl6pS3C8qogiqMNGBLibPsnK8saURb5Ayf9pxzcFjA=", + "ref": "refs/heads/main", + "rev": "d33b47139a431ebc6aef9926f1f80bb2420ac596", + "revCount": 152, + "type": "git", + "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" + }, + "original": { + "type": "git", + "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" + } + }, "nur": { "inputs": { "flake-parts": [ @@ -588,6 +610,27 @@ "type": "github" } }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "nova-shell", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775720097, + "narHash": "sha256-p+vqkCuFfVNyQBo370wr6MebNUvz55RZiC0m8YKUhvQ=", + "ref": "refs/heads/master", + "rev": "d4c92973b53d9fa34cc110d3b974eb6bde5b3027", + "revCount": 800, + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + } + }, "root": { "inputs": { "flake-parts": "flake-parts", @@ -600,12 +643,13 @@ "nixos-generators": "nixos-generators", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", + "nova-shell": "nova-shell", "nur": "nur", "servicepoint-cli": "servicepoint-cli", "servicepoint-simulator": "servicepoint-simulator", "servicepoint-tanks": "servicepoint-tanks", "stylix": "stylix", - "treefmt-nix": "treefmt-nix", + "treefmt-nix": "treefmt-nix_2", "zerforschen-plus": "zerforschen-plus" } }, @@ -858,6 +902,27 @@ } }, "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nova-shell", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775636079, + "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { "inputs": { "nixpkgs": [ "nixpkgs" diff --git a/flake.nix b/flake.nix index 2a7ad86f..4cb474f8 100644 --- a/flake.nix +++ b/flake.nix @@ -23,8 +23,10 @@ }; niri = { url = "github:sodiboo/niri-flake"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.nixpkgs-stable.follows = "nixpkgs"; + inputs = { + nixpkgs.follows = "nixpkgs"; + nixpkgs-stable.follows = "nixpkgs"; + }; }; nix-filter.url = "github:numtide/nix-filter"; nix-vscode-extensions = { @@ -35,6 +37,10 @@ url = "github:nix-community/nixos-generators"; inputs.nixpkgs.follows = "nixpkgs"; }; + nova-shell = { + url = "git+https://git.berlin.ccc.de/vinzenz/nova-shell"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; nur = { url = "github:nix-community/NUR"; inputs = { diff --git a/foo.diff b/foo.diff new file mode 100644 index 00000000..a070e7bc --- /dev/null +++ b/foo.diff @@ -0,0 +1,295 @@ +diff --git a/flake.lock b/flake.lock +index e1d289b..2ae403c 100644 +--- a/flake.lock ++++ b/flake.lock +@@ -539,6 +539,28 @@ + "type": "github" + } + }, ++ "nova-shell": { ++ "inputs": { ++ "nixpkgs": [ ++ "nixpkgs-unstable" ++ ], ++ "quickshell": "quickshell", ++ "treefmt-nix": "treefmt-nix" ++ }, ++ "locked": { ++ "lastModified": 1775855370, ++ "narHash": "sha256-HCTOC6tSXvRNoZl/CQjjvZ63iMlYgH4HSPsqn25zFJA=", ++ "ref": "refs/heads/main", ++ "rev": "3c9f6e78cc8a0af240a5ac7a0ed0cb517f2bbb5a", ++ "revCount": 8, ++ "type": "git", ++ "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" ++ }, ++ "original": { ++ "type": "git", ++ "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" ++ } ++ }, + "nur": { + "inputs": { + "flake-parts": [ +@@ -588,6 +610,27 @@ + "type": "github" + } + }, ++ "quickshell": { ++ "inputs": { ++ "nixpkgs": [ ++ "nova-shell", ++ "nixpkgs" ++ ] ++ }, ++ "locked": { ++ "lastModified": 1775720097, ++ "narHash": "sha256-p+vqkCuFfVNyQBo370wr6MebNUvz55RZiC0m8YKUhvQ=", ++ "ref": "refs/heads/master", ++ "rev": "d4c92973b53d9fa34cc110d3b974eb6bde5b3027", ++ "revCount": 800, ++ "type": "git", ++ "url": "https://git.outfoxxed.me/outfoxxed/quickshell" ++ }, ++ "original": { ++ "type": "git", ++ "url": "https://git.outfoxxed.me/outfoxxed/quickshell" ++ } ++ }, + "root": { + "inputs": { + "flake-parts": "flake-parts", +@@ -600,12 +643,13 @@ + "nixos-generators": "nixos-generators", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", ++ "nova-shell": "nova-shell", + "nur": "nur", + "servicepoint-cli": "servicepoint-cli", + "servicepoint-simulator": "servicepoint-simulator", + "servicepoint-tanks": "servicepoint-tanks", + "stylix": "stylix", +- "treefmt-nix": "treefmt-nix", ++ "treefmt-nix": "treefmt-nix_2", + "zerforschen-plus": "zerforschen-plus" + } + }, +@@ -858,6 +902,27 @@ + } + }, + "treefmt-nix": { ++ "inputs": { ++ "nixpkgs": [ ++ "nova-shell", ++ "nixpkgs" ++ ] ++ }, ++ "locked": { ++ "lastModified": 1775636079, ++ "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", ++ "owner": "numtide", ++ "repo": "treefmt-nix", ++ "rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba", ++ "type": "github" ++ }, ++ "original": { ++ "owner": "numtide", ++ "repo": "treefmt-nix", ++ "type": "github" ++ } ++ }, ++ "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" +diff --git a/flake.nix b/flake.nix +index 2a7ad86..87683fe 100644 +--- a/flake.nix ++++ b/flake.nix +@@ -35,6 +35,10 @@ + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "nixpkgs"; + }; ++ nova-shell = { ++ url = "git+https://git.berlin.ccc.de/vinzenz/nova-shell"; ++ inputs.nixpkgs.follows = "nixpkgs-unstable"; ++ }; + nur = { + url = "github:nix-community/NUR"; + inputs = { +diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix +index 9face22..5f12afb 100644 +--- a/homeConfigurations/muede/default.nix ++++ b/homeConfigurations/muede/default.nix +@@ -1,4 +1,4 @@ +-{ pkgs, ... }: ++{ pkgs, self,... }: + { + imports = [ + # keep-sorted start ++ self.inputs.nova-shell.homeModules.default +@@ -18,6 +18,7 @@ + ./waybar.nix + ./wlogout.nix + ./zsh.nix + # keep-sorted end + ]; + +@@ -48,6 +49,7 @@ + }; + + chromium.enable = true; ++ nova-shell.enable = true; + }; + + home.packages = with pkgs; [ +diff --git a/homeConfigurations/muede/swaylock.nix b/homeConfigurations/muede/swaylock.nix +index 8ff6747..55d7f91 100644 +--- a/homeConfigurations/muede/swaylock.nix ++++ b/homeConfigurations/muede/swaylock.nix +@@ -1,59 +1,63 @@ + # based on https://codeberg.org/kiara/cfg/src/commit/b9c472acd78c9c08dfe8b6a643c5c82cc5828433/home-manager/kiara/swaylock.nix# +-{ pkgs, config, lib, ... }: + { +- stylix.targets.swaylock = { +- enable = true; +- useWallpaper = true; +- }; +- +- programs.swaylock = { +- enable = true; +- package = pkgs.swaylock-effects; +- # https://github.com/jirutka/swaylock-effects/blob/master/swaylock.1.scd +- settings = { +- screenshot = false; +- effect-blur = "9x9"; +- effect-vignette = "0.2:0.2"; +- fade-in = 0.5; +- font-size = 75; +- indicator-caps-lock = true; +- clock = true; +- indicator-radius = 400; +- show-failed-attempts = true; +- ignore-empty-password = true; +- grace = 3.5; +- indicator-thickness = 20; +- }; +- }; ++ pkgs, ++ config, ++ lib, ++ ... ++}: ++{ ++ stylix.targets.swaylock = { ++ enable = true; ++ useWallpaper = true; ++ }; + +- services.swayidle = { +- enable = true; +- systemdTarget = "graphical-session.target"; +- timeouts = [ +- { +- timeout = 60; +- command = "${config.programs.swaylock.package}/bin/swaylock"; +- } +- { +- timeout = 60 * 10; +- command = "${pkgs.systemd}/bin/systemctl suspend"; +- } +- ]; +- events = [ +- { +- event = "before-sleep"; +- command = "${pkgs.playerctl}/bin/playerctl pause; ${config.programs.swaylock.package}/bin/swaylock"; +- } +- { +- event = "lock"; +- command = "${config.programs.swaylock.package}/bin/swaylock"; +- } +- ]; ++ programs.swaylock = { ++ enable = true; ++ package = pkgs.swaylock-effects; ++ # https://github.com/jirutka/swaylock-effects/blob/master/swaylock.1.scd ++ settings = { ++ screenshot = false; ++ effect-blur = "9x9"; ++ effect-vignette = "0.2:0.2"; ++ fade-in = 0.5; ++ font-size = 75; ++ indicator-caps-lock = true; ++ clock = true; ++ indicator-radius = 400; ++ show-failed-attempts = true; ++ ignore-empty-password = true; ++ grace = 3.5; ++ indicator-thickness = 20; + }; ++ }; + ++ services.swayidle = { ++ enable = true; ++ systemdTarget = "graphical-session.target"; ++ timeouts = [ ++ { ++ timeout = 60; ++ command = "${config.programs.swaylock.package}/bin/swaylock"; ++ } ++ { ++ timeout = 60 * 10; ++ command = "${pkgs.systemd}/bin/systemctl suspend"; ++ } ++ ]; ++ events = [ ++ { ++ event = "before-sleep"; ++ command = "${pkgs.playerctl}/bin/playerctl pause; ${config.programs.swaylock.package}/bin/swaylock"; ++ } ++ { ++ event = "lock"; ++ command = "${config.programs.swaylock.package}/bin/swaylock"; ++ } ++ ]; ++ }; + +- programs.niri.settings.binds."Super+Alt+L" = { +- action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; +- allow-when-locked = true; +- }; ++ programs.niri.settings.binds."Super+Alt+L" = { ++ action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; ++ allow-when-locked = true; ++ }; + } +diff --git a/homeConfigurations/muede/waybar.css b/homeConfigurations/muede/waybar.css +index 79e7671..0f1d38a 100644 +--- a/homeConfigurations/muede/waybar.css ++++ b/homeConfigurations/muede/waybar.css +@@ -72,8 +72,8 @@ window#waybar { + } + + #workspaces { +- padding-left: 0; +- padding-right: 0; ++ padding-left: 0; ++ padding-right: 0; + } + + /* Individual widget colors */ +diff --git a/nixosConfigurations/muede-pc2/default.nix b/nixosConfigurations/muede-pc2/default.nix +index 742fa9f..dd97b00 100644 +--- a/nixosConfigurations/muede-pc2/default.nix ++++ b/nixosConfigurations/muede-pc2/default.nix +@@ -2,8 +2,8 @@ + { + imports = [ + ./hardware.nix +-# ./vscode-server.nix +-# ./hass.nix ++ # ./vscode-server.nix ++ # ./hass.nix + + self.nixosModules.user-muede + self.nixosModules.gnome diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index 9face221..e4ff0117 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, self, ... }: { imports = [ # keep-sorted start @@ -15,9 +15,10 @@ ./swaylock.nix ./swaync.nix ./vscode.nix - ./waybar.nix - ./wlogout.nix +# ./waybar.nix +# ./wlogout.nix ./zsh.nix + self.inputs.nova-shell.homeModules.default # keep-sorted end ]; @@ -48,6 +49,12 @@ }; chromium.enable = true; + nova-shell = { + enable = true; + theme = { + fontSize = 13; + }; + }; }; home.packages = with pkgs; [ diff --git a/homeConfigurations/muede/swaylock.nix b/homeConfigurations/muede/swaylock.nix index 8ff67473..064cb9b4 100644 --- a/homeConfigurations/muede/swaylock.nix +++ b/homeConfigurations/muede/swaylock.nix @@ -1,59 +1,63 @@ # based on https://codeberg.org/kiara/cfg/src/commit/b9c472acd78c9c08dfe8b6a643c5c82cc5828433/home-manager/kiara/swaylock.nix# -{ pkgs, config, lib, ... }: { - stylix.targets.swaylock = { - enable = true; - useWallpaper = true; + pkgs, + config, + lib, + ... +}: +{ + stylix.targets.swaylock = { + enable = true; + useWallpaper = true; + }; + + programs.swaylock = { + enable = true; + package = pkgs.swaylock-effects; + # https://github.com/jirutka/swaylock-effects/blob/master/swaylock.1.scd + settings = { + screenshot = false; + effect-blur = "9x9"; + effect-vignette = "0.2:0.2"; + fade-in = 0.5; + font-size = 75; + indicator-caps-lock = true; + clock = true; + indicator-radius = 400; + show-failed-attempts = true; + ignore-empty-password = true; + grace = 3.5; + indicator-thickness = 20; }; + }; - programs.swaylock = { - enable = true; - package = pkgs.swaylock-effects; - # https://github.com/jirutka/swaylock-effects/blob/master/swaylock.1.scd - settings = { - screenshot = false; - effect-blur = "9x9"; - effect-vignette = "0.2:0.2"; - fade-in = 0.5; - font-size = 75; - indicator-caps-lock = true; - clock = true; - indicator-radius = 400; - show-failed-attempts = true; - ignore-empty-password = true; - grace = 3.5; - indicator-thickness = 20; - }; - }; + services.swayidle = { + enable = true; + systemdTarget = "graphical-session.target"; + timeouts = [ + { + timeout = 5; + command = "${config.programs.swaylock.package}/bin/swaylock"; + } + { + timeout = 60 * 10; + command = "${pkgs.systemd}/bin/systemctl suspend"; + } + ]; + events = [ + { + event = "before-sleep"; + command = "${pkgs.playerctl}/bin/playerctl pause; ${config.programs.swaylock.package}/bin/swaylock"; + } + { + event = "lock"; + command = "${config.programs.swaylock.package}/bin/swaylock"; + } + ]; + }; - services.swayidle = { - enable = true; - systemdTarget = "graphical-session.target"; - timeouts = [ - { - timeout = 60; - command = "${config.programs.swaylock.package}/bin/swaylock"; - } - { - timeout = 60 * 10; - command = "${pkgs.systemd}/bin/systemctl suspend"; - } - ]; - events = [ - { - event = "before-sleep"; - command = "${pkgs.playerctl}/bin/playerctl pause; ${config.programs.swaylock.package}/bin/swaylock"; - } - { - event = "lock"; - command = "${config.programs.swaylock.package}/bin/swaylock"; - } - ]; - }; - - - programs.niri.settings.binds."Super+Alt+L" = { - action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; - allow-when-locked = true; - }; + programs.niri.settings.binds."Super+Alt+L" = { + action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; + allow-when-locked = true; + }; } diff --git a/homeConfigurations/muede/waybar.css b/homeConfigurations/muede/waybar.css index 79e7671e..0f1d38a3 100644 --- a/homeConfigurations/muede/waybar.css +++ b/homeConfigurations/muede/waybar.css @@ -72,8 +72,8 @@ window#waybar { } #workspaces { - padding-left: 0; - padding-right: 0; + padding-left: 0; + padding-right: 0; } /* Individual widget colors */ diff --git a/nixosConfigurations/damocles/default.nix b/nixosConfigurations/damocles/default.nix index 69ebb1aa..e62b6acd 100644 --- a/nixosConfigurations/damocles/default.nix +++ b/nixosConfigurations/damocles/default.nix @@ -9,6 +9,7 @@ environment.systemPackages = with pkgs; [ unstable.claude-code git + python3 ]; users.users.muede = { diff --git a/nixosConfigurations/muede-pc2/default.nix b/nixosConfigurations/muede-pc2/default.nix index 742fa9f3..dd97b004 100644 --- a/nixosConfigurations/muede-pc2/default.nix +++ b/nixosConfigurations/muede-pc2/default.nix @@ -2,8 +2,8 @@ { imports = [ ./hardware.nix -# ./vscode-server.nix -# ./hass.nix + # ./vscode-server.nix + # ./hass.nix self.nixosModules.user-muede self.nixosModules.gnome From 8a097b0581586b73c580452503af86a759053325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 12 Apr 2026 21:39:52 +0200 Subject: [PATCH 0449/1295] nix fmt, explicit container enable --- homeConfigurations/muede/default.nix | 58 ++++++++++------------ nixosConfigurations/muede-lpt2/default.nix | 3 ++ 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index e4ff0117..d239d012 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -15,8 +15,8 @@ ./swaylock.nix ./swaync.nix ./vscode.nix -# ./waybar.nix -# ./wlogout.nix + # ./waybar.nix + # ./wlogout.nix ./zsh.nix self.inputs.nova-shell.homeModules.default # keep-sorted end @@ -58,42 +58,34 @@ }; home.packages = with pkgs; [ - keepassxc - nextcloud-client - thunderbird - fractal - telegram-desktop - - wireguard-tools - wirelesstools - tailscale - - kdiff3 - jetbrains-toolbox - - vlc - lutris + # keep-sorted start arduino - arduino-ide arduino-cli - + arduino-ide + claude-code + dconf2nix + foliate + fractal + geary + gnome-terminal + gparted + icu + jetbrains-toolbox + kdiff3 + keepassxc + lutris + nextcloud-client + onefetch servicepoint-cli servicepoint-simulator - - icu - - foliate - - dconf2nix - - gnome-terminal - - gparted - - geary - - claude-code + tailscale + telegram-desktop + thunderbird + vlc + wireguard-tools + wirelesstools + # keep-sorted end ]; home.file = { diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index 29f97bcb..6cc5934b 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -66,5 +66,8 @@ privateNetwork = false; path = self.nixosConfigurations.damocles.config.system.build.toplevel; }; + + boot.enableContainers = true; + virtualisation.containers.enable = true; }; } From 925fd85c2855d7899cd49ad32e21e841c870332d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 12 Apr 2026 21:44:10 +0200 Subject: [PATCH 0450/1295] remove diff --- foo.diff | 295 ------------------------------------------------------- 1 file changed, 295 deletions(-) delete mode 100644 foo.diff diff --git a/foo.diff b/foo.diff deleted file mode 100644 index a070e7bc..00000000 --- a/foo.diff +++ /dev/null @@ -1,295 +0,0 @@ -diff --git a/flake.lock b/flake.lock -index e1d289b..2ae403c 100644 ---- a/flake.lock -+++ b/flake.lock -@@ -539,6 +539,28 @@ - "type": "github" - } - }, -+ "nova-shell": { -+ "inputs": { -+ "nixpkgs": [ -+ "nixpkgs-unstable" -+ ], -+ "quickshell": "quickshell", -+ "treefmt-nix": "treefmt-nix" -+ }, -+ "locked": { -+ "lastModified": 1775855370, -+ "narHash": "sha256-HCTOC6tSXvRNoZl/CQjjvZ63iMlYgH4HSPsqn25zFJA=", -+ "ref": "refs/heads/main", -+ "rev": "3c9f6e78cc8a0af240a5ac7a0ed0cb517f2bbb5a", -+ "revCount": 8, -+ "type": "git", -+ "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" -+ }, -+ "original": { -+ "type": "git", -+ "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" -+ } -+ }, - "nur": { - "inputs": { - "flake-parts": [ -@@ -588,6 +610,27 @@ - "type": "github" - } - }, -+ "quickshell": { -+ "inputs": { -+ "nixpkgs": [ -+ "nova-shell", -+ "nixpkgs" -+ ] -+ }, -+ "locked": { -+ "lastModified": 1775720097, -+ "narHash": "sha256-p+vqkCuFfVNyQBo370wr6MebNUvz55RZiC0m8YKUhvQ=", -+ "ref": "refs/heads/master", -+ "rev": "d4c92973b53d9fa34cc110d3b974eb6bde5b3027", -+ "revCount": 800, -+ "type": "git", -+ "url": "https://git.outfoxxed.me/outfoxxed/quickshell" -+ }, -+ "original": { -+ "type": "git", -+ "url": "https://git.outfoxxed.me/outfoxxed/quickshell" -+ } -+ }, - "root": { - "inputs": { - "flake-parts": "flake-parts", -@@ -600,12 +643,13 @@ - "nixos-generators": "nixos-generators", - "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable", -+ "nova-shell": "nova-shell", - "nur": "nur", - "servicepoint-cli": "servicepoint-cli", - "servicepoint-simulator": "servicepoint-simulator", - "servicepoint-tanks": "servicepoint-tanks", - "stylix": "stylix", -- "treefmt-nix": "treefmt-nix", -+ "treefmt-nix": "treefmt-nix_2", - "zerforschen-plus": "zerforschen-plus" - } - }, -@@ -858,6 +902,27 @@ - } - }, - "treefmt-nix": { -+ "inputs": { -+ "nixpkgs": [ -+ "nova-shell", -+ "nixpkgs" -+ ] -+ }, -+ "locked": { -+ "lastModified": 1775636079, -+ "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", -+ "owner": "numtide", -+ "repo": "treefmt-nix", -+ "rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba", -+ "type": "github" -+ }, -+ "original": { -+ "owner": "numtide", -+ "repo": "treefmt-nix", -+ "type": "github" -+ } -+ }, -+ "treefmt-nix_2": { - "inputs": { - "nixpkgs": [ - "nixpkgs" -diff --git a/flake.nix b/flake.nix -index 2a7ad86..87683fe 100644 ---- a/flake.nix -+++ b/flake.nix -@@ -35,6 +35,10 @@ - url = "github:nix-community/nixos-generators"; - inputs.nixpkgs.follows = "nixpkgs"; - }; -+ nova-shell = { -+ url = "git+https://git.berlin.ccc.de/vinzenz/nova-shell"; -+ inputs.nixpkgs.follows = "nixpkgs-unstable"; -+ }; - nur = { - url = "github:nix-community/NUR"; - inputs = { -diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix -index 9face22..5f12afb 100644 ---- a/homeConfigurations/muede/default.nix -+++ b/homeConfigurations/muede/default.nix -@@ -1,4 +1,4 @@ --{ pkgs, ... }: -+{ pkgs, self,... }: - { - imports = [ - # keep-sorted start -+ self.inputs.nova-shell.homeModules.default -@@ -18,6 +18,7 @@ - ./waybar.nix - ./wlogout.nix - ./zsh.nix - # keep-sorted end - ]; - -@@ -48,6 +49,7 @@ - }; - - chromium.enable = true; -+ nova-shell.enable = true; - }; - - home.packages = with pkgs; [ -diff --git a/homeConfigurations/muede/swaylock.nix b/homeConfigurations/muede/swaylock.nix -index 8ff6747..55d7f91 100644 ---- a/homeConfigurations/muede/swaylock.nix -+++ b/homeConfigurations/muede/swaylock.nix -@@ -1,59 +1,63 @@ - # based on https://codeberg.org/kiara/cfg/src/commit/b9c472acd78c9c08dfe8b6a643c5c82cc5828433/home-manager/kiara/swaylock.nix# --{ pkgs, config, lib, ... }: - { -- stylix.targets.swaylock = { -- enable = true; -- useWallpaper = true; -- }; -- -- programs.swaylock = { -- enable = true; -- package = pkgs.swaylock-effects; -- # https://github.com/jirutka/swaylock-effects/blob/master/swaylock.1.scd -- settings = { -- screenshot = false; -- effect-blur = "9x9"; -- effect-vignette = "0.2:0.2"; -- fade-in = 0.5; -- font-size = 75; -- indicator-caps-lock = true; -- clock = true; -- indicator-radius = 400; -- show-failed-attempts = true; -- ignore-empty-password = true; -- grace = 3.5; -- indicator-thickness = 20; -- }; -- }; -+ pkgs, -+ config, -+ lib, -+ ... -+}: -+{ -+ stylix.targets.swaylock = { -+ enable = true; -+ useWallpaper = true; -+ }; - -- services.swayidle = { -- enable = true; -- systemdTarget = "graphical-session.target"; -- timeouts = [ -- { -- timeout = 60; -- command = "${config.programs.swaylock.package}/bin/swaylock"; -- } -- { -- timeout = 60 * 10; -- command = "${pkgs.systemd}/bin/systemctl suspend"; -- } -- ]; -- events = [ -- { -- event = "before-sleep"; -- command = "${pkgs.playerctl}/bin/playerctl pause; ${config.programs.swaylock.package}/bin/swaylock"; -- } -- { -- event = "lock"; -- command = "${config.programs.swaylock.package}/bin/swaylock"; -- } -- ]; -+ programs.swaylock = { -+ enable = true; -+ package = pkgs.swaylock-effects; -+ # https://github.com/jirutka/swaylock-effects/blob/master/swaylock.1.scd -+ settings = { -+ screenshot = false; -+ effect-blur = "9x9"; -+ effect-vignette = "0.2:0.2"; -+ fade-in = 0.5; -+ font-size = 75; -+ indicator-caps-lock = true; -+ clock = true; -+ indicator-radius = 400; -+ show-failed-attempts = true; -+ ignore-empty-password = true; -+ grace = 3.5; -+ indicator-thickness = 20; - }; -+ }; - -+ services.swayidle = { -+ enable = true; -+ systemdTarget = "graphical-session.target"; -+ timeouts = [ -+ { -+ timeout = 60; -+ command = "${config.programs.swaylock.package}/bin/swaylock"; -+ } -+ { -+ timeout = 60 * 10; -+ command = "${pkgs.systemd}/bin/systemctl suspend"; -+ } -+ ]; -+ events = [ -+ { -+ event = "before-sleep"; -+ command = "${pkgs.playerctl}/bin/playerctl pause; ${config.programs.swaylock.package}/bin/swaylock"; -+ } -+ { -+ event = "lock"; -+ command = "${config.programs.swaylock.package}/bin/swaylock"; -+ } -+ ]; -+ }; - -- programs.niri.settings.binds."Super+Alt+L" = { -- action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; -- allow-when-locked = true; -- }; -+ programs.niri.settings.binds."Super+Alt+L" = { -+ action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; -+ allow-when-locked = true; -+ }; - } -diff --git a/homeConfigurations/muede/waybar.css b/homeConfigurations/muede/waybar.css -index 79e7671..0f1d38a 100644 ---- a/homeConfigurations/muede/waybar.css -+++ b/homeConfigurations/muede/waybar.css -@@ -72,8 +72,8 @@ window#waybar { - } - - #workspaces { -- padding-left: 0; -- padding-right: 0; -+ padding-left: 0; -+ padding-right: 0; - } - - /* Individual widget colors */ -diff --git a/nixosConfigurations/muede-pc2/default.nix b/nixosConfigurations/muede-pc2/default.nix -index 742fa9f..dd97b00 100644 ---- a/nixosConfigurations/muede-pc2/default.nix -+++ b/nixosConfigurations/muede-pc2/default.nix -@@ -2,8 +2,8 @@ - { - imports = [ - ./hardware.nix --# ./vscode-server.nix --# ./hass.nix -+ # ./vscode-server.nix -+ # ./hass.nix - - self.nixosModules.user-muede - self.nixosModules.gnome From c87d351456e02c05a0ceb6c616feeeac1d36a80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 12 Apr 2026 23:57:00 +0200 Subject: [PATCH 0451/1295] also replace swaync with nova-shell --- flake.lock | 8 ++++---- homeConfigurations/muede/default.nix | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 9773037f..aa408286 100644 --- a/flake.lock +++ b/flake.lock @@ -548,11 +548,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1776022066, - "narHash": "sha256-EVl6pS3C8qogiqMNGBLibPsnK8saURb5Ayf9pxzcFjA=", + "lastModified": 1776030769, + "narHash": "sha256-q9qIqbFyCr0kqRbrABpiwydZzErBU75Y10rOgld5sYg=", "ref": "refs/heads/main", - "rev": "d33b47139a431ebc6aef9926f1f80bb2420ac596", - "revCount": 152, + "rev": "c973bd8163758ffb1b2c9762d00dae9e89efdcb1", + "revCount": 173, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index d239d012..25b953d2 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -13,7 +13,7 @@ ./ssh.nix ./starship.nix ./swaylock.nix - ./swaync.nix + #./swaync.nix ./vscode.nix # ./waybar.nix # ./wlogout.nix @@ -59,7 +59,6 @@ home.packages = with pkgs; [ # keep-sorted start - arduino arduino-cli arduino-ide From 61b054463d41109384643ffa4acfb641ba25934a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Mon, 13 Apr 2026 10:21:13 +0200 Subject: [PATCH 0452/1295] fix system deprecated --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 4cb474f8..04acd075 100644 --- a/flake.nix +++ b/flake.nix @@ -175,7 +175,8 @@ overlays = { unstable-packages = final: prev: { unstable = import nixpkgs-unstable { - inherit (prev) system config; + localSystem = prev.stdenv.hostPlatform; + inherit (prev) config; }; }; }; @@ -222,7 +223,7 @@ }; in nixpkgs.lib.nixosSystem { - inherit system specialArgs; + inherit specialArgs; modules = [ { imports = [ @@ -234,7 +235,6 @@ ]); nixpkgs = { - inherit system; hostPlatform = lib.mkDefault system; }; } From ad0844356fe53ba18946469a60d4ddd5a9e914ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 16 Apr 2026 21:13:24 +0200 Subject: [PATCH 0453/1295] nix flake update --- flake.lock | 56 +++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/flake.lock b/flake.lock index aa408286..68eec1aa 100644 --- a/flake.lock +++ b/flake.lock @@ -332,11 +332,11 @@ ] }, "locked": { - "lastModified": 1769799857, - "narHash": "sha256-88IFXZ7Sa1vxbz5pty0Io5qEaMQMMUPMonLa3Ls/ss4=", + "lastModified": 1776200608, + "narHash": "sha256-broZ6RFQr4Fv0wT73gGmzNX14A43TmTFF8g4wDKlNss=", "owner": "nix-community", "repo": "naersk", - "rev": "9d4ed44d8b8cecdceb1d6fd76e74123d90ae6339", + "rev": "8b23250ab45c2a38cd91031aee26478ca4d0a28e", "type": "github" }, "original": { @@ -359,11 +359,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1775710668, - "narHash": "sha256-pi2TWoWZR22vzr5RBAgIdl1LDwgLX+fh+Hqngt/Kkt8=", + "lastModified": 1776363101, + "narHash": "sha256-PIsrdhbaD+aqB473D3IjVjRdO5uQJ6etnm5b7nvdnmU=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "bef414577a6a745543989716df478afec96486bd", + "rev": "f273e1406713b729e02e419d31c48200a285fac1", "type": "github" }, "original": { @@ -392,11 +392,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1775561155, - "narHash": "sha256-TK2IrqQivRcwqJa0suZMbcsN17CtA8Uu0v7CDnLATb0=", + "lastModified": 1776358048, + "narHash": "sha256-0OpEyuTrEVVkQXFJ5iSmjFXqSEsTNje0ldmiTNgEkOQ=", "owner": "YaLTeR", "repo": "niri", - "rev": "599db847f857b8a7ff78ce02f15acab5d5d9fee1", + "rev": "a1b0bd6d1cbbc695188f53839e42def4c5d38f43", "type": "github" }, "original": { @@ -427,11 +427,11 @@ ] }, "locked": { - "lastModified": 1775703285, - "narHash": "sha256-Dck/lX920n3ClC6U2m3fWaXgoGrtJpnqfGCdiOb8Gf4=", + "lastModified": 1776310443, + "narHash": "sha256-XQo/vlS6xak3iT3xS2Q3TUMbreeeqe+PR99feUoV0UQ=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "c2281bf25d05ecb8155319456340afd34bea28ec", + "rev": "3a6d0ea13d092493b285b9093b5ce81e79df5cee", "type": "github" }, "original": { @@ -478,11 +478,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1775595990, - "narHash": "sha256-OEf7YqhF9IjJFYZJyuhAypgU+VsRB5lD4DuiMws5Ltc=", + "lastModified": 1776067740, + "narHash": "sha256-B35lpsqnSZwn1Lmz06BpwF7atPgFmUgw1l8KAV3zpVQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4e92bbcdb030f3b4782be4751dc08e6b6cb6ccf2", + "rev": "7e495b747b51f95ae15e74377c5ce1fe69c1765f", "type": "github" }, "original": { @@ -509,11 +509,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1775701739, - "narHash": "sha256-2FWWY1rr/+pGUJK1npcVcsWNEblzmKs6VxD3VEvwJSs=", + "lastModified": 1776255774, + "narHash": "sha256-psVTpH6PK3q1htMJpmdz1hLF5pQgEshu7gQWgKO6t6Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0f7663154ff2fec150f9dbf5f81ec2785dc1e0db", + "rev": "566acc07c54dc807f91625bb286cb9b321b5f42a", "type": "github" }, "original": { @@ -548,11 +548,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1776030769, - "narHash": "sha256-q9qIqbFyCr0kqRbrABpiwydZzErBU75Y10rOgld5sYg=", + "lastModified": 1776366610, + "narHash": "sha256-7HXk7GwK7fCiIQ3ep8SsKUkfWhOOWxARuBKRPqWy0fc=", "ref": "refs/heads/main", - "rev": "c973bd8163758ffb1b2c9762d00dae9e89efdcb1", - "revCount": 173, + "rev": "434f8f8ffd3801cfeac82f6caaf1b58ef25e9c11", + "revCount": 344, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, @@ -571,11 +571,11 @@ ] }, "locked": { - "lastModified": 1775746236, - "narHash": "sha256-wCMkv45LNU6gjWbl53WE4LAHU3Q3dNFU4dRWdlGW1PE=", + "lastModified": 1776364314, + "narHash": "sha256-xH/BIk0BBiZRhcJrurLBzpe0tAdmpeE3FAExIPnb3/w=", "owner": "nix-community", "repo": "NUR", - "rev": "1088e4c4f5f40c9ce5e5181ae501576f72f1bce8", + "rev": "528ff912ac19b61c3be7d29e3976e7f2186c2101", "type": "github" }, "original": { @@ -791,11 +791,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1775509805, - "narHash": "sha256-CxmSn6FihFw7RvqLGGAdQUhbdBfdok946bg8ubvTfa4=", + "lastModified": 1775935110, + "narHash": "sha256-twTHKUFXjNNsaAvX0KoaIClt+923jXDRbfCd9PC/f0o=", "owner": "nix-community", "repo": "stylix", - "rev": "83e8a81710ddd56fb5112da54e0395de51bbcd3a", + "rev": "14f248ad1a7668e7858c6d9163608c208b7daf02", "type": "github" }, "original": { From 3c8024045e46a53374aacc1c312d3f48a29629a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 17 Apr 2026 12:39:45 +0200 Subject: [PATCH 0454/1295] damocles: longer timeout to prevent namespace breakage --- nixosConfigurations/muede-lpt2/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index 6cc5934b..2f5e9492 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -67,6 +67,10 @@ path = self.nixosConfigurations.damocles.config.system.build.toplevel; }; + # Global DefaultTimeoutStopSec is 10s (modern-desktop.nix), which kills systemd-nspawn + # before it finishes halting, leaving cgroups busy and breaking restarts. + systemd.services."container@damocles".serviceConfig.TimeoutStopSec = "60s"; + boot.enableContainers = true; virtualisation.containers.enable = true; }; From 4c82ecd2b94607dd03c38a0c2ca3ca4ecba82303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 17 Apr 2026 12:47:51 +0200 Subject: [PATCH 0455/1295] replace swaylock with nova-shell lock --- flake.lock | 8 +++--- homeConfigurations/muede/default.nix | 7 +++-- homeConfigurations/muede/niri.nix | 5 ++++ homeConfigurations/muede/swayidle.nix | 27 +++++++++++++++++++ homeConfigurations/muede/swaylock.nix | 37 +-------------------------- 5 files changed, 42 insertions(+), 42 deletions(-) create mode 100644 homeConfigurations/muede/swayidle.nix diff --git a/flake.lock b/flake.lock index 68eec1aa..cbaede41 100644 --- a/flake.lock +++ b/flake.lock @@ -548,11 +548,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1776366610, - "narHash": "sha256-7HXk7GwK7fCiIQ3ep8SsKUkfWhOOWxARuBKRPqWy0fc=", + "lastModified": 1776422982, + "narHash": "sha256-H4TfZRvGyWHzY/o0JiSYj/0UOxLv4mOM38xQKUKFW6Q=", "ref": "refs/heads/main", - "rev": "434f8f8ffd3801cfeac82f6caaf1b58ef25e9c11", - "revCount": 344, + "rev": "1a78b5808d49131aa13371235172f31587f4af3f", + "revCount": 398, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index 25b953d2..9a5f7144 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -12,7 +12,8 @@ ./podman.nix ./ssh.nix ./starship.nix - ./swaylock.nix + ./swayidle.nix + #./swaylock.nix #./swaync.nix ./vscode.nix # ./waybar.nix @@ -52,8 +53,10 @@ nova-shell = { enable = true; theme = { - fontSize = 13; + fontSize = 14; }; + #modules.backgroundOverlay.enable = false; + #modules.screenCorners.enable = false; }; }; diff --git a/homeConfigurations/muede/niri.nix b/homeConfigurations/muede/niri.nix index 4eebab75..d2288998 100644 --- a/homeConfigurations/muede/niri.nix +++ b/homeConfigurations/muede/niri.nix @@ -402,6 +402,11 @@ "Mod+W".action.toggle-column-tabbed-display = { }; "Mod+O".action.toggle-overview = { }; + + "Super+Alt+L" = { + action.spawn = "${pkgs.systemd}/bin/loginctl lock-session"; + allow-when-locked = true; + }; }; }; }; diff --git a/homeConfigurations/muede/swayidle.nix b/homeConfigurations/muede/swayidle.nix new file mode 100644 index 00000000..73029e65 --- /dev/null +++ b/homeConfigurations/muede/swayidle.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: +{ + services.swayidle = + let + lock-command = "${pkgs.systemd}/bin/loginctl lock-session"; + in + { + enable = true; + systemdTarget = "graphical-session.target"; + timeouts = [ + { + timeout = 30; + command = lock-command; + } + { + timeout = 60 * 10; + command = "${pkgs.systemd}/bin/systemctl suspend"; + } + ]; + events = [ + { + event = "before-sleep"; + command = "${pkgs.playerctl}/bin/playerctl pause; ${lock-command}"; + } + ]; + }; +} diff --git a/homeConfigurations/muede/swaylock.nix b/homeConfigurations/muede/swaylock.nix index 064cb9b4..f807135f 100644 --- a/homeConfigurations/muede/swaylock.nix +++ b/homeConfigurations/muede/swaylock.nix @@ -1,10 +1,5 @@ # based on https://codeberg.org/kiara/cfg/src/commit/b9c472acd78c9c08dfe8b6a643c5c82cc5828433/home-manager/kiara/swaylock.nix# -{ - pkgs, - config, - lib, - ... -}: +{ pkgs, ... }: { stylix.targets.swaylock = { enable = true; @@ -30,34 +25,4 @@ indicator-thickness = 20; }; }; - - services.swayidle = { - enable = true; - systemdTarget = "graphical-session.target"; - timeouts = [ - { - timeout = 5; - command = "${config.programs.swaylock.package}/bin/swaylock"; - } - { - timeout = 60 * 10; - command = "${pkgs.systemd}/bin/systemctl suspend"; - } - ]; - events = [ - { - event = "before-sleep"; - command = "${pkgs.playerctl}/bin/playerctl pause; ${config.programs.swaylock.package}/bin/swaylock"; - } - { - event = "lock"; - command = "${config.programs.swaylock.package}/bin/swaylock"; - } - ]; - }; - - programs.niri.settings.binds."Super+Alt+L" = { - action.spawn = "${lib.getBin config.programs.swaylock.package}/bin/swaylock"; - allow-when-locked = true; - }; } From e45185a95b63abff0de11c530844b70493e3d338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sat, 18 Apr 2026 16:37:53 +0200 Subject: [PATCH 0456/1295] nix flake update nixpkgs-unstable nova-shell --- flake.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index cbaede41..a714affc 100644 --- a/flake.lock +++ b/flake.lock @@ -509,11 +509,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1776255774, - "narHash": "sha256-psVTpH6PK3q1htMJpmdz1hLF5pQgEshu7gQWgKO6t6Y=", + "lastModified": 1776329215, + "narHash": "sha256-a8BYi3mzoJ/AcJP8UldOx8emoPRLeWqALZWu4ZvjPXw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "566acc07c54dc807f91625bb286cb9b321b5f42a", + "rev": "b86751bc4085f48661017fa226dee99fab6c651b", "type": "github" }, "original": { @@ -548,11 +548,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1776422982, - "narHash": "sha256-H4TfZRvGyWHzY/o0JiSYj/0UOxLv4mOM38xQKUKFW6Q=", + "lastModified": 1776522593, + "narHash": "sha256-HqQ8XQGv14TehBKL1IXF28wvbC6OCoHWvTOI/IdCA/8=", "ref": "refs/heads/main", - "rev": "1a78b5808d49131aa13371235172f31587f4af3f", - "revCount": 398, + "rev": "d821500db7375ebb346aaa17c80dc25214165584", + "revCount": 479, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, @@ -618,11 +618,11 @@ ] }, "locked": { - "lastModified": 1775720097, - "narHash": "sha256-p+vqkCuFfVNyQBo370wr6MebNUvz55RZiC0m8YKUhvQ=", + "lastModified": 1776066068, + "narHash": "sha256-SwKVkgEsqsp5ki9m7fqvhncb5MjvH1hlZqbn3s+x/Uk=", "ref": "refs/heads/master", - "rev": "d4c92973b53d9fa34cc110d3b974eb6bde5b3027", - "revCount": 800, + "rev": "fb08eced449e87e47321e95beeb890a63d2c67bd", + "revCount": 801, "type": "git", "url": "https://git.outfoxxed.me/outfoxxed/quickshell" }, From 8670cd15b867404a5c087281275be46777b63aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sat, 18 Apr 2026 16:38:17 +0200 Subject: [PATCH 0457/1295] add more tools to damocles --- nixosConfigurations/damocles/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixosConfigurations/damocles/default.nix b/nixosConfigurations/damocles/default.nix index e62b6acd..786a1b85 100644 --- a/nixosConfigurations/damocles/default.nix +++ b/nixosConfigurations/damocles/default.nix @@ -10,6 +10,9 @@ unstable.claude-code git python3 + coreutils-full + gawk + gnugrep ]; users.users.muede = { From 1969d71a8c7bf0ea98966da1666daad27d543ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Tue, 21 Apr 2026 23:57:24 +0200 Subject: [PATCH 0458/1295] make desktops more responsive while nix builds run --- nixosModules/global-settings-desktop.nix | 28 ++++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/nixosModules/global-settings-desktop.nix b/nixosModules/global-settings-desktop.nix index 5f8bbf7f..bf23ef7c 100644 --- a/nixosModules/global-settings-desktop.nix +++ b/nixosModules/global-settings-desktop.nix @@ -35,21 +35,25 @@ extraSpecialArgs = specialArgs; useGlobalPkgs = true; useUserPackages = true; + users = home-manager-users; + sharedModules = [ + { home.stateVersion = "22.11"; } + # keep-sorted start + self.homeModules.git + self.homeModules.gnome-extensions + self.homeModules.nano + self.homeModules.templates + self.homeModules.zsh-basics + # keep-sorted end + ]; }; time.timeZone = "Europe/Berlin"; - home-manager.sharedModules = [ - { home.stateVersion = "22.11"; } - # keep-sorted start - self.homeModules.git - self.homeModules.gnome-extensions - self.homeModules.nano - self.homeModules.templates - self.homeModules.zsh-basics - # keep-sorted end - ]; - - home-manager.users = home-manager-users; + # on desktops, keep the device useable interactively during expensive builds + nix = { + daemonCPUSchedPolicy = "idle"; + daemonIOSchedClass = "idle"; + }; }; } From fbe9ce80d1763f7bcfb3cb17c7c8c46637ec6fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Wed, 22 Apr 2026 23:44:26 +0200 Subject: [PATCH 0459/1295] add android tools to damocles --- nixosConfigurations/damocles/android-dev.nix | 43 ++++++++++++++++++++ nixosConfigurations/damocles/default.nix | 10 +++++ 2 files changed, 53 insertions(+) create mode 100644 nixosConfigurations/damocles/android-dev.nix diff --git a/nixosConfigurations/damocles/android-dev.nix b/nixosConfigurations/damocles/android-dev.nix new file mode 100644 index 00000000..ea5432c8 --- /dev/null +++ b/nixosConfigurations/damocles/android-dev.nix @@ -0,0 +1,43 @@ +{ pkgs, ... }: +let + androidComposition = pkgs.androidenv.composeAndroidPackages { + buildToolsVersions = [ "36.1.0" ]; + platformVersions = [ "35" ]; + includeNDK = false; + includeEmulator = false; + includeSystemImages = false; + }; + androidSdk = androidComposition.androidsdk; +in +{ + nixpkgs.config.android_sdk.accept_license = true; + + allowedUnfreePackages = [ + "android-sdk-cmdline-tools" + "android-sdk-platform-tools" + "android-sdk-tools" + "android-sdk-build-tools" + "android-sdk-platforms" + + # wtf + "platform-tools" + "tools" + "build-tools" + "cmdline-tools" + "platforms" + "cmake" # android sdk repackage + ]; + + environment.systemPackages = with pkgs; [ + androidSdk + gradle + kotlin + jdk21 + ]; + + environment.variables = { + ANDROID_HOME = "${androidSdk}/libexec/android-sdk"; + ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk"; + JAVA_HOME = "${pkgs.jdk21}"; + }; +} diff --git a/nixosConfigurations/damocles/default.nix b/nixosConfigurations/damocles/default.nix index 786a1b85..a91e1317 100644 --- a/nixosConfigurations/damocles/default.nix +++ b/nixosConfigurations/damocles/default.nix @@ -1,5 +1,7 @@ { pkgs, self, ... }: { + imports = [ ./android-dev.nix ]; + nixpkgs.overlays = [ self.overlays.unstable-packages ]; boot.isContainer = true; @@ -21,4 +23,12 @@ }; security.sudo.wheelNeedsPassword = false; + + programs.nix-ld = { + enable = true; + libraries = with pkgs; [ + stdenv.cc.cc.lib + zlib + ]; + }; } From e71e56a30d7c1fad794d9ab1a762b97b411713d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Wed, 22 Apr 2026 23:44:40 +0200 Subject: [PATCH 0460/1295] update nova-shell --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index a714affc..d23a8adf 100644 --- a/flake.lock +++ b/flake.lock @@ -548,11 +548,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1776522593, - "narHash": "sha256-HqQ8XQGv14TehBKL1IXF28wvbC6OCoHWvTOI/IdCA/8=", + "lastModified": 1776893458, + "narHash": "sha256-/oT77s8xQGAr80mWV+zcRixZMOqU6AJBloC97xuGY34=", "ref": "refs/heads/main", - "rev": "d821500db7375ebb346aaa17c80dc25214165584", - "revCount": 479, + "rev": "2c370afe8ed3ea4c198f65246a32a8809c246fd6", + "revCount": 524, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, From f2ed78747c83e4b106ad1fa3eda886c5ca0ba2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 24 Apr 2026 20:55:18 +0200 Subject: [PATCH 0461/1295] fix damocles cgroup broken after sleep with network switch --- nixosConfigurations/damocles/default.nix | 8 +++++++- nixosConfigurations/muede-lpt2/default.nix | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/nixosConfigurations/damocles/default.nix b/nixosConfigurations/damocles/default.nix index a91e1317..4cdd6f7f 100644 --- a/nixosConfigurations/damocles/default.nix +++ b/nixosConfigurations/damocles/default.nix @@ -1,4 +1,4 @@ -{ pkgs, self, ... }: +{ pkgs, lib, self, ... }: { imports = [ ./android-dev.nix ]; @@ -6,6 +6,12 @@ boot.isContainer = true; + # Container shares host network namespace (privateNetwork = false), so the + # host's tailscale already covers this. Running a second tailscaled in the + # same netns fights over routing and breaks connectivity after sleep/wake. + services.tailscale.enable = lib.mkForce false; + networking.firewall.checkReversePath = lib.mkForce "strict"; + allowedUnfreePackages = [ "claude-code" ]; environment.systemPackages = with pkgs; [ diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index 2f5e9492..19b2119f 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -69,7 +69,12 @@ # Global DefaultTimeoutStopSec is 10s (modern-desktop.nix), which kills systemd-nspawn # before it finishes halting, leaving cgroups busy and breaking restarts. - systemd.services."container@damocles".serviceConfig.TimeoutStopSec = "60s"; + systemd.services."container@damocles".serviceConfig = { + TimeoutStopSec = "60s"; + # After a SIGKILL of nspawn, the kernel needs a moment to reap its cgroups. + # Without this, the immediate restart attempt fails with "Device or resource busy". + RestartSec = "5s"; + }; boot.enableContainers = true; virtualisation.containers.enable = true; From fcd4b958270dbf5944e5955378cebbe4cfdf4d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 24 Apr 2026 20:55:35 +0200 Subject: [PATCH 0462/1295] nix flake update --- flake.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/flake.lock b/flake.lock index d23a8adf..3dce7db9 100644 --- a/flake.lock +++ b/flake.lock @@ -359,11 +359,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1776363101, - "narHash": "sha256-PIsrdhbaD+aqB473D3IjVjRdO5uQJ6etnm5b7nvdnmU=", + "lastModified": 1776879043, + "narHash": "sha256-M9RjuowtoqQbFRdQAm2P6GjFwgHjRcnWYcB7ChSjDms=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "f273e1406713b729e02e419d31c48200a285fac1", + "rev": "535ebbe038039215a5d1c6c0c67f833409a5be96", "type": "github" }, "original": { @@ -392,11 +392,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1776358048, - "narHash": "sha256-0OpEyuTrEVVkQXFJ5iSmjFXqSEsTNje0ldmiTNgEkOQ=", + "lastModified": 1776853441, + "narHash": "sha256-mSxfoEs7DiDhMCBzprI/1K7UXzMISuGq0b7T06LVJXE=", "owner": "YaLTeR", "repo": "niri", - "rev": "a1b0bd6d1cbbc695188f53839e42def4c5d38f43", + "rev": "74d2b18603366b98ec9045ecf4a632422f472365", "type": "github" }, "original": { @@ -427,11 +427,11 @@ ] }, "locked": { - "lastModified": 1776310443, - "narHash": "sha256-XQo/vlS6xak3iT3xS2Q3TUMbreeeqe+PR99feUoV0UQ=", + "lastModified": 1776828494, + "narHash": "sha256-gQ5+syn8ndyF/+c5g5ZpeAScNKhkTF4/63JsO2hqGHo=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "3a6d0ea13d092493b285b9093b5ce81e79df5cee", + "rev": "ea6764d22ff5478f5db39ede57eeafc70d14e8e6", "type": "github" }, "original": { @@ -478,11 +478,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1776067740, - "narHash": "sha256-B35lpsqnSZwn1Lmz06BpwF7atPgFmUgw1l8KAV3zpVQ=", + "lastModified": 1776734388, + "narHash": "sha256-vl3dkhlE5gzsItuHoEMVe+DlonsK+0836LIRDnm6MXQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7e495b747b51f95ae15e74377c5ce1fe69c1765f", + "rev": "10e7ad5bbcb421fe07e3a4ad53a634b0cd57ffac", "type": "github" }, "original": { @@ -548,11 +548,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1776893458, - "narHash": "sha256-/oT77s8xQGAr80mWV+zcRixZMOqU6AJBloC97xuGY34=", + "lastModified": 1776984220, + "narHash": "sha256-7o1I1Nl+HU+aXbCg7HLmj4W9o5/u6Tqviwmeczxzds0=", "ref": "refs/heads/main", - "rev": "2c370afe8ed3ea4c198f65246a32a8809c246fd6", - "revCount": 524, + "rev": "8d76df6ef5188b7fc640518b5c80687c52fcec55", + "revCount": 536, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, @@ -571,11 +571,11 @@ ] }, "locked": { - "lastModified": 1776364314, - "narHash": "sha256-xH/BIk0BBiZRhcJrurLBzpe0tAdmpeE3FAExIPnb3/w=", + "lastModified": 1776893492, + "narHash": "sha256-V4r/mdAFHe6fRiu3D+3+UdclSH7LJoHfv+4Y1YNawK0=", "owner": "nix-community", "repo": "NUR", - "rev": "528ff912ac19b61c3be7d29e3976e7f2186c2101", + "rev": "0aa8e8fc21887cc34a4c0e3816f08b56795f52ca", "type": "github" }, "original": { From 96239eef490056e0feb30d764919ff3dca20e396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 26 Apr 2026 19:06:01 +0200 Subject: [PATCH 0463/1295] nova-shell: use system module --- flake.lock | 8 ++++---- homeConfigurations/muede/default.nix | 1 - nixosModules/global-settings-desktop.nix | 2 ++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 3dce7db9..7593fcdc 100644 --- a/flake.lock +++ b/flake.lock @@ -548,11 +548,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1776984220, - "narHash": "sha256-7o1I1Nl+HU+aXbCg7HLmj4W9o5/u6Tqviwmeczxzds0=", + "lastModified": 1777222693, + "narHash": "sha256-5AQpEtjSaWfcWfuO8Z4nRgYqJegCa/0lUO2HUVJR4AI=", "ref": "refs/heads/main", - "rev": "8d76df6ef5188b7fc640518b5c80687c52fcec55", - "revCount": 536, + "rev": "dc8344d0af83ba9de5f74a68bee82cdf6364c9a2", + "revCount": 573, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index 9a5f7144..767b40e9 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -19,7 +19,6 @@ # ./waybar.nix # ./wlogout.nix ./zsh.nix - self.inputs.nova-shell.homeModules.default # keep-sorted end ]; diff --git a/nixosModules/global-settings-desktop.nix b/nixosModules/global-settings-desktop.nix index bf23ef7c..a94ab808 100644 --- a/nixosModules/global-settings-desktop.nix +++ b/nixosModules/global-settings-desktop.nix @@ -7,12 +7,14 @@ servicepoint-tanks, stylix, specialArgs, + nova-shell, ... }: { imports = [ # keep-sorted start home-manager.nixosModules.home-manager + nova-shell.nixosModules.default self.nixosModules.en-de self.nixosModules.firmware-updates self.nixosModules.gnome From 1366030c9bab35c22aa626b9118a85cf7c5ad6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 26 Apr 2026 19:07:12 +0200 Subject: [PATCH 0464/1295] wip add aur0ra --- flake.lock | 114 ++++++++++++++++-- flake.nix | 62 +++++----- .../aur0ra-installer/default.nix | 17 +++ nixosConfigurations/aur0ra/default.nix | 56 +++++++++ nixosConfigurations/aur0ra/hardware.nix | 64 ++++++++++ .../aur0ra/nice-looking-console.nix | 32 +++++ nixosConfigurations/damocles/default.nix | 7 +- nixosModules/extra-caches.nix | 14 ++- 8 files changed, 321 insertions(+), 45 deletions(-) create mode 100644 nixosConfigurations/aur0ra-installer/default.nix create mode 100644 nixosConfigurations/aur0ra/default.nix create mode 100644 nixosConfigurations/aur0ra/hardware.nix create mode 100644 nixosConfigurations/aur0ra/nice-looking-console.nix diff --git a/flake.lock b/flake.lock index 7593fcdc..f2eef87d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "argononed": { + "flake": false, + "locked": { + "lastModified": 1729566243, + "narHash": "sha256-DPNI0Dpk5aym3Baf5UbEe5GENDrSmmXVdriRSWE+rgk=", + "owner": "nvmd", + "repo": "argononed", + "rev": "16dbee54d49b66d5654d228d1061246b440ef7cf", + "type": "github" + }, + "original": { + "owner": "nvmd", + "repo": "argononed", + "type": "github" + } + }, "base16": { "inputs": { "fromYaml": "fromYaml" @@ -181,6 +197,21 @@ "type": "github" } }, + "flake-compat_2": { + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -476,13 +507,61 @@ "type": "github" } }, + "nixos-images": { + "inputs": { + "nixos-stable": [ + "nixos-raspberrypi", + "nixpkgs" + ], + "nixos-unstable": [ + "nixos-raspberrypi", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1747747741, + "narHash": "sha256-LUOH27unNWbGTvZFitHonraNx0JF/55h30r9WxqrznM=", + "owner": "nvmd", + "repo": "nixos-images", + "rev": "cbbd6db325775096680b65e2a32fb6187c09bbb4", + "type": "github" + }, + "original": { + "owner": "nvmd", + "ref": "sdimage-installer", + "repo": "nixos-images", + "type": "github" + } + }, + "nixos-raspberrypi": { + "inputs": { + "argononed": "argononed", + "flake-compat": "flake-compat_2", + "nixos-images": "nixos-images", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1775857096, + "narHash": "sha256-+eSij7C0oMqz76rGnB99RuWptBuEkJBm9vgb5fIwRrg=", + "owner": "nvmd", + "repo": "nixos-raspberrypi", + "rev": "1dc4ca5f93587932383c0b61e1753f5eed1c3bba", + "type": "github" + }, + "original": { + "owner": "nvmd", + "ref": "main", + "repo": "nixos-raspberrypi", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1776734388, - "narHash": "sha256-vl3dkhlE5gzsItuHoEMVe+DlonsK+0836LIRDnm6MXQ=", + "lastModified": 1775595990, + "narHash": "sha256-OEf7YqhF9IjJFYZJyuhAypgU+VsRB5lD4DuiMws5Ltc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "10e7ad5bbcb421fe07e3a4ad53a634b0cd57ffac", + "rev": "4e92bbcdb030f3b4782be4751dc08e6b6cb6ccf2", "type": "github" }, "original": { @@ -524,6 +603,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1776734388, + "narHash": "sha256-vl3dkhlE5gzsItuHoEMVe+DlonsK+0836LIRDnm6MXQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "10e7ad5bbcb421fe07e3a4ad53a634b0cd57ffac", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1757545623, "narHash": "sha256-mCxPABZ6jRjUQx3bPP4vjA68ETbPLNz9V2pk9tO7pRQ=", @@ -548,11 +643,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1777222693, - "narHash": "sha256-5AQpEtjSaWfcWfuO8Z4nRgYqJegCa/0lUO2HUVJR4AI=", + "lastModified": 1777295064, + "narHash": "sha256-A+Ooli4ckGyiT+zh10Ybj3nY2ql4QX1p6q6HrKCDvpA=", "ref": "refs/heads/main", - "rev": "dc8344d0af83ba9de5f74a68bee82cdf6364c9a2", - "revCount": 573, + "rev": "adb6c21135c93e0c57517ba90a32dd8f6bf2704d", + "revCount": 578, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, @@ -641,7 +736,8 @@ "nix-filter": "nix-filter", "nix-vscode-extensions": "nix-vscode-extensions", "nixos-generators": "nixos-generators", - "nixpkgs": "nixpkgs", + "nixos-raspberrypi": "nixos-raspberrypi", + "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", "nova-shell": "nova-shell", "nur": "nur", @@ -728,7 +824,7 @@ "nix-filter": [ "nix-filter" ], - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1757763091, diff --git a/flake.nix b/flake.nix index 04acd075..5a0fe151 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,7 @@ }; #keep-sorted start block=yes + flake-parts = { url = "github:hercules-ci/flake-parts"; #inputs.nixpkgs.follows = "nixpkgs"; @@ -37,6 +38,9 @@ url = "github:nix-community/nixos-generators"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixos-raspberrypi = { + url = "github:nvmd/nixos-raspberrypi/main"; + }; nova-shell = { url = "git+https://git.berlin.ccc.de/vinzenz/nova-shell"; inputs.nixpkgs.follows = "nixpkgs-unstable"; @@ -99,6 +103,7 @@ niri, nix-vscode-extensions, nixos-generators, + nixos-raspberrypi, nixpkgs-unstable, servicepoint-cli, servicepoint-simulator, @@ -111,6 +116,28 @@ }: let devices = { + # keep-sorted start block=yes + aur0ra = { + system = "aarch64-linux"; + nixosSystem = nixos-raspberrypi.lib.nixosSystem; + }; + aur0ra-installer = { + # build with nix build .\#nixosConfigurations.aur0ra-installer.config.system.build.sdImage + system = "aarch64-linux"; + nixosSystem = nixos-raspberrypi.lib.nixosInstaller; + }; + damocles = { + system = "x86_64-linux"; + }; + epimetheus = { + system = "aarch64-linux"; + }; + forgejo-runner-1 = { + system = "aarch64-linux"; + }; + hetzner-vpn2 = { + system = "aarch64-linux"; + }; muede-lpt2 = { system = "x86_64-linux"; home-manager-users = { @@ -129,18 +156,7 @@ inherit (self.homeConfigurations) ronja; }; }; - hetzner-vpn2 = { - system = "aarch64-linux"; - }; - forgejo-runner-1 = { - system = "aarch64-linux"; - }; - epimetheus = { - system = "aarch64-linux"; - }; - damocles = { - system = "x86_64-linux"; - }; + # keep-sorted end }; inherit (nixpkgs) lib; forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) devices; @@ -216,18 +232,19 @@ device, system, home-manager-users ? { }, + nixosSystem ? nixpkgs.lib.nixosSystem }: let specialArgs = inputs // { inherit device home-manager-users; }; in - nixpkgs.lib.nixosSystem { + nixosSystem { inherit specialArgs; modules = [ { imports = [ - ./nixosConfigurations/${device} + ./nixosConfigurations/${device} self.nixosModules.global-settings ] ++ (lib.optionals (home-manager-users != { }) [ @@ -250,22 +267,5 @@ formatting = treefmt-eval.config.build.check self; } ); - - packages = forAllSystems ( - { ... }: - { - nixos-aarch64-pxvirt-lxc-template = nixos-generators.nixosGenerate { - system = "aarch64-linux"; - format = "proxmox-lxc"; - specialArgs = inputs // { - device = "nixos-aarch64-pxvirt-lxc-template"; - }; - modules = [ - self.nixosModules.global-settings - self.nixosModules.pxvirt-guest - ]; - }; - } - ); }; } diff --git a/nixosConfigurations/aur0ra-installer/default.nix b/nixosConfigurations/aur0ra-installer/default.nix new file mode 100644 index 00000000..5557fae4 --- /dev/null +++ b/nixosConfigurations/aur0ra-installer/default.nix @@ -0,0 +1,17 @@ +{ + nixos-images, + config, + lib, + modulesPath, + ... +}: +{ + imports = [ + ../aur0ra + # nixos-images.nixosModules.sdimage-installer + ]; + disabledModules = [ + # disable the sd-image module that nixos-images uses + # (modulesPath + "/installer/sd-card/sd-image-aarch64-installer.nix") + ]; +} diff --git a/nixosConfigurations/aur0ra/default.nix b/nixosConfigurations/aur0ra/default.nix new file mode 100644 index 00000000..20aa8c34 --- /dev/null +++ b/nixosConfigurations/aur0ra/default.nix @@ -0,0 +1,56 @@ +{ lib, ... }: +{ + imports = [ + ./hardware.nix + ./nice-looking-console.nix + ]; + + users.users.ruth = { + # initialPassword = "setup"; + isNormalUser = true; + extraGroups = [ + "wheel" + "networkmanager" + "video" + ]; + # Allow the graphical user to login without password + initialHashedPassword = ""; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC lpt2-roaming" + ]; + }; + nix.settings.trusted-users = [ "ruth" ]; + + # Don't require sudo/root to `reboot` or `poweroff`. + security.polkit.enable = true; + + # Allow passwordless sudo from nixos user + security.sudo = { + enable = true; + wheelNeedsPassword = false; + }; + + services.openssh.enable = true; + + # https://github.com/nvmd/nixos-raspberrypi-demo/blob/c521600570f0365ae9c846af4b023049b80ae331/modules/server-networking.nix + + networking.firewall.logRefusedConnections = lib.mkDefault false; + + # Use networkd instead of the pile of shell scripts + # NOTE: SK: is it safe to combine with NetworkManager on desktops? + networking.useNetworkd = lib.mkDefault true; + + # The notion of "online" is a broken concept + # https://github.com/systemd/systemd/blob/e1b45a756f71deac8c1aa9a008bd0dab47f64777/NEWS#L13 + # https://github.com/NixOS/nixpkgs/issues/247608 + systemd.services.NetworkManager-wait-online.enable = false; + systemd.network.wait-online.enable = false; + + # Do not take down the network for too long when upgrading, + # This also prevents failures of services that are restarted instead of stopped. + # It will use `systemctl restart` rather than stopping it with `systemctl stop` + # followed by a delayed `systemctl start`. + systemd.services.systemd-networkd.stopIfChanged = false; + # Services that are only restarted might be not able to resolve when resolved is stopped before + systemd.services.systemd-resolved.stopIfChanged = false; +} diff --git a/nixosConfigurations/aur0ra/hardware.nix b/nixosConfigurations/aur0ra/hardware.nix new file mode 100644 index 00000000..8014f410 --- /dev/null +++ b/nixosConfigurations/aur0ra/hardware.nix @@ -0,0 +1,64 @@ +{ nixos-raspberrypi, lib, ... }: +{ + imports = with nixos-raspberrypi.nixosModules; [ + raspberry-pi-5.base + raspberry-pi-5.bluetooth + raspberry-pi-5.page-size-16k + raspberry-pi-5.display-vc4 + ]; + + # No one got time for xz compression. + #isoImage.squashfsCompression = "zstd"; + + boot.loader = { + raspberry-pi.bootloader = "kernel"; + systemd-boot.enable = lib.mkForce false; + #generic-extlinux-compatible.enable = lib.mkForce false; + }; + + /* + fileSystems = { + "/boot/firmware" = { + # TODO + device = "/dev/disk/by-uuid/2175-794E"; + fsType = "vfat"; + options = [ + "noatime" + "noauto" + "x-systemd.automount" + "x-systemd.idle-timeout=1min" + ]; + }; + "/" = { + # TODO + device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + options = [ "noatime" ]; + }; + }; + */ + + hardware.raspberry-pi.config = { + all = { + # [all] conditional filter, https://www.raspberrypi.com/documentation/computers/config_txt.html#conditional-filters + # Base DTB parameters + # https://github.com/raspberrypi/linux/blob/a1d3defcca200077e1e382fe049ca613d16efd2b/arch/arm/boot/dts/overlays/README#L132 + base-dt-params = { + + # https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#enable-pcie + pciex1 = { + enable = true; + value = "on"; + }; + # PCIe Gen 3.0 + # https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#pcie-gen-3-0 + pciex1_gen = { + enable = true; + value = "3"; + }; + + }; + + }; + }; +} diff --git a/nixosConfigurations/aur0ra/nice-looking-console.nix b/nixosConfigurations/aur0ra/nice-looking-console.nix new file mode 100644 index 00000000..847bfc2c --- /dev/null +++ b/nixosConfigurations/aur0ra/nice-looking-console.nix @@ -0,0 +1,32 @@ +# re-borrowed from https://github.com/nvmd/nixos-raspberrypi-demo/blob/main/modules/nice-looking-console.nix +{ lib, pkgs, ... }: +{ + # The following have been borrowed from: + # https://github.com/nix-community/nixos-images/blob/b733f0680a42cc01d6ad53896fb5ca40a66d5e79/nix/image-installer/module.nix#L84 + + console.earlySetup = true; + # ter-u22n is probably too big + console.font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-u16n.psf.gz"; + + # Make colored console output more readable + # for example, `ip addr`s (blues are too dark by default) + # Tango theme: https://yayachiken.net/en/posts/tango-colors-in-terminal/ + console.colors = lib.mkDefault [ + "000000" + "CC0000" + "4E9A06" + "C4A000" + "3465A4" + "75507B" + "06989A" + "D3D7CF" + "555753" + "EF2929" + "8AE234" + "FCE94F" + "739FCF" + "AD7FA8" + "34E2E2" + "EEEEEC" + ]; +} diff --git a/nixosConfigurations/damocles/default.nix b/nixosConfigurations/damocles/default.nix index 4cdd6f7f..75c54392 100644 --- a/nixosConfigurations/damocles/default.nix +++ b/nixosConfigurations/damocles/default.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, self, ... }: +{ + pkgs, + lib, + self, + ... +}: { imports = [ ./android-dev.nix ]; diff --git a/nixosModules/extra-caches.nix b/nixosModules/extra-caches.nix index 6af372f4..8b5431cb 100644 --- a/nixosModules/extra-caches.nix +++ b/nixosModules/extra-caches.nix @@ -1,16 +1,22 @@ { nix.settings = { substituters = [ - "https://cache.nixos.org/" - "https://nix-community.cachix.org" + # keep-sorted start "https://cache.lix.systems" + "https://cache.nixos.org/" "https://niri.cachix.org" + "https://nix-community.cachix.org" + "https://nixos-raspberrypi.cachix.org" + # keep-sorted end ]; trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + # keep-sorted start "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI=" + # keep-sorted end ]; }; } From 27a71e94ce6dd0f32a2c73645670a178814077e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Wed, 29 Apr 2026 21:38:40 +0200 Subject: [PATCH 0465/1295] add damocles-lab container --- flake.nix | 3 ++ nixosConfigurations/damocles-lab/default.nix | 16 +++++++ .../damocles/claude-container.nix | 41 +++++++++++++++++ nixosConfigurations/damocles/default.nix | 44 +------------------ nixosConfigurations/muede-lpt2/default.nix | 27 ++++++++++++ 5 files changed, 88 insertions(+), 43 deletions(-) create mode 100644 nixosConfigurations/damocles-lab/default.nix create mode 100644 nixosConfigurations/damocles/claude-container.nix diff --git a/flake.nix b/flake.nix index 5a0fe151..ea6d9fe7 100644 --- a/flake.nix +++ b/flake.nix @@ -129,6 +129,9 @@ damocles = { system = "x86_64-linux"; }; + damocles-lab = { + system = "x86_64-linux"; + }; epimetheus = { system = "aarch64-linux"; }; diff --git a/nixosConfigurations/damocles-lab/default.nix b/nixosConfigurations/damocles-lab/default.nix new file mode 100644 index 00000000..752065d9 --- /dev/null +++ b/nixosConfigurations/damocles-lab/default.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +{ + imports = [../damocles/claude-container.nix]; + + services.openssh = { + enable = true; + ports = [ 2222 ]; + # Path written into sshd_config as a string — not read at eval time. + # Key can be rotated without a rebuild. + authorizedKeysFiles = [ "/persist/damocles-ssh/id_ed25519.pub" ]; + }; + + environment.systemPackages = with pkgs; [ + + ]; +} diff --git a/nixosConfigurations/damocles/claude-container.nix b/nixosConfigurations/damocles/claude-container.nix new file mode 100644 index 00000000..c754f47c --- /dev/null +++ b/nixosConfigurations/damocles/claude-container.nix @@ -0,0 +1,41 @@ +{ pkgs,self,lib, ... }: { + + nixpkgs.overlays = [ self.overlays.unstable-packages ]; + allowedUnfreePackages = [ "claude-code" ]; + + environment.systemPackages = with pkgs; [ + unstable.claude-code + git + python3 + coreutils-full + gawk + gnugrep + curl + cargo + rustc + clippy + ]; + + boot.isContainer = true; + + programs.nix-ld = { + enable = true; + libraries = with pkgs; [ + stdenv.cc.cc.lib + zlib + ]; + }; + + # Container shares host network namespace (privateNetwork = false), so the + # host's tailscale already covers this. Running a second tailscaled in the + # same netns fights over routing and breaks connectivity after sleep/wake. + services.tailscale.enable = lib.mkForce false; + networking.firewall.checkReversePath = lib.mkForce "strict"; + + users.users.muede = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + }; + + security.sudo.wheelNeedsPassword = false; +} diff --git a/nixosConfigurations/damocles/default.nix b/nixosConfigurations/damocles/default.nix index 75c54392..e0c276bf 100644 --- a/nixosConfigurations/damocles/default.nix +++ b/nixosConfigurations/damocles/default.nix @@ -1,45 +1,3 @@ { - pkgs, - lib, - self, - ... -}: -{ - imports = [ ./android-dev.nix ]; - - nixpkgs.overlays = [ self.overlays.unstable-packages ]; - - boot.isContainer = true; - - # Container shares host network namespace (privateNetwork = false), so the - # host's tailscale already covers this. Running a second tailscaled in the - # same netns fights over routing and breaks connectivity after sleep/wake. - services.tailscale.enable = lib.mkForce false; - networking.firewall.checkReversePath = lib.mkForce "strict"; - - allowedUnfreePackages = [ "claude-code" ]; - - environment.systemPackages = with pkgs; [ - unstable.claude-code - git - python3 - coreutils-full - gawk - gnugrep - ]; - - users.users.muede = { - isNormalUser = true; - extraGroups = [ "wheel" ]; - }; - - security.sudo.wheelNeedsPassword = false; - - programs.nix-ld = { - enable = true; - libraries = with pkgs; [ - stdenv.cc.cc.lib - zlib - ]; - }; + imports = [ ./android-dev.nix ./claude-container.nix ]; } diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index 19b2119f..711a5782 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -65,6 +65,28 @@ autoStart = false; privateNetwork = false; path = self.nixosConfigurations.damocles.config.system.build.toplevel; + bindMounts."/persist/damocles-ssh" = { + hostPath = "/persist/damocles-ssh"; + isReadOnly = true; + }; + bindMounts."/persist/damocles-lab" = { + hostPath = "/persist/damocles-lab"; + isReadOnly = false; + }; + }; + + containers.damocles-lab = { + autoStart = false; + privateNetwork = false; + path = self.nixosConfigurations.damocles-lab.config.system.build.toplevel; + bindMounts."/workspace" = { + hostPath = "/persist/damocles-lab"; + isReadOnly = false; + }; + bindMounts."/persist/damocles-ssh" = { + hostPath = "/persist/damocles-ssh"; + isReadOnly = true; + }; }; # Global DefaultTimeoutStopSec is 10s (modern-desktop.nix), which kills systemd-nspawn @@ -76,6 +98,11 @@ RestartSec = "5s"; }; + systemd.services."container@damocles-lab".serviceConfig = { + TimeoutStopSec = "60s"; + RestartSec = "5s"; + }; + boot.enableContainers = true; virtualisation.containers.enable = true; }; From 7b56f73a488766de5bfd276cce3a3c0ec11bb3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Wed, 29 Apr 2026 21:38:54 +0200 Subject: [PATCH 0466/1295] update nova-shell --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index f2eef87d..461b3c03 100644 --- a/flake.lock +++ b/flake.lock @@ -643,11 +643,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1777295064, - "narHash": "sha256-A+Ooli4ckGyiT+zh10Ybj3nY2ql4QX1p6q6HrKCDvpA=", + "lastModified": 1777479755, + "narHash": "sha256-rKha1HlZIYn+nhptqOSaSPGywXXdM5S462oiXh64EWM=", "ref": "refs/heads/main", - "rev": "adb6c21135c93e0c57517ba90a32dd8f6bf2704d", - "revCount": 578, + "rev": "7ab784e101b69f35f65e300d5779888624f7a7a5", + "revCount": 596, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, From 4d872cd6323b5579e3b7bb50185c082d8c7f5632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Wed, 29 Apr 2026 23:58:15 +0200 Subject: [PATCH 0467/1295] damocles-lab misc --- flake.nix | 4 ++-- nixosConfigurations/aur0ra-installer/default.nix | 4 ++-- nixosConfigurations/damocles-lab/default.nix | 2 +- nixosConfigurations/damocles/claude-container.nix | 11 +++++++---- nixosConfigurations/damocles/default.nix | 13 ++++++++++++- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index ea6d9fe7..dce39297 100644 --- a/flake.nix +++ b/flake.nix @@ -235,7 +235,7 @@ device, system, home-manager-users ? { }, - nixosSystem ? nixpkgs.lib.nixosSystem + nixosSystem ? nixpkgs.lib.nixosSystem, }: let specialArgs = inputs // { @@ -247,7 +247,7 @@ modules = [ { imports = [ - ./nixosConfigurations/${device} + ./nixosConfigurations/${device} self.nixosModules.global-settings ] ++ (lib.optionals (home-manager-users != { }) [ diff --git a/nixosConfigurations/aur0ra-installer/default.nix b/nixosConfigurations/aur0ra-installer/default.nix index 5557fae4..b6c1e1a1 100644 --- a/nixosConfigurations/aur0ra-installer/default.nix +++ b/nixosConfigurations/aur0ra-installer/default.nix @@ -8,10 +8,10 @@ { imports = [ ../aur0ra - # nixos-images.nixosModules.sdimage-installer + # nixos-images.nixosModules.sdimage-installer ]; disabledModules = [ # disable the sd-image module that nixos-images uses - # (modulesPath + "/installer/sd-card/sd-image-aarch64-installer.nix") + # (modulesPath + "/installer/sd-card/sd-image-aarch64-installer.nix") ]; } diff --git a/nixosConfigurations/damocles-lab/default.nix b/nixosConfigurations/damocles-lab/default.nix index 752065d9..705e31a8 100644 --- a/nixosConfigurations/damocles-lab/default.nix +++ b/nixosConfigurations/damocles-lab/default.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { - imports = [../damocles/claude-container.nix]; + imports = [ ../damocles/claude-container.nix ]; services.openssh = { enable = true; diff --git a/nixosConfigurations/damocles/claude-container.nix b/nixosConfigurations/damocles/claude-container.nix index c754f47c..17d599f1 100644 --- a/nixosConfigurations/damocles/claude-container.nix +++ b/nixosConfigurations/damocles/claude-container.nix @@ -1,4 +1,10 @@ -{ pkgs,self,lib, ... }: { +{ + pkgs, + self, + lib, + ... +}: +{ nixpkgs.overlays = [ self.overlays.unstable-packages ]; allowedUnfreePackages = [ "claude-code" ]; @@ -11,9 +17,6 @@ gawk gnugrep curl - cargo - rustc - clippy ]; boot.isContainer = true; diff --git a/nixosConfigurations/damocles/default.nix b/nixosConfigurations/damocles/default.nix index e0c276bf..c5eff0a5 100644 --- a/nixosConfigurations/damocles/default.nix +++ b/nixosConfigurations/damocles/default.nix @@ -1,3 +1,14 @@ +{ pkgs, ... }: { - imports = [ ./android-dev.nix ./claude-container.nix ]; + imports = [ + ./android-dev.nix + ./claude-container.nix + ]; + + environment.systemPackages = with pkgs; [ + cargo + rustc + clippy + gh + ]; } From f5a7d1ec100a3ab835b184ea67d4294686f81ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 30 Apr 2026 00:00:44 +0200 Subject: [PATCH 0468/1295] nix flake update --- flake.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index 461b3c03..9445a9a7 100644 --- a/flake.lock +++ b/flake.lock @@ -363,11 +363,11 @@ ] }, "locked": { - "lastModified": 1776200608, - "narHash": "sha256-broZ6RFQr4Fv0wT73gGmzNX14A43TmTFF8g4wDKlNss=", + "lastModified": 1777031541, + "narHash": "sha256-KZ4s1kolHXFQrRGlnB503gDcTrVQMhiczO+LvvwKEPg=", "owner": "nix-community", "repo": "naersk", - "rev": "8b23250ab45c2a38cd91031aee26478ca4d0a28e", + "rev": "5e73301621274c44798bf6c6211ed27fc2ced201", "type": "github" }, "original": { @@ -390,11 +390,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1776879043, - "narHash": "sha256-M9RjuowtoqQbFRdQAm2P6GjFwgHjRcnWYcB7ChSjDms=", + "lastModified": 1777472199, + "narHash": "sha256-gJr/OrHv6s8ANqv915sb69LLThow1u5yAO/ouElVGGM=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "535ebbe038039215a5d1c6c0c67f833409a5be96", + "rev": "323a80f2ce4541c595d491acbd15a8800201cbae", "type": "github" }, "original": { @@ -423,11 +423,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1776853441, - "narHash": "sha256-mSxfoEs7DiDhMCBzprI/1K7UXzMISuGq0b7T06LVJXE=", + "lastModified": 1777468255, + "narHash": "sha256-lBZc1UMy+1P1T/E41j3jQrpS7EFI3qegd+ktHZdamIg=", "owner": "YaLTeR", "repo": "niri", - "rev": "74d2b18603366b98ec9045ecf4a632422f472365", + "rev": "dd1c3bcb9f1ef416df33ffa22d1d9bcee1398e7d", "type": "github" }, "original": { @@ -458,11 +458,11 @@ ] }, "locked": { - "lastModified": 1776828494, - "narHash": "sha256-gQ5+syn8ndyF/+c5g5ZpeAScNKhkTF4/63JsO2hqGHo=", + "lastModified": 1777434090, + "narHash": "sha256-i7p7ajtdKF6oVjs3ERyECCg6m1lWEchHNPKQjgRW4h4=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "ea6764d22ff5478f5db39ede57eeafc70d14e8e6", + "rev": "f32bb01e6a12b74fa67261e9d690ff9d0603d86b", "type": "github" }, "original": { @@ -588,11 +588,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1776329215, - "narHash": "sha256-a8BYi3mzoJ/AcJP8UldOx8emoPRLeWqALZWu4ZvjPXw=", + "lastModified": 1777270315, + "narHash": "sha256-yKB4G6cKsQsWN7M6rZGk6gkJPDNPIzT05y4qzRyCDlI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b86751bc4085f48661017fa226dee99fab6c651b", + "rev": "6368eda62c9775c38ef7f714b2555a741c20c72d", "type": "github" }, "original": { @@ -604,11 +604,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1776734388, - "narHash": "sha256-vl3dkhlE5gzsItuHoEMVe+DlonsK+0836LIRDnm6MXQ=", + "lastModified": 1777077449, + "narHash": "sha256-AIiMJiqvGrN4HyLEbKAoCSRRYn0rnlW5VbKNIMIYqm4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "10e7ad5bbcb421fe07e3a4ad53a634b0cd57ffac", + "rev": "a4bf06618f0b5ee50f14ed8f0da77d34ecc19160", "type": "github" }, "original": { @@ -666,11 +666,11 @@ ] }, "locked": { - "lastModified": 1776893492, - "narHash": "sha256-V4r/mdAFHe6fRiu3D+3+UdclSH7LJoHfv+4Y1YNawK0=", + "lastModified": 1777499139, + "narHash": "sha256-s817mwTTkW0VIReee1z41LJAz13AUw3DOK41jZooFGw=", "owner": "nix-community", "repo": "NUR", - "rev": "0aa8e8fc21887cc34a4c0e3816f08b56795f52ca", + "rev": "c0295550b00f0d0d4a9f41efd5e6c14d38a671fc", "type": "github" }, "original": { @@ -887,11 +887,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1775935110, - "narHash": "sha256-twTHKUFXjNNsaAvX0KoaIClt+923jXDRbfCd9PC/f0o=", + "lastModified": 1776894428, + "narHash": "sha256-wuT915MyCtMTfLj+uo9y8wtCwkEgJXiXvcbSleFrlN0=", "owner": "nix-community", "repo": "stylix", - "rev": "14f248ad1a7668e7858c6d9163608c208b7daf02", + "rev": "f34be27ce83efaa1c85ad1e5b1f8b6dea65b147d", "type": "github" }, "original": { From aa567694df35d78788dbdf1db93df0d50773dab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 21:17:51 +0200 Subject: [PATCH 0469/1295] distributed builds - infra and lpt2 --- flake.nix | 10 ++- nixosConfigurations/muede-lpt2/default.nix | 8 +++ nixosModules/distributed-builds.nix | 80 ++++++++++++++++++++++ nixosModules/global-settings.nix | 1 + 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 nixosModules/distributed-builds.nix diff --git a/flake.nix b/flake.nix index dce39297..57d4037e 100644 --- a/flake.nix +++ b/flake.nix @@ -128,9 +128,11 @@ }; damocles = { system = "x86_64-linux"; + distributedBuilds.maxJobs = 0; }; damocles-lab = { system = "x86_64-linux"; + distributedBuilds.maxJobs = 0; }; epimetheus = { system = "aarch64-linux"; @@ -146,12 +148,17 @@ home-manager-users = { inherit (self.homeConfigurations) muede; }; + distributedBuilds.isBuilder = true; }; muede-pc2 = { system = "x86_64-linux"; home-manager-users = { inherit (self.homeConfigurations) muede; }; + distributedBuilds = { + isBuilder = true; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAbojdhb3PfazSRmudvo381Y+zUFVLMa7AbWbfK/Zp2 muede-pc2-nix-builds"; + }; }; ronja-pc = { system = "x86_64-linux"; @@ -236,10 +243,11 @@ system, home-manager-users ? { }, nixosSystem ? nixpkgs.lib.nixosSystem, + ... }: let specialArgs = inputs // { - inherit device home-manager-users; + inherit device home-manager-users devices; }; in nixosSystem { diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index 711a5782..434b0464 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -65,6 +65,10 @@ autoStart = false; privateNetwork = false; path = self.nixosConfigurations.damocles.config.system.build.toplevel; + bindMounts."/etc/nix/distributed-build-key" = { + hostPath = "/etc/nix/distributed-build-key"; + isReadOnly = true; + }; bindMounts."/persist/damocles-ssh" = { hostPath = "/persist/damocles-ssh"; isReadOnly = true; @@ -79,6 +83,10 @@ autoStart = false; privateNetwork = false; path = self.nixosConfigurations.damocles-lab.config.system.build.toplevel; + bindMounts."/etc/nix/distributed-build-key" = { + hostPath = "/etc/nix/distributed-build-key"; + isReadOnly = true; + }; bindMounts."/workspace" = { hostPath = "/persist/damocles-lab"; isReadOnly = false; diff --git a/nixosModules/distributed-builds.nix b/nixosModules/distributed-builds.nix new file mode 100644 index 00000000..a811a712 --- /dev/null +++ b/nixosModules/distributed-builds.nix @@ -0,0 +1,80 @@ +{ + config, + lib, + devices, + ... +}: +let + sshKeyPath = "/etc/nix/distributed-build-key"; + buildUser = "remotebuild"; + + # Collect all per-device public keys that have been registered. + authorizedPublicKeys = lib.pipe devices [ + (lib.filterAttrs (_: v: (v.distributedBuilds or { }) ? publicKey)) + (lib.mapAttrsToList (_: v: v.distributedBuilds.publicKey)) + ]; + + # === Onboarding a device as a build client === + # + # 1. Generate a key pair on the device: + # sudo ssh-keygen -t ed25519 -f /etc/nix/distributed-build-key -N "" -C "-nix-builds" + # (owned by root, mode 0600) + # + # 2. Add the public key to the device entry in flake.nix: + # distributedBuilds.publicKey = "ssh-ed25519 AAAA... -nix-builds"; + # + # 3. Rebuild all machines so they pick up the new authorized key. + # + # === Marking a device as a build server === + # + # Add to its entry in flake.nix: + # distributedBuilds.isBuilder = true; + # All machines automatically discover and use it after the next rebuild. + + buildServerDevices = lib.filterAttrs (_: v: (v.distributedBuilds or { }).isBuilder or false) devices; + + buildMachineList = lib.mapAttrsToList (hostName: v: { + inherit hostName; + systems = [ v.system ]; + sshUser = buildUser; + sshKey = sshKeyPath; + protocol = "ssh-ng"; + supportedFeatures = [ + "nixos-test" + "big-parallel" + "kvm" + "benchmark" + ]; + }) buildServerDevices; + + remoteMachines = builtins.filter (m: m.hostName != config.networking.hostName) buildMachineList; +in +{ + # Dedicated user for receiving distributed build connections + users.users.${buildUser} = { + isSystemUser = true; + group = buildUser; + useDefaultShell = true; + openssh.authorizedKeys.keys = authorizedPublicKeys; + }; + users.groups.${buildUser} = { }; + + nix = { + distributedBuilds = remoteMachines != [ ]; + buildMachines = remoteMachines; + settings = { + trusted-users = [ buildUser ]; + builders-use-substitutes = true; + max-jobs = (devices.${config.networking.hostName}.distributedBuilds or { }).maxJobs or "auto"; + cores = 0; + min-free = 10 * 1024 * 1024; + max-free = 200 * 1024 * 1024; + }; + }; + + systemd.services.nix-daemon.serviceConfig = { + MemoryAccounting = true; + MemoryMax = "90%"; + OOMScoreAdjust = 500; + }; +} diff --git a/nixosModules/global-settings.nix b/nixosModules/global-settings.nix index cd92140f..2d1c5b3d 100644 --- a/nixosModules/global-settings.nix +++ b/nixosModules/global-settings.nix @@ -12,6 +12,7 @@ self.nixosModules.allowed-unfree-list self.nixosModules.autoupdate self.nixosModules.default + self.nixosModules.distributed-builds self.nixosModules.extra-caches self.nixosModules.globalinstalls self.nixosModules.lix-is-nix From cde2658789cf45a8e4f987d6829cf46e10553305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 21:24:16 +0200 Subject: [PATCH 0470/1295] distributed builds: fix swapped key, add pc2 --- flake.nix | 7 +++++-- nixosModules/distributed-builds.nix | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 57d4037e..2c80aec3 100644 --- a/flake.nix +++ b/flake.nix @@ -148,7 +148,10 @@ home-manager-users = { inherit (self.homeConfigurations) muede; }; - distributedBuilds.isBuilder = true; + distributedBuilds = { + isBuilder = true; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAbojdhb3PfazSRmudvo381Y+zUFVLMa7AbWbfK/Zp2 muede-lpt2-nix-builds"; + }; }; muede-pc2 = { system = "x86_64-linux"; @@ -157,7 +160,7 @@ }; distributedBuilds = { isBuilder = true; - publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAbojdhb3PfazSRmudvo381Y+zUFVLMa7AbWbfK/Zp2 muede-pc2-nix-builds"; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHmnyhP6L+kGHV15cb/d31AQr50wSEaQhkUBwy2+OEKk muede-pc2-nix-builds"; }; }; ronja-pc = { diff --git a/nixosModules/distributed-builds.nix b/nixosModules/distributed-builds.nix index a811a712..27804ee0 100644 --- a/nixosModules/distributed-builds.nix +++ b/nixosModules/distributed-builds.nix @@ -17,7 +17,7 @@ let # === Onboarding a device as a build client === # # 1. Generate a key pair on the device: - # sudo ssh-keygen -t ed25519 -f /etc/nix/distributed-build-key -N "" -C "-nix-builds" + # sudo ssh-keygen -t ed25519 -f /etc/nix/distributed-build-key -N "" -C "$(hostname)-nix-builds" # (owned by root, mode 0600) # # 2. Add the public key to the device entry in flake.nix: From 05645a2c46eb2c6bc2a8596a00c6b01dac8adc25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 21:24:32 +0200 Subject: [PATCH 0471/1295] nix flake update nova-shell --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 9445a9a7..764d4217 100644 --- a/flake.lock +++ b/flake.lock @@ -643,11 +643,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1777479755, - "narHash": "sha256-rKha1HlZIYn+nhptqOSaSPGywXXdM5S462oiXh64EWM=", + "lastModified": 1777656272, + "narHash": "sha256-OcxjycGuzEeU6ZbX4SjSx4YVKcDlaZm8gdSvEFGowoo=", "ref": "refs/heads/main", - "rev": "7ab784e101b69f35f65e300d5779888624f7a7a5", - "revCount": 596, + "rev": "40cc681e9a36320659175f240e9ccc3f3041a7e9", + "revCount": 598, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, From b995113f56d3669f589a0aba30a5360d7c32b3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 21:54:54 +0200 Subject: [PATCH 0472/1295] distributed builds: add builders to known hosts --- flake.nix | 7 +++++-- nixosModules/distributed-builds.nix | 21 +++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 2c80aec3..35739dcb 100644 --- a/flake.nix +++ b/flake.nix @@ -150,7 +150,8 @@ }; distributedBuilds = { isBuilder = true; - publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAbojdhb3PfazSRmudvo381Y+zUFVLMa7AbWbfK/Zp2 muede-lpt2-nix-builds"; + hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHGKoZ68wwyVRmPB0SkvpJUyUMDWeFbC5Je9zukyEOh7"; + clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAbojdhb3PfazSRmudvo381Y+zUFVLMa7AbWbfK/Zp2 muede-lpt2-nix-builds"; }; }; muede-pc2 = { @@ -160,7 +161,9 @@ }; distributedBuilds = { isBuilder = true; - publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHmnyhP6L+kGHV15cb/d31AQr50wSEaQhkUBwy2+OEKk muede-pc2-nix-builds"; + speedFactor = 2; + hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKEQQS5XNoj62Oj85xQfIuLORwoBRwfqjvfBHHsiI+RH"; + clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHmnyhP6L+kGHV15cb/d31AQr50wSEaQhkUBwy2+OEKk muede-pc2-nix-builds"; }; }; ronja-pc = { diff --git a/nixosModules/distributed-builds.nix b/nixosModules/distributed-builds.nix index 27804ee0..f0c45da6 100644 --- a/nixosModules/distributed-builds.nix +++ b/nixosModules/distributed-builds.nix @@ -10,8 +10,8 @@ let # Collect all per-device public keys that have been registered. authorizedPublicKeys = lib.pipe devices [ - (lib.filterAttrs (_: v: (v.distributedBuilds or { }) ? publicKey)) - (lib.mapAttrsToList (_: v: v.distributedBuilds.publicKey)) + (lib.filterAttrs (_: v: (v.distributedBuilds or { }) ? clientPublicKey)) + (lib.mapAttrsToList (_: v: v.distributedBuilds.clientPublicKey)) ]; # === Onboarding a device as a build client === @@ -21,7 +21,7 @@ let # (owned by root, mode 0600) # # 2. Add the public key to the device entry in flake.nix: - # distributedBuilds.publicKey = "ssh-ed25519 AAAA... -nix-builds"; + # distributedBuilds.clientPublicKey = "ssh-ed25519 AAAA... -nix-builds"; # # 3. Rebuild all machines so they pick up the new authorized key. # @@ -29,16 +29,27 @@ let # # Add to its entry in flake.nix: # distributedBuilds.isBuilder = true; + # distributedBuilds.hostPublicKey = "ssh-ed25519 AAAA..."; # from: ssh-keyscan -t ed25519 # All machines automatically discover and use it after the next rebuild. buildServerDevices = lib.filterAttrs (_: v: (v.distributedBuilds or { }).isBuilder or false) devices; + knownHosts = lib.pipe buildServerDevices [ + (lib.filterAttrs (_: v: v.distributedBuilds ? hostPublicKey)) + (lib.mapAttrs (hostName: v: { + publicKey = v.distributedBuilds.hostPublicKey; + })) + ]; + buildMachineList = lib.mapAttrsToList (hostName: v: { inherit hostName; systems = [ v.system ]; sshUser = buildUser; sshKey = sshKeyPath; protocol = "ssh-ng"; + } // lib.optionalAttrs (v.distributedBuilds ? speedFactor) { + speedFactor = v.distributedBuilds.speedFactor; + } // { supportedFeatures = [ "nixos-test" "big-parallel" @@ -51,11 +62,13 @@ let in { # Dedicated user for receiving distributed build connections + programs.ssh.knownHosts = knownHosts; + users.users.${buildUser} = { isSystemUser = true; group = buildUser; useDefaultShell = true; - openssh.authorizedKeys.keys = authorizedPublicKeys; + openssh.authorizedKeys.keys = map (k: ''command="nix daemon --stdio",restrict ${k}'') authorizedPublicKeys; }; users.groups.${buildUser} = { }; From c2d4ce78de05fc554e767cc9ee9050832944246a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 22:04:11 +0200 Subject: [PATCH 0473/1295] move devices to own file --- devices.nix | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 60 +------------------------------------------------- 2 files changed, 64 insertions(+), 59 deletions(-) create mode 100644 devices.nix diff --git a/devices.nix b/devices.nix new file mode 100644 index 00000000..a8e427a1 --- /dev/null +++ b/devices.nix @@ -0,0 +1,63 @@ +{ self }: +let + nixos-raspberrypi = self.inputs.nixos-raspberrypi; +in +{ + # keep-sorted start block=yes + aur0ra = { + system = "aarch64-linux"; + nixosSystem = nixos-raspberrypi.lib.nixosSystem; + }; + aur0ra-installer = { + # build with nix build .\#nixosConfigurations.aur0ra-installer.config.system.build.sdImage + system = "aarch64-linux"; + nixosSystem = nixos-raspberrypi.lib.nixosInstaller; + }; + damocles = { + system = "x86_64-linux"; + distributedBuilds.maxJobs = 0; + }; + damocles-lab = { + system = "x86_64-linux"; + distributedBuilds.maxJobs = 0; + }; + epimetheus = { + system = "aarch64-linux"; + }; + forgejo-runner-1 = { + system = "aarch64-linux"; + }; + hetzner-vpn2 = { + system = "aarch64-linux"; + }; + muede-lpt2 = { + system = "x86_64-linux"; + home-manager-users = { + inherit (self.homeConfigurations) muede; + }; + distributedBuilds = { + isBuilder = true; + hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHGKoZ68wwyVRmPB0SkvpJUyUMDWeFbC5Je9zukyEOh7"; + clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAbojdhb3PfazSRmudvo381Y+zUFVLMa7AbWbfK/Zp2 muede-lpt2-nix-builds"; + }; + }; + muede-pc2 = { + system = "x86_64-linux"; + home-manager-users = { + inherit (self.homeConfigurations) muede; + }; + distributedBuilds = { + isBuilder = true; + speedFactor = 2; + hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKEQQS5XNoj62Oj85xQfIuLORwoBRwfqjvfBHHsiI+RH"; + clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHmnyhP6L+kGHV15cb/d31AQr50wSEaQhkUBwy2+OEKk muede-pc2-nix-builds"; + }; + }; + ronja-pc = { + system = "x86_64-linux"; + home-manager-users = { + inherit (self.homeConfigurations) ronja; + }; + }; + # keep-sorted end +} diff --git a/flake.nix b/flake.nix index 35739dcb..805c81ff 100644 --- a/flake.nix +++ b/flake.nix @@ -115,65 +115,7 @@ ... }: let - devices = { - # keep-sorted start block=yes - aur0ra = { - system = "aarch64-linux"; - nixosSystem = nixos-raspberrypi.lib.nixosSystem; - }; - aur0ra-installer = { - # build with nix build .\#nixosConfigurations.aur0ra-installer.config.system.build.sdImage - system = "aarch64-linux"; - nixosSystem = nixos-raspberrypi.lib.nixosInstaller; - }; - damocles = { - system = "x86_64-linux"; - distributedBuilds.maxJobs = 0; - }; - damocles-lab = { - system = "x86_64-linux"; - distributedBuilds.maxJobs = 0; - }; - epimetheus = { - system = "aarch64-linux"; - }; - forgejo-runner-1 = { - system = "aarch64-linux"; - }; - hetzner-vpn2 = { - system = "aarch64-linux"; - }; - muede-lpt2 = { - system = "x86_64-linux"; - home-manager-users = { - inherit (self.homeConfigurations) muede; - }; - distributedBuilds = { - isBuilder = true; - hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHGKoZ68wwyVRmPB0SkvpJUyUMDWeFbC5Je9zukyEOh7"; - clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAbojdhb3PfazSRmudvo381Y+zUFVLMa7AbWbfK/Zp2 muede-lpt2-nix-builds"; - }; - }; - muede-pc2 = { - system = "x86_64-linux"; - home-manager-users = { - inherit (self.homeConfigurations) muede; - }; - distributedBuilds = { - isBuilder = true; - speedFactor = 2; - hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKEQQS5XNoj62Oj85xQfIuLORwoBRwfqjvfBHHsiI+RH"; - clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHmnyhP6L+kGHV15cb/d31AQr50wSEaQhkUBwy2+OEKk muede-pc2-nix-builds"; - }; - }; - ronja-pc = { - system = "x86_64-linux"; - home-manager-users = { - inherit (self.homeConfigurations) ronja; - }; - }; - # keep-sorted end - }; + devices = import ./devices.nix { inherit self; }; inherit (nixpkgs) lib; forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) devices; supported-systems = lib.attrsets.mapAttrsToList (k: v: v.system) devices; From 850d67303528e64fb4aab6634bc0a4f7650c593e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 22:39:21 +0200 Subject: [PATCH 0474/1295] refactor: import nixosModules unconditionally, add enable options --- flake.nix | 110 +++++++++--- nixosConfigurations/epimetheus/default.nix | 6 +- .../forgejo-runner-1/default.nix | 5 +- nixosConfigurations/muede-lpt2/default.nix | 16 +- nixosConfigurations/muede-pc2/default.nix | 19 +- nixosConfigurations/ronja-pc/default.nix | 19 +- nixosModules/amd-graphics.nix | 29 +-- nixosModules/autoupdate.nix | 27 +-- nixosModules/default.nix | 37 ++++ nixosModules/distributed-builds.nix | 105 ++++++----- nixosModules/en-de.nix | 63 ++++--- nixosModules/extra-caches.nix | 43 +++-- nixosModules/firmware-updates.nix | 21 ++- nixosModules/global-settings-desktop.nix | 61 ------- nixosModules/global-settings.nix | 44 ----- nixosModules/globalinstalls.nix | 59 +++--- nixosModules/gnome.nix | 101 ++++++----- nixosModules/intel-graphics.nix | 11 +- nixosModules/kdeconnect.nix | 86 ++++----- nixosModules/latex.nix | 11 +- nixosModules/lix-is-nix.nix | 33 ++-- nixosModules/modern-desktop.nix | 79 ++++---- nixosModules/muede-desktop-settings.nix | 39 ++-- nixosModules/nix-ld.nix | 49 ++--- nixosModules/openssh.nix | 19 +- nixosModules/podman.nix | 19 +- nixosModules/printing.nix | 19 +- nixosModules/prometheus-node.nix | 37 ++-- nixosModules/pxvirt-guest.nix | 12 +- nixosModules/quiet-boot.nix | 49 ++--- nixosModules/secure-boot.nix | 53 +++--- nixosModules/steam.nix | 77 ++++---- nixosModules/stylix.nix | 169 +++++++++--------- nixosModules/systemd-boot.nix | 19 +- nixosModules/tailscale.nix | 15 +- nixosModules/user-muede.nix | 75 ++++---- nixosModules/user-ronja.nix | 41 +++-- nixosModules/wine-gaming.nix | 43 +++-- 38 files changed, 959 insertions(+), 761 deletions(-) create mode 100644 nixosModules/default.nix delete mode 100644 nixosModules/global-settings-desktop.nix delete mode 100644 nixosModules/global-settings.nix diff --git a/flake.nix b/flake.nix index 805c81ff..8cacd378 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,6 @@ }; #keep-sorted start block=yes - flake-parts = { url = "github:hercules-ci/flake-parts"; #inputs.nixpkgs.follows = "nixpkgs"; @@ -103,8 +102,8 @@ niri, nix-vscode-extensions, nixos-generators, - nixos-raspberrypi, nixpkgs-unstable, + nova-shell, servicepoint-cli, servicepoint-simulator, servicepoint-tanks, @@ -157,14 +156,18 @@ nixosModules = (importModuleDir ./nixosModules) // { niri = - { pkgs, ... }: + { lib, config, ... }: { imports = [ niri.nixosModules.niri ]; - nixpkgs.overlays = [ niri.overlays.niri ]; - programs.niri = { - enable = true; - #package = pkgs.niri-stable; + options.my.niri.enable = lib.mkEnableOption "niri wayland compositor"; + + config = lib.mkIf config.my.niri.enable { + nixpkgs.overlays = [ niri.overlays.niri ]; + programs.niri = { + enable = true; + #package = pkgs.niri-stable; + }; }; }; pkgs-unstable = { @@ -173,10 +176,6 @@ pkgs-vscode-extensions = { nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; }; - # required modules to use other modules, should not do anything on their own - default = { - imports = [ self.nixosModules.allowed-unfree-list ]; - }; }; homeModules = importModuleDir ./homeModules; @@ -201,18 +200,87 @@ nixosSystem { inherit specialArgs; modules = [ - { - imports = [ - ./nixosConfigurations/${device} - self.nixosModules.global-settings - ] - ++ (lib.optionals (home-manager-users != { }) [ - self.nixosModules.global-settings-desktop - ]); + ./nixosConfigurations/${device} + self.nixosModules.default - nixpkgs = { - hostPlatform = lib.mkDefault system; + # keep-sorted start + home-manager.nixosModules.home-manager + lanzaboote.nixosModules.lanzaboote + nova-shell.nixosModules.default + self.nixosModules.niri + self.nixosModules.pkgs-vscode-extensions + servicepoint-cli.nixosModules.default + servicepoint-simulator.nixosModules.default + servicepoint-tanks.nixosModules.default + stylix.nixosModules.stylix + zerforschen-plus.nixosModules.default + # keep-sorted end + + # Base config (replaces global-settings.nix) + { + nixpkgs.hostPlatform = lib.mkDefault system; + networking.hostName = device; + system = { + stateVersion = "22.11"; + autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; }; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + documentation = { + info.enable = false; + doc.enable = false; + }; + + my.autoupdate.enable = true; + my.distributedBuilds.enable = true; + my.extraCaches.enable = true; + my.globalinstalls.enable = true; + my.lixIsNix.enable = true; + my.openssh.enable = true; + my.prometheusNode.enable = true; + my.systemdBoot.enable = true; + my.tailscale.enable = true; + } + ] + ++ lib.optionals (home-manager-users != { }) [ + # Desktop config (replaces global-settings-desktop.nix) + { + home-manager = { + extraSpecialArgs = specialArgs; + useGlobalPkgs = true; + useUserPackages = true; + users = home-manager-users; + sharedModules = [ + { home.stateVersion = "22.11"; } + # keep-sorted start + self.homeModules.git + self.homeModules.gnome-extensions + self.homeModules.nano + self.homeModules.templates + self.homeModules.zsh-basics + # keep-sorted end + ]; + }; + + time.timeZone = "Europe/Berlin"; + + # on desktops, keep the device useable interactively during expensive builds + nix = { + daemonCPUSchedPolicy = "idle"; + daemonIOSchedClass = "idle"; + }; + + my.enDe.enable = true; + my.firmwareUpdates.enable = true; + my.gnome.enable = true; + my.kdeconnect.enable = true; + my.modernDesktop.enable = true; + my.niri.enable = true; + my.nixLd.enable = true; + my.quietBoot.enable = true; + my.stylix.enable = true; } ]; } diff --git a/nixosConfigurations/epimetheus/default.nix b/nixosConfigurations/epimetheus/default.nix index 02c6ae8b..bff9b144 100644 --- a/nixosConfigurations/epimetheus/default.nix +++ b/nixosConfigurations/epimetheus/default.nix @@ -1,8 +1,6 @@ -{ self, ... }: +{ ... }: { - imports = [ self.nixosModules.pxvirt-guest ]; - config = { - + my.pxvirtGuest.enable = true; }; } diff --git a/nixosConfigurations/forgejo-runner-1/default.nix b/nixosConfigurations/forgejo-runner-1/default.nix index 41964305..41c7717b 100644 --- a/nixosConfigurations/forgejo-runner-1/default.nix +++ b/nixosConfigurations/forgejo-runner-1/default.nix @@ -1,12 +1,13 @@ -{ self, ... }: +{ ... }: { imports = [ ./hardware.nix ./forgejo-runner.nix - self.nixosModules.podman ]; config = { + my.podman.enable = true; + # uncomment for build check on non arm system (requires --impure) # nixpkgs.buildPlatform = builtins.currentSystem; services.tailscale.useRoutingFeatures = "both"; diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index 434b0464..78c9d553 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -2,17 +2,17 @@ { imports = [ ./hardware.nix - self.nixosModules.user-muede - self.nixosModules.gnome - self.nixosModules.wine-gaming - self.nixosModules.steam - self.nixosModules.podman - self.nixosModules.muede-desktop-settings - self.nixosModules.intel-graphics - self.nixosModules.secure-boot ]; config = { + my.users.muede.enable = true; + my.wineGaming.enable = true; + my.steam.enable = true; + my.podman.enable = true; + my.muedeDesktopSettings.enable = true; + my.intelGraphics.enable = true; + my.secureBoot.enable = true; + nix.settings.extra-platforms = [ "aarch64-linux" "i686-linux" diff --git a/nixosConfigurations/muede-pc2/default.nix b/nixosConfigurations/muede-pc2/default.nix index dd97b004..5a90eeaa 100644 --- a/nixosConfigurations/muede-pc2/default.nix +++ b/nixosConfigurations/muede-pc2/default.nix @@ -1,21 +1,20 @@ -{ pkgs, self, ... }: +{ pkgs, ... }: { imports = [ ./hardware.nix # ./vscode-server.nix # ./hass.nix - - self.nixosModules.user-muede - self.nixosModules.gnome - self.nixosModules.wine-gaming - self.nixosModules.steam - self.nixosModules.podman - self.nixosModules.muede-desktop-settings - self.nixosModules.amd-graphics - self.nixosModules.secure-boot ]; config = { + my.users.muede.enable = true; + my.wineGaming.enable = true; + my.steam.enable = true; + my.podman.enable = true; + my.muedeDesktopSettings.enable = true; + my.amdGraphics.enable = true; + my.secureBoot.enable = true; + nix.settings.extra-platforms = [ "aarch64-linux" "i686-linux" diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index 8e1eb52d..85227ff5 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -1,20 +1,15 @@ -{ - config, - pkgs, - self, - ... -}: +{ pkgs, ... }: { imports = [ ./hardware.nix - self.nixosModules.user-ronja - self.nixosModules.gnome - self.nixosModules.steam - self.nixosModules.wine-gaming - self.nixosModules.muede-desktop-settings ]; config = { + my.users.ronja.enable = true; + my.steam.enable = true; + my.wineGaming.enable = true; + my.muedeDesktopSettings.enable = true; + # Configure keymap in X11 services.xserver.xkb = { layout = "de"; @@ -24,8 +19,6 @@ # Configure console keymap console.keyMap = "de"; - # List packages installed in system profile. To search, run: - # $ nix search wget environment.systemPackages = with pkgs; [ # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # wget diff --git a/nixosModules/amd-graphics.nix b/nixosModules/amd-graphics.nix index 9bc386c4..1baeb24f 100644 --- a/nixosModules/amd-graphics.nix +++ b/nixosModules/amd-graphics.nix @@ -1,15 +1,24 @@ -{ pkgs, ... }: { - boot.kernelModules = [ "amdgpu" ]; - services.xserver.videoDrivers = [ "amdgpu" ]; + lib, + config, + pkgs, + ... +}: +{ + options.my.amdGraphics.enable = lib.mkEnableOption "AMD graphics drivers"; - hardware = { - graphics.enable = true; - amdgpu = { - opencl.enable = true; - overdrive.enable = true; + config = lib.mkIf config.my.amdGraphics.enable { + boot.kernelModules = [ "amdgpu" ]; + services.xserver.videoDrivers = [ "amdgpu" ]; + + hardware = { + graphics.enable = true; + amdgpu = { + opencl.enable = true; + overdrive.enable = true; + }; }; - }; - environment.systemPackages = with pkgs; [ nvtopPackages.amd ]; + environment.systemPackages = with pkgs; [ nvtopPackages.amd ]; + }; } diff --git a/nixosModules/autoupdate.nix b/nixosModules/autoupdate.nix index 0f26b7ee..028cfd7d 100644 --- a/nixosModules/autoupdate.nix +++ b/nixosModules/autoupdate.nix @@ -1,16 +1,21 @@ +{ lib, config, ... }: { - nix = { - optimise.automatic = true; - gc = { - automatic = true; + options.my.autoupdate.enable = lib.mkEnableOption "automatic Nix GC and system upgrades"; + + config = lib.mkIf config.my.autoupdate.enable { + nix = { + optimise.automatic = true; + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + }; + }; + + system.autoUpgrade = { + enable = true; dates = "daily"; - options = "--delete-older-than 7d"; + # do not forget to set `flake` when using this module! }; }; - - system.autoUpgrade = { - enable = true; - dates = "daily"; - # do not forget to set `flake` when using this module! - }; } diff --git a/nixosModules/default.nix b/nixosModules/default.nix new file mode 100644 index 00000000..621cca7f --- /dev/null +++ b/nixosModules/default.nix @@ -0,0 +1,37 @@ +{ ... }: +{ + imports = [ + # keep-sorted start + ./allowed-unfree-list.nix + ./amd-graphics.nix + ./autoupdate.nix + ./distributed-builds.nix + ./en-de.nix + ./extra-caches.nix + ./firmware-updates.nix + ./globalinstalls.nix + ./gnome.nix + ./intel-graphics.nix + ./kdeconnect.nix + ./latex.nix + ./lix-is-nix.nix + ./modern-desktop.nix + ./muede-desktop-settings.nix + ./nix-ld.nix + ./openssh.nix + ./podman.nix + ./printing.nix + ./prometheus-node.nix + ./pxvirt-guest.nix + ./quiet-boot.nix + ./secure-boot.nix + ./steam.nix + ./stylix.nix + ./systemd-boot.nix + ./tailscale.nix + ./user-muede.nix + ./user-ronja.nix + ./wine-gaming.nix + # keep-sorted end + ]; +} diff --git a/nixosModules/distributed-builds.nix b/nixosModules/distributed-builds.nix index f0c45da6..94ec25c3 100644 --- a/nixosModules/distributed-builds.nix +++ b/nixosModules/distributed-builds.nix @@ -32,62 +32,77 @@ let # distributedBuilds.hostPublicKey = "ssh-ed25519 AAAA..."; # from: ssh-keyscan -t ed25519 # All machines automatically discover and use it after the next rebuild. - buildServerDevices = lib.filterAttrs (_: v: (v.distributedBuilds or { }).isBuilder or false) devices; + buildServerDevices = lib.filterAttrs ( + _: v: (v.distributedBuilds or { }).isBuilder or false + ) devices; knownHosts = lib.pipe buildServerDevices [ (lib.filterAttrs (_: v: v.distributedBuilds ? hostPublicKey)) - (lib.mapAttrs (hostName: v: { - publicKey = v.distributedBuilds.hostPublicKey; - })) + (lib.mapAttrs ( + _: v: { + publicKey = v.distributedBuilds.hostPublicKey; + } + )) ]; - buildMachineList = lib.mapAttrsToList (hostName: v: { - inherit hostName; - systems = [ v.system ]; - sshUser = buildUser; - sshKey = sshKeyPath; - protocol = "ssh-ng"; - } // lib.optionalAttrs (v.distributedBuilds ? speedFactor) { - speedFactor = v.distributedBuilds.speedFactor; - } // { - supportedFeatures = [ - "nixos-test" - "big-parallel" - "kvm" - "benchmark" - ]; - }) buildServerDevices; + buildMachineList = lib.mapAttrsToList ( + hostName: v: + { + inherit hostName; + systems = [ v.system ]; + sshUser = buildUser; + sshKey = sshKeyPath; + protocol = "ssh-ng"; + } + // lib.optionalAttrs (v.distributedBuilds ? speedFactor) { + speedFactor = v.distributedBuilds.speedFactor; + } + // { + supportedFeatures = [ + "nixos-test" + "big-parallel" + "kvm" + "benchmark" + ]; + } + ) buildServerDevices; remoteMachines = builtins.filter (m: m.hostName != config.networking.hostName) buildMachineList; in { - # Dedicated user for receiving distributed build connections - programs.ssh.knownHosts = knownHosts; + options.my.distributedBuilds.enable = lib.mkEnableOption "distributed Nix builds"; - users.users.${buildUser} = { - isSystemUser = true; - group = buildUser; - useDefaultShell = true; - openssh.authorizedKeys.keys = map (k: ''command="nix daemon --stdio",restrict ${k}'') authorizedPublicKeys; - }; - users.groups.${buildUser} = { }; + config = lib.mkIf config.my.distributedBuilds.enable { + programs.ssh.knownHosts = knownHosts; - nix = { - distributedBuilds = remoteMachines != [ ]; - buildMachines = remoteMachines; - settings = { - trusted-users = [ buildUser ]; - builders-use-substitutes = true; - max-jobs = (devices.${config.networking.hostName}.distributedBuilds or { }).maxJobs or "auto"; - cores = 0; - min-free = 10 * 1024 * 1024; - max-free = 200 * 1024 * 1024; + # Dedicated user for receiving distributed build connections + users.users.${buildUser} = { + isSystemUser = true; + group = buildUser; + useDefaultShell = true; + openssh.authorizedKeys.keys = map ( + k: ''command="nix daemon --stdio",restrict ${k}'' + ) authorizedPublicKeys; + }; + users.groups.${buildUser} = { }; + + nix = { + distributedBuilds = remoteMachines != [ ]; + buildMachines = remoteMachines; + settings = { + trusted-users = [ buildUser ]; + builders-use-substitutes = true; + max-jobs = (devices.${config.networking.hostName}.distributedBuilds or { }).maxJobs or "auto"; + cores = 0; + min-free = 10 * 1024 * 1024; + max-free = 200 * 1024 * 1024; + }; + }; + + systemd.services.nix-daemon.serviceConfig = { + MemoryAccounting = true; + MemoryMax = "90%"; + OOMScoreAdjust = 500; }; }; - - systemd.services.nix-daemon.serviceConfig = { - MemoryAccounting = true; - MemoryMax = "90%"; - OOMScoreAdjust = 500; - }; } diff --git a/nixosModules/en-de.nix b/nixosModules/en-de.nix index a91780e5..4a35b28f 100644 --- a/nixosModules/en-de.nix +++ b/nixosModules/en-de.nix @@ -1,31 +1,40 @@ -{ pkgs, ... }: { - i18n = { - defaultLocale = "en_US.UTF-8"; - extraLocales = [ - "de_DE.UTF-8/UTF-8" - ]; - extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; + lib, + config, + pkgs, + ... +}: +{ + options.my.enDe.enable = lib.mkEnableOption "English/German locale and language packs"; + + config = lib.mkIf config.my.enDe.enable { + i18n = { + defaultLocale = "en_US.UTF-8"; + extraLocales = [ + "de_DE.UTF-8/UTF-8" + ]; + extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; }; + + programs.firefox.languagePacks = [ + "en-US" + "de" + ]; + + environment.systemPackages = [ + pkgs.hunspell + pkgs.hunspellDicts.de-de + pkgs.hunspellDicts.en-us + ]; }; - - programs.firefox.languagePacks = [ - "en-US" - "de" - ]; - - environment.systemPackages = [ - pkgs.hunspell - pkgs.hunspellDicts.de-de - pkgs.hunspellDicts.en-us - ]; } diff --git a/nixosModules/extra-caches.nix b/nixosModules/extra-caches.nix index 8b5431cb..6a727551 100644 --- a/nixosModules/extra-caches.nix +++ b/nixosModules/extra-caches.nix @@ -1,22 +1,27 @@ +{ lib, config, ... }: { - nix.settings = { - substituters = [ - # keep-sorted start - "https://cache.lix.systems" - "https://cache.nixos.org/" - "https://niri.cachix.org" - "https://nix-community.cachix.org" - "https://nixos-raspberrypi.cachix.org" - # keep-sorted end - ]; - trusted-public-keys = [ - # keep-sorted start - "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI=" - # keep-sorted end - ]; + options.my.extraCaches.enable = lib.mkEnableOption "extra Nix binary caches"; + + config = lib.mkIf config.my.extraCaches.enable { + nix.settings = { + substituters = [ + # keep-sorted start + "https://cache.lix.systems" + "https://cache.nixos.org/" + "https://niri.cachix.org" + "https://nix-community.cachix.org" + "https://nixos-raspberrypi.cachix.org" + # keep-sorted end + ]; + trusted-public-keys = [ + # keep-sorted start + "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI=" + # keep-sorted end + ]; + }; }; } diff --git a/nixosModules/firmware-updates.nix b/nixosModules/firmware-updates.nix index 8e81b725..61b2ff83 100644 --- a/nixosModules/firmware-updates.nix +++ b/nixosModules/firmware-updates.nix @@ -1,11 +1,16 @@ +{ lib, config, ... }: { - hardware = { - enableRedistributableFirmware = true; - cpu = { - amd.updateMicrocode = true; - intel.updateMicrocode = true; - }; - }; + options.my.firmwareUpdates.enable = lib.mkEnableOption "firmware updates and microcode"; - services.fwupd.enable = true; + config = lib.mkIf config.my.firmwareUpdates.enable { + hardware = { + enableRedistributableFirmware = true; + cpu = { + amd.updateMicrocode = true; + intel.updateMicrocode = true; + }; + }; + + services.fwupd.enable = true; + }; } diff --git a/nixosModules/global-settings-desktop.nix b/nixosModules/global-settings-desktop.nix deleted file mode 100644 index a94ab808..00000000 --- a/nixosModules/global-settings-desktop.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - home-manager-users, - self, - home-manager, - servicepoint-cli, - servicepoint-simulator, - servicepoint-tanks, - stylix, - specialArgs, - nova-shell, - ... -}: -{ - imports = [ - # keep-sorted start - home-manager.nixosModules.home-manager - nova-shell.nixosModules.default - self.nixosModules.en-de - self.nixosModules.firmware-updates - self.nixosModules.gnome - self.nixosModules.kdeconnect - self.nixosModules.modern-desktop - self.nixosModules.niri - self.nixosModules.nix-ld - self.nixosModules.pkgs-vscode-extensions - self.nixosModules.quiet-boot - self.nixosModules.stylix - servicepoint-cli.nixosModules.default - servicepoint-simulator.nixosModules.default - servicepoint-tanks.nixosModules.default - stylix.nixosModules.stylix - # keep-sorted end - ]; - - config = { - home-manager = { - extraSpecialArgs = specialArgs; - useGlobalPkgs = true; - useUserPackages = true; - users = home-manager-users; - sharedModules = [ - { home.stateVersion = "22.11"; } - # keep-sorted start - self.homeModules.git - self.homeModules.gnome-extensions - self.homeModules.nano - self.homeModules.templates - self.homeModules.zsh-basics - # keep-sorted end - ]; - }; - - time.timeZone = "Europe/Berlin"; - - # on desktops, keep the device useable interactively during expensive builds - nix = { - daemonCPUSchedPolicy = "idle"; - daemonIOSchedClass = "idle"; - }; - }; -} diff --git a/nixosModules/global-settings.nix b/nixosModules/global-settings.nix deleted file mode 100644 index 2d1c5b3d..00000000 --- a/nixosModules/global-settings.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - device, - self, - lanzaboote, - zerforschen-plus, - ... -}: -{ - imports = [ - # keep-sorted start - lanzaboote.nixosModules.lanzaboote - self.nixosModules.allowed-unfree-list - self.nixosModules.autoupdate - self.nixosModules.default - self.nixosModules.distributed-builds - self.nixosModules.extra-caches - self.nixosModules.globalinstalls - self.nixosModules.lix-is-nix - self.nixosModules.openssh - self.nixosModules.prometheus-node - self.nixosModules.systemd-boot - self.nixosModules.tailscale - zerforschen-plus.nixosModules.default - # keep-sorted end - ]; - - config = { - networking.hostName = device; - system = { - stateVersion = "22.11"; - autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; - }; - - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - documentation = { - info.enable = false; # info pages and the info command - doc.enable = false; # documentation distributed in packages' /share/doc - }; - }; -} diff --git a/nixosModules/globalinstalls.nix b/nixosModules/globalinstalls.nix index 146d4013..56061ee0 100644 --- a/nixosModules/globalinstalls.nix +++ b/nixosModules/globalinstalls.nix @@ -1,30 +1,39 @@ -{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ - ncdu - glances - lsof - dig - screen - tldr - nix-output-monitor - git-credential-oauth - ]; + lib, + config, + pkgs, + ... +}: +{ + options.my.globalinstalls.enable = lib.mkEnableOption "global system packages and tools"; - programs = { - zsh.enable = true; - htop.enable = true; - iotop.enable = true; - git.enable = true; - nano = { - enable = true; - syntaxHighlight = true; + config = lib.mkIf config.my.globalinstalls.enable { + environment.systemPackages = with pkgs; [ + ncdu + glances + lsof + dig + screen + tldr + nix-output-monitor + git-credential-oauth + ]; + + programs = { + zsh.enable = true; + htop.enable = true; + iotop.enable = true; + git.enable = true; + nano = { + enable = true; + syntaxHighlight = true; + }; }; - }; - environment.etc."gitconfig".text = '' - [credential] - helper = oauth - credentialStore = cache - ''; + environment.etc."gitconfig".text = '' + [credential] + helper = oauth + credentialStore = cache + ''; + }; } diff --git a/nixosModules/gnome.nix b/nixosModules/gnome.nix index 260fbbd9..b0bf4068 100644 --- a/nixosModules/gnome.nix +++ b/nixosModules/gnome.nix @@ -1,62 +1,65 @@ { - pkgs, lib, config, + pkgs, ... }: { - options.muede = { - keep-gnome-default-apps = lib.mkEnableOption "keep gnome default apps"; + options = { + my.gnome.enable = lib.mkEnableOption "GNOME desktop environment"; + muede.keep-gnome-default-apps = lib.mkEnableOption "keep gnome default apps"; }; - config = lib.mkMerge [ - { - services = { - xserver.excludePackages = [ pkgs.xterm ]; + config = lib.mkIf config.my.gnome.enable ( + lib.mkMerge [ + { + services = { + xserver.excludePackages = [ pkgs.xterm ]; - # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; - desktopManager.gnome = { - enable = true; - extraGSettingsOverridePackages = [ pkgs.mutter ]; - extraGSettingsOverrides = '' - [org.gnome.mutter] - experimental-features=['scale-monitor-framebuffer'] - ''; + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome = { + enable = true; + extraGSettingsOverridePackages = [ pkgs.mutter ]; + extraGSettingsOverrides = '' + [org.gnome.mutter] + experimental-features=['scale-monitor-framebuffer'] + ''; + }; + + gnome = { + tinysparql.enable = false; + localsearch.enable = false; + sushi.enable = true; + }; }; - gnome = { - tinysparql.enable = false; - localsearch.enable = false; - sushi.enable = true; + programs = { + dconf.enable = true; + gpaste.enable = true; }; - }; - - programs = { - dconf.enable = true; - gpaste.enable = true; - }; - } - (lib.mkIf (!config.muede.keep-gnome-default-apps) { - environment.gnome.excludePackages = with pkgs; [ - cheese # photo booth - epiphany # web browser - evince # document viewer - geary # email client - gnome-maps - gnome-weather - gnome-tour - sysprof - orca # screen reader - gnome-weather - gnome-backgrounds - gnome-user-docs - yelp # help app - gnome-music - totem # video player - snapshot # camera - baobab # disk usage - ]; - }) - ]; + } + (lib.mkIf (!config.muede.keep-gnome-default-apps) { + environment.gnome.excludePackages = with pkgs; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + gnome-maps + gnome-weather + gnome-tour + sysprof + orca # screen reader + gnome-weather + gnome-backgrounds + gnome-user-docs + yelp # help app + gnome-music + totem # video player + snapshot # camera + baobab # disk usage + ]; + }) + ] + ); } diff --git a/nixosModules/intel-graphics.nix b/nixosModules/intel-graphics.nix index 74c6e670..b3674891 100644 --- a/nixosModules/intel-graphics.nix +++ b/nixosModules/intel-graphics.nix @@ -1,6 +1,13 @@ -{ pkgs, ... }: { - config = { + lib, + config, + pkgs, + ... +}: +{ + options.my.intelGraphics.enable = lib.mkEnableOption "Intel graphics drivers"; + + config = lib.mkIf config.my.intelGraphics.enable { hardware.graphics = { extraPackages = with pkgs; [ intel-media-driver diff --git a/nixosModules/kdeconnect.nix b/nixosModules/kdeconnect.nix index 1a3c2f11..bc809c95 100644 --- a/nixosModules/kdeconnect.nix +++ b/nixosModules/kdeconnect.nix @@ -5,49 +5,53 @@ ... }: { - config = lib.mkMerge [ - { - networking.firewall = - let - kdeconnect-range = { - from = 1714; - to = 1764; - }; - in - { - allowedTCPPortRanges = [ kdeconnect-range ]; - allowedUDPPortRanges = [ kdeconnect-range ]; - }; + options.my.kdeconnect.enable = lib.mkEnableOption "KDE Connect / GSConnect"; - programs.kdeconnect.enable = true; - home-manager.sharedModules = [ - { - services.kdeconnect = { - enable = true; - # this still shows up in gnome session starting with 25.05 - # indicator = true; - }; - } - ]; - } - - (lib.mkIf config.services.desktopManager.gnome.enable { - # replace kdeconnect with gsconnect - programs.kdeconnect.package = pkgs.gnomeExtensions.gsconnect; - - home-manager.sharedModules = [ - ( - { pkgs, ... }: + config = lib.mkIf config.my.kdeconnect.enable ( + lib.mkMerge [ + { + networking.firewall = + let + kdeconnect-range = { + from = 1714; + to = 1764; + }; + in { - home.packages = [ pkgs.gnomeExtensions.gsconnect ]; - # enable gsconnect extension - dconf.settings = { - "org/gnome/shell".enabled-extensions = [ "gsconnect@andyholmes.github.io" ]; - "org/gnome/shell/extensions/gsconnect".enabled = true; + allowedTCPPortRanges = [ kdeconnect-range ]; + allowedUDPPortRanges = [ kdeconnect-range ]; + }; + + programs.kdeconnect.enable = true; + home-manager.sharedModules = [ + { + services.kdeconnect = { + enable = true; + # this still shows up in gnome session starting with 25.05 + # indicator = true; }; } - ) - ]; - }) - ]; + ]; + } + + (lib.mkIf config.services.desktopManager.gnome.enable { + # replace kdeconnect with gsconnect + programs.kdeconnect.package = pkgs.gnomeExtensions.gsconnect; + + home-manager.sharedModules = [ + ( + { pkgs, ... }: + { + home.packages = [ pkgs.gnomeExtensions.gsconnect ]; + # enable gsconnect extension + dconf.settings = { + "org/gnome/shell".enabled-extensions = [ "gsconnect@andyholmes.github.io" ]; + "org/gnome/shell/extensions/gsconnect".enabled = true; + }; + } + ) + ]; + }) + ] + ); } diff --git a/nixosModules/latex.nix b/nixosModules/latex.nix index 3d097f8a..ce5483d8 100644 --- a/nixosModules/latex.nix +++ b/nixosModules/latex.nix @@ -1,6 +1,13 @@ -{ pkgs, ... }: { - config = { + lib, + config, + pkgs, + ... +}: +{ + options.my.latex.enable = lib.mkEnableOption "LaTeX (texliveFull + TeXstudio)"; + + config = lib.mkIf config.my.latex.enable { environment.systemPackages = with pkgs; [ fontconfig texliveFull diff --git a/nixosModules/lix-is-nix.nix b/nixosModules/lix-is-nix.nix index 3480d06a..04eaf421 100644 --- a/nixosModules/lix-is-nix.nix +++ b/nixosModules/lix-is-nix.nix @@ -1,15 +1,24 @@ -{ pkgs, ... }: { - nixpkgs.overlays = [ - (final: prev: { - inherit (prev.lixPackageSets.stable) - nixpkgs-review - nix-eval-jobs - nix-fast-build - colmena - ; - }) - ]; + lib, + config, + pkgs, + ... +}: +{ + options.my.lixIsNix.enable = lib.mkEnableOption "Lix as the Nix implementation"; - nix.package = pkgs.lixPackageSets.latest.lix; + config = lib.mkIf config.my.lixIsNix.enable { + nixpkgs.overlays = [ + (final: prev: { + inherit (prev.lixPackageSets.stable) + nixpkgs-review + nix-eval-jobs + nix-fast-build + colmena + ; + }) + ]; + + nix.package = pkgs.lixPackageSets.latest.lix; + }; } diff --git a/nixosModules/modern-desktop.nix b/nixosModules/modern-desktop.nix index 6f3ccacd..7a10531a 100644 --- a/nixosModules/modern-desktop.nix +++ b/nixosModules/modern-desktop.nix @@ -1,47 +1,52 @@ +{ lib, config, ... }: { - services = { - xserver.enable = true; - libinput.enable = true; - flatpak.enable = true; - fstrim.enable = true; - earlyoom = { - enable = true; - freeMemThreshold = 5; + options.my.modernDesktop.enable = lib.mkEnableOption "modern desktop base (pipewire, flatpak, earlyoom)"; + + config = lib.mkIf config.my.modernDesktop.enable { + services = { + xserver.enable = true; + libinput.enable = true; + flatpak.enable = true; + fstrim.enable = true; + earlyoom = { + enable = true; + freeMemThreshold = 5; + }; }; - }; - # Enable sound with pipewire. - security.rtkit.enable = true; - services = { - pulseaudio.enable = false; - pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - #jack.enable = true; + # Enable sound with pipewire. + security.rtkit.enable = true; + services = { + pulseaudio.enable = false; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + #jack.enable = true; + }; }; - }; - systemd = { - # save some boot time because nothing actually requires network connectivity - services.NetworkManager-wait-online.enable = false; + systemd = { + # save some boot time because nothing actually requires network connectivity + services.NetworkManager-wait-online.enable = false; - # prevent stuck units from preventing shutdown (default is 120s) - settings.Manager.DefaultTimeoutStopSec = "10s"; - }; - - programs = { - xwayland.enable = true; - - appimage = { - enable = true; - binfmt = true; + # prevent stuck units from preventing shutdown (default is 120s) + settings.Manager.DefaultTimeoutStopSec = "10s"; }; - }; - system.autoUpgrade = { - allowReboot = false; - operation = "boot"; + programs = { + xwayland.enable = true; + + appimage = { + enable = true; + binfmt = true; + }; + }; + + system.autoUpgrade = { + allowReboot = false; + operation = "boot"; + }; }; } diff --git a/nixosModules/muede-desktop-settings.nix b/nixosModules/muede-desktop-settings.nix index 27e790b0..32035248 100644 --- a/nixosModules/muede-desktop-settings.nix +++ b/nixosModules/muede-desktop-settings.nix @@ -1,21 +1,30 @@ -{ pkgs, ... }: { - programs.firefox.enable = true; + lib, + config, + pkgs, + ... +}: +{ + options.my.muedeDesktopSettings.enable = lib.mkEnableOption "muede desktop settings (Firefox, Logitech, RDP)"; - environment.systemPackages = with pkgs; [ - lm_sensors - libreoffice-qt6 - usbutils - ]; + config = lib.mkIf config.my.muedeDesktopSettings.enable { + programs.firefox.enable = true; - fonts.enableDefaultPackages = true; + environment.systemPackages = with pkgs; [ + lm_sensors + libreoffice-qt6 + usbutils + ]; - hardware.logitech.wireless = { - enable = true; - enableGraphical = true; + fonts.enableDefaultPackages = true; + + hardware.logitech.wireless = { + enable = true; + enableGraphical = true; + }; + + # RDP connections + services.gnome.gnome-remote-desktop.enable = true; + networking.firewall.allowedTCPPorts = [ 3389 ]; }; - - # RDP connections - services.gnome.gnome-remote-desktop.enable = true; - networking.firewall.allowedTCPPorts = [ 3389 ]; } diff --git a/nixosModules/nix-ld.nix b/nixosModules/nix-ld.nix index 0d09078f..ac7ae7b2 100644 --- a/nixosModules/nix-ld.nix +++ b/nixosModules/nix-ld.nix @@ -1,23 +1,32 @@ -{ pkgs, ... }: { - programs.nix-ld = { - enable = true; - libraries = with pkgs; [ - stdenv.cc.cc - zlib - zstd - curl - openssl - attr - libssh - bzip2 - libxml2 - acl - libsodium - util-linux - xz - systemd - icu - ]; + lib, + config, + pkgs, + ... +}: +{ + options.my.nixLd.enable = lib.mkEnableOption "nix-ld for running unpatched dynamic binaries"; + + config = lib.mkIf config.my.nixLd.enable { + programs.nix-ld = { + enable = true; + libraries = with pkgs; [ + stdenv.cc.cc + zlib + zstd + curl + openssl + attr + libssh + bzip2 + libxml2 + acl + libsodium + util-linux + xz + systemd + icu + ]; + }; }; } diff --git a/nixosModules/openssh.nix b/nixosModules/openssh.nix index 7ff8b18f..bed46f8b 100644 --- a/nixosModules/openssh.nix +++ b/nixosModules/openssh.nix @@ -1,11 +1,16 @@ +{ lib, config, ... }: { - services.openssh = { - enable = true; - openFirewall = true; - settings = { - PermitRootLogin = "prohibit-password"; - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; + options.my.openssh.enable = lib.mkEnableOption "OpenSSH server"; + + config = lib.mkIf config.my.openssh.enable { + services.openssh = { + enable = true; + openFirewall = true; + settings = { + PermitRootLogin = "prohibit-password"; + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; }; }; } diff --git a/nixosModules/podman.nix b/nixosModules/podman.nix index 93540f89..b9622420 100644 --- a/nixosModules/podman.nix +++ b/nixosModules/podman.nix @@ -1,11 +1,16 @@ +{ lib, config, ... }: { - virtualisation = { - containers.enable = true; - podman = { - enable = true; - dockerCompat = true; - dockerSocket.enable = true; - autoPrune.enable = true; + options.my.podman.enable = lib.mkEnableOption "Podman container runtime"; + + config = lib.mkIf config.my.podman.enable { + virtualisation = { + containers.enable = true; + podman = { + enable = true; + dockerCompat = true; + dockerSocket.enable = true; + autoPrune.enable = true; + }; }; }; } diff --git a/nixosModules/printing.nix b/nixosModules/printing.nix index c85edd74..48c41aed 100644 --- a/nixosModules/printing.nix +++ b/nixosModules/printing.nix @@ -1,12 +1,17 @@ +{ lib, config, ... }: { - services = { - # Enable CUPS to print documents. - printing.enable = true; + options.my.printing.enable = lib.mkEnableOption "printing (CUPS + Avahi)"; - avahi = { - enable = true; # runs the Avahi daemon - nssmdns4 = true; # enables the mDNS NSS plug-in - openFirewall = true; # opens the firewall for UDP port 5353 + config = lib.mkIf config.my.printing.enable { + services = { + # Enable CUPS to print documents. + printing.enable = true; + + avahi = { + enable = true; # runs the Avahi daemon + nssmdns4 = true; # enables the mDNS NSS plug-in + openFirewall = true; # opens the firewall for UDP port 5353 + }; }; }; } diff --git a/nixosModules/prometheus-node.nix b/nixosModules/prometheus-node.nix index 576db81e..f5e02fcd 100644 --- a/nixosModules/prometheus-node.nix +++ b/nixosModules/prometheus-node.nix @@ -1,20 +1,25 @@ +{ lib, config, ... }: { - services.prometheus.exporters = { - node = { - enable = true; - openFirewall = true; - port = 9190; - enabledCollectors = [ - # keep-sorted start - "cgroups" - "interrupts" - "softirqs" - "swap" - "systemd" - "tcpstat" - "wifi" - # keep-sorted end - ]; + options.my.prometheusNode.enable = lib.mkEnableOption "Prometheus node exporter"; + + config = lib.mkIf config.my.prometheusNode.enable { + services.prometheus.exporters = { + node = { + enable = true; + openFirewall = true; + port = 9190; + enabledCollectors = [ + # keep-sorted start + "cgroups" + "interrupts" + "softirqs" + "swap" + "systemd" + "tcpstat" + "wifi" + # keep-sorted end + ]; + }; }; }; } diff --git a/nixosModules/pxvirt-guest.nix b/nixosModules/pxvirt-guest.nix index 067a0ece..4a66ff25 100644 --- a/nixosModules/pxvirt-guest.nix +++ b/nixosModules/pxvirt-guest.nix @@ -1,8 +1,16 @@ -{ modulesPath, lib, ... }: { + modulesPath, + lib, + config, + ... +}: +{ + # Import unconditionally — the module only defines options, activating nothing by default. imports = [ (modulesPath + "/virtualisation/proxmox-lxc.nix") ]; - config = { + options.my.pxvirtGuest.enable = lib.mkEnableOption "Proxmox LXC guest configuration"; + + config = lib.mkIf config.my.pxvirtGuest.enable { # TODO is this needed? # nix.settings.sandbox = false; diff --git a/nixosModules/quiet-boot.nix b/nixosModules/quiet-boot.nix index d9b59c83..84bae5fe 100644 --- a/nixosModules/quiet-boot.nix +++ b/nixosModules/quiet-boot.nix @@ -1,25 +1,34 @@ -{ pkgs, ... }: { - boot = { - kernelParams = [ - "quiet" - "udev.log_level=3" - "udev.log_priority=3" - "rd.systemd.show_status=auto" - ]; - consoleLogLevel = 0; - initrd = { - verbose = false; - systemd.enable = true; # required fpr graphical LUKS prompt - }; - plymouth = { - enable = true; - theme = "catppuccin-mocha"; - themePackages = [ - (pkgs.catppuccin-plymouth.override { - variant = "mocha"; - }) + lib, + config, + pkgs, + ... +}: +{ + options.my.quietBoot.enable = lib.mkEnableOption "quiet boot with Plymouth splash"; + + config = lib.mkIf config.my.quietBoot.enable { + boot = { + kernelParams = [ + "quiet" + "udev.log_level=3" + "udev.log_priority=3" + "rd.systemd.show_status=auto" ]; + consoleLogLevel = 0; + initrd = { + verbose = false; + systemd.enable = true; # required fpr graphical LUKS prompt + }; + plymouth = { + enable = true; + theme = "catppuccin-mocha"; + themePackages = [ + (pkgs.catppuccin-plymouth.override { + variant = "mocha"; + }) + ]; + }; }; }; } diff --git a/nixosModules/secure-boot.nix b/nixosModules/secure-boot.nix index 9bf2c930..948d1c48 100644 --- a/nixosModules/secure-boot.nix +++ b/nixosModules/secure-boot.nix @@ -1,28 +1,37 @@ -{ pkgs, lib, ... }: { - # https://github.com/nix-community/lanzaboote/blob/70be03ab23d0988224e152f5b52e2fbf44a6d8ee/docs/QUICK_START.md - # To enroll: - # 1. sudo sbctl create-keys - # 2. import this module, rebuild - # 3. Put Secure Boot in Setup mode - # 4. sudo sbctl verify - # 5. sudo sbctl enroll-keys --microsoft - # 6, reboot - # 7. sudo sbctl status + lib, + config, + pkgs, + ... +}: +{ + options.my.secureBoot.enable = lib.mkEnableOption "Secure Boot via lanzaboote"; - environment.systemPackages = [ - # For debugging and troubleshooting Secure Boot. - pkgs.sbctl - ]; + config = lib.mkIf config.my.secureBoot.enable { + # https://github.com/nix-community/lanzaboote/blob/70be03ab23d0988224e152f5b52e2fbf44a6d8ee/docs/QUICK_START.md + # To enroll: + # 1. sudo sbctl create-keys + # 2. enable this module, rebuild + # 3. Put Secure Boot in Setup mode + # 4. sudo sbctl verify + # 5. sudo sbctl enroll-keys --microsoft + # 6, reboot + # 7. sudo sbctl status - # 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 - # for now. - boot.loader.systemd-boot.enable = lib.mkForce false; + environment.systemPackages = [ + # For debugging and troubleshooting Secure Boot. + pkgs.sbctl + ]; - boot.lanzaboote = { - enable = true; - pkiBundle = "/var/lib/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 + # for now. + boot.loader.systemd-boot.enable = lib.mkForce false; + + boot.lanzaboote = { + enable = true; + pkiBundle = "/var/lib/sbctl"; + }; }; } diff --git a/nixosModules/steam.nix b/nixosModules/steam.nix index b0991e66..78bbf714 100644 --- a/nixosModules/steam.nix +++ b/nixosModules/steam.nix @@ -1,45 +1,50 @@ +{ lib, config, ... }: { - hardware.steam-hardware.enable = true; + options.my.steam.enable = lib.mkEnableOption "Steam gaming platform"; - programs = { - steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - gamescopeSession.enable = false; + config = lib.mkIf config.my.steam.enable { + hardware.steam-hardware.enable = true; + + programs = { + steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + gamescopeSession.enable = false; + }; + gamemode.enable = true; }; - gamemode.enable = true; - }; - # steam network transfer - networking.firewall = { - allowedUDPPorts = [ 3478 ]; - allowedTCPPorts = [ 24070 ]; + # steam network transfer + networking.firewall = { + allowedUDPPorts = [ 3478 ]; + allowedTCPPorts = [ 24070 ]; - allowedTCPPortRanges = [ - { - from = 27015; - to = 27050; - } - ]; + allowedTCPPortRanges = [ + { + from = 27015; + to = 27050; + } + ]; - allowedUDPPortRanges = [ - { - from = 4379; - to = 4380; - } - { - from = 27000; - to = 27100; - } + allowedUDPPortRanges = [ + { + from = 4379; + to = 4380; + } + { + from = 27000; + to = 27100; + } + ]; + }; + + allowedUnfreePackages = [ + "steam" + "steam-original" + "steam-run" + "steam-unwrapped" ]; }; - - allowedUnfreePackages = [ - "steam" - "steam-original" - "steam-run" - "steam-unwrapped" - ]; } diff --git a/nixosModules/stylix.nix b/nixosModules/stylix.nix index 33ab6eee..4b30dc74 100644 --- a/nixosModules/stylix.nix +++ b/nixosModules/stylix.nix @@ -1,86 +1,95 @@ -{ pkgs, config, ... }: { - stylix = { - enable = true; - base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; - override = { - scheme = "Catppuccin Mocha Pride"; + lib, + config, + pkgs, + ... +}: +{ + options.my.stylix.enable = lib.mkEnableOption "Stylix theming (Catppuccin Mocha)"; - base09 = "#6f9dff"; - base0A = "#d162a4"; - base0B = "#a8c9ff"; - base0C = "#a30262"; - - # pink_light = "#d162a4"; - # pink_dark = "#a30262"; - # blue_light = "#5BCEFA"; - # blue_dark = "#4a6bb1"; - - # original values - # base00: "#1e1e2e" # base - - # base01: "#181825" # mantle - # base02: "#313244" # surface0 - # base03: "#45475a" # surface1 - # base04: "#585b70" # surface2 - # base05: "#cdd6f4" # text - # base06: "#f5e0dc" # rosewater - # base07: "#b4befe" # lavender - # base08: "#f38ba8" # red - # base09: "#fab387" # peach - # base0A: "#f9e2af" # yellow - # base0B: "#a6e3a1" # green - # base0C: "#94e2d5" # teal - # base0D: "#89b4fa" # blue - # base0E: "#cba6f7" # mauve - # base0F: "#f2cdcd" # flamingo - - # https://github.com/chriskempson/base16/blob/main/styling.md - # base00 - Default Background - # base01 - Lighter Background (Used for status bars, line number and folding marks) - # base02 - Selection Background - # base03 - Comments, Invisibles, Line Highlighting - # base04 - Dark Foreground (Used for status bars) - # base05 - Default Foreground, Caret, Delimiters, Operators - # base06 - Light Foreground (Not often used) - # base07 - Light Background (Not often used) - # base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted - # base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url - # base0A - Classes, Markup Bold, Search Text Background - # base0B - Strings, Inherited Class, Markup Code, Diff Inserted - # base0C - Support, Regular Expressions, Escape Characters, Markup Quotes - # base0D - Functions, Methods, Attribute IDs, Headings - # base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed - # base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. - }; - image = config.lib.stylix.pixel "base00"; - polarity = "dark"; - targets = { - gnome.enable = false; - gtk.enable = false; - gtksourceview.enable = false; - fontconfig.enable = true; - plymouth.enable = false; - }; - fonts = { - sansSerif = { - name = "Inter Nerd Font"; - package = pkgs.inter-nerdfont; - }; - monospace = { - name = "FiraCode Nerd Font Mono"; - package = pkgs.nerd-fonts.fira-code; - }; - }; - icons = { + config = lib.mkIf config.my.stylix.enable { + stylix = { enable = true; - dark = "Adwaita"; - light = "Adwaita"; - package = pkgs.adwaita-icon-theme; - }; - cursor = { - name = "Adwaita"; - size = 16; - package = pkgs.adwaita-icon-theme; + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + override = { + scheme = "Catppuccin Mocha Pride"; + + base09 = "#6f9dff"; + base0A = "#d162a4"; + base0B = "#a8c9ff"; + base0C = "#a30262"; + + # pink_light = "#d162a4"; + # pink_dark = "#a30262"; + # blue_light = "#5BCEFA"; + # blue_dark = "#4a6bb1"; + + # original values + # base00: "#1e1e2e" # base - + # base01: "#181825" # mantle + # base02: "#313244" # surface0 + # base03: "#45475a" # surface1 + # base04: "#585b70" # surface2 + # base05: "#cdd6f4" # text + # base06: "#f5e0dc" # rosewater + # base07: "#b4befe" # lavender + # base08: "#f38ba8" # red + # base09: "#fab387" # peach + # base0A: "#f9e2af" # yellow + # base0B: "#a6e3a1" # green + # base0C: "#94e2d5" # teal + # base0D: "#89b4fa" # blue + # base0E: "#cba6f7" # mauve + # base0F: "#f2cdcd" # flamingo + + # https://github.com/chriskempson/base16/blob/main/styling.md + # base00 - Default Background + # base01 - Lighter Background (Used for status bars, line number and folding marks) + # base02 - Selection Background + # base03 - Comments, Invisibles, Line Highlighting + # base04 - Dark Foreground (Used for status bars) + # base05 - Default Foreground, Caret, Delimiters, Operators + # base06 - Light Foreground (Not often used) + # base07 - Light Background (Not often used) + # base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted + # base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url + # base0A - Classes, Markup Bold, Search Text Background + # base0B - Strings, Inherited Class, Markup Code, Diff Inserted + # base0C - Support, Regular Expressions, Escape Characters, Markup Quotes + # base0D - Functions, Methods, Attribute IDs, Headings + # base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed + # base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. + }; + image = config.lib.stylix.pixel "base00"; + polarity = "dark"; + targets = { + gnome.enable = false; + gtk.enable = false; + gtksourceview.enable = false; + fontconfig.enable = true; + plymouth.enable = false; + }; + fonts = { + sansSerif = { + name = "Inter Nerd Font"; + package = pkgs.inter-nerdfont; + }; + monospace = { + name = "FiraCode Nerd Font Mono"; + package = pkgs.nerd-fonts.fira-code; + }; + }; + icons = { + enable = true; + dark = "Adwaita"; + light = "Adwaita"; + package = pkgs.adwaita-icon-theme; + }; + cursor = { + name = "Adwaita"; + size = 16; + package = pkgs.adwaita-icon-theme; + }; }; }; } diff --git a/nixosModules/systemd-boot.nix b/nixosModules/systemd-boot.nix index 321a26cd..e44f9dca 100644 --- a/nixosModules/systemd-boot.nix +++ b/nixosModules/systemd-boot.nix @@ -1,11 +1,16 @@ +{ lib, config, ... }: { - boot.loader = { - timeout = 3; - efi.canTouchEfiVariables = true; - systemd-boot = { - enable = true; - editor = false; # do not allow changing kernel parameters - consoleMode = "max"; + options.my.systemdBoot.enable = lib.mkEnableOption "systemd-boot bootloader"; + + config = lib.mkIf config.my.systemdBoot.enable { + boot.loader = { + timeout = 3; + efi.canTouchEfiVariables = true; + systemd-boot = { + enable = true; + editor = false; # do not allow changing kernel parameters + consoleMode = "max"; + }; }; }; } diff --git a/nixosModules/tailscale.nix b/nixosModules/tailscale.nix index e51ee7f4..55295f93 100644 --- a/nixosModules/tailscale.nix +++ b/nixosModules/tailscale.nix @@ -1,8 +1,13 @@ +{ lib, config, ... }: { - services.tailscale = { - enable = true; - openFirewall = true; - }; + options.my.tailscale.enable = lib.mkEnableOption "Tailscale VPN"; - networking.firewall.checkReversePath = "loose"; + config = lib.mkIf config.my.tailscale.enable { + services.tailscale = { + enable = true; + openFirewall = true; + }; + + networking.firewall.checkReversePath = "loose"; + }; } diff --git a/nixosModules/user-muede.nix b/nixosModules/user-muede.nix index 498c5a8f..20f9cdb4 100644 --- a/nixosModules/user-muede.nix +++ b/nixosModules/user-muede.nix @@ -1,37 +1,46 @@ -{ pkgs, ... }: { - users.users.muede = { - isNormalUser = true; - uid = 1000; - name = "muede"; - description = "müde"; - extraGroups = [ - "networkmanager" - "wheel" - "games" - "dialout" - "podman" - "nginx" - "adbusers" - "kvm" - "input" - "video" + lib, + config, + pkgs, + ... +}: +{ + options.my.users.muede.enable = lib.mkEnableOption "muede user account"; + + config = lib.mkIf config.my.users.muede.enable { + users.users.muede = { + isNormalUser = true; + uid = 1000; + name = "muede"; + description = "müde"; + extraGroups = [ + "networkmanager" + "wheel" + "games" + "dialout" + "podman" + "nginx" + "adbusers" + "kvm" + "input" + "video" + ]; + shell = pkgs.zsh; + autoSubUidGidRange = true; + }; + + nix.settings.trusted-users = [ "muede" ]; + + allowedUnfreePackages = [ + "rider" + "pycharm-professional" + "jetbrains-toolbox" + + "anydesk" + + "vscode-extension-ms-dotnettools-csharp" + + "claude-code" ]; - shell = pkgs.zsh; - autoSubUidGidRange = true; }; - - nix.settings.trusted-users = [ "muede" ]; - - allowedUnfreePackages = [ - "rider" - "pycharm-professional" - "jetbrains-toolbox" - - "anydesk" - - "vscode-extension-ms-dotnettools-csharp" - - "claude-code" - ]; } diff --git a/nixosModules/user-ronja.nix b/nixosModules/user-ronja.nix index b374ab9c..46319eb5 100644 --- a/nixosModules/user-ronja.nix +++ b/nixosModules/user-ronja.nix @@ -1,19 +1,28 @@ -{ pkgs, ... }: { - users.users.ronja = { - isNormalUser = true; - name = "ronja"; - description = "Ronja"; - home = "/home/ronja"; - extraGroups = [ - "networkmanager" - "wheel" - "games" - "podman" - "openvscode-server" - ]; - shell = pkgs.zsh; - }; + lib, + config, + pkgs, + ... +}: +{ + options.my.users.ronja.enable = lib.mkEnableOption "ronja user account"; - nix.settings.trusted-users = [ "ronja" ]; + config = lib.mkIf config.my.users.ronja.enable { + users.users.ronja = { + isNormalUser = true; + name = "ronja"; + description = "Ronja"; + home = "/home/ronja"; + extraGroups = [ + "networkmanager" + "wheel" + "games" + "podman" + "openvscode-server" + ]; + shell = pkgs.zsh; + }; + + nix.settings.trusted-users = [ "ronja" ]; + }; } diff --git a/nixosModules/wine-gaming.nix b/nixosModules/wine-gaming.nix index 84111141..58b0099c 100644 --- a/nixosModules/wine-gaming.nix +++ b/nixosModules/wine-gaming.nix @@ -1,22 +1,31 @@ -{ pkgs, ... }: { - hardware = { - graphics = { - enable32Bit = true; - extraPackages = with pkgs; [ mangohud ]; - extraPackages32 = with pkgs; [ mangohud ]; + lib, + config, + pkgs, + ... +}: +{ + options.my.wineGaming.enable = lib.mkEnableOption "Wine gaming (DXVK, MangoHud, xpadneo)"; + + config = lib.mkIf config.my.wineGaming.enable { + hardware = { + graphics = { + enable32Bit = true; + extraPackages = with pkgs; [ mangohud ]; + extraPackages32 = with pkgs; [ mangohud ]; + }; + + xpadneo.enable = true; }; - xpadneo.enable = true; + environment.systemPackages = with pkgs; [ + wineWowPackages.stagingFull + wineWowPackages.fonts + winetricks + dxvk + mangohud + vulkan-tools + mesa-demos + ]; }; - - environment.systemPackages = with pkgs; [ - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks - dxvk - mangohud - vulkan-tools - mesa-demos - ]; } From 281d763c6261535863e287cb01b348af56678433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 23:06:26 +0200 Subject: [PATCH 0475/1295] refactor: automatic options for overlays, fix build --- flake.nix | 52 +++++++++---------- nixosConfigurations/aur0ra/hardware.nix | 8 ++- .../damocles/claude-container.nix | 3 +- nixosConfigurations/epimetheus/default.nix | 9 +++- nixosModules/default.nix | 1 + nixosModules/nixpkgs-overlays.nix | 33 ++++++++++++ nixosModules/pxvirt-guest.nix | 12 ----- 7 files changed, 72 insertions(+), 46 deletions(-) create mode 100644 nixosModules/nixpkgs-overlays.nix diff --git a/flake.nix b/flake.nix index 8cacd378..f76fe57b 100644 --- a/flake.nix +++ b/flake.nix @@ -146,12 +146,13 @@ in { overlays = { - unstable-packages = final: prev: { + unstable = final: prev: { unstable = import nixpkgs-unstable { localSystem = prev.stdenv.hostPlatform; inherit (prev) config; }; }; + vscodeExtensions = nix-vscode-extensions.overlays.default; }; nixosModules = (importModuleDir ./nixosModules) // { @@ -170,12 +171,6 @@ }; }; }; - pkgs-unstable = { - nixpkgs.overlays = [ self.overlays.unstable-packages ]; - }; - pkgs-vscode-extensions = { - nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; - }; }; homeModules = importModuleDir ./homeModules; @@ -208,7 +203,6 @@ lanzaboote.nixosModules.lanzaboote nova-shell.nixosModules.default self.nixosModules.niri - self.nixosModules.pkgs-vscode-extensions servicepoint-cli.nixosModules.default servicepoint-simulator.nixosModules.default servicepoint-tanks.nixosModules.default @@ -233,15 +227,19 @@ doc.enable = false; }; - my.autoupdate.enable = true; - my.distributedBuilds.enable = true; - my.extraCaches.enable = true; - my.globalinstalls.enable = true; - my.lixIsNix.enable = true; - my.openssh.enable = true; - my.prometheusNode.enable = true; - my.systemdBoot.enable = true; - my.tailscale.enable = true; + my = { + autoupdate.enable = true; + distributedBuilds.enable = true; + overlays.unstable.enable = true; + overlays.vscodeExtensions.enable = true; + extraCaches.enable = true; + globalinstalls.enable = true; + lixIsNix.enable = true; + openssh.enable = true; + prometheusNode.enable = true; + systemdBoot.enable = true; + tailscale.enable = true; + }; } ] ++ lib.optionals (home-manager-users != { }) [ @@ -272,15 +270,17 @@ daemonIOSchedClass = "idle"; }; - my.enDe.enable = true; - my.firmwareUpdates.enable = true; - my.gnome.enable = true; - my.kdeconnect.enable = true; - my.modernDesktop.enable = true; - my.niri.enable = true; - my.nixLd.enable = true; - my.quietBoot.enable = true; - my.stylix.enable = true; + my = { + enDe.enable = true; + firmwareUpdates.enable = true; + gnome.enable = true; + kdeconnect.enable = true; + modernDesktop.enable = true; + niri.enable = true; + nixLd.enable = true; + quietBoot.enable = true; + stylix.enable = true; + }; } ]; } diff --git a/nixosConfigurations/aur0ra/hardware.nix b/nixosConfigurations/aur0ra/hardware.nix index 8014f410..8642f799 100644 --- a/nixosConfigurations/aur0ra/hardware.nix +++ b/nixosConfigurations/aur0ra/hardware.nix @@ -10,11 +10,9 @@ # No one got time for xz compression. #isoImage.squashfsCompression = "zstd"; - boot.loader = { - raspberry-pi.bootloader = "kernel"; - systemd-boot.enable = lib.mkForce false; - #generic-extlinux-compatible.enable = lib.mkForce false; - }; + boot.loader.raspberry-pi.bootloader = "kernel"; + + my.systemdBoot.enable = lib.mkForce false; /* fileSystems = { diff --git a/nixosConfigurations/damocles/claude-container.nix b/nixosConfigurations/damocles/claude-container.nix index 17d599f1..c568243b 100644 --- a/nixosConfigurations/damocles/claude-container.nix +++ b/nixosConfigurations/damocles/claude-container.nix @@ -1,12 +1,11 @@ { pkgs, - self, lib, ... }: { - nixpkgs.overlays = [ self.overlays.unstable-packages ]; + my.overlays.unstable.enable = true; allowedUnfreePackages = [ "claude-code" ]; environment.systemPackages = with pkgs; [ diff --git a/nixosConfigurations/epimetheus/default.nix b/nixosConfigurations/epimetheus/default.nix index bff9b144..19b62193 100644 --- a/nixosConfigurations/epimetheus/default.nix +++ b/nixosConfigurations/epimetheus/default.nix @@ -1,6 +1,13 @@ -{ ... }: +{ modulesPath, ... }: { + imports = [ (modulesPath + "/virtualisation/proxmox-lxc.nix") ]; + config = { my.pxvirtGuest.enable = true; + + proxmoxLXC = { + manageNetwork = false; + privileged = false; + }; }; } diff --git a/nixosModules/default.nix b/nixosModules/default.nix index 621cca7f..46dbbd76 100644 --- a/nixosModules/default.nix +++ b/nixosModules/default.nix @@ -18,6 +18,7 @@ ./modern-desktop.nix ./muede-desktop-settings.nix ./nix-ld.nix + ./nixpkgs-overlays.nix ./openssh.nix ./podman.nix ./printing.nix diff --git a/nixosModules/nixpkgs-overlays.nix b/nixosModules/nixpkgs-overlays.nix new file mode 100644 index 00000000..7a657b1a --- /dev/null +++ b/nixosModules/nixpkgs-overlays.nix @@ -0,0 +1,33 @@ +{ + lib, + config, + self, + ... +}: +{ + options.my.overlays = { + enableAll = lib.mkEnableOption "all nixpkgs overlays"; + } + // lib.mapAttrs (_: _: { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + }; + }) self.overlays; + + config = lib.mkMerge ( + [ + { + my.overlays = lib.mapAttrs (_: _: { + enable = lib.mkDefault config.my.overlays.enableAll; + }) self.overlays; + } + ] + ++ lib.mapAttrsToList ( + name: overlay: + lib.mkIf config.my.overlays.${name}.enable { + nixpkgs.overlays = [ overlay ]; + } + ) self.overlays + ); +} diff --git a/nixosModules/pxvirt-guest.nix b/nixosModules/pxvirt-guest.nix index 4a66ff25..a70266a5 100644 --- a/nixosModules/pxvirt-guest.nix +++ b/nixosModules/pxvirt-guest.nix @@ -1,24 +1,12 @@ { - modulesPath, lib, config, ... }: { - # Import unconditionally — the module only defines options, activating nothing by default. - imports = [ (modulesPath + "/virtualisation/proxmox-lxc.nix") ]; - options.my.pxvirtGuest.enable = lib.mkEnableOption "Proxmox LXC guest configuration"; config = lib.mkIf config.my.pxvirtGuest.enable { - # TODO is this needed? - # nix.settings.sandbox = false; - - proxmoxLXC = { - manageNetwork = false; - privileged = false; - }; - # Let Proxmox host handle fstrim services.fstrim.enable = false; From a7cc61a624577422a7cfd1ff47296ae4d6c8a8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 23:15:02 +0200 Subject: [PATCH 0476/1295] refactor: move niri enable to desktop settings --- flake.nix | 23 +++-------------------- nixosModules/muede-desktop-settings.nix | 6 ++++++ 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/flake.nix b/flake.nix index f76fe57b..3b58cc3d 100644 --- a/flake.nix +++ b/flake.nix @@ -153,25 +153,10 @@ }; }; vscodeExtensions = nix-vscode-extensions.overlays.default; + niri = niri.overlays.niri; }; - nixosModules = (importModuleDir ./nixosModules) // { - niri = - { lib, config, ... }: - { - imports = [ niri.nixosModules.niri ]; - - options.my.niri.enable = lib.mkEnableOption "niri wayland compositor"; - - config = lib.mkIf config.my.niri.enable { - nixpkgs.overlays = [ niri.overlays.niri ]; - programs.niri = { - enable = true; - #package = pkgs.niri-stable; - }; - }; - }; - }; + nixosModules = importModuleDir ./nixosModules; homeModules = importModuleDir ./homeModules; homeConfigurations = { @@ -202,7 +187,6 @@ home-manager.nixosModules.home-manager lanzaboote.nixosModules.lanzaboote nova-shell.nixosModules.default - self.nixosModules.niri servicepoint-cli.nixosModules.default servicepoint-simulator.nixosModules.default servicepoint-tanks.nixosModules.default @@ -236,7 +220,7 @@ globalinstalls.enable = true; lixIsNix.enable = true; openssh.enable = true; - prometheusNode.enable = true; + # prometheusNode.enable = true; systemdBoot.enable = true; tailscale.enable = true; }; @@ -276,7 +260,6 @@ gnome.enable = true; kdeconnect.enable = true; modernDesktop.enable = true; - niri.enable = true; nixLd.enable = true; quietBoot.enable = true; stylix.enable = true; diff --git a/nixosModules/muede-desktop-settings.nix b/nixosModules/muede-desktop-settings.nix index 32035248..8f25f62c 100644 --- a/nixosModules/muede-desktop-settings.nix +++ b/nixosModules/muede-desktop-settings.nix @@ -2,12 +2,18 @@ lib, config, pkgs, + niri, ... }: { + imports = [ niri.nixosModules.niri ]; + options.my.muedeDesktopSettings.enable = lib.mkEnableOption "muede desktop settings (Firefox, Logitech, RDP)"; config = lib.mkIf config.my.muedeDesktopSettings.enable { + my.overlays.niri.enable = true; + programs.niri.enable = true; + programs.firefox.enable = true; environment.systemPackages = with pkgs; [ From ec5b785a8a2e9734121d0f3903f6b9922bfbbeb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 23:20:46 +0200 Subject: [PATCH 0477/1295] refactor: move out nixosConfigurations --- flake.nix | 110 +---------------------------------- nixosConfigurations.nix | 123 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 107 deletions(-) create mode 100644 nixosConfigurations.nix diff --git a/flake.nix b/flake.nix index 3b58cc3d..f692eff0 100644 --- a/flake.nix +++ b/flake.nix @@ -114,10 +114,9 @@ ... }: let - devices = import ./devices.nix { inherit self; }; inherit (nixpkgs) lib; - forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) devices; - supported-systems = lib.attrsets.mapAttrsToList (k: v: v.system) devices; + nixosConfigurations = import ./nixosConfigurations.nix { inherit inputs lib; }; + supported-systems = lib.unique (lib.mapAttrsToList (_: v: v.pkgs.system) nixosConfigurations); treefmt-config = { projectRootFile = "flake.nix"; programs = { @@ -164,110 +163,7 @@ ronja = ./homeConfigurations/ronja; }; - nixosConfigurations = forDevice ( - { - device, - system, - home-manager-users ? { }, - nixosSystem ? nixpkgs.lib.nixosSystem, - ... - }: - let - specialArgs = inputs // { - inherit device home-manager-users devices; - }; - in - nixosSystem { - inherit specialArgs; - modules = [ - ./nixosConfigurations/${device} - self.nixosModules.default - - # keep-sorted start - home-manager.nixosModules.home-manager - lanzaboote.nixosModules.lanzaboote - nova-shell.nixosModules.default - servicepoint-cli.nixosModules.default - servicepoint-simulator.nixosModules.default - servicepoint-tanks.nixosModules.default - stylix.nixosModules.stylix - zerforschen-plus.nixosModules.default - # keep-sorted end - - # Base config (replaces global-settings.nix) - { - nixpkgs.hostPlatform = lib.mkDefault system; - networking.hostName = device; - system = { - stateVersion = "22.11"; - autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; - }; - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - documentation = { - info.enable = false; - doc.enable = false; - }; - - my = { - autoupdate.enable = true; - distributedBuilds.enable = true; - overlays.unstable.enable = true; - overlays.vscodeExtensions.enable = true; - extraCaches.enable = true; - globalinstalls.enable = true; - lixIsNix.enable = true; - openssh.enable = true; - # prometheusNode.enable = true; - systemdBoot.enable = true; - tailscale.enable = true; - }; - } - ] - ++ lib.optionals (home-manager-users != { }) [ - # Desktop config (replaces global-settings-desktop.nix) - { - home-manager = { - extraSpecialArgs = specialArgs; - useGlobalPkgs = true; - useUserPackages = true; - users = home-manager-users; - sharedModules = [ - { home.stateVersion = "22.11"; } - # keep-sorted start - self.homeModules.git - self.homeModules.gnome-extensions - self.homeModules.nano - self.homeModules.templates - self.homeModules.zsh-basics - # keep-sorted end - ]; - }; - - time.timeZone = "Europe/Berlin"; - - # on desktops, keep the device useable interactively during expensive builds - nix = { - daemonCPUSchedPolicy = "idle"; - daemonIOSchedClass = "idle"; - }; - - my = { - enDe.enable = true; - firmwareUpdates.enable = true; - gnome.enable = true; - kdeconnect.enable = true; - modernDesktop.enable = true; - nixLd.enable = true; - quietBoot.enable = true; - stylix.enable = true; - }; - } - ]; - } - ); + inherit nixosConfigurations; formatter = forAllSystems ({ treefmt-eval, ... }: treefmt-eval.config.build.wrapper); diff --git a/nixosConfigurations.nix b/nixosConfigurations.nix new file mode 100644 index 00000000..9874985a --- /dev/null +++ b/nixosConfigurations.nix @@ -0,0 +1,123 @@ +{ + inputs, + lib, +}: +let + devices = import ./devices.nix { inherit (inputs) self; }; + inherit (inputs) + self + home-manager + lanzaboote + nova-shell + servicepoint-cli + servicepoint-simulator + servicepoint-tanks + stylix + zerforschen-plus + ; + forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) devices; +in +forDevice ( + { + device, + system, + home-manager-users ? { }, + nixosSystem ? inputs.nixpkgs.lib.nixosSystem, + ... + }: + let + specialArgs = inputs // { + inherit device home-manager-users devices; + }; + in + nixosSystem { + inherit specialArgs; + modules = [ + ./nixosConfigurations/${device} + self.nixosModules.default + + # keep-sorted start + home-manager.nixosModules.home-manager + lanzaboote.nixosModules.lanzaboote + nova-shell.nixosModules.default + servicepoint-cli.nixosModules.default + servicepoint-simulator.nixosModules.default + servicepoint-tanks.nixosModules.default + stylix.nixosModules.stylix + zerforschen-plus.nixosModules.default + # keep-sorted end + + # Base config + { + nixpkgs.hostPlatform = lib.mkDefault system; + networking.hostName = device; + system = { + stateVersion = "22.11"; + autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; + }; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + documentation = { + info.enable = false; + doc.enable = false; + }; + + my = { + autoupdate.enable = true; + distributedBuilds.enable = true; + overlays.unstable.enable = true; + overlays.vscodeExtensions.enable = true; + extraCaches.enable = true; + globalinstalls.enable = true; + lixIsNix.enable = true; + openssh.enable = true; + # prometheusNode.enable = true; + systemdBoot.enable = true; + tailscale.enable = true; + }; + } + ] + ++ lib.optionals (home-manager-users != { }) [ + # Desktop config + { + home-manager = { + extraSpecialArgs = specialArgs; + useGlobalPkgs = true; + useUserPackages = true; + users = home-manager-users; + sharedModules = [ + { home.stateVersion = "22.11"; } + # keep-sorted start + self.homeModules.git + self.homeModules.gnome-extensions + self.homeModules.nano + self.homeModules.templates + self.homeModules.zsh-basics + # keep-sorted end + ]; + }; + + time.timeZone = "Europe/Berlin"; + + # on desktops, keep the device useable interactively during expensive builds + nix = { + daemonCPUSchedPolicy = "idle"; + daemonIOSchedClass = "idle"; + }; + + my = { + enDe.enable = true; + firmwareUpdates.enable = true; + gnome.enable = true; + kdeconnect.enable = true; + modernDesktop.enable = true; + nixLd.enable = true; + quietBoot.enable = true; + stylix.enable = true; + }; + } + ]; + } +) From 29ab335879b87a76e13dff527a862dc6fe430546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 23:31:14 +0200 Subject: [PATCH 0478/1295] deadnix fixes --- flake.nix | 9 --------- homeConfigurations/muede/default.nix | 2 +- nixosModules/lix-is-nix.nix | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index f692eff0..01c4906e 100644 --- a/flake.nix +++ b/flake.nix @@ -96,20 +96,11 @@ inputs@{ self, nixpkgs, - home-manager, # keep-sorted start - lanzaboote, niri, nix-vscode-extensions, - nixos-generators, nixpkgs-unstable, - nova-shell, - servicepoint-cli, - servicepoint-simulator, - servicepoint-tanks, - stylix, treefmt-nix, - zerforschen-plus, # keep-sorted end ... }: diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index 767b40e9..185476d2 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -1,4 +1,4 @@ -{ pkgs, self, ... }: +{ pkgs, ... }: { imports = [ # keep-sorted start diff --git a/nixosModules/lix-is-nix.nix b/nixosModules/lix-is-nix.nix index 04eaf421..2bb071e0 100644 --- a/nixosModules/lix-is-nix.nix +++ b/nixosModules/lix-is-nix.nix @@ -9,7 +9,7 @@ config = lib.mkIf config.my.lixIsNix.enable { nixpkgs.overlays = [ - (final: prev: { + (_: prev: { inherit (prev.lixPackageSets.stable) nixpkgs-review nix-eval-jobs From c2aa932494fbab644471b96089b88bcc3113b5df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 23:43:24 +0200 Subject: [PATCH 0479/1295] move git to own mod --- homeModules/git.nix | 6 ------ nixosConfigurations.nix | 10 +++++++--- nixosModules/default.nix | 1 + nixosModules/git.nix | 24 ++++++++++++++++++++++++ nixosModules/globalinstalls.nix | 8 -------- 5 files changed, 32 insertions(+), 17 deletions(-) delete mode 100644 homeModules/git.nix create mode 100644 nixosModules/git.nix diff --git a/homeModules/git.nix b/homeModules/git.nix deleted file mode 100644 index 2c66c82b..00000000 --- a/homeModules/git.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.git = { - enable = true; - settings.init.defaultBranch = "main"; - }; -} diff --git a/nixosConfigurations.nix b/nixosConfigurations.nix index 9874985a..9fb2cf2c 100644 --- a/nixosConfigurations.nix +++ b/nixosConfigurations.nix @@ -65,17 +65,20 @@ forDevice ( }; my = { + # keep-sorted start autoupdate.enable = true; distributedBuilds.enable = true; - overlays.unstable.enable = true; - overlays.vscodeExtensions.enable = true; extraCaches.enable = true; + git.enable = true; globalinstalls.enable = true; lixIsNix.enable = true; openssh.enable = true; + overlays.unstable.enable = true; + overlays.vscodeExtensions.enable = true; # prometheusNode.enable = true; systemdBoot.enable = true; tailscale.enable = true; + # keep-sorted end }; } ] @@ -90,7 +93,6 @@ forDevice ( sharedModules = [ { home.stateVersion = "22.11"; } # keep-sorted start - self.homeModules.git self.homeModules.gnome-extensions self.homeModules.nano self.homeModules.templates @@ -108,6 +110,7 @@ forDevice ( }; my = { + # keep-sorted start enDe.enable = true; firmwareUpdates.enable = true; gnome.enable = true; @@ -116,6 +119,7 @@ forDevice ( nixLd.enable = true; quietBoot.enable = true; stylix.enable = true; + # keep-sorted end }; } ]; diff --git a/nixosModules/default.nix b/nixosModules/default.nix index 46dbbd76..2808b2a6 100644 --- a/nixosModules/default.nix +++ b/nixosModules/default.nix @@ -9,6 +9,7 @@ ./en-de.nix ./extra-caches.nix ./firmware-updates.nix + ./git.nix ./globalinstalls.nix ./gnome.nix ./intel-graphics.nix diff --git a/nixosModules/git.nix b/nixosModules/git.nix new file mode 100644 index 00000000..ffe5c785 --- /dev/null +++ b/nixosModules/git.nix @@ -0,0 +1,24 @@ +{ + lib, + config, + pkgs, + ... +}: +{ + options.my.git.enable = lib.mkEnableOption "git with credential helper"; + + config = lib.mkIf config.my.git.enable { + environment.systemPackages = [ pkgs.git-credential-oauth ]; + + programs.git = { + enable = true; + config = { + init.defaultBranch = "main"; + credential = { + helper = "oauth"; + credentialStore = "cache"; + }; + }; + }; + }; +} diff --git a/nixosModules/globalinstalls.nix b/nixosModules/globalinstalls.nix index 56061ee0..6c914c7e 100644 --- a/nixosModules/globalinstalls.nix +++ b/nixosModules/globalinstalls.nix @@ -16,24 +16,16 @@ screen tldr nix-output-monitor - git-credential-oauth ]; programs = { zsh.enable = true; htop.enable = true; iotop.enable = true; - git.enable = true; nano = { enable = true; syntaxHighlight = true; }; }; - - environment.etc."gitconfig".text = '' - [credential] - helper = oauth - credentialStore = cache - ''; }; } From cfa42f11b59d64fd3682b89a5bff57ae3cd926a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 1 May 2026 23:50:28 +0200 Subject: [PATCH 0480/1295] pc2: fix cannot build aarch64 --- nixosConfigurations/muede-pc2/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixosConfigurations/muede-pc2/default.nix b/nixosConfigurations/muede-pc2/default.nix index 5a90eeaa..4686ffbf 100644 --- a/nixosConfigurations/muede-pc2/default.nix +++ b/nixosConfigurations/muede-pc2/default.nix @@ -15,6 +15,7 @@ my.amdGraphics.enable = true; my.secureBoot.enable = true; + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; nix.settings.extra-platforms = [ "aarch64-linux" "i686-linux" From 396e8121d03be47a940c0456ac36bbb55412cd62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sat, 2 May 2026 00:03:09 +0200 Subject: [PATCH 0481/1295] distributed builds: use builders as binary caches --- README.md | 36 +++++++++++++++++++++++++++++ devices.nix | 2 ++ nixosModules/distributed-builds.nix | 34 +++++++++++++-------------- 3 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..f97d4b5d --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# nixos-configuration + +Personal NixOS configuration for all machines. Devices are declared in `devices.nix`, per-device configs live in `nixosConfigurations//`, and shared modules in `nixosModules/`. + +## Distributed builds + +Machines are configured to act as build servers / binary caches for each other in devices.nix. + +### Onboarding a device as a build client + +1. Generate a key pair on the device: + ``` + sudo ssh-keygen -t ed25519 -f /etc/nix/distributed-build-key -N "" -C "$(hostname)-nix-builds" + ``` +2. Add the public key to the device entry in `devices.nix`: + ```nix + distributedBuilds.clientPublicKey = "ssh-ed25519 AAAA... -nix-builds"; + ``` +3. Rebuild all build machines so they pick up the new authorized key. + +### Adding a build server + +1. Add to its entry in `devices.nix`: + ```nix + distributedBuilds.isBuilder = true; + distributedBuilds.hostPublicKey = "ssh-ed25519 AAAA..."; # from: ssh-keyscan -t ed25519 + ``` +2. Generate a store signing key on the builder: + ``` + sudo nix key generate-secret --key-name "$(hostname)" | sudo tee /etc/nix/signing-key.sec | sudo nix key convert-secret-to-public + ``` +3. Add the printed public key to `devices.nix`: + ```nix + distributedBuilds.storeSigningPublicKey = ":"; + ``` +4. Rebuild all machines so they trust the new signing key. diff --git a/devices.nix b/devices.nix index a8e427a1..c17d02e2 100644 --- a/devices.nix +++ b/devices.nix @@ -39,6 +39,7 @@ in isBuilder = true; hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHGKoZ68wwyVRmPB0SkvpJUyUMDWeFbC5Je9zukyEOh7"; clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAbojdhb3PfazSRmudvo381Y+zUFVLMa7AbWbfK/Zp2 muede-lpt2-nix-builds"; + storeSigningPublicKey = "muede-lpt2:3csut7FW6oZK/ztRLBRC80LSBfFE3qzl+aIYgOixB6U="; }; }; muede-pc2 = { @@ -51,6 +52,7 @@ in speedFactor = 2; hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKEQQS5XNoj62Oj85xQfIuLORwoBRwfqjvfBHHsiI+RH"; clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHmnyhP6L+kGHV15cb/d31AQr50wSEaQhkUBwy2+OEKk muede-pc2-nix-builds"; + storeSigningPublicKey = "muede-pc2:fqQO0E0y65MjUWlQnrgWt5ZsmQKlKCv4jls3CmUXDEQ="; }; }; ronja-pc = { diff --git a/nixosModules/distributed-builds.nix b/nixosModules/distributed-builds.nix index 94ec25c3..32a8f34f 100644 --- a/nixosModules/distributed-builds.nix +++ b/nixosModules/distributed-builds.nix @@ -14,24 +14,6 @@ let (lib.mapAttrsToList (_: v: v.distributedBuilds.clientPublicKey)) ]; - # === Onboarding a device as a build client === - # - # 1. Generate a key pair on the device: - # sudo ssh-keygen -t ed25519 -f /etc/nix/distributed-build-key -N "" -C "$(hostname)-nix-builds" - # (owned by root, mode 0600) - # - # 2. Add the public key to the device entry in flake.nix: - # distributedBuilds.clientPublicKey = "ssh-ed25519 AAAA... -nix-builds"; - # - # 3. Rebuild all machines so they pick up the new authorized key. - # - # === Marking a device as a build server === - # - # Add to its entry in flake.nix: - # distributedBuilds.isBuilder = true; - # distributedBuilds.hostPublicKey = "ssh-ed25519 AAAA..."; # from: ssh-keyscan -t ed25519 - # All machines automatically discover and use it after the next rebuild. - buildServerDevices = lib.filterAttrs ( _: v: (v.distributedBuilds or { }).isBuilder or false ) devices; @@ -92,6 +74,22 @@ in settings = { trusted-users = [ buildUser ]; builders-use-substitutes = true; + # Use build machines as binary caches so already-built paths are downloaded + # rather than rebuilt. Only machines with a storeSigningPublicKey are used. + substituters = lib.pipe buildServerDevices [ + (lib.filterAttrs (_: v: v.distributedBuilds ? storeSigningPublicKey)) + (lib.mapAttrsToList (hostName: _: "ssh-ng://${buildUser}@${hostName}")) + (lib.filter (s: s != "ssh-ng://${buildUser}@${config.networking.hostName}")) + ]; + trusted-public-keys = lib.pipe buildServerDevices [ + (lib.mapAttrsToList (_: v: v.distributedBuilds.storeSigningPublicKey or null)) + (builtins.filter (k: k != null)) + ]; + secret-key-files = + let + thisDevice = devices.${config.networking.hostName} or { }; + in + lib.optional (thisDevice.distributedBuilds.isBuilder or false) "/etc/nix/signing-key.sec"; max-jobs = (devices.${config.networking.hostName}.distributedBuilds or { }).maxJobs or "auto"; cores = 0; min-free = 10 * 1024 * 1024; From f035f1300ff8e6f57a25e8cb82680b1f1b989c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sat, 2 May 2026 01:18:51 +0200 Subject: [PATCH 0482/1295] auto-generate nixosModules.default --- flake.nix | 6 +++++- nixosModules/default.nix | 39 --------------------------------------- 2 files changed, 5 insertions(+), 40 deletions(-) delete mode 100644 nixosModules/default.nix diff --git a/flake.nix b/flake.nix index 01c4906e..e95af0e4 100644 --- a/flake.nix +++ b/flake.nix @@ -146,7 +146,11 @@ niri = niri.overlays.niri; }; - nixosModules = importModuleDir ./nixosModules; + nixosModules = (importModuleDir ./nixosModules) // { + default = { + imports = builtins.attrValues (builtins.removeAttrs self.nixosModules [ "default" ]); + }; + }; homeModules = importModuleDir ./homeModules; homeConfigurations = { diff --git a/nixosModules/default.nix b/nixosModules/default.nix deleted file mode 100644 index 2808b2a6..00000000 --- a/nixosModules/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ ... }: -{ - imports = [ - # keep-sorted start - ./allowed-unfree-list.nix - ./amd-graphics.nix - ./autoupdate.nix - ./distributed-builds.nix - ./en-de.nix - ./extra-caches.nix - ./firmware-updates.nix - ./git.nix - ./globalinstalls.nix - ./gnome.nix - ./intel-graphics.nix - ./kdeconnect.nix - ./latex.nix - ./lix-is-nix.nix - ./modern-desktop.nix - ./muede-desktop-settings.nix - ./nix-ld.nix - ./nixpkgs-overlays.nix - ./openssh.nix - ./podman.nix - ./printing.nix - ./prometheus-node.nix - ./pxvirt-guest.nix - ./quiet-boot.nix - ./secure-boot.nix - ./steam.nix - ./stylix.nix - ./systemd-boot.nix - ./tailscale.nix - ./user-muede.nix - ./user-ronja.nix - ./wine-gaming.nix - # keep-sorted end - ]; -} From 736557bb8adedd081b57cb59506979a3b9868980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sat, 2 May 2026 02:01:30 +0200 Subject: [PATCH 0483/1295] distributed builds: cleanups, fixes --- nixosConfigurations.nix | 13 ++- nixosModules/distributed-builds.nix | 142 ++++++++++++++++------------ 2 files changed, 90 insertions(+), 65 deletions(-) diff --git a/nixosConfigurations.nix b/nixosConfigurations.nix index 9fb2cf2c..29e78c31 100644 --- a/nixosConfigurations.nix +++ b/nixosConfigurations.nix @@ -3,7 +3,7 @@ lib, }: let - devices = import ./devices.nix { inherit (inputs) self; }; + allDevices = import ./devices.nix { inherit (inputs) self; }; inherit (inputs) self home-manager @@ -15,7 +15,7 @@ let stylix zerforschen-plus ; - forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) devices; + forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) allDevices; in forDevice ( { @@ -24,10 +24,15 @@ forDevice ( home-manager-users ? { }, nixosSystem ? inputs.nixpkgs.lib.nixosSystem, ... - }: + }@thisDevice: let specialArgs = inputs // { - inherit device home-manager-users devices; + inherit + device + home-manager-users + allDevices + thisDevice + ; }; in nixosSystem { diff --git a/nixosModules/distributed-builds.nix b/nixosModules/distributed-builds.nix index 32a8f34f..1d0a55ee 100644 --- a/nixosModules/distributed-builds.nix +++ b/nixosModules/distributed-builds.nix @@ -1,24 +1,27 @@ { config, lib, - devices, + allDevices, + thisDevice, ... }: let - sshKeyPath = "/etc/nix/distributed-build-key"; + clientSshKeyPath = "/etc/nix/distributed-build-key"; buildUser = "remotebuild"; # Collect all per-device public keys that have been registered. - authorizedPublicKeys = lib.pipe devices [ + allClientPublicKeys = lib.pipe allDevices [ (lib.filterAttrs (_: v: (v.distributedBuilds or { }) ? clientPublicKey)) (lib.mapAttrsToList (_: v: v.distributedBuilds.clientPublicKey)) ]; + isClient = (thisDevice.distributedBuilds or { }) ? clientPublicKey; + buildServerDevices = lib.filterAttrs ( _: v: (v.distributedBuilds or { }).isBuilder or false - ) devices; + ) allDevices; - knownHosts = lib.pipe buildServerDevices [ + buildServerKnownHosts = lib.pipe buildServerDevices [ (lib.filterAttrs (_: v: v.distributedBuilds ? hostPublicKey)) (lib.mapAttrs ( _: v: { @@ -27,17 +30,21 @@ let )) ]; - buildMachineList = lib.mapAttrsToList ( - hostName: v: + remoteBuildServerDevices = builtins.filter ( + m: m.hostName != config.networking.hostName + ) (lib.mapAttrsToList (name: v: v // { hostName = name; }) buildServerDevices); + + buildMachines = map ( + m: { - inherit hostName; - systems = [ v.system ]; + hostName = m.hostName; + systems = [ m.system ]; sshUser = buildUser; - sshKey = sshKeyPath; + sshKey = clientSshKeyPath; protocol = "ssh-ng"; } - // lib.optionalAttrs (v.distributedBuilds ? speedFactor) { - speedFactor = v.distributedBuilds.speedFactor; + // lib.optionalAttrs (m.distributedBuilds ? speedFactor) { + speedFactor = m.distributedBuilds.speedFactor; } // { supportedFeatures = [ @@ -47,60 +54,73 @@ let "benchmark" ]; } - ) buildServerDevices; - - remoteMachines = builtins.filter (m: m.hostName != config.networking.hostName) buildMachineList; + ) remoteBuildServerDevices; in { options.my.distributedBuilds.enable = lib.mkEnableOption "distributed Nix builds"; - config = lib.mkIf config.my.distributedBuilds.enable { - programs.ssh.knownHosts = knownHosts; + config = lib.mkIf config.my.distributedBuilds.enable ( + lib.mkMerge [ - # Dedicated user for receiving distributed build connections - users.users.${buildUser} = { - isSystemUser = true; - group = buildUser; - useDefaultShell = true; - openssh.authorizedKeys.keys = map ( - k: ''command="nix daemon --stdio",restrict ${k}'' - ) authorizedPublicKeys; - }; - users.groups.${buildUser} = { }; + # All machines + { + nix.settings = { + trusted-public-keys = lib.pipe buildServerDevices [ + (lib.mapAttrsToList (_: v: v.distributedBuilds.storeSigningPublicKey or null)) + (builtins.filter (k: k != null)) + ]; + max-jobs = (thisDevice.distributedBuilds or { }).maxJobs or "auto"; + cores = 0; + min-free = 10 * 1024 * 1024; + max-free = 200 * 1024 * 1024; + }; + systemd.services.nix-daemon.serviceConfig = { + MemoryAccounting = true; + MemoryMax = "90%"; + OOMScoreAdjust = 500; + }; + } - nix = { - distributedBuilds = remoteMachines != [ ]; - buildMachines = remoteMachines; - settings = { - trusted-users = [ buildUser ]; - builders-use-substitutes = true; - # Use build machines as binary caches so already-built paths are downloaded - # rather than rebuilt. Only machines with a storeSigningPublicKey are used. - substituters = lib.pipe buildServerDevices [ - (lib.filterAttrs (_: v: v.distributedBuilds ? storeSigningPublicKey)) - (lib.mapAttrsToList (hostName: _: "ssh-ng://${buildUser}@${hostName}")) - (lib.filter (s: s != "ssh-ng://${buildUser}@${config.networking.hostName}")) - ]; - trusted-public-keys = lib.pipe buildServerDevices [ - (lib.mapAttrsToList (_: v: v.distributedBuilds.storeSigningPublicKey or null)) - (builtins.filter (k: k != null)) - ]; - secret-key-files = - let - thisDevice = devices.${config.networking.hostName} or { }; - in - lib.optional (thisDevice.distributedBuilds.isBuilder or false) "/etc/nix/signing-key.sec"; - max-jobs = (devices.${config.networking.hostName}.distributedBuilds or { }).maxJobs or "auto"; - cores = 0; - min-free = 10 * 1024 * 1024; - max-free = 200 * 1024 * 1024; - }; - }; + # Server: accept incoming build connections + (lib.mkIf (thisDevice.distributedBuilds.isBuilder or false) { + users.users.${buildUser} = { + isSystemUser = true; + group = buildUser; + useDefaultShell = true; + openssh.authorizedKeys.keys = map ( + k: ''command="nix daemon --stdio",restrict ${k}'' + ) allClientPublicKeys; + }; + users.groups.${buildUser} = { }; + nix.settings = { + trusted-users = [ buildUser ]; + secret-key-files = [ "/etc/nix/signing-key.sec" ]; + }; + }) - systemd.services.nix-daemon.serviceConfig = { - MemoryAccounting = true; - MemoryMax = "90%"; - OOMScoreAdjust = 500; - }; - }; + # Client: connect to build servers for building and substitution + (lib.mkIf isClient { + programs.ssh = { + knownHosts = buildServerKnownHosts; + extraConfig = '' + Host ${lib.concatStringsSep " " (lib.attrNames buildServerDevices)} + User ${buildUser} + IdentityFile ${clientSshKeyPath} + IdentitiesOnly yes + ''; + }; + nix = { + distributedBuilds = buildMachines != [ ]; + buildMachines = buildMachines; + settings = { + builders-use-substitutes = true; + substituters = map (m: "ssh-ng://${buildUser}@${m.hostName}") ( + builtins.filter (m: m.distributedBuilds ? storeSigningPublicKey) remoteBuildServerDevices + ); + }; + }; + }) + + ] + ); } From cf98cb7880851e980567b1c245befd4e3daacc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sat, 2 May 2026 11:37:32 +0200 Subject: [PATCH 0484/1295] ditributed builds: add forgejo-runner-1 it may be a bad idea to have it act as a client, but only one way to find out --- README.md | 18 ++++++++++++++---- devices.nix | 6 ++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f97d4b5d..3ad5e880 100644 --- a/README.md +++ b/README.md @@ -9,28 +9,38 @@ Machines are configured to act as build servers / binary caches for each other i ### Onboarding a device as a build client 1. Generate a key pair on the device: + + ```sh + sudo ssh-keygen -t ed25519 -f /etc/nix/distributed-build-key -N "" -C "$(hostname)-nix-builds" && sudo cat /etc/nix/distributed-build-key.pub ``` - sudo ssh-keygen -t ed25519 -f /etc/nix/distributed-build-key -N "" -C "$(hostname)-nix-builds" - ``` + 2. Add the public key to the device entry in `devices.nix`: + ```nix distributedBuilds.clientPublicKey = "ssh-ed25519 AAAA... -nix-builds"; ``` + 3. Rebuild all build machines so they pick up the new authorized key. ### Adding a build server 1. Add to its entry in `devices.nix`: + ```nix distributedBuilds.isBuilder = true; - distributedBuilds.hostPublicKey = "ssh-ed25519 AAAA..."; # from: ssh-keyscan -t ed25519 + distributedBuilds.hostPublicKey = "ssh-ed25519 AAAA..."; # from: ssh-keyscan -t ed25519 "$(hostname)" ``` + 2. Generate a store signing key on the builder: - ``` + + ```sh sudo nix key generate-secret --key-name "$(hostname)" | sudo tee /etc/nix/signing-key.sec | sudo nix key convert-secret-to-public ``` + 3. Add the printed public key to `devices.nix`: + ```nix distributedBuilds.storeSigningPublicKey = ":"; ``` + 4. Rebuild all machines so they trust the new signing key. diff --git a/devices.nix b/devices.nix index c17d02e2..ea3c6f65 100644 --- a/devices.nix +++ b/devices.nix @@ -26,6 +26,12 @@ in }; forgejo-runner-1 = { system = "aarch64-linux"; + distributedBuilds = { + isBuilder = true; + clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0NLgg0sFobBWz/bjYs9WkrMvlcvJC5F6+3jQ/b+AnD forgejo-runner-1-nix-builds"; + hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIANGC89GiT5xCsFICwrharrbV3q7acWHqk6ZwOUXbtGT"; + storeSigningPublicKey = "forgejo-runner-1:ln1FVLL8G5+IveQuBi/Kn3SaqFZ1gaiQrE3yPlMhCMA="; + }; }; hetzner-vpn2 = { system = "aarch64-linux"; From ceeec5be416aad5b47154e622b262c394babccd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sat, 2 May 2026 11:48:32 +0200 Subject: [PATCH 0485/1295] distributed builds: fix ssh only accepting build key --- nixosModules/distributed-builds.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixosModules/distributed-builds.nix b/nixosModules/distributed-builds.nix index 1d0a55ee..7d5df6eb 100644 --- a/nixosModules/distributed-builds.nix +++ b/nixosModules/distributed-builds.nix @@ -103,8 +103,7 @@ in programs.ssh = { knownHosts = buildServerKnownHosts; extraConfig = '' - Host ${lib.concatStringsSep " " (lib.attrNames buildServerDevices)} - User ${buildUser} + Match Host ${lib.concatStringsSep " " (lib.attrNames buildServerDevices)} User ${buildUser} IdentityFile ${clientSshKeyPath} IdentitiesOnly yes ''; From 704e14251f81e953e432f1e7e01e8a82feb576d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 13:45:51 +0200 Subject: [PATCH 0486/1295] rename options.muede to options.my --- homeModules/gnome-extensions.nix | 4 ++-- nixosModules/gnome.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeModules/gnome-extensions.nix b/homeModules/gnome-extensions.nix index 0e6ca16d..071fa153 100644 --- a/homeModules/gnome-extensions.nix +++ b/homeModules/gnome-extensions.nix @@ -6,7 +6,7 @@ ... }: { - options.muede.gnome-extensions = + options.my.gnome-extensions = let mkDefaultEnabledOption = name: @@ -40,7 +40,7 @@ config = let - cfg = config.muede.gnome-extensions; + cfg = config.my.gnome-extensions; in lib.mkIf cfg.enable ( lib.mkMerge [ diff --git a/nixosModules/gnome.nix b/nixosModules/gnome.nix index b0bf4068..83113738 100644 --- a/nixosModules/gnome.nix +++ b/nixosModules/gnome.nix @@ -7,7 +7,7 @@ { options = { my.gnome.enable = lib.mkEnableOption "GNOME desktop environment"; - muede.keep-gnome-default-apps = lib.mkEnableOption "keep gnome default apps"; + my.gnome.keep-default-apps = lib.mkEnableOption "keep gnome default apps"; }; config = lib.mkIf config.my.gnome.enable ( @@ -39,7 +39,7 @@ gpaste.enable = true; }; } - (lib.mkIf (!config.muede.keep-gnome-default-apps) { + (lib.mkIf (!config.my.gnome.keep-default-apps) { environment.gnome.excludePackages = with pkgs; [ cheese # photo booth epiphany # web browser From e394a6e21e642666c4c8c0962bad09834efd02cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 13:46:30 +0200 Subject: [PATCH 0487/1295] distributed builds: fix ssh only accepting build key for real --- nixosModules/distributed-builds.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nixosModules/distributed-builds.nix b/nixosModules/distributed-builds.nix index 7d5df6eb..91341f57 100644 --- a/nixosModules/distributed-builds.nix +++ b/nixosModules/distributed-builds.nix @@ -102,11 +102,13 @@ in (lib.mkIf isClient { programs.ssh = { knownHosts = buildServerKnownHosts; - extraConfig = '' - Match Host ${lib.concatStringsSep " " (lib.attrNames buildServerDevices)} User ${buildUser} - IdentityFile ${clientSshKeyPath} - IdentitiesOnly yes - ''; + extraConfig = lib.concatStringsSep "\n" ( + lib.mapAttrsToList (name: _: '' + Match host ${name} user ${buildUser} + IdentityFile ${clientSshKeyPath} + IdentitiesOnly yes + '') buildServerDevices + ); }; nix = { distributedBuilds = buildMachines != [ ]; From 95eb2fa1cb95e4065f37888514414402a5adaa1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 13:53:11 +0200 Subject: [PATCH 0488/1295] devices: flag desktps, install tailscale tray if dektop --- devices.nix | 3 +++ homeConfigurations/muede/default.nix | 6 +----- homeModules/tailscale.nix | 4 ++++ nixosConfigurations.nix | 4 +++- 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 homeModules/tailscale.nix diff --git a/devices.nix b/devices.nix index ea3c6f65..0eaa3b03 100644 --- a/devices.nix +++ b/devices.nix @@ -38,6 +38,7 @@ in }; muede-lpt2 = { system = "x86_64-linux"; + isDesktop = true; home-manager-users = { inherit (self.homeConfigurations) muede; }; @@ -50,6 +51,7 @@ in }; muede-pc2 = { system = "x86_64-linux"; + isDesktop = true; home-manager-users = { inherit (self.homeConfigurations) muede; }; @@ -63,6 +65,7 @@ in }; ronja-pc = { system = "x86_64-linux"; + isDesktop = true; home-manager-users = { inherit (self.homeConfigurations) ronja; }; diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index 185476d2..87db6340 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -80,7 +80,6 @@ onefetch servicepoint-cli servicepoint-simulator - tailscale telegram-desktop thunderbird vlc @@ -93,9 +92,6 @@ "idea.properties".text = "idea.filewatcher.executable.path = ${pkgs.fsnotifier}/bin/fsnotifier"; }; - services = { - trayscale.enable = true; - poweralertd.enable = true; - }; + services.poweralertd.enable = true; }; } diff --git a/homeModules/tailscale.nix b/homeModules/tailscale.nix new file mode 100644 index 00000000..34d1c3d0 --- /dev/null +++ b/homeModules/tailscale.nix @@ -0,0 +1,4 @@ +{ osConfig, thisDevice, ... }: +{ + services.tailscale-systray.enable = (thisDevice.isDesktop or false) && osConfig.my.tailscale.enable; +} diff --git a/nixosConfigurations.nix b/nixosConfigurations.nix index 29e78c31..c0d3a80b 100644 --- a/nixosConfigurations.nix +++ b/nixosConfigurations.nix @@ -21,6 +21,7 @@ forDevice ( { device, system, + isDesktop ? false, home-manager-users ? { }, nixosSystem ? inputs.nixpkgs.lib.nixosSystem, ... @@ -87,7 +88,7 @@ forDevice ( }; } ] - ++ lib.optionals (home-manager-users != { }) [ + ++ lib.optionals isDesktop [ # Desktop config { home-manager = { @@ -100,6 +101,7 @@ forDevice ( # keep-sorted start self.homeModules.gnome-extensions self.homeModules.nano + self.homeModules.tailscale self.homeModules.templates self.homeModules.zsh-basics # keep-sorted end From dc36665e7a004b428271bb44271f6b317e837975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 14:21:34 +0200 Subject: [PATCH 0489/1295] distributed builds: fix host name does not match after expansion --- nixosModules/distributed-builds.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixosModules/distributed-builds.nix b/nixosModules/distributed-builds.nix index 91341f57..50d9ee66 100644 --- a/nixosModules/distributed-builds.nix +++ b/nixosModules/distributed-builds.nix @@ -104,7 +104,7 @@ in knownHosts = buildServerKnownHosts; extraConfig = lib.concatStringsSep "\n" ( lib.mapAttrsToList (name: _: '' - Match host ${name} user ${buildUser} + Match originalhost ${name} user ${buildUser} IdentityFile ${clientSshKeyPath} IdentitiesOnly yes '') buildServerDevices From 6ee82131cd2db664c9e24dacca753c3e8d9de0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 14:24:56 +0200 Subject: [PATCH 0490/1295] ditributed builds: tweak speed factors --- devices.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/devices.nix b/devices.nix index 0eaa3b03..7313e7b2 100644 --- a/devices.nix +++ b/devices.nix @@ -28,6 +28,7 @@ in system = "aarch64-linux"; distributedBuilds = { isBuilder = true; + speedFactor = 1; clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0NLgg0sFobBWz/bjYs9WkrMvlcvJC5F6+3jQ/b+AnD forgejo-runner-1-nix-builds"; hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIANGC89GiT5xCsFICwrharrbV3q7acWHqk6ZwOUXbtGT"; storeSigningPublicKey = "forgejo-runner-1:ln1FVLL8G5+IveQuBi/Kn3SaqFZ1gaiQrE3yPlMhCMA="; @@ -44,6 +45,7 @@ in }; distributedBuilds = { isBuilder = true; + speedFactor = 2; hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHGKoZ68wwyVRmPB0SkvpJUyUMDWeFbC5Je9zukyEOh7"; clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAbojdhb3PfazSRmudvo381Y+zUFVLMa7AbWbfK/Zp2 muede-lpt2-nix-builds"; storeSigningPublicKey = "muede-lpt2:3csut7FW6oZK/ztRLBRC80LSBfFE3qzl+aIYgOixB6U="; @@ -57,7 +59,7 @@ in }; distributedBuilds = { isBuilder = true; - speedFactor = 2; + speedFactor = 4; hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKEQQS5XNoj62Oj85xQfIuLORwoBRwfqjvfBHHsiI+RH"; clientPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHmnyhP6L+kGHV15cb/d31AQr50wSEaQhkUBwy2+OEKk muede-pc2-nix-builds"; storeSigningPublicKey = "muede-pc2:fqQO0E0y65MjUWlQnrgWt5ZsmQKlKCv4jls3CmUXDEQ="; From c8cfa37bb9e3dbd3bc0e2c004db909aca512b5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 15:19:06 +0200 Subject: [PATCH 0491/1295] hm modules: gate behind enable options, always import --- homeConfigurations/muede/default.nix | 9 +++++++++ homeConfigurations/ronja/default.nix | 8 ++++++++ homeModules/gnome-extensions.nix | 2 +- homeModules/nano.nix | 17 +++++++++++------ homeModules/tailscale.nix | 12 ++++++++++-- homeModules/templates.nix | 23 ++++++++++++++--------- homeModules/zsh-basics.nix | 21 +++++++++++++-------- nixosConfigurations.nix | 11 +---------- 8 files changed, 67 insertions(+), 36 deletions(-) diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index 87db6340..17c66a09 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -23,6 +23,15 @@ ]; config = { + my = { + # keep-sorted start + gnome-extensions.enable = true; + nano.enable = true; + templates.enable = true; + zsh.enable = true; + # keep-sorted end + }; + programs = { home-manager.enable = true; fzf.enable = true; diff --git a/homeConfigurations/ronja/default.nix b/homeConfigurations/ronja/default.nix index 0f202cd0..4d5c5ee3 100644 --- a/homeConfigurations/ronja/default.nix +++ b/homeConfigurations/ronja/default.nix @@ -2,6 +2,14 @@ { imports = [ ./vscode.nix ]; config = { + my = { + # keep-sorted start + nano.enable = true; + templates.enable = true; + zsh.enable = true; + # keep-sorted end + }; + home.packages = with pkgs; [ ## Apps telegram-desktop diff --git a/homeModules/gnome-extensions.nix b/homeModules/gnome-extensions.nix index 071fa153..20b3a703 100644 --- a/homeModules/gnome-extensions.nix +++ b/homeModules/gnome-extensions.nix @@ -18,7 +18,7 @@ }; in { - enable = mkDefaultEnabledOption "gnome extended options"; + enable = lib.mkEnableOption "gnome extended options"; appindicator.enable = mkDefaultEnabledOption "appindicator"; caffeine.enable = mkDefaultEnabledOption "caffeine"; tailscale-qs.enable = lib.mkOption { diff --git a/homeModules/nano.nix b/homeModules/nano.nix index ab3e7b24..2293b997 100644 --- a/homeModules/nano.nix +++ b/homeModules/nano.nix @@ -1,9 +1,14 @@ +{ lib, config, ... }: { - home = { - sessionVariables.EDITOR = "nano"; - file.".nanorc".text = '' - set linenumbers - set mouse - ''; + options.my.nano.enable = lib.mkEnableOption "nano editor config"; + + config = lib.mkIf config.my.nano.enable { + home = { + sessionVariables.EDITOR = "nano"; + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; }; } diff --git a/homeModules/tailscale.nix b/homeModules/tailscale.nix index 34d1c3d0..5f51fc96 100644 --- a/homeModules/tailscale.nix +++ b/homeModules/tailscale.nix @@ -1,4 +1,12 @@ -{ osConfig, thisDevice, ... }: +{ lib, config, osConfig, thisDevice, ... }: { - services.tailscale-systray.enable = (thisDevice.isDesktop or false) && osConfig.my.tailscale.enable; + options.my.tailscale.enable = lib.mkOption { + type = lib.types.bool; + default = (thisDevice.isDesktop or false) && osConfig.my.tailscale.enable; + description = "Whether to enable the Tailscale system tray applet. Defaults to true on desktops with Tailscale enabled."; + }; + + config = lib.mkIf config.my.tailscale.enable { + services.tailscale-systray.enable = true; + }; } diff --git a/homeModules/templates.nix b/homeModules/templates.nix index 71d2e0b8..e0a6df2c 100644 --- a/homeModules/templates.nix +++ b/homeModules/templates.nix @@ -1,12 +1,17 @@ +{ lib, config, ... }: { - home.file = { - "Templates/Empty file".text = ""; - "Templates/Empty bash script".text = '' - #!/usr/bin/env bash - # abort on error, undefined variables - set -eu - # print commands before execution - set -x - ''; + options.my.templates.enable = lib.mkEnableOption "file templates"; + + config = lib.mkIf config.my.templates.enable { + home.file = { + "Templates/Empty file".text = ""; + "Templates/Empty bash script".text = '' + #!/usr/bin/env bash + # abort on error, undefined variables + set -eu + # print commands before execution + set -x + ''; + }; }; } diff --git a/homeModules/zsh-basics.nix b/homeModules/zsh-basics.nix index 0b0e2818..50e116aa 100644 --- a/homeModules/zsh-basics.nix +++ b/homeModules/zsh-basics.nix @@ -1,13 +1,18 @@ +{ lib, config, ... }: { - programs = { - command-not-found.enable = true; - dircolors.enable = true; + options.my.zsh.enable = lib.mkEnableOption "zsh with basic settings"; - zsh = { - enable = true; - syntaxHighlighting.enable = true; - autosuggestion.enable = true; - enableVteIntegration = true; + config = lib.mkIf config.my.zsh.enable { + programs = { + command-not-found.enable = true; + dircolors.enable = true; + + zsh = { + enable = true; + syntaxHighlighting.enable = true; + autosuggestion.enable = true; + enableVteIntegration = true; + }; }; }; } diff --git a/nixosConfigurations.nix b/nixosConfigurations.nix index c0d3a80b..1c39c232 100644 --- a/nixosConfigurations.nix +++ b/nixosConfigurations.nix @@ -96,16 +96,7 @@ forDevice ( useGlobalPkgs = true; useUserPackages = true; users = home-manager-users; - sharedModules = [ - { home.stateVersion = "22.11"; } - # keep-sorted start - self.homeModules.gnome-extensions - self.homeModules.nano - self.homeModules.tailscale - self.homeModules.templates - self.homeModules.zsh-basics - # keep-sorted end - ]; + sharedModules = [ { home.stateVersion = "22.11"; } ] ++ builtins.attrValues self.homeModules; }; time.timeZone = "Europe/Berlin"; From 9bff3f718f51080897ade7eda4de06611675f5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 16:04:27 +0200 Subject: [PATCH 0492/1295] ditributed builds: use fqdn if available --- devices.nix | 1 + nixosModules/distributed-builds.nix | 31 ++++++++++++++++++----------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/devices.nix b/devices.nix index 7313e7b2..a4fbeb48 100644 --- a/devices.nix +++ b/devices.nix @@ -26,6 +26,7 @@ in }; forgejo-runner-1 = { system = "aarch64-linux"; + publicFqdn = "forgejo-runner-1.dev.zerforschen.plus"; distributedBuilds = { isBuilder = true; speedFactor = 1; diff --git a/nixosModules/distributed-builds.nix b/nixosModules/distributed-builds.nix index 50d9ee66..84628e4b 100644 --- a/nixosModules/distributed-builds.nix +++ b/nixosModules/distributed-builds.nix @@ -21,13 +21,14 @@ let _: v: (v.distributedBuilds or { }).isBuilder or false ) allDevices; + sshHostname = m: m.publicFqdn or m.hostName; + buildServerKnownHosts = lib.pipe buildServerDevices [ (lib.filterAttrs (_: v: v.distributedBuilds ? hostPublicKey)) - (lib.mapAttrs ( - _: v: { - publicKey = v.distributedBuilds.hostPublicKey; - } - )) + (lib.mapAttrs (name: v: { + publicKey = v.distributedBuilds.hostPublicKey; + hostNames = [ (v.publicFqdn or name) ]; + })) ]; remoteBuildServerDevices = builtins.filter ( @@ -37,7 +38,7 @@ let buildMachines = map ( m: { - hostName = m.hostName; + hostName = sshHostname m; systems = [ m.system ]; sshUser = buildUser; sshKey = clientSshKeyPath; @@ -65,6 +66,8 @@ in # All machines { nix.settings = { + #fallback = true; + connect-timeout = 5; trusted-public-keys = lib.pipe buildServerDevices [ (lib.mapAttrsToList (_: v: v.distributedBuilds.storeSigningPublicKey or null)) (builtins.filter (k: k != null)) @@ -103,11 +106,15 @@ in programs.ssh = { knownHosts = buildServerKnownHosts; extraConfig = lib.concatStringsSep "\n" ( - lib.mapAttrsToList (name: _: '' - Match originalhost ${name} user ${buildUser} - IdentityFile ${clientSshKeyPath} - IdentitiesOnly yes - '') buildServerDevices + lib.mapAttrsToList (name: v: + let + names = lib.unique [ name (v.publicFqdn or name) ]; + in + '' + Match originalhost ${lib.concatStringsSep "," names} user ${buildUser} + IdentityFile ${clientSshKeyPath} + IdentitiesOnly yes + '') buildServerDevices ); }; nix = { @@ -115,7 +122,7 @@ in buildMachines = buildMachines; settings = { builders-use-substitutes = true; - substituters = map (m: "ssh-ng://${buildUser}@${m.hostName}") ( + substituters = map (m: "ssh-ng://${buildUser}@${sshHostname m}") ( builtins.filter (m: m.distributedBuilds ? storeSigningPublicKey) remoteBuildServerDevices ); }; From 7de5751743ccba459fbde3b1a11c44b4af13ac31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 16:13:47 +0200 Subject: [PATCH 0493/1295] distributed builds: add assertions, nix fmt --- homeModules/tailscale.nix | 8 +++++- nixosModules/distributed-builds.nix | 41 ++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/homeModules/tailscale.nix b/homeModules/tailscale.nix index 5f51fc96..686bf840 100644 --- a/homeModules/tailscale.nix +++ b/homeModules/tailscale.nix @@ -1,4 +1,10 @@ -{ lib, config, osConfig, thisDevice, ... }: +{ + lib, + config, + osConfig, + thisDevice, + ... +}: { options.my.tailscale.enable = lib.mkOption { type = lib.types.bool; diff --git a/nixosModules/distributed-builds.nix b/nixosModules/distributed-builds.nix index 84628e4b..c08d6573 100644 --- a/nixosModules/distributed-builds.nix +++ b/nixosModules/distributed-builds.nix @@ -25,15 +25,17 @@ let buildServerKnownHosts = lib.pipe buildServerDevices [ (lib.filterAttrs (_: v: v.distributedBuilds ? hostPublicKey)) - (lib.mapAttrs (name: v: { - publicKey = v.distributedBuilds.hostPublicKey; - hostNames = [ (v.publicFqdn or name) ]; - })) + (lib.mapAttrs ( + name: v: { + publicKey = v.distributedBuilds.hostPublicKey; + hostNames = [ (v.publicFqdn or name) ]; + } + )) ]; - remoteBuildServerDevices = builtins.filter ( - m: m.hostName != config.networking.hostName - ) (lib.mapAttrsToList (name: v: v // { hostName = name; }) buildServerDevices); + remoteBuildServerDevices = builtins.filter (m: m.hostName != config.networking.hostName) ( + lib.mapAttrsToList (name: v: v // { hostName = name; }) buildServerDevices + ); buildMachines = map ( m: @@ -65,6 +67,20 @@ in # All machines { + assertions = + lib.mapAttrsToList (name: v: { + assertion = v.distributedBuilds ? hostPublicKey && v.distributedBuilds ? storeSigningPublicKey; + message = "devices.${name}: isBuilder = true requires distributedBuilds.hostPublicKey and distributedBuilds.storeSigningPublicKey"; + }) buildServerDevices + ++ lib.mapAttrsToList (name: v: { + assertion = lib.hasPrefix "ssh-" v.distributedBuilds.clientPublicKey; + message = "devices.${name}: distributedBuilds.clientPublicKey must start with 'ssh-'"; + }) (lib.filterAttrs (_: v: (v.distributedBuilds or { }) ? clientPublicKey) allDevices) + ++ lib.mapAttrsToList (name: v: { + assertion = builtins.match ".+:.+" v.distributedBuilds.storeSigningPublicKey != null; + message = "devices.${name}: distributedBuilds.storeSigningPublicKey must be in ':' format"; + }) (lib.filterAttrs (_: v: (v.distributedBuilds or { }) ? storeSigningPublicKey) allDevices); + nix.settings = { #fallback = true; connect-timeout = 5; @@ -106,15 +122,20 @@ in programs.ssh = { knownHosts = buildServerKnownHosts; extraConfig = lib.concatStringsSep "\n" ( - lib.mapAttrsToList (name: v: + lib.mapAttrsToList ( + name: v: let - names = lib.unique [ name (v.publicFqdn or name) ]; + names = lib.unique [ + name + (v.publicFqdn or name) + ]; in '' Match originalhost ${lib.concatStringsSep "," names} user ${buildUser} IdentityFile ${clientSshKeyPath} IdentitiesOnly yes - '') buildServerDevices + '' + ) buildServerDevices ); }; nix = { From d2acd47e715a97240c2136fefda4a10654e2c152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 16:29:34 +0200 Subject: [PATCH 0494/1295] move some imports to desktop only --- nixosConfigurations.nix | 36 ++++++++++++------------- nixosModules/muede-desktop-settings.nix | 3 --- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/nixosConfigurations.nix b/nixosConfigurations.nix index 1c39c232..55af6119 100644 --- a/nixosConfigurations.nix +++ b/nixosConfigurations.nix @@ -45,10 +45,6 @@ forDevice ( # keep-sorted start home-manager.nixosModules.home-manager lanzaboote.nixosModules.lanzaboote - nova-shell.nixosModules.default - servicepoint-cli.nixosModules.default - servicepoint-simulator.nixosModules.default - servicepoint-tanks.nixosModules.default stylix.nixosModules.stylix zerforschen-plus.nixosModules.default # keep-sorted end @@ -80,15 +76,32 @@ forDevice ( lixIsNix.enable = true; openssh.enable = true; overlays.unstable.enable = true; - overlays.vscodeExtensions.enable = true; # prometheusNode.enable = true; systemdBoot.enable = true; tailscale.enable = true; # keep-sorted end + + # keep-sorted start + enDe.enable = isDesktop; + firmwareUpdates.enable = isDesktop; + gnome.enable = isDesktop; + kdeconnect.enable = isDesktop; + modernDesktop.enable = isDesktop; + nixLd.enable = isDesktop; + overlays.vscodeExtensions.enable = isDesktop; + quietBoot.enable = isDesktop; + stylix.enable = isDesktop; + # keep-sorted end }; } ] ++ lib.optionals isDesktop [ + inputs.niri.nixosModules.niri + nova-shell.nixosModules.default + servicepoint-cli.nixosModules.default + servicepoint-simulator.nixosModules.default + servicepoint-tanks.nixosModules.default + # Desktop config { home-manager = { @@ -106,19 +119,6 @@ forDevice ( daemonCPUSchedPolicy = "idle"; daemonIOSchedClass = "idle"; }; - - my = { - # keep-sorted start - enDe.enable = true; - firmwareUpdates.enable = true; - gnome.enable = true; - kdeconnect.enable = true; - modernDesktop.enable = true; - nixLd.enable = true; - quietBoot.enable = true; - stylix.enable = true; - # keep-sorted end - }; } ]; } diff --git a/nixosModules/muede-desktop-settings.nix b/nixosModules/muede-desktop-settings.nix index 8f25f62c..980af137 100644 --- a/nixosModules/muede-desktop-settings.nix +++ b/nixosModules/muede-desktop-settings.nix @@ -2,12 +2,9 @@ lib, config, pkgs, - niri, ... }: { - imports = [ niri.nixosModules.niri ]; - options.my.muedeDesktopSettings.enable = lib.mkEnableOption "muede desktop settings (Firefox, Logitech, RDP)"; config = lib.mkIf config.my.muedeDesktopSettings.enable { From 63ce7eac05ea8610ebb2cf4b9933d5f5e08619e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 16:32:26 +0200 Subject: [PATCH 0495/1295] move allowedUnfreePackages into my namespace --- nixosConfigurations/damocles/android-dev.nix | 2 +- nixosConfigurations/damocles/claude-container.nix | 2 +- nixosModules/allowed-unfree-list.nix | 4 ++-- nixosModules/intel-graphics.nix | 2 +- nixosModules/steam.nix | 2 +- nixosModules/user-muede.nix | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nixosConfigurations/damocles/android-dev.nix b/nixosConfigurations/damocles/android-dev.nix index ea5432c8..f484e6a7 100644 --- a/nixosConfigurations/damocles/android-dev.nix +++ b/nixosConfigurations/damocles/android-dev.nix @@ -12,7 +12,7 @@ in { nixpkgs.config.android_sdk.accept_license = true; - allowedUnfreePackages = [ + my.allowedUnfreePackages = [ "android-sdk-cmdline-tools" "android-sdk-platform-tools" "android-sdk-tools" diff --git a/nixosConfigurations/damocles/claude-container.nix b/nixosConfigurations/damocles/claude-container.nix index c568243b..7df7b246 100644 --- a/nixosConfigurations/damocles/claude-container.nix +++ b/nixosConfigurations/damocles/claude-container.nix @@ -6,7 +6,7 @@ { my.overlays.unstable.enable = true; - allowedUnfreePackages = [ "claude-code" ]; + my.allowedUnfreePackages = [ "claude-code" ]; environment.systemPackages = with pkgs; [ unstable.claude-code diff --git a/nixosModules/allowed-unfree-list.nix b/nixosModules/allowed-unfree-list.nix index 7bfa7586..2aee96f7 100644 --- a/nixosModules/allowed-unfree-list.nix +++ b/nixosModules/allowed-unfree-list.nix @@ -1,6 +1,6 @@ { lib, config, ... }: { - options.allowedUnfreePackages = lib.mkOption { + options.my.allowedUnfreePackages = lib.mkOption { type = lib.types.listOf lib.types.str; default = [ ]; example = [ "steam" ]; @@ -10,7 +10,7 @@ nixpkgs.config = { # https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085 allowUnfreePredicate = lib.mkDefault ( - pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages + pkg: builtins.elem (lib.getName pkg) config.my.allowedUnfreePackages ); }; }; diff --git a/nixosModules/intel-graphics.nix b/nixosModules/intel-graphics.nix index b3674891..619af5ad 100644 --- a/nixosModules/intel-graphics.nix +++ b/nixosModules/intel-graphics.nix @@ -22,6 +22,6 @@ ]; }; environment.systemPackages = with pkgs; [ nvtopPackages.intel ]; - allowedUnfreePackages = [ "intel-ocl" ]; + my.allowedUnfreePackages = [ "intel-ocl" ]; }; } diff --git a/nixosModules/steam.nix b/nixosModules/steam.nix index 78bbf714..3a4f25a4 100644 --- a/nixosModules/steam.nix +++ b/nixosModules/steam.nix @@ -40,7 +40,7 @@ ]; }; - allowedUnfreePackages = [ + my.allowedUnfreePackages = [ "steam" "steam-original" "steam-run" diff --git a/nixosModules/user-muede.nix b/nixosModules/user-muede.nix index 20f9cdb4..078cb964 100644 --- a/nixosModules/user-muede.nix +++ b/nixosModules/user-muede.nix @@ -31,7 +31,7 @@ nix.settings.trusted-users = [ "muede" ]; - allowedUnfreePackages = [ + my.allowedUnfreePackages = [ "rider" "pycharm-professional" "jetbrains-toolbox" From d75e91b7bc10dddec3c7c296f415386311093628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 16:33:56 +0200 Subject: [PATCH 0496/1295] group options in my namespace --- .../damocles/claude-container.nix | 6 ++++-- nixosConfigurations/muede-lpt2/default.nix | 18 +++++++++++------- nixosConfigurations/muede-pc2/default.nix | 18 +++++++++++------- nixosConfigurations/ronja-pc/default.nix | 12 ++++++++---- nixosModules/gnome.nix | 6 +++--- 5 files changed, 37 insertions(+), 23 deletions(-) diff --git a/nixosConfigurations/damocles/claude-container.nix b/nixosConfigurations/damocles/claude-container.nix index 7df7b246..aea9343f 100644 --- a/nixosConfigurations/damocles/claude-container.nix +++ b/nixosConfigurations/damocles/claude-container.nix @@ -5,8 +5,10 @@ }: { - my.overlays.unstable.enable = true; - my.allowedUnfreePackages = [ "claude-code" ]; + my = { + allowedUnfreePackages = [ "claude-code" ]; + overlays.unstable.enable = true; + }; environment.systemPackages = with pkgs; [ unstable.claude-code diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index 78c9d553..f52d735e 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -5,13 +5,17 @@ ]; config = { - my.users.muede.enable = true; - my.wineGaming.enable = true; - my.steam.enable = true; - my.podman.enable = true; - my.muedeDesktopSettings.enable = true; - my.intelGraphics.enable = true; - my.secureBoot.enable = true; + my = { + # keep-sorted start + intelGraphics.enable = true; + muedeDesktopSettings.enable = true; + podman.enable = true; + secureBoot.enable = true; + steam.enable = true; + users.muede.enable = true; + wineGaming.enable = true; + # keep-sorted end + }; nix.settings.extra-platforms = [ "aarch64-linux" diff --git a/nixosConfigurations/muede-pc2/default.nix b/nixosConfigurations/muede-pc2/default.nix index 4686ffbf..42f77b3d 100644 --- a/nixosConfigurations/muede-pc2/default.nix +++ b/nixosConfigurations/muede-pc2/default.nix @@ -7,13 +7,17 @@ ]; config = { - my.users.muede.enable = true; - my.wineGaming.enable = true; - my.steam.enable = true; - my.podman.enable = true; - my.muedeDesktopSettings.enable = true; - my.amdGraphics.enable = true; - my.secureBoot.enable = true; + my = { + # keep-sorted start + amdGraphics.enable = true; + muedeDesktopSettings.enable = true; + podman.enable = true; + secureBoot.enable = true; + steam.enable = true; + users.muede.enable = true; + wineGaming.enable = true; + # keep-sorted end + }; boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; nix.settings.extra-platforms = [ diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index 85227ff5..2a56407d 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -5,10 +5,14 @@ ]; config = { - my.users.ronja.enable = true; - my.steam.enable = true; - my.wineGaming.enable = true; - my.muedeDesktopSettings.enable = true; + my = { + # keep-sorted start + muedeDesktopSettings.enable = true; + steam.enable = true; + users.ronja.enable = true; + wineGaming.enable = true; + # keep-sorted end + }; # Configure keymap in X11 services.xserver.xkb = { diff --git a/nixosModules/gnome.nix b/nixosModules/gnome.nix index 83113738..fd195e89 100644 --- a/nixosModules/gnome.nix +++ b/nixosModules/gnome.nix @@ -5,9 +5,9 @@ ... }: { - options = { - my.gnome.enable = lib.mkEnableOption "GNOME desktop environment"; - my.gnome.keep-default-apps = lib.mkEnableOption "keep gnome default apps"; + options.my.gnome = { + enable = lib.mkEnableOption "GNOME desktop environment"; + keep-default-apps = lib.mkEnableOption "keep gnome default apps"; }; config = lib.mkIf config.my.gnome.enable ( From a2494f52134980e9b0ae7a87df494afb45fca4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 17:11:13 +0200 Subject: [PATCH 0497/1295] ssh: block sleep while conntections acive --- nixosModules/openssh.nix | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/nixosModules/openssh.nix b/nixosModules/openssh.nix index bed46f8b..f1ba770b 100644 --- a/nixosModules/openssh.nix +++ b/nixosModules/openssh.nix @@ -1,4 +1,10 @@ -{ lib, config, ... }: +{ + lib, + config, + pkgs, + thisDevice, + ... +}: { options.my.openssh.enable = lib.mkEnableOption "OpenSSH server"; @@ -12,5 +18,35 @@ KbdInteractiveAuthentication = false; }; }; + + # On desktops, hold a systemd sleep inhibitor while SSH connections are active + security.pam.services.sshd.rules.session.ssh-inhibit = lib.mkIf (thisDevice.isDesktop or false) { + order = 10000; + control = "optional"; + modulePath = "${pkgs.pam}/lib/security/pam_exec.so"; + args = [ + "quiet" + "${pkgs.writeShellScript "ssh-inhibit-pam" '' + PIDFILE="/run/ssh-inhibitor-''${PPID}.pid" + case "''${PAM_TYPE:-}" in + open) + ${pkgs.systemd}/bin/systemd-inhibit \ + --what=sleep \ + --who=sshd \ + --why="SSH session active" \ + --mode=block \ + sleep infinity & + echo $! > "$PIDFILE" + ;; + close) + if [ -f "$PIDFILE" ]; then + kill "$(cat "$PIDFILE")" 2>/dev/null || true + rm -f "$PIDFILE" + fi + ;; + esac + ''}" + ]; + }; }; } From edc2e50a9bde2b2b3c46defd906137d201656ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 3 May 2026 23:26:37 +0200 Subject: [PATCH 0498/1295] timezone UTC for non desktop devices --- nixosConfigurations.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixosConfigurations.nix b/nixosConfigurations.nix index 55af6119..60822839 100644 --- a/nixosConfigurations.nix +++ b/nixosConfigurations.nix @@ -66,6 +66,8 @@ forDevice ( doc.enable = false; }; + time.timeZone = lib.mkDefault "Etc/UTC"; + my = { # keep-sorted start autoupdate.enable = true; From 90dfef044ce781bfc49ad5e09487e6c1e16c7707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Wed, 6 May 2026 23:32:08 +0200 Subject: [PATCH 0499/1295] ssh: fix prevent sleep on open ssh conn --- nixosModules/openssh.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixosModules/openssh.nix b/nixosModules/openssh.nix index f1ba770b..92eb5f65 100644 --- a/nixosModules/openssh.nix +++ b/nixosModules/openssh.nix @@ -29,7 +29,7 @@ "${pkgs.writeShellScript "ssh-inhibit-pam" '' PIDFILE="/run/ssh-inhibitor-''${PPID}.pid" case "''${PAM_TYPE:-}" in - open) + open_session) ${pkgs.systemd}/bin/systemd-inhibit \ --what=sleep \ --who=sshd \ @@ -38,7 +38,7 @@ sleep infinity & echo $! > "$PIDFILE" ;; - close) + close_session) if [ -f "$PIDFILE" ]; then kill "$(cat "$PIDFILE")" 2>/dev/null || true rm -f "$PIDFILE" From 9d2ecaa0105c3a1775fc852d14290c425a34f58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 7 May 2026 18:21:38 +0200 Subject: [PATCH 0500/1295] lpt2: split containers --- nixosConfigurations/muede-lpt2/containers.nix | 57 +++++++++++++++++++ nixosConfigurations/muede-lpt2/default.nix | 54 +----------------- 2 files changed, 58 insertions(+), 53 deletions(-) create mode 100644 nixosConfigurations/muede-lpt2/containers.nix diff --git a/nixosConfigurations/muede-lpt2/containers.nix b/nixosConfigurations/muede-lpt2/containers.nix new file mode 100644 index 00000000..7033b52e --- /dev/null +++ b/nixosConfigurations/muede-lpt2/containers.nix @@ -0,0 +1,57 @@ +{ self, ... }: +{ + config = { + boot.enableContainers = true; + virtualisation.containers.enable = true; + + containers.damocles = { + autoStart = false; + privateNetwork = false; + path = self.nixosConfigurations.damocles.config.system.build.toplevel; + bindMounts."/etc/nix/distributed-build-key" = { + hostPath = "/etc/nix/distributed-build-key"; + isReadOnly = true; + }; + bindMounts."/persist/damocles-ssh" = { + hostPath = "/persist/damocles-ssh"; + isReadOnly = true; + }; + bindMounts."/persist/damocles-lab" = { + hostPath = "/persist/damocles-lab"; + isReadOnly = false; + }; + }; + + containers.damocles-lab = { + autoStart = false; + privateNetwork = false; + path = self.nixosConfigurations.damocles-lab.config.system.build.toplevel; + bindMounts."/etc/nix/distributed-build-key" = { + hostPath = "/etc/nix/distributed-build-key"; + isReadOnly = true; + }; + bindMounts."/workspace" = { + hostPath = "/persist/damocles-lab"; + isReadOnly = false; + }; + bindMounts."/persist/damocles-ssh" = { + hostPath = "/persist/damocles-ssh"; + isReadOnly = true; + }; + }; + + # Global DefaultTimeoutStopSec is 10s (modern-desktop.nix), which kills systemd-nspawn + # before it finishes halting, leaving cgroups busy and breaking restarts. + systemd.services."container@damocles".serviceConfig = { + TimeoutStopSec = "60s"; + # After a SIGKILL of nspawn, the kernel needs a moment to reap its cgroups. + # Without this, the immediate restart attempt fails with "Device or resource busy". + RestartSec = "5s"; + }; + + systemd.services."container@damocles-lab".serviceConfig = { + TimeoutStopSec = "60s"; + RestartSec = "5s"; + }; + }; +} diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index f52d735e..be7927cf 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -1,6 +1,7 @@ { self, ... }: { imports = [ + ./containers.nix ./hardware.nix ]; @@ -64,58 +65,5 @@ ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; - - containers.damocles = { - autoStart = false; - privateNetwork = false; - path = self.nixosConfigurations.damocles.config.system.build.toplevel; - bindMounts."/etc/nix/distributed-build-key" = { - hostPath = "/etc/nix/distributed-build-key"; - isReadOnly = true; - }; - bindMounts."/persist/damocles-ssh" = { - hostPath = "/persist/damocles-ssh"; - isReadOnly = true; - }; - bindMounts."/persist/damocles-lab" = { - hostPath = "/persist/damocles-lab"; - isReadOnly = false; - }; - }; - - containers.damocles-lab = { - autoStart = false; - privateNetwork = false; - path = self.nixosConfigurations.damocles-lab.config.system.build.toplevel; - bindMounts."/etc/nix/distributed-build-key" = { - hostPath = "/etc/nix/distributed-build-key"; - isReadOnly = true; - }; - bindMounts."/workspace" = { - hostPath = "/persist/damocles-lab"; - isReadOnly = false; - }; - bindMounts."/persist/damocles-ssh" = { - hostPath = "/persist/damocles-ssh"; - isReadOnly = true; - }; - }; - - # Global DefaultTimeoutStopSec is 10s (modern-desktop.nix), which kills systemd-nspawn - # before it finishes halting, leaving cgroups busy and breaking restarts. - systemd.services."container@damocles".serviceConfig = { - TimeoutStopSec = "60s"; - # After a SIGKILL of nspawn, the kernel needs a moment to reap its cgroups. - # Without this, the immediate restart attempt fails with "Device or resource busy". - RestartSec = "5s"; - }; - - systemd.services."container@damocles-lab".serviceConfig = { - TimeoutStopSec = "60s"; - RestartSec = "5s"; - }; - - boot.enableContainers = true; - virtualisation.containers.enable = true; }; } From 1ca757fe95faad6f23fc0369222384502d9fda11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 7 May 2026 21:09:22 +0200 Subject: [PATCH 0501/1295] update nova-shell --- flake.lock | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 764d4217..a74a8938 100644 --- a/flake.lock +++ b/flake.lock @@ -143,6 +143,21 @@ "type": "github" } }, + "crane_2": { + "locked": { + "lastModified": 1777830388, + "narHash": "sha256-2uoQAqUk2H0ijQtGiWAyNeQYGYc6yfAcRRLlJAz4Gp8=", + "owner": "ipetkov", + "repo": "crane", + "rev": "d459c1350e96ce1a7e3859c513ef5e9869d67d6f", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -636,6 +651,7 @@ }, "nova-shell": { "inputs": { + "crane": "crane_2", "nixpkgs": [ "nixpkgs-unstable" ], @@ -643,11 +659,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1777656272, - "narHash": "sha256-OcxjycGuzEeU6ZbX4SjSx4YVKcDlaZm8gdSvEFGowoo=", + "lastModified": 1778180483, + "narHash": "sha256-35cMiZn5DAnYFpKFdWg5dxW7hLO3/ey743ED6yV3pL8=", "ref": "refs/heads/main", - "rev": "40cc681e9a36320659175f240e9ccc3f3041a7e9", - "revCount": 598, + "rev": "dfa3840d97186fef3480b49f289acd3ae707ee27", + "revCount": 626, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, From 5188d951ef09aede3706331114adeb55f7fead31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 7 May 2026 23:10:49 +0200 Subject: [PATCH 0502/1295] misc installs --- homeConfigurations/muede/default.nix | 1 + nixosConfigurations/damocles/claude-container.nix | 1 + nixosConfigurations/damocles/default.nix | 1 + 3 files changed, 3 insertions(+) diff --git a/homeConfigurations/muede/default.nix b/homeConfigurations/muede/default.nix index 17c66a09..c2293ca2 100644 --- a/homeConfigurations/muede/default.nix +++ b/homeConfigurations/muede/default.nix @@ -73,6 +73,7 @@ arduino arduino-cli arduino-ide + btop claude-code dconf2nix foliate diff --git a/nixosConfigurations/damocles/claude-container.nix b/nixosConfigurations/damocles/claude-container.nix index aea9343f..8093878b 100644 --- a/nixosConfigurations/damocles/claude-container.nix +++ b/nixosConfigurations/damocles/claude-container.nix @@ -18,6 +18,7 @@ gawk gnugrep curl + bintools ]; boot.isContainer = true; diff --git a/nixosConfigurations/damocles/default.nix b/nixosConfigurations/damocles/default.nix index c5eff0a5..a511d472 100644 --- a/nixosConfigurations/damocles/default.nix +++ b/nixosConfigurations/damocles/default.nix @@ -10,5 +10,6 @@ rustc clippy gh + buildPackages.stdenv.cc ]; } From 8a2379c60a85d54c92008046227bce5da8ae45ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:21:11 +0200 Subject: [PATCH 0503/1295] plan --- PLAN.md | 220 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 PLAN.md diff --git a/PLAN.md b/PLAN.md new file mode 100644 index 00000000..69875d1a --- /dev/null +++ b/PLAN.md @@ -0,0 +1,220 @@ +# hyperhive — Plan + +> **Status.** Planning doc for a new project. Lives at `~/Repos/nixos-configuration-claude/agent-system/PLAN.md` during planning; **moves to `~/Repos/hyperhive/PLAN.md`** once the repo is created. +> +> **Names.** +> - Repo: `hyperhive` +> - Host-side daemon (helper): **`hive-c0re`** — its own crate (daemon + CLI in one binary). +> - In-container harness: **`hive-ag3nt`** crate, with **two `[[bin]]` targets**: +> - `hive-ag3nt` — runs in each sub-agent container. +> - `hive-m1nd` — runs in the manager container (same crate, second `main.rs`, wires the manager tool surface). +> - Shared crate between `hive-c0re` and `hive-ag3nt` (wire protocol, MCP verb types, message shapes): **`hive-sh4re`**. +> +> **Relationship to damocles.** Damocles is a separate, currently-running setup. `hyperhive` is a new, independent system in its own repo. Damocles' existing `claude-container.nix` informs the agent-base template but is not a dependency. Eventually damocles migrates onto `hyperhive` — out of v1 scope. + +## What we're building + +A multi-Claude-Code-agent setup on a single host: + +- Each agent runs in its own **nixos-container** (the NixOS wrapper around `systemd-nspawn` — gives us `nixos-container update`, declarative configs, etc.). +- A **manager agent** (itself a nixos-container) coordinates: spawns/kills agents, routes inter-agent messages, filters relevance, summarises, gates lifecycle changes on user approval. +- Host-side Rust daemon **`hive-c0re`** owns container lifecycle, hosts the MCP transport, brokers messages, runs the dashboard, and orchestrates approval-via-git-commit. +- Inside each agent container, **`hive-ag3nt`** runs the agent turn loop (drives `claude` as a subprocess), provides the per-agent web UI, and is the MCP client for that agent. +- Inside the manager container, **`hive-m1nd`** runs the analogous loop with the manager's tool surface and `/agents/**` RW access. It's a second binary in the `hive-ag3nt` crate — same lib code, different `main.rs`. +- Wire protocol and types shared between `hive-c0re` and the harness live in **`hive-sh4re`**. + +## Architecture + +``` +┌────────────────── host ────────────────────────────────────┐ +│ │ +│ hive-c0re (Rust daemon, NixOS service) │ +│ ├── lifecycle : nixos-container CRUD + nixos-container │ +│ │ update on approved config commits │ +│ ├── broker : sqlite message store + routing │ +│ ├── mcp : per-socket MCP servers (see Sockets) │ +│ ├── approvals : git-commit-based change requests │ +│ └── dashboard : HTMX/SSE web UI │ +│ │ +│ /var/lib/hyperhive/ │ +│ ├── state-repo/ (world: who exists, etc.) │ +│ ├── shared-instructions/ (RO into every agent) │ +│ └── agents/ │ +│ ├── manager/ │ +│ │ ├── config/ (flake repo, manager's own setup) │ +│ │ ├── prompts/ (manager's role/CLAUDE.md) │ +│ │ └── state/ (RW for manager) │ +│ └── / │ +│ ├── config/ (flake repo, RW for manager, RO ag) │ +│ ├── prompts/ (RO inside agent) │ +│ └── state/ (RW for agent + manager) │ +│ │ +│ Sockets (one per principal — perms by mount location): │ +│ ├── /run/hyperhive/host.sock admin/CLI on host │ +│ ├── /run/hyperhive/manager.sock → manager container │ +│ └── /run/hyperhive/agents/.sock → that agent │ +│ │ +│ ┌─ nixos-container: manager ────────────────────┐ │ +│ │ hive-m1nd (Rust, hive-ag3nt crate) │ │ +│ │ ├ MCP client → /run/hyperhive/manager.sock │ │ +│ │ ├ turn loop driving `claude` │ │ +│ │ └ per-container web UI │ │ +│ │ /var/lib/hyperhive/agents/** bind RW │ │ +│ │ MCP tools (manager surface): │ │ +│ │ send(to, body, wait_for_reply: bool), │ │ +│ │ recv / next_event, │ │ +│ │ request_spawn, request_kill, │ │ +│ │ request_apply_commit, inject_peer_info, │ │ +│ │ update_shared_instructions │ │ +│ └────────────────────────────────────────────────┘ │ +│ │ +│ ┌─ nixos-container: agent- ───────────────┐ │ +│ │ hive-ag3nt (Rust) │ │ +│ │ MCP client → /run/hyperhive/agents/.sock │ +│ │ state/ RW, config/ + prompts/ + shared RO │ │ +│ │ MCP tools (agent surface): │ │ +│ │ send, recv, request_install │ │ +│ └────────────────────────────────────────────────┘ │ +└─────────────────────────────────────────────────────────────┘ +``` + +## Key model decisions + +**Sockets, not identity gating.** One unix socket per principal, bind-mounted into the right place. The socket *is* the principal — no `SO_PEERCRED` lookups, no token plumbing. Perms are filesystem perms on the host side, plus the fact that only the matching container has the bind-mount. Each socket runs the MCP tool surface appropriate to its principal. + +**Approvals are git commits.** `hive-c0re` maintains a `state-repo` on host that records the world (which agents exist, their roles, etc.). Per-agent flake configs (`agents//config/`) are themselves git repos. The manager edits clones with plain `git` CLI inside its container and asks `hive-c0re` to apply a commit via `request_apply_commit(agent, sha)`. `hive-c0re` queues it; once approved, fast-forwards `main` and reconciles state (rebuild containers, etc.). **No abstract "approval token" — the commit hash is the token.** + +**Approval UX evolves.** Early phases approve by CLI (`hive-c0re approve `) or even direct `git merge` on the host. The dashboard's commit-view UI is one of the last features built (so the system runs end-to-end on CLI long before the browser does anything useful). + +**Manager is a second binary in the same crate.** `hive-m1nd` lives in the `hive-ag3nt` crate as a second `[[bin]]`, sharing the crate's lib code. The two binaries differ in: +- Tool surface (manager's `main.rs` wires `request_spawn`/`request_kill`/`request_apply_commit`/`inject_peer_info`/`update_shared_instructions`). +- Bind-mounts (manager gets `agents/**` RW; agents get only their own `state/`). +- Auto-restart (manager is auto-restarted by `hive-c0re`; agents stay down once killed). +- The manager container is declared in the host NixOS module as a known container. + +**Manager concurrency = event loop.** `hive-m1nd` pulls from a heterogeneous `next_event` stream: inbound agent messages, replies to sync sends, lifecycle events from `hive-c0re` (crash, OOM, approval-resolved), and dashboard signals. One queue, claude turn per event. + +**Anthropic credentials.** Shared key on host, bind-mounted into every container. No per-agent keys in v1. + +**Workdir bootstrap.** Each agent's `state/` starts empty. Initial-task message tells the agent what to clone/set up. Manager can drop big artefacts into `state/` directly (it has RW) and pass the path as a message reference. + +## Riskiest assumptions (test in this order) + +1. **`nixos-container update` hot-reloads under the in-flight `nsresourced` / `mountfsd` / privateUsers patch stack** without nuking the running harness (and thus the `claude` session). Validated in Phase 1. +2. **The harness driving `claude` as a long-running turn loop is stable** — claude as a subprocess streaming output back; harness deciding when a turn ends; injecting inbox messages as new user turns. Validated in Phase 3. +3. **`hive-m1nd` (as a claude session) sensibly drives spawn / route / peer-injection.** Behavioural; only knowable by running it. Phase 4. +4. **`hive-c0re` throughput under multiple agents** — bursty messaging, MCP relay, sqlite writes. Likely fine; flag for measurement. + +## Phased path + +### Phase 0 — repo bootstrap +- Create `~/Repos/hyperhive/`, init flake. +- Cargo workspace: `hive-c0re/`, `hive-sh4re/`, `hive-ag3nt/` (the last with two `[[bin]]` targets — `hive-ag3nt` and `hive-m1nd`). All compile, all do nothing useful. +- NixOS module skeleton (`nix/modules/hive-c0re.nix`) that runs the daemon as a systemd service on the host. +- Agent base template (`nix/templates/agent-base.nix`) that builds a nixos-container including the `hive-ag3nt` binary. +- **Exit:** `nixos-container create test-agent --flake .#agent-base && nixos-container start test-agent` brings up a container whose `hive-ag3nt` prints "hello" and exits. + +### Phase 1 — container lifecycle + Risk 1 +- `hive-c0re`: open host admin socket (`/run/hyperhive/host.sock`); verbs `spawn(name)`, `kill(name)`, `rebuild(name)`, `list()`. Uses `nixos-container` underneath. +- CLI tool talking to the admin socket (same `hive-c0re` binary, subcommand-driven). +- Manually mutate an agent's config flake, call `rebuild`, observe whether `hive-ag3nt` survives. +- **Decision:** if hot-reload doesn't preserve the harness, that becomes a hard requirement of `hive-ag3nt`'s design (resume from disk state). Document the outcome. +- **Exit:** spawn / rebuild / kill via CLI is reliable; known behaviour for in-flight rebuilds. + +### Phase 2 — sockets + minimal MCP +- `hive-c0re` opens `manager.sock` and `agents/.sock` (one per spawned agent). Per-socket MCP server with the right tool surface baked in. Types from `hive-sh4re`. +- `hive-ag3nt`: MCP client (types from `hive-sh4re`), connects to its socket on startup, exchanges hello. +- Tools: agent gets `send(to, body)`, `recv()`. No persistence yet (in-memory). +- **Exit:** two test agents exchange messages through `hive-c0re` manually-driven. + +### Phase 3 — broker + turn loop +- `hive-c0re`: sqlite-backed message store (`messages` table; `id, sender, recipient, body, sent_at, delivered_at`). Survives `hive-c0re` restart. +- `hive-ag3nt` (lib): real turn loop. Reads from `recv`; feeds new messages as user turns to `claude`; captures output; calls `send` for outbound. Long-running. +- **Exit:** two `hive-ag3nt`-driven agents have a back-and-forth conversation through `hive-c0re`. + +### Phase 4 — `hive-m1nd` + privileged surface +- `hive-m1nd` binary (second `[[bin]]` in `hive-ag3nt`) wires the manager tool surface. +- Manager container declared in host NixOS module (auto-restart). Bind-mount `agents/**` RW. +- Manager socket gets the privileged tool surface: `request_spawn`/`request_kill`, `request_apply_commit`, `inject_peer_info`, `send(..., wait_for_reply=true)`. +- Smoke: attach a terminal to the manager container (`nixos-container root-login`); ask `hive-m1nd` to spawn an agent and route a message to it. +- **Exit:** manager spawns, routes, kills a child agent end-to-end; lifecycle still gated by manual CLI approval (no GUI yet). + +### Phase 5 — git-commit approval flow +- `state-repo` on host tracks world (agents directory listing, allow-lists, etc.). +- Per-agent `config/` flake repos created at spawn time. +- Manager's container: bind-mounted clones; uses plain `git` CLI to edit/commit. +- `request_apply_commit(name, sha)` queues a change in `hive-c0re`. Approval = CLI `hive-c0re approve `; on approve, `hive-c0re` fast-forwards `main` and reconciles (rebuild if config changed, run `nixos-container update`). +- Per-agent allow-list for `request_install`: in-list installs become auto-applied commits; novel pkgs become pending commits. +- **Exit:** manager adds a package to an agent → user approves on CLI → agent picks it up. + +### Phase 6 — per-agent web UI + dashboard MVP +- `hive-ag3nt` web UI module (in the crate's lib): HTTP on a per-container host port (host network): status, last messages, embedded terminal (xterm.js over WebSocket). Both `hive-ag3nt` and `hive-m1nd` binaries expose it. +- Dashboard served by `hive-c0re`: agent list, per-agent status, links to each agent's UI, link to manager's UI. +- No approval UI yet; users still approve via CLI. +- **Exit:** browser is a usable navigation layer over the whole system. + +### Phase 7 — dashboard commit view + polish +- Pending-commits view in the dashboard with diff rendering and Approve/Deny buttons (replaces the CLI approve step). +- Live message-flow view (`hive-c0re` sees all MCP relay traffic). +- `hive-c0re` event push into `hive-m1nd`'s `next_event` (crashes, OOM, approval resolved). +- Resource caps in nixos-container units (`MemoryMax`, `CPUQuota`). +- Migration plan for damocles' existing containers (separate doc). + +## Repo layout (target) + +``` +~/Repos/hyperhive/ +├── hive-c0re/ # host-side Rust crate (daemon + CLI) +│ ├── src/ +│ │ ├── main.rs +│ │ ├── lifecycle.rs # nixos-container CRUD +│ │ ├── broker.rs # sqlite message store +│ │ ├── mcp/ # MCP servers (per-socket) +│ │ ├── approvals.rs # git-commit change requests +│ │ ├── state_repo.rs # world-state git repo +│ │ └── dashboard/ # HTMX/SSE web UI +│ └── Cargo.toml +├── hive-sh4re/ # shared crate (hive-c0re ↔ hive-ag3nt) +│ ├── src/ +│ │ ├── lib.rs +│ │ ├── protocol.rs # MCP wire types, verb shapes +│ │ └── message.rs # message types +│ └── Cargo.toml +├── hive-ag3nt/ # in-container harness crate; two binaries +│ ├── src/ +│ │ ├── lib.rs # shared harness code +│ │ ├── mcp_client.rs # MCP client over unix socket +│ │ ├── turn_loop.rs # claude subprocess driver +│ │ ├── web_ui.rs # per-container UI scaffolding +│ │ └── bin/ +│ │ ├── hive-ag3nt.rs # agent tool surface wiring +│ │ └── hive-m1nd.rs # manager tool surface wiring +│ └── Cargo.toml # [[bin]] hive-ag3nt + [[bin]] hive-m1nd +├── nix/ +│ ├── modules/hive-c0re.nix # NixOS module for the host +│ ├── templates/ +│ │ ├── agent-base.nix # base agent nixos-container (pulls hive-ag3nt) +│ │ └── manager.nix # manager nixos-container (pulls hive-m1nd) +│ └── overlay.nix # exposes the three crates + both bins as pkgs +├── web/ # static assets, HTMX templates +├── flake.nix +├── Cargo.toml # workspace +└── PLAN.md # this file +``` + +## Explicitly deferred / out of v1 scope + +- Per-agent API keys, cost attribution. +- Pooled / pre-warmed containers. +- Destroy verb on the `hive-c0re` API (use `rm` on host; `state-repo` records intent). +- Backup / replication of `agents/` state. +- Migration of existing damocles containers (later, separate effort). +- Anything about multiple hosts. + +## Open implementation decisions (resolve during build) + +- MCP relay wire format: stdio MCP shuttled through the socket vs custom JSON-RPC matching MCP semantics. Default: stick with MCP stdio, `hive-c0re` multiplexes. +- Per-agent web UI tech: own small `axum` server in `hive-ag3nt`'s lib with embedded HTMX, plus xterm.js over WebSocket for the terminal. Reuse same stack as the dashboard. +- `state-repo` schema: filesystem-shaped (`agents//role.txt`, `agents//allow-list.txt`) vs single declarative file (`world.toml`). Lean filesystem-shaped — git diffs read naturally per agent. +- Whether `hive-m1nd` also auto-mounts `state-repo` RW or only via the `request_apply_commit` path. Lean: only via the verb (keeps the audit trail clean). +- Whether `hive-c0re` daemon and `hive-c0re` CLI are one binary (subcommands) or two binaries sharing a crate. Default: one binary, `hive-c0re serve` vs `hive-c0re approve ` etc. From ae7c5e18c69a17b9882c93ad625c3afa34a7cfee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:22:30 +0200 Subject: [PATCH 0504/1295] flake: rust devshell --- .gitignore | 3 +++ flake.lock | 48 +++++++++++++++++++++++++++++++++++++ flake.nix | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..8470fac9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/target +/result +/result-* diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..4e05f679 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1778430510, + "narHash": "sha256-Ti+ZBvW6yrWWAg2szExVTwCd4qOJ3KlVr1tFHfyfi8Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8fd9daa3db09ced9700431c5b7ad0e8ba199b575", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "treefmt-nix": "treefmt-nix" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775636079, + "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..8bd7c192 --- /dev/null +++ b/flake.nix @@ -0,0 +1,69 @@ +{ + description = "hyperhive — multi-Claude-Code-agent orchestration on nixos-containers"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + inputs@{ + self, + nixpkgs, + treefmt-nix, + }: + let + inherit (nixpkgs) lib; + systems = [ + "aarch64-linux" + "x86_64-linux" + ]; + treefmt-config = { + projectRootFile = "flake.nix"; + programs = { + keep-sorted.enable = true; + nixfmt.enable = true; + rustfmt.enable = true; + }; + }; + forAllSystems = + f: + lib.genAttrs systems ( + system: + f rec { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + treefmt-eval = treefmt-nix.lib.evalModule pkgs treefmt-config; + } + ); + in + { + devShells = forAllSystems ( + { pkgs, ... }: + { + default = pkgs.mkShell { + packages = with pkgs; [ + cargo + clippy + pkg-config + rust-analyzer + rustc + rustfmt + ]; + }; + } + ); + + formatter = forAllSystems ({ treefmt-eval, ... }: treefmt-eval.config.build.wrapper); + + checks = forAllSystems ( + { treefmt-eval, ... }: + { + formatting = treefmt-eval.config.build.check self; + } + ); + }; +} From 6686df93a50b0ee46dff71b665f424e203b2b21a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:24:55 +0200 Subject: [PATCH 0505/1295] cargo workspace skeleton --- Cargo.lock | 15 +++++++++++++++ Cargo.toml | 11 +++++++++++ hive-ag3nt/Cargo.toml | 12 ++++++++++++ hive-ag3nt/src/bin/hive-ag3nt.rs | 3 +++ hive-ag3nt/src/bin/hive-m1nd.rs | 3 +++ hive-ag3nt/src/lib.rs | 0 hive-c0re/Cargo.toml | 4 ++++ hive-c0re/src/main.rs | 3 +++ hive-sh4re/Cargo.toml | 4 ++++ hive-sh4re/src/lib.rs | 0 10 files changed, 55 insertions(+) create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 hive-ag3nt/Cargo.toml create mode 100644 hive-ag3nt/src/bin/hive-ag3nt.rs create mode 100644 hive-ag3nt/src/bin/hive-m1nd.rs create mode 100644 hive-ag3nt/src/lib.rs create mode 100644 hive-c0re/Cargo.toml create mode 100644 hive-c0re/src/main.rs create mode 100644 hive-sh4re/Cargo.toml create mode 100644 hive-sh4re/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..f7f27d88 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,15 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "hive-ag3nt" +version = "0.1.0" + +[[package]] +name = "hive-c0re" +version = "0.1.0" + +[[package]] +name = "hive-sh4re" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..bc136965 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,11 @@ +[workspace] +resolver = "3" +members = [ + "hive-ag3nt", + "hive-c0re", + "hive-sh4re", +] + +[workspace.package] +edition = "2024" +version = "0.1.0" diff --git a/hive-ag3nt/Cargo.toml b/hive-ag3nt/Cargo.toml new file mode 100644 index 00000000..c268836b --- /dev/null +++ b/hive-ag3nt/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "hive-ag3nt" +edition.workspace = true +version.workspace = true + +[[bin]] +name = "hive-ag3nt" +path = "src/bin/hive-ag3nt.rs" + +[[bin]] +name = "hive-m1nd" +path = "src/bin/hive-m1nd.rs" diff --git a/hive-ag3nt/src/bin/hive-ag3nt.rs b/hive-ag3nt/src/bin/hive-ag3nt.rs new file mode 100644 index 00000000..03c1e0cf --- /dev/null +++ b/hive-ag3nt/src/bin/hive-ag3nt.rs @@ -0,0 +1,3 @@ +fn main() { + println!("hive-ag3nt placeholder"); +} diff --git a/hive-ag3nt/src/bin/hive-m1nd.rs b/hive-ag3nt/src/bin/hive-m1nd.rs new file mode 100644 index 00000000..314550ca --- /dev/null +++ b/hive-ag3nt/src/bin/hive-m1nd.rs @@ -0,0 +1,3 @@ +fn main() { + println!("hive-m1nd placeholder"); +} diff --git a/hive-ag3nt/src/lib.rs b/hive-ag3nt/src/lib.rs new file mode 100644 index 00000000..e69de29b diff --git a/hive-c0re/Cargo.toml b/hive-c0re/Cargo.toml new file mode 100644 index 00000000..e0ef81d8 --- /dev/null +++ b/hive-c0re/Cargo.toml @@ -0,0 +1,4 @@ +[package] +name = "hive-c0re" +edition.workspace = true +version.workspace = true diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs new file mode 100644 index 00000000..629d0d0f --- /dev/null +++ b/hive-c0re/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("hive-c0re placeholder"); +} diff --git a/hive-sh4re/Cargo.toml b/hive-sh4re/Cargo.toml new file mode 100644 index 00000000..004c5f01 --- /dev/null +++ b/hive-sh4re/Cargo.toml @@ -0,0 +1,4 @@ +[package] +name = "hive-sh4re" +edition.workspace = true +version.workspace = true diff --git a/hive-sh4re/src/lib.rs b/hive-sh4re/src/lib.rs new file mode 100644 index 00000000..e69de29b From c67584c7c1e4887801e9a2d30410848e5cd652b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:33:25 +0200 Subject: [PATCH 0506/1295] flake: expose hyperhive package + nixos module + agent-base container --- flake.lock | 61 ++++++++++++++++++++++++++++++++++++ flake.nix | 33 +++++++++++++++++++ hive-ag3nt/src/lib.rs | 1 + hive-sh4re/src/lib.rs | 1 + nix/modules/hive-c0re.nix | 32 +++++++++++++++++++ nix/templates/agent-base.nix | 17 ++++++++++ 6 files changed, 145 insertions(+) create mode 100644 nix/modules/hive-c0re.nix create mode 100644 nix/templates/agent-base.nix diff --git a/flake.lock b/flake.lock index 4e05f679..b97b56a2 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,48 @@ { "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "naersk", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1752475459, + "narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=", + "owner": "nix-community", + "repo": "fenix", + "rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "naersk": { + "inputs": { + "fenix": "fenix", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1778151388, + "narHash": "sha256-lldMJPUeouEjO8/7aLuwhcsIw29vVihm2ZALzjiqfec=", + "owner": "nix-community", + "repo": "naersk", + "rev": "efdddff9ff4d8e7d0056d57ec67dac50f75ab8f6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1778430510, @@ -18,10 +61,28 @@ }, "root": { "inputs": { + "naersk": "naersk", "nixpkgs": "nixpkgs", "treefmt-nix": "treefmt-nix" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1752428706, + "narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "591e3b7624be97e4443ea7b5542c191311aa141d", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 8bd7c192..ad0007d2 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,10 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + naersk = { + url = "github:nix-community/naersk"; + inputs.nixpkgs.follows = "nixpkgs"; + }; treefmt-nix = { url = "github:numtide/treefmt-nix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -13,6 +17,7 @@ inputs@{ self, nixpkgs, + naersk, treefmt-nix, }: let @@ -37,10 +42,38 @@ inherit system; pkgs = nixpkgs.legacyPackages.${system}; treefmt-eval = treefmt-nix.lib.evalModule pkgs treefmt-config; + naersk-lib = pkgs.callPackage naersk { }; } ); in { + packages = forAllSystems ( + { naersk-lib, ... }: + { + default = naersk-lib.buildPackage { + src = ./.; + meta.description = "hyperhive workspace (hive-c0re, hive-ag3nt, hive-m1nd)"; + }; + } + ); + + overlays.default = final: prev: { + hyperhive = self.packages.${prev.stdenv.hostPlatform.system}.default; + }; + + nixosModules = { + agent-base = ./nix/templates/agent-base.nix; + hive-c0re = ./nix/modules/hive-c0re.nix; + }; + + nixosConfigurations.agent-base = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + self.nixosModules.agent-base + { nixpkgs.overlays = [ self.overlays.default ]; } + ]; + }; + devShells = forAllSystems ( { pkgs, ... }: { diff --git a/hive-ag3nt/src/lib.rs b/hive-ag3nt/src/lib.rs index e69de29b..8b137891 100644 --- a/hive-ag3nt/src/lib.rs +++ b/hive-ag3nt/src/lib.rs @@ -0,0 +1 @@ + diff --git a/hive-sh4re/src/lib.rs b/hive-sh4re/src/lib.rs index e69de29b..8b137891 100644 --- a/hive-sh4re/src/lib.rs +++ b/hive-sh4re/src/lib.rs @@ -0,0 +1 @@ + diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix new file mode 100644 index 00000000..f3e0caa4 --- /dev/null +++ b/nix/modules/hive-c0re.nix @@ -0,0 +1,32 @@ +{ + pkgs, + lib, + config, + ... +}: +let + cfg = config.services.hive-c0re; +in +{ + options.services.hive-c0re = { + enable = lib.mkEnableOption "hive-c0re — hyperhive coordinator daemon"; + package = lib.mkOption { + type = lib.types.package; + default = pkgs.hyperhive; + defaultText = lib.literalExpression "pkgs.hyperhive"; + description = "Package that provides /bin/hive-c0re."; + }; + }; + + config = lib.mkIf cfg.enable { + systemd.services.hive-c0re = { + description = "hyperhive coordinator daemon"; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = "${cfg.package}/bin/hive-c0re"; + Restart = "on-failure"; + RestartSec = 2; + }; + }; + }; +} diff --git a/nix/templates/agent-base.nix b/nix/templates/agent-base.nix new file mode 100644 index 00000000..af425b51 --- /dev/null +++ b/nix/templates/agent-base.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: +{ + boot.isContainer = true; + + environment.systemPackages = [ pkgs.hyperhive ]; + + systemd.services.hive-ag3nt = { + description = "hive-ag3nt harness"; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = "${pkgs.hyperhive}/bin/hive-ag3nt"; + Type = "oneshot"; + }; + }; + + system.stateVersion = "25.11"; +} From 27bc538fd724ae4debbeb19afbbf4c8914b09bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:43:54 +0200 Subject: [PATCH 0507/1295] plan: hive- prefix for managed containers --- PLAN.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PLAN.md b/PLAN.md index 69875d1a..9596cd82 100644 --- a/PLAN.md +++ b/PLAN.md @@ -54,7 +54,7 @@ A multi-Claude-Code-agent setup on a single host: │ ├── /run/hyperhive/manager.sock → manager container │ │ └── /run/hyperhive/agents/.sock → that agent │ │ │ -│ ┌─ nixos-container: manager ────────────────────┐ │ +│ ┌─ nixos-container: hive-manager ───────────────┐ │ │ │ hive-m1nd (Rust, hive-ag3nt crate) │ │ │ │ ├ MCP client → /run/hyperhive/manager.sock │ │ │ │ ├ turn loop driving `claude` │ │ @@ -68,7 +68,7 @@ A multi-Claude-Code-agent setup on a single host: │ │ update_shared_instructions │ │ │ └────────────────────────────────────────────────┘ │ │ │ -│ ┌─ nixos-container: agent- ───────────────┐ │ +│ ┌─ nixos-container: hive- ────────────────┐ │ │ │ hive-ag3nt (Rust) │ │ │ │ MCP client → /run/hyperhive/agents/.sock │ │ │ state/ RW, config/ + prompts/ + shared RO │ │ @@ -82,6 +82,8 @@ A multi-Claude-Code-agent setup on a single host: **Sockets, not identity gating.** One unix socket per principal, bind-mounted into the right place. The socket *is* the principal — no `SO_PEERCRED` lookups, no token plumbing. Perms are filesystem perms on the host side, plus the fact that only the matching container has the bind-mount. Each socket runs the MCP tool surface appropriate to its principal. +**Container naming.** All nixos-containers managed by `hive-c0re` are prefixed `hive-`. An agent named `foo` runs as nixos-container `hive-foo`; the manager runs as `hive-manager`. The prefix prevents collisions with other containers on the host and makes ownership obvious. On-disk paths (`/var/lib/hyperhive/agents/foo/`) and socket paths (`/run/hyperhive/agents/foo.sock`) use the bare logical name; the prefix lives only at the nixos-container layer. + **Approvals are git commits.** `hive-c0re` maintains a `state-repo` on host that records the world (which agents exist, their roles, etc.). Per-agent flake configs (`agents//config/`) are themselves git repos. The manager edits clones with plain `git` CLI inside its container and asks `hive-c0re` to apply a commit via `request_apply_commit(agent, sha)`. `hive-c0re` queues it; once approved, fast-forwards `main` and reconciles state (rebuild containers, etc.). **No abstract "approval token" — the commit hash is the token.** **Approval UX evolves.** Early phases approve by CLI (`hive-c0re approve `) or even direct `git merge` on the host. The dashboard's commit-view UI is one of the last features built (so the system runs end-to-end on CLI long before the browser does anything useful). @@ -115,7 +117,7 @@ A multi-Claude-Code-agent setup on a single host: - **Exit:** `nixos-container create test-agent --flake .#agent-base && nixos-container start test-agent` brings up a container whose `hive-ag3nt` prints "hello" and exits. ### Phase 1 — container lifecycle + Risk 1 -- `hive-c0re`: open host admin socket (`/run/hyperhive/host.sock`); verbs `spawn(name)`, `kill(name)`, `rebuild(name)`, `list()`. Uses `nixos-container` underneath. +- `hive-c0re`: open host admin socket (`/run/hyperhive/host.sock`); verbs `spawn(name)`, `kill(name)`, `rebuild(name)`, `list()`. Uses `nixos-container` underneath; container name on the host is `hive-`. - CLI tool talking to the admin socket (same `hive-c0re` binary, subcommand-driven). - Manually mutate an agent's config flake, call `rebuild`, observe whether `hive-ag3nt` survives. - **Decision:** if hot-reload doesn't preserve the harness, that becomes a hard requirement of `hive-ag3nt`'s design (resume from disk state). Document the outcome. @@ -134,7 +136,7 @@ A multi-Claude-Code-agent setup on a single host: ### Phase 4 — `hive-m1nd` + privileged surface - `hive-m1nd` binary (second `[[bin]]` in `hive-ag3nt`) wires the manager tool surface. -- Manager container declared in host NixOS module (auto-restart). Bind-mount `agents/**` RW. +- Manager container (`hive-manager`) declared in host NixOS module (auto-restart). Bind-mount `agents/**` RW. - Manager socket gets the privileged tool surface: `request_spawn`/`request_kill`, `request_apply_commit`, `inject_peer_info`, `send(..., wait_for_reply=true)`. - Smoke: attach a terminal to the manager container (`nixos-container root-login`); ask `hive-m1nd` to spawn an agent and route a message to it. - **Exit:** manager spawns, routes, kills a child agent end-to-end; lifecycle still gated by manual CLI approval (no GUI yet). From a63e9bdbfc99df148b8de4ef0609b85f58f22ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:46:13 +0200 Subject: [PATCH 0508/1295] plan: hive-agent- prefix for sub-agents --- PLAN.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PLAN.md b/PLAN.md index 9596cd82..fe5fd7a4 100644 --- a/PLAN.md +++ b/PLAN.md @@ -68,7 +68,7 @@ A multi-Claude-Code-agent setup on a single host: │ │ update_shared_instructions │ │ │ └────────────────────────────────────────────────┘ │ │ │ -│ ┌─ nixos-container: hive- ────────────────┐ │ +│ ┌─ nixos-container: hive-agent- ──────────┐ │ │ │ hive-ag3nt (Rust) │ │ │ │ MCP client → /run/hyperhive/agents/.sock │ │ │ state/ RW, config/ + prompts/ + shared RO │ │ @@ -82,7 +82,7 @@ A multi-Claude-Code-agent setup on a single host: **Sockets, not identity gating.** One unix socket per principal, bind-mounted into the right place. The socket *is* the principal — no `SO_PEERCRED` lookups, no token plumbing. Perms are filesystem perms on the host side, plus the fact that only the matching container has the bind-mount. Each socket runs the MCP tool surface appropriate to its principal. -**Container naming.** All nixos-containers managed by `hive-c0re` are prefixed `hive-`. An agent named `foo` runs as nixos-container `hive-foo`; the manager runs as `hive-manager`. The prefix prevents collisions with other containers on the host and makes ownership obvious. On-disk paths (`/var/lib/hyperhive/agents/foo/`) and socket paths (`/run/hyperhive/agents/foo.sock`) use the bare logical name; the prefix lives only at the nixos-container layer. +**Container naming.** All nixos-containers managed by `hive-c0re` are prefixed `hive-`. The manager runs as `hive-manager`. Sub-agents run as `hive-agent-` — the extra `-agent-` segment keeps sub-agents from colliding with the manager slot (even if someone names an agent `manager`) and makes ownership obvious. On-disk paths (`/var/lib/hyperhive/agents/foo/`) and socket paths (`/run/hyperhive/agents/foo.sock`) use the bare logical name; the prefixing lives only at the nixos-container layer. **Approvals are git commits.** `hive-c0re` maintains a `state-repo` on host that records the world (which agents exist, their roles, etc.). Per-agent flake configs (`agents//config/`) are themselves git repos. The manager edits clones with plain `git` CLI inside its container and asks `hive-c0re` to apply a commit via `request_apply_commit(agent, sha)`. `hive-c0re` queues it; once approved, fast-forwards `main` and reconciles state (rebuild containers, etc.). **No abstract "approval token" — the commit hash is the token.** @@ -117,7 +117,7 @@ A multi-Claude-Code-agent setup on a single host: - **Exit:** `nixos-container create test-agent --flake .#agent-base && nixos-container start test-agent` brings up a container whose `hive-ag3nt` prints "hello" and exits. ### Phase 1 — container lifecycle + Risk 1 -- `hive-c0re`: open host admin socket (`/run/hyperhive/host.sock`); verbs `spawn(name)`, `kill(name)`, `rebuild(name)`, `list()`. Uses `nixos-container` underneath; container name on the host is `hive-`. +- `hive-c0re`: open host admin socket (`/run/hyperhive/host.sock`); verbs `spawn(name)`, `kill(name)`, `rebuild(name)`, `list()`. Uses `nixos-container` underneath; container name on the host is `hive-agent-`. - CLI tool talking to the admin socket (same `hive-c0re` binary, subcommand-driven). - Manually mutate an agent's config flake, call `rebuild`, observe whether `hive-ag3nt` survives. - **Decision:** if hot-reload doesn't preserve the harness, that becomes a hard requirement of `hive-ag3nt`'s design (resume from disk state). Document the outcome. From a24dc14213526869bc8740250cc9c0365d1b4b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:47:05 +0200 Subject: [PATCH 0509/1295] hive-c0re: cli scaffolding (stubs) --- Cargo.toml | 10 +++++++ hive-c0re/Cargo.toml | 10 +++++++ hive-c0re/src/main.rs | 69 +++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 87 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bc136965..ec8e622f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,3 +9,13 @@ members = [ [workspace.package] edition = "2024" version = "0.1.0" + +[workspace.dependencies] +anyhow = "1" +clap = { version = "4", features = ["derive"] } +hive-sh4re = { path = "hive-sh4re" } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +tokio = { version = "1", features = ["io-util", "macros", "net", "process", "rt-multi-thread", "signal"] } +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/hive-c0re/Cargo.toml b/hive-c0re/Cargo.toml index e0ef81d8..be3ed947 100644 --- a/hive-c0re/Cargo.toml +++ b/hive-c0re/Cargo.toml @@ -2,3 +2,13 @@ name = "hive-c0re" edition.workspace = true version.workspace = true + +[dependencies] +anyhow.workspace = true +clap.workspace = true +hive-sh4re.workspace = true +serde.workspace = true +serde_json.workspace = true +tokio.workspace = true +tracing.workspace = true +tracing-subscriber.workspace = true diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index 629d0d0f..24f4ac8b 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -1,3 +1,68 @@ -fn main() { - println!("hive-c0re placeholder"); +use std::path::PathBuf; + +use anyhow::{Result, bail}; +use clap::{Parser, Subcommand}; + +#[derive(Parser)] +#[command(name = "hive-c0re", about = "hyperhive coordinator daemon and CLI")] +struct Cli { + #[command(subcommand)] + cmd: Cmd, +} + +#[derive(Subcommand)] +enum Cmd { + /// Run the coordinator daemon. + Serve { + /// Flake reference for the agent base template. + #[arg(long, default_value = "/etc/hyperhive#agent-base")] + agent_flake: String, + /// Path to the host admin socket. + #[arg(long, default_value = "/run/hyperhive/host.sock")] + socket: PathBuf, + }, + /// Spawn a new agent container (creates `hive-agent-`). + Spawn { name: String }, + /// Stop a managed container (graceful). + Kill { name: String }, + /// Apply pending config to a managed container. + Rebuild { name: String }, + /// List managed containers. + List, +} + +fn main() -> Result<()> { + tracing_subscriber::fmt() + .with_env_filter( + tracing_subscriber::EnvFilter::try_from_default_env() + .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")), + ) + .init(); + + let cli = Cli::parse(); + match cli.cmd { + Cmd::Serve { + agent_flake, + socket, + } => { + tracing::info!(?socket, %agent_flake, "serve: not yet implemented"); + bail!("serve not yet implemented"); + } + Cmd::Spawn { name } => { + tracing::info!(%name, "spawn: not yet implemented"); + bail!("spawn not yet implemented"); + } + Cmd::Kill { name } => { + tracing::info!(%name, "kill: not yet implemented"); + bail!("kill not yet implemented"); + } + Cmd::Rebuild { name } => { + tracing::info!(%name, "rebuild: not yet implemented"); + bail!("rebuild not yet implemented"); + } + Cmd::List => { + tracing::info!("list: not yet implemented"); + bail!("list not yet implemented"); + } + } } From bb2770856d390daa2dd387116be491c6ffc06469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:47:36 +0200 Subject: [PATCH 0510/1295] Cargo.lock: cli scaffolding deps --- Cargo.lock | 504 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 504 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index f7f27d88..885b1fa9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,145 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hive-ag3nt" version = "0.1.0" @@ -9,7 +148,372 @@ version = "0.1.0" [[package]] name = "hive-c0re" version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "hive-sh4re", + "serde", + "serde_json", + "tokio", + "tracing", + "tracing-subscriber", +] [[package]] name = "hive-sh4re" version = "0.1.0" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "tokio" +version = "1.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" From 0ec54ecf898f20c4ea773e94aed07059cfb03d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:49:11 +0200 Subject: [PATCH 0511/1295] hive-c0re: admin socket server + client (stub dispatch) --- hive-c0re/src/client.rs | 27 ++++++++++++++++ hive-c0re/src/main.rs | 50 ++++++++++++++--------------- hive-c0re/src/server.rs | 70 +++++++++++++++++++++++++++++++++++++++++ hive-sh4re/Cargo.toml | 3 ++ hive-sh4re/src/lib.rs | 53 +++++++++++++++++++++++++++++++ 5 files changed, 177 insertions(+), 26 deletions(-) create mode 100644 hive-c0re/src/client.rs create mode 100644 hive-c0re/src/server.rs diff --git a/hive-c0re/src/client.rs b/hive-c0re/src/client.rs new file mode 100644 index 00000000..14866369 --- /dev/null +++ b/hive-c0re/src/client.rs @@ -0,0 +1,27 @@ +use std::path::Path; + +use anyhow::{Context, Result, bail}; +use hive_sh4re::{HostRequest, HostResponse}; +use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; +use tokio::net::UnixStream; + +pub async fn request(socket: &Path, req: HostRequest) -> Result { + let stream = UnixStream::connect(socket) + .await + .with_context(|| format!("connect to {}", socket.display()))?; + let (read, mut write) = stream.into_split(); + + let mut payload = serde_json::to_string(&req)?; + payload.push('\n'); + write.write_all(payload.as_bytes()).await?; + write.flush().await?; + + let mut reader = BufReader::new(read); + let mut line = String::new(); + reader.read_line(&mut line).await?; + if line.is_empty() { + bail!("server closed connection without responding"); + } + let resp: HostResponse = serde_json::from_str(line.trim())?; + Ok(resp) +} diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index 24f4ac8b..0f13e81d 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -2,10 +2,18 @@ use std::path::PathBuf; use anyhow::{Result, bail}; use clap::{Parser, Subcommand}; +use hive_sh4re::{HostRequest, HostResponse}; + +mod client; +mod server; #[derive(Parser)] #[command(name = "hive-c0re", about = "hyperhive coordinator daemon and CLI")] struct Cli { + /// Path to the host admin socket. + #[arg(long, global = true, default_value = "/run/hyperhive/host.sock")] + socket: PathBuf, + #[command(subcommand)] cmd: Cmd, } @@ -17,11 +25,8 @@ enum Cmd { /// Flake reference for the agent base template. #[arg(long, default_value = "/etc/hyperhive#agent-base")] agent_flake: String, - /// Path to the host admin socket. - #[arg(long, default_value = "/run/hyperhive/host.sock")] - socket: PathBuf, }, - /// Spawn a new agent container (creates `hive-agent-`). + /// Spawn a new agent container (`hive-agent-`). Spawn { name: String }, /// Stop a managed container (graceful). Kill { name: String }, @@ -31,7 +36,8 @@ enum Cmd { List, } -fn main() -> Result<()> { +#[tokio::main] +async fn main() -> Result<()> { tracing_subscriber::fmt() .with_env_filter( tracing_subscriber::EnvFilter::try_from_default_env() @@ -41,28 +47,20 @@ fn main() -> Result<()> { let cli = Cli::parse(); match cli.cmd { - Cmd::Serve { - agent_flake, - socket, - } => { - tracing::info!(?socket, %agent_flake, "serve: not yet implemented"); - bail!("serve not yet implemented"); - } - Cmd::Spawn { name } => { - tracing::info!(%name, "spawn: not yet implemented"); - bail!("spawn not yet implemented"); - } - Cmd::Kill { name } => { - tracing::info!(%name, "kill: not yet implemented"); - bail!("kill not yet implemented"); - } + Cmd::Serve { agent_flake } => server::serve(&cli.socket, &agent_flake).await, + Cmd::Spawn { name } => render(client::request(&cli.socket, HostRequest::Spawn { name }).await?), + Cmd::Kill { name } => render(client::request(&cli.socket, HostRequest::Kill { name }).await?), Cmd::Rebuild { name } => { - tracing::info!(%name, "rebuild: not yet implemented"); - bail!("rebuild not yet implemented"); - } - Cmd::List => { - tracing::info!("list: not yet implemented"); - bail!("list not yet implemented"); + render(client::request(&cli.socket, HostRequest::Rebuild { name }).await?) } + Cmd::List => render(client::request(&cli.socket, HostRequest::List).await?), } } + +fn render(resp: HostResponse) -> Result<()> { + println!("{}", serde_json::to_string_pretty(&resp)?); + if !resp.ok { + bail!(resp.error.unwrap_or_else(|| "request failed".to_owned())); + } + Ok(()) +} diff --git a/hive-c0re/src/server.rs b/hive-c0re/src/server.rs new file mode 100644 index 00000000..d7b9fd30 --- /dev/null +++ b/hive-c0re/src/server.rs @@ -0,0 +1,70 @@ +use std::path::Path; + +use anyhow::{Context, Result}; +use hive_sh4re::{HostRequest, HostResponse}; +use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; +use tokio::net::{UnixListener, UnixStream}; + +pub async fn serve(socket: &Path, agent_flake: &str) -> Result<()> { + if let Some(parent) = socket.parent() { + std::fs::create_dir_all(parent) + .with_context(|| format!("create socket parent {}", parent.display()))?; + } + if socket.exists() { + std::fs::remove_file(socket).context("remove stale socket")?; + } + + let listener = UnixListener::bind(socket) + .with_context(|| format!("bind admin socket {}", socket.display()))?; + tracing::info!(socket = %socket.display(), %agent_flake, "hive-c0re listening"); + + loop { + let (stream, _) = listener.accept().await.context("accept connection")?; + let agent_flake = agent_flake.to_owned(); + tokio::spawn(async move { + if let Err(e) = handle(stream, &agent_flake).await { + tracing::warn!(error = ?e, "connection failed"); + } + }); + } +} + +async fn handle(stream: UnixStream, agent_flake: &str) -> Result<()> { + let (read, mut write) = stream.into_split(); + let mut reader = BufReader::new(read); + let mut line = String::new(); + + loop { + line.clear(); + let n = reader.read_line(&mut line).await?; + if n == 0 { + return Ok(()); + } + let resp = match serde_json::from_str::(line.trim()) { + Ok(req) => dispatch(&req, agent_flake).await, + Err(e) => HostResponse::error(format!("parse error: {e}")), + }; + let mut payload = serde_json::to_string(&resp)?; + payload.push('\n'); + write.write_all(payload.as_bytes()).await?; + write.flush().await?; + } +} + +async fn dispatch(req: &HostRequest, _agent_flake: &str) -> HostResponse { + match req { + HostRequest::Spawn { name } => { + tracing::info!(%name, "spawn (stub)"); + HostResponse::error("spawn: nixos-container integration pending") + } + HostRequest::Kill { name } => { + tracing::info!(%name, "kill (stub)"); + HostResponse::error("kill: nixos-container integration pending") + } + HostRequest::Rebuild { name } => { + tracing::info!(%name, "rebuild (stub)"); + HostResponse::error("rebuild: nixos-container integration pending") + } + HostRequest::List => HostResponse::list(Vec::new()), + } +} diff --git a/hive-sh4re/Cargo.toml b/hive-sh4re/Cargo.toml index 004c5f01..45f43cfb 100644 --- a/hive-sh4re/Cargo.toml +++ b/hive-sh4re/Cargo.toml @@ -2,3 +2,6 @@ name = "hive-sh4re" edition.workspace = true version.workspace = true + +[dependencies] +serde.workspace = true diff --git a/hive-sh4re/src/lib.rs b/hive-sh4re/src/lib.rs index 8b137891..93222825 100644 --- a/hive-sh4re/src/lib.rs +++ b/hive-sh4re/src/lib.rs @@ -1 +1,54 @@ +//! Wire types shared between `hive-c0re` and the in-container harness. +use serde::{Deserialize, Serialize}; + +/// Requests on the host admin socket (`/run/hyperhive/host.sock`). +/// +/// Wire format: one JSON object per line. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "cmd", rename_all = "snake_case")] +pub enum HostRequest { + /// Create and start a sub-agent container `hive-agent-`. + Spawn { name: String }, + /// Stop a managed container (graceful). + Kill { name: String }, + /// Apply pending config to a managed container. + Rebuild { name: String }, + /// List managed containers. + List, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct HostResponse { + pub ok: bool, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agents: Option>, +} + +impl HostResponse { + pub fn success() -> Self { + Self { + ok: true, + error: None, + agents: None, + } + } + + pub fn error(message: impl Into) -> Self { + Self { + ok: false, + error: Some(message.into()), + agents: None, + } + } + + pub fn list(agents: Vec) -> Self { + Self { + ok: true, + error: None, + agents: Some(agents), + } + } +} From 90798b936ec925ea4927d4e55b4179dabfedae3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:51:35 +0200 Subject: [PATCH 0512/1295] hive-c0re: nixos-container lifecycle (spawn/kill/rebuild/list) --- hive-c0re/src/lifecycle.rs | 60 ++++++++++++++++++++++++++++++++++++++ hive-c0re/src/main.rs | 1 + hive-c0re/src/server.rs | 42 ++++++++++++++++---------- 3 files changed, 88 insertions(+), 15 deletions(-) create mode 100644 hive-c0re/src/lifecycle.rs diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs new file mode 100644 index 00000000..60f1f71d --- /dev/null +++ b/hive-c0re/src/lifecycle.rs @@ -0,0 +1,60 @@ +//! Thin async wrappers over `nixos-container`. + +use anyhow::{Context, Result, bail}; +use tokio::process::Command; + +pub const AGENT_PREFIX: &str = "hive-agent-"; +pub const HIVE_PREFIX: &str = "hive-"; + +pub fn container_name(name: &str) -> String { + format!("{AGENT_PREFIX}{name}") +} + +pub async fn spawn(name: &str, agent_flake: &str) -> Result<()> { + let container = container_name(name); + run(&["create", &container, "--flake", agent_flake]).await?; + run(&["start", &container]).await +} + +pub async fn kill(name: &str) -> Result<()> { + let container = container_name(name); + run(&["stop", &container]).await +} + +pub async fn rebuild(name: &str, agent_flake: &str) -> Result<()> { + let container = container_name(name); + run(&["update", &container, "--flake", agent_flake]).await +} + +pub async fn list() -> Result> { + let out = Command::new("nixos-container") + .arg("list") + .output() + .await + .context("invoke nixos-container list")?; + if !out.status.success() { + bail!( + "nixos-container list exited with status {}: {}", + out.status, + String::from_utf8_lossy(&out.stderr).trim() + ); + } + Ok(String::from_utf8_lossy(&out.stdout) + .lines() + .map(str::trim) + .filter(|line| line.starts_with(HIVE_PREFIX)) + .map(str::to_owned) + .collect()) +} + +async fn run(args: &[&str]) -> Result<()> { + let status = Command::new("nixos-container") + .args(args) + .status() + .await + .with_context(|| format!("invoke nixos-container {}", args.join(" ")))?; + if !status.success() { + bail!("nixos-container {} exited with {status}", args.join(" ")); + } + Ok(()) +} diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index 0f13e81d..c84305bd 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -5,6 +5,7 @@ use clap::{Parser, Subcommand}; use hive_sh4re::{HostRequest, HostResponse}; mod client; +mod lifecycle; mod server; #[derive(Parser)] diff --git a/hive-c0re/src/server.rs b/hive-c0re/src/server.rs index d7b9fd30..48eeb569 100644 --- a/hive-c0re/src/server.rs +++ b/hive-c0re/src/server.rs @@ -5,6 +5,8 @@ use hive_sh4re::{HostRequest, HostResponse}; use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; use tokio::net::{UnixListener, UnixStream}; +use crate::lifecycle; + pub async fn serve(socket: &Path, agent_flake: &str) -> Result<()> { if let Some(parent) = socket.parent() { std::fs::create_dir_all(parent) @@ -51,20 +53,30 @@ async fn handle(stream: UnixStream, agent_flake: &str) -> Result<()> { } } -async fn dispatch(req: &HostRequest, _agent_flake: &str) -> HostResponse { - match req { - HostRequest::Spawn { name } => { - tracing::info!(%name, "spawn (stub)"); - HostResponse::error("spawn: nixos-container integration pending") - } - HostRequest::Kill { name } => { - tracing::info!(%name, "kill (stub)"); - HostResponse::error("kill: nixos-container integration pending") - } - HostRequest::Rebuild { name } => { - tracing::info!(%name, "rebuild (stub)"); - HostResponse::error("rebuild: nixos-container integration pending") - } - HostRequest::List => HostResponse::list(Vec::new()), +async fn dispatch(req: &HostRequest, agent_flake: &str) -> HostResponse { + let result: anyhow::Result = async { + Ok(match req { + HostRequest::Spawn { name } => { + tracing::info!(%name, "spawn"); + lifecycle::spawn(name, agent_flake).await?; + HostResponse::success() + } + HostRequest::Kill { name } => { + tracing::info!(%name, "kill"); + lifecycle::kill(name).await?; + HostResponse::success() + } + HostRequest::Rebuild { name } => { + tracing::info!(%name, "rebuild"); + lifecycle::rebuild(name, agent_flake).await?; + HostResponse::success() + } + HostRequest::List => HostResponse::list(lifecycle::list().await?), + }) + } + .await; + match result { + Ok(r) => r, + Err(e) => HostResponse::error(format!("{e:#}")), } } From b1b11cf17ccc8a18beae8c664557282dd25150f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:52:44 +0200 Subject: [PATCH 0513/1295] module: serve subcommand + runtime/state dirs --- nix/modules/hive-c0re.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index f3e0caa4..90d6f1f4 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -16,6 +16,11 @@ in defaultText = lib.literalExpression "pkgs.hyperhive"; description = "Package that provides /bin/hive-c0re."; }; + agentFlake = lib.mkOption { + type = lib.types.str; + default = "/etc/hyperhive#agent-base"; + description = "Flake reference passed to `nixos-container create --flake` when spawning sub-agents."; + }; }; config = lib.mkIf cfg.enable { @@ -23,9 +28,12 @@ in description = "hyperhive coordinator daemon"; wantedBy = [ "multi-user.target" ]; serviceConfig = { - ExecStart = "${cfg.package}/bin/hive-c0re"; + ExecStart = "${cfg.package}/bin/hive-c0re --socket /run/hyperhive/host.sock serve --agent-flake ${cfg.agentFlake}"; Restart = "on-failure"; RestartSec = 2; + RuntimeDirectory = "hyperhive"; + RuntimeDirectoryMode = "0750"; + StateDirectory = "hyperhive"; }; }; }; From 81059dc836d48af0da7b57ca0bd83df3f85da435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:53:43 +0200 Subject: [PATCH 0514/1295] fmt: rustfmt + Cargo.lock refresh --- .tmp | 1 + Cargo.lock | 3 +++ hive-c0re/src/main.rs | 8 ++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 120000 .tmp diff --git a/.tmp b/.tmp new file mode 120000 index 00000000..50c26199 --- /dev/null +++ b/.tmp @@ -0,0 +1 @@ +/nix/store/04hrlfv9r7azlp71zdydlgf2syx69n0f-nixos-system-nixos-25.11.20260510.8fd9daa \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 885b1fa9..dba829eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,6 +162,9 @@ dependencies = [ [[package]] name = "hive-sh4re" version = "0.1.0" +dependencies = [ + "serde", +] [[package]] name = "is_terminal_polyfill" diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index c84305bd..c03df938 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -49,8 +49,12 @@ async fn main() -> Result<()> { let cli = Cli::parse(); match cli.cmd { Cmd::Serve { agent_flake } => server::serve(&cli.socket, &agent_flake).await, - Cmd::Spawn { name } => render(client::request(&cli.socket, HostRequest::Spawn { name }).await?), - Cmd::Kill { name } => render(client::request(&cli.socket, HostRequest::Kill { name }).await?), + Cmd::Spawn { name } => { + render(client::request(&cli.socket, HostRequest::Spawn { name }).await?) + } + Cmd::Kill { name } => { + render(client::request(&cli.socket, HostRequest::Kill { name }).await?) + } Cmd::Rebuild { name } => { render(client::request(&cli.socket, HostRequest::Rebuild { name }).await?) } From 31a5ed69fb2ea0efdf7cbe3c0370f025bff54e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:54:31 +0200 Subject: [PATCH 0515/1295] untrack .tmp nix out-link --- .gitignore | 1 + .tmp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 120000 .tmp diff --git a/.gitignore b/.gitignore index 8470fac9..6c8d9c44 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target /result /result-* +/.tmp diff --git a/.tmp b/.tmp deleted file mode 120000 index 50c26199..00000000 --- a/.tmp +++ /dev/null @@ -1 +0,0 @@ -/nix/store/04hrlfv9r7azlp71zdydlgf2syx69n0f-nixos-system-nixos-25.11.20260510.8fd9daa \ No newline at end of file From 15c32a95a411eb4f00c586772b3ffade734eece1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:56:52 +0200 Subject: [PATCH 0516/1295] nix flake update --- flake.lock | 74 +++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/flake.lock b/flake.lock index a74a8938..b0d2c2e8 100644 --- a/flake.lock +++ b/flake.lock @@ -232,11 +232,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1775087534, - "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=", + "lastModified": 1777988971, + "narHash": "sha256-qIoWPDs+0/8JecyYgE3gpKQxW/4bLW/gp45vow9ioCQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b", + "rev": "0678d8986be1661af6bb555f3489f2fdfc31f6ff", "type": "github" }, "original": { @@ -330,11 +330,11 @@ ] }, "locked": { - "lastModified": 1775425411, - "narHash": "sha256-KY6HsebJHEe5nHOWP7ur09mb0drGxYSzE3rQxy62rJo=", + "lastModified": 1777851538, + "narHash": "sha256-Gp8qwTEYNoy2yvmErVGlvLOQvrtEECCAKbonW7VJef8=", "owner": "nix-community", "repo": "home-manager", - "rev": "0d02ec1d0a05f88ef9e74b516842900c41f0f2fe", + "rev": "cc09c0f9b7eaa95c2d9827338a5eb03d32505ca5", "type": "github" }, "original": { @@ -378,11 +378,11 @@ ] }, "locked": { - "lastModified": 1777031541, - "narHash": "sha256-KZ4s1kolHXFQrRGlnB503gDcTrVQMhiczO+LvvwKEPg=", + "lastModified": 1778151388, + "narHash": "sha256-lldMJPUeouEjO8/7aLuwhcsIw29vVihm2ZALzjiqfec=", "owner": "nix-community", "repo": "naersk", - "rev": "5e73301621274c44798bf6c6211ed27fc2ced201", + "rev": "efdddff9ff4d8e7d0056d57ec67dac50f75ab8f6", "type": "github" }, "original": { @@ -405,11 +405,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1777472199, - "narHash": "sha256-gJr/OrHv6s8ANqv915sb69LLThow1u5yAO/ouElVGGM=", + "lastModified": 1778224717, + "narHash": "sha256-lzpzFAinsI1YriR+iVDIDZVkps2oQw1LG2QvFcDVYCk=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "323a80f2ce4541c595d491acbd15a8800201cbae", + "rev": "cb2fdda815a0c2c03f8a7fe7075c433d4ef37110", "type": "github" }, "original": { @@ -438,11 +438,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1777468255, - "narHash": "sha256-lBZc1UMy+1P1T/E41j3jQrpS7EFI3qegd+ktHZdamIg=", + "lastModified": 1778221858, + "narHash": "sha256-+nZlx8MKCs973N9Bm0hNzFHjY+2lmBrBOQeTALeCRhI=", "owner": "YaLTeR", "repo": "niri", - "rev": "dd1c3bcb9f1ef416df33ffa22d1d9bcee1398e7d", + "rev": "0200670d9ee8cfbdb154e3e14d92b5ff61aedd59", "type": "github" }, "original": { @@ -473,11 +473,11 @@ ] }, "locked": { - "lastModified": 1777434090, - "narHash": "sha256-i7p7ajtdKF6oVjs3ERyECCg6m1lWEchHNPKQjgRW4h4=", + "lastModified": 1778297753, + "narHash": "sha256-IRgRWBkluHR+JiNmhS/fbTbodr22/P9MuWZSU7x3DGI=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "f32bb01e6a12b74fa67261e9d690ff9d0603d86b", + "rev": "a15c2ddce7f4018f9277c727f6689c56be8b2720", "type": "github" }, "original": { @@ -588,11 +588,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1774748309, - "narHash": "sha256-+U7gF3qxzwD5TZuANzZPeJTZRHS29OFQgkQ2kiTJBIQ=", + "lastModified": 1777168982, + "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "333c4e0545a6da976206c74db8773a1645b5870a", + "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14", "type": "github" }, "original": { @@ -603,11 +603,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1777270315, - "narHash": "sha256-yKB4G6cKsQsWN7M6rZGk6gkJPDNPIzT05y4qzRyCDlI=", + "lastModified": 1778124196, + "narHash": "sha256-pYEytCNic/czazbV9r3tbQ6BZzqRBg/41x2dIC5ymOo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6368eda62c9775c38ef7f714b2555a741c20c72d", + "rev": "68a8af93ff4297686cb68880845e61e5e2e41d92", "type": "github" }, "original": { @@ -619,11 +619,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1777077449, - "narHash": "sha256-AIiMJiqvGrN4HyLEbKAoCSRRYn0rnlW5VbKNIMIYqm4=", + "lastModified": 1778003029, + "narHash": "sha256-q/nkKLDtHIyLjZpKhWk3cSK5IYsFqtMd6UtXF3ddjgA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a4bf06618f0b5ee50f14ed8f0da77d34ecc19160", + "rev": "0c88e1f2bdb93d5999019e99cb0e61e1fe2af4c5", "type": "github" }, "original": { @@ -659,11 +659,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1778180483, - "narHash": "sha256-35cMiZn5DAnYFpKFdWg5dxW7hLO3/ey743ED6yV3pL8=", + "lastModified": 1778182618, + "narHash": "sha256-1KzLskWhgJZu0jL03UZZtmHBgk11HMhLFvO9mCWnCao=", "ref": "refs/heads/main", - "rev": "dfa3840d97186fef3480b49f289acd3ae707ee27", - "revCount": 626, + "rev": "628ae67b7def027553c287cfd71f840570469bce", + "revCount": 627, "type": "git", "url": "https://git.berlin.ccc.de/vinzenz/nova-shell" }, @@ -682,11 +682,11 @@ ] }, "locked": { - "lastModified": 1777499139, - "narHash": "sha256-s817mwTTkW0VIReee1z41LJAz13AUw3DOK41jZooFGw=", + "lastModified": 1778311636, + "narHash": "sha256-oYvKqSgs5qxcSynyOwBMGDr0dTYUGu4Lucou9OsbwlU=", "owner": "nix-community", "repo": "NUR", - "rev": "c0295550b00f0d0d4a9f41efd5e6c14d38a671fc", + "rev": "3f8e3217d2da6312a529f62a40c90b7129e2ea47", "type": "github" }, "original": { @@ -903,11 +903,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1776894428, - "narHash": "sha256-wuT915MyCtMTfLj+uo9y8wtCwkEgJXiXvcbSleFrlN0=", + "lastModified": 1778105055, + "narHash": "sha256-SWz0cVHEGFb2rSszCaQ7nmuM9q7Cq3xbsg+DAg0N9jo=", "owner": "nix-community", "repo": "stylix", - "rev": "f34be27ce83efaa1c85ad1e5b1f8b6dea65b147d", + "rev": "68b1ff44196f4f593d0cd837ffb2a088c2870055", "type": "github" }, "original": { From e541f2ac709e5b3691f213bab4332218189ddef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 21:21:10 +0200 Subject: [PATCH 0517/1295] module: expose hive-c0re CLI in environment.systemPackages --- nix/modules/hive-c0re.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index 90d6f1f4..ec9223cc 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -24,6 +24,8 @@ in }; config = lib.mkIf cfg.enable { + environment.systemPackages = [ cfg.package ]; + systemd.services.hive-c0re = { description = "hyperhive coordinator daemon"; wantedBy = [ "multi-user.target" ]; From 11e999ca9391ef657cf9a63a9df5f6cf57dacad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 21:24:37 +0200 Subject: [PATCH 0518/1295] module: add /run/current-system/sw to service path for nixos-container --- nix/modules/hive-c0re.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index ec9223cc..ba778257 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -29,6 +29,8 @@ in systemd.services.hive-c0re = { description = "hyperhive coordinator daemon"; wantedBy = [ "multi-user.target" ]; + # `nixos-container` lives in the system path; make it reachable from the unit. + path = [ "/run/current-system/sw" ]; serviceConfig = { ExecStart = "${cfg.package}/bin/hive-c0re --socket /run/hyperhive/host.sock serve --agent-flake ${cfg.agentFlake}"; Restart = "on-failure"; From 4545c08908ca0ff89aa756bd2295c1ac8591a5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 21:40:38 +0200 Subject: [PATCH 0519/1295] hive-sh4re: per-agent socket protocol (Message/AgentRequest/AgentResponse) --- hive-sh4re/src/lib.rs | 44 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/hive-sh4re/src/lib.rs b/hive-sh4re/src/lib.rs index 93222825..06683116 100644 --- a/hive-sh4re/src/lib.rs +++ b/hive-sh4re/src/lib.rs @@ -2,7 +2,11 @@ use serde::{Deserialize, Serialize}; -/// Requests on the host admin socket (`/run/hyperhive/host.sock`). +// ----------------------------------------------------------------------------- +// Host admin socket — /run/hyperhive/host.sock +// ----------------------------------------------------------------------------- + +/// Requests on the host admin socket. /// /// Wire format: one JSON object per line. #[derive(Debug, Clone, Serialize, Deserialize)] @@ -52,3 +56,41 @@ impl HostResponse { } } } + +// ----------------------------------------------------------------------------- +// Per-agent socket — /run/hyperhive/agents//mcp.sock on the host, +// bind-mounted into the container at /run/hive/mcp.sock. +// ----------------------------------------------------------------------------- + +/// A logical message between agents. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Message { + pub from: String, + pub to: String, + pub body: String, +} + +/// Requests on a per-agent socket. The agent's identity is the socket +/// it came in on; `Send.from` is filled in by the server, not the client. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "cmd", rename_all = "snake_case")] +pub enum AgentRequest { + /// Send a message to another agent. + Send { to: String, body: String }, + /// Pop one pending message from this agent's inbox. + Recv, +} + +/// Responses on a per-agent socket. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "kind", rename_all = "snake_case")] +pub enum AgentResponse { + /// `Send` succeeded. + Ok, + /// Either `Send` failed or `Recv` errored. + Err { message: String }, + /// `Recv` produced a message. + Message { from: String, body: String }, + /// `Recv` found nothing pending. + Empty, +} From d79b5a39a1d411fefb2ac61a5e5c0b7c74a8e05e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 21:42:51 +0200 Subject: [PATCH 0520/1295] hive-c0re: in-memory broker + per-agent sockets + coordinator state --- hive-c0re/src/agent_server.rs | 101 ++++++++++++++++++++++++++++++++++ hive-c0re/src/broker.rs | 30 ++++++++++ hive-c0re/src/coordinator.rs | 56 +++++++++++++++++++ hive-c0re/src/lifecycle.rs | 10 +++- hive-c0re/src/main.rs | 11 +++- hive-c0re/src/server.rs | 21 +++++-- 6 files changed, 220 insertions(+), 9 deletions(-) create mode 100644 hive-c0re/src/agent_server.rs create mode 100644 hive-c0re/src/broker.rs create mode 100644 hive-c0re/src/coordinator.rs diff --git a/hive-c0re/src/agent_server.rs b/hive-c0re/src/agent_server.rs new file mode 100644 index 00000000..89104a8a --- /dev/null +++ b/hive-c0re/src/agent_server.rs @@ -0,0 +1,101 @@ +//! Per-agent socket listener. Each socket file's existence on disk +//! authenticates the caller: connecting to `<.../agents/foo/mcp.sock>` means +//! you are `foo`. + +use std::path::PathBuf; +use std::sync::Arc; + +use anyhow::{Context, Result}; +use hive_sh4re::{AgentRequest, AgentResponse, Message}; +use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; +use tokio::net::{UnixListener, UnixStream}; +use tokio::task::JoinHandle; + +use crate::broker::Broker; + +pub struct AgentSocket { + pub path: PathBuf, + pub handle: JoinHandle<()>, +} + +pub async fn start( + agent: String, + socket_path: PathBuf, + broker: Arc, +) -> Result { + if let Some(parent) = socket_path.parent() { + std::fs::create_dir_all(parent) + .with_context(|| format!("create agent socket dir {}", parent.display()))?; + } + if socket_path.exists() { + std::fs::remove_file(&socket_path).context("remove stale agent socket")?; + } + let listener = UnixListener::bind(&socket_path) + .with_context(|| format!("bind agent socket {}", socket_path.display()))?; + tracing::info!(%agent, socket = %socket_path.display(), "agent socket listening"); + + let path = socket_path.clone(); + let handle = tokio::spawn(async move { + loop { + match listener.accept().await { + Ok((stream, _)) => { + let agent = agent.clone(); + let broker = broker.clone(); + tokio::spawn(async move { + if let Err(e) = serve(stream, agent, broker).await { + tracing::warn!(error = ?e, "agent connection failed"); + } + }); + } + Err(e) => { + tracing::warn!(error = ?e, "agent listener accept failed; exiting"); + return; + } + } + } + }); + Ok(AgentSocket { path, handle }) +} + +async fn serve(stream: UnixStream, agent: String, broker: Arc) -> Result<()> { + let (read, mut write) = stream.into_split(); + let mut reader = BufReader::new(read); + let mut line = String::new(); + loop { + line.clear(); + let n = reader.read_line(&mut line).await?; + if n == 0 { + return Ok(()); + } + let resp = match serde_json::from_str::(line.trim()) { + Ok(req) => dispatch(&req, &agent, &broker), + Err(e) => AgentResponse::Err { + message: format!("parse error: {e}"), + }, + }; + let mut payload = serde_json::to_string(&resp)?; + payload.push('\n'); + write.write_all(payload.as_bytes()).await?; + write.flush().await?; + } +} + +fn dispatch(req: &AgentRequest, agent: &str, broker: &Broker) -> AgentResponse { + match req { + AgentRequest::Send { to, body } => { + broker.send(Message { + from: agent.to_owned(), + to: to.clone(), + body: body.clone(), + }); + AgentResponse::Ok + } + AgentRequest::Recv => match broker.recv(agent) { + Some(msg) => AgentResponse::Message { + from: msg.from, + body: msg.body, + }, + None => AgentResponse::Empty, + }, + } +} diff --git a/hive-c0re/src/broker.rs b/hive-c0re/src/broker.rs new file mode 100644 index 00000000..2867c1f7 --- /dev/null +++ b/hive-c0re/src/broker.rs @@ -0,0 +1,30 @@ +//! In-memory message broker. Phase 3 replaces this with a sqlite-backed store. + +use std::collections::{HashMap, VecDeque}; +use std::sync::Mutex; + +use hive_sh4re::Message; + +#[derive(Default)] +pub struct Broker { + queues: Mutex>>, +} + +impl Broker { + pub fn new() -> Self { + Self::default() + } + + pub fn send(&self, message: Message) { + let mut queues = self.queues.lock().unwrap(); + queues + .entry(message.to.clone()) + .or_default() + .push_back(message); + } + + pub fn recv(&self, recipient: &str) -> Option { + let mut queues = self.queues.lock().unwrap(); + queues.get_mut(recipient).and_then(|q| q.pop_front()) + } +} diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs new file mode 100644 index 00000000..66d8b7dd --- /dev/null +++ b/hive-c0re/src/coordinator.rs @@ -0,0 +1,56 @@ +//! Runtime state shared between the host admin socket and the per-agent +//! sockets: the broker plus a map of `name -> AgentSocket`. + +use std::collections::HashMap; +use std::path::PathBuf; +use std::sync::{Arc, Mutex}; + +use anyhow::{Context, Result}; + +use crate::agent_server::{self, AgentSocket}; +use crate::broker::Broker; + +const AGENT_RUNTIME_ROOT: &str = "/run/hyperhive/agents"; + +pub struct Coordinator { + pub broker: Arc, + agents: Mutex>, +} + +impl Coordinator { + pub fn new() -> Self { + Self { + broker: Arc::new(Broker::new()), + agents: Mutex::new(HashMap::new()), + } + } + + pub async fn register_agent(&self, name: &str) -> Result { + let agent_dir = Self::agent_dir(name); + std::fs::create_dir_all(&agent_dir) + .with_context(|| format!("create agent dir {}", agent_dir.display()))?; + let socket_path = Self::socket_path(name); + let socket = + agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?; + self.agents + .lock() + .unwrap() + .insert(name.to_owned(), socket); + Ok(agent_dir) + } + + pub fn unregister_agent(&self, name: &str) { + if let Some(socket) = self.agents.lock().unwrap().remove(name) { + socket.handle.abort(); + let _ = std::fs::remove_file(&socket.path); + } + } + + pub fn agent_dir(name: &str) -> PathBuf { + PathBuf::from(format!("{AGENT_RUNTIME_ROOT}/{name}")) + } + + pub fn socket_path(name: &str) -> PathBuf { + Self::agent_dir(name).join("mcp.sock") + } +} diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index 60f1f71d..72c26cdf 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -1,18 +1,24 @@ //! Thin async wrappers over `nixos-container`. +use std::path::Path; + use anyhow::{Context, Result, bail}; use tokio::process::Command; pub const AGENT_PREFIX: &str = "hive-agent-"; pub const HIVE_PREFIX: &str = "hive-"; +/// Mount point of the per-agent runtime directory inside the container. +pub const CONTAINER_RUNTIME_MOUNT: &str = "/run/hive"; + pub fn container_name(name: &str) -> String { format!("{AGENT_PREFIX}{name}") } -pub async fn spawn(name: &str, agent_flake: &str) -> Result<()> { +pub async fn spawn(name: &str, agent_flake: &str, agent_dir: &Path) -> Result<()> { let container = container_name(name); - run(&["create", &container, "--flake", agent_flake]).await?; + let bind = format!("{}:{CONTAINER_RUNTIME_MOUNT}", agent_dir.display()); + run(&["create", &container, "--flake", agent_flake, "--bind", &bind]).await?; run(&["start", &container]).await } diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index c03df938..760d1933 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -1,13 +1,19 @@ use std::path::PathBuf; +use std::sync::Arc; use anyhow::{Result, bail}; use clap::{Parser, Subcommand}; use hive_sh4re::{HostRequest, HostResponse}; +mod agent_server; +mod broker; mod client; +mod coordinator; mod lifecycle; mod server; +use coordinator::Coordinator; + #[derive(Parser)] #[command(name = "hive-c0re", about = "hyperhive coordinator daemon and CLI")] struct Cli { @@ -48,7 +54,10 @@ async fn main() -> Result<()> { let cli = Cli::parse(); match cli.cmd { - Cmd::Serve { agent_flake } => server::serve(&cli.socket, &agent_flake).await, + Cmd::Serve { agent_flake } => { + let coord = Arc::new(Coordinator::new()); + server::serve(&cli.socket, &agent_flake, coord).await + } Cmd::Spawn { name } => { render(client::request(&cli.socket, HostRequest::Spawn { name }).await?) } diff --git a/hive-c0re/src/server.rs b/hive-c0re/src/server.rs index 48eeb569..131e1b43 100644 --- a/hive-c0re/src/server.rs +++ b/hive-c0re/src/server.rs @@ -1,13 +1,15 @@ use std::path::Path; +use std::sync::Arc; use anyhow::{Context, Result}; use hive_sh4re::{HostRequest, HostResponse}; use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; use tokio::net::{UnixListener, UnixStream}; +use crate::coordinator::Coordinator; use crate::lifecycle; -pub async fn serve(socket: &Path, agent_flake: &str) -> Result<()> { +pub async fn serve(socket: &Path, agent_flake: &str, coord: Arc) -> Result<()> { if let Some(parent) = socket.parent() { std::fs::create_dir_all(parent) .with_context(|| format!("create socket parent {}", parent.display()))?; @@ -23,15 +25,16 @@ pub async fn serve(socket: &Path, agent_flake: &str) -> Result<()> { loop { let (stream, _) = listener.accept().await.context("accept connection")?; let agent_flake = agent_flake.to_owned(); + let coord = coord.clone(); tokio::spawn(async move { - if let Err(e) = handle(stream, &agent_flake).await { + if let Err(e) = handle(stream, &agent_flake, coord).await { tracing::warn!(error = ?e, "connection failed"); } }); } } -async fn handle(stream: UnixStream, agent_flake: &str) -> Result<()> { +async fn handle(stream: UnixStream, agent_flake: &str, coord: Arc) -> Result<()> { let (read, mut write) = stream.into_split(); let mut reader = BufReader::new(read); let mut line = String::new(); @@ -43,7 +46,7 @@ async fn handle(stream: UnixStream, agent_flake: &str) -> Result<()> { return Ok(()); } let resp = match serde_json::from_str::(line.trim()) { - Ok(req) => dispatch(&req, agent_flake).await, + Ok(req) => dispatch(&req, agent_flake, &coord).await, Err(e) => HostResponse::error(format!("parse error: {e}")), }; let mut payload = serde_json::to_string(&resp)?; @@ -53,17 +56,23 @@ async fn handle(stream: UnixStream, agent_flake: &str) -> Result<()> { } } -async fn dispatch(req: &HostRequest, agent_flake: &str) -> HostResponse { +async fn dispatch(req: &HostRequest, agent_flake: &str, coord: &Coordinator) -> HostResponse { let result: anyhow::Result = async { Ok(match req { HostRequest::Spawn { name } => { tracing::info!(%name, "spawn"); - lifecycle::spawn(name, agent_flake).await?; + let agent_dir = coord.register_agent(name).await?; + if let Err(e) = lifecycle::spawn(name, agent_flake, &agent_dir).await { + // Roll back socket registration if container creation failed. + coord.unregister_agent(name); + return Err(e); + } HostResponse::success() } HostRequest::Kill { name } => { tracing::info!(%name, "kill"); lifecycle::kill(name).await?; + coord.unregister_agent(name); HostResponse::success() } HostRequest::Rebuild { name } => { From 61407f41c999df893d3d04eb5fe17ed44bd8babb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 21:44:05 +0200 Subject: [PATCH 0521/1295] hive-ag3nt: serve loop + send/recv CLI; template runs serve --- hive-ag3nt/Cargo.toml | 10 ++++ hive-ag3nt/src/bin/hive-ag3nt.rs | 92 +++++++++++++++++++++++++++++++- hive-ag3nt/src/bin/hive-m1nd.rs | 2 + hive-ag3nt/src/client.rs | 27 ++++++++++ hive-ag3nt/src/lib.rs | 6 +++ nix/templates/agent-base.nix | 6 ++- 6 files changed, 139 insertions(+), 4 deletions(-) create mode 100644 hive-ag3nt/src/client.rs diff --git a/hive-ag3nt/Cargo.toml b/hive-ag3nt/Cargo.toml index c268836b..f5bc59d7 100644 --- a/hive-ag3nt/Cargo.toml +++ b/hive-ag3nt/Cargo.toml @@ -3,6 +3,16 @@ name = "hive-ag3nt" edition.workspace = true version.workspace = true +[dependencies] +anyhow.workspace = true +clap.workspace = true +hive-sh4re.workspace = true +serde.workspace = true +serde_json.workspace = true +tokio.workspace = true +tracing.workspace = true +tracing-subscriber.workspace = true + [[bin]] name = "hive-ag3nt" path = "src/bin/hive-ag3nt.rs" diff --git a/hive-ag3nt/src/bin/hive-ag3nt.rs b/hive-ag3nt/src/bin/hive-ag3nt.rs index 03c1e0cf..021c400a 100644 --- a/hive-ag3nt/src/bin/hive-ag3nt.rs +++ b/hive-ag3nt/src/bin/hive-ag3nt.rs @@ -1,3 +1,91 @@ -fn main() { - println!("hive-ag3nt placeholder"); +use std::path::PathBuf; +use std::time::Duration; + +use anyhow::{Result, bail}; +use clap::{Parser, Subcommand}; +use hive_ag3nt::{DEFAULT_SOCKET, client}; +use hive_sh4re::{AgentRequest, AgentResponse}; + +#[derive(Parser)] +#[command(name = "hive-ag3nt", about = "hyperhive sub-agent harness")] +struct Cli { + /// Path to the per-agent MCP socket (bind-mounted from the host). + #[arg(long, global = true, default_value = DEFAULT_SOCKET)] + socket: PathBuf, + + #[command(subcommand)] + cmd: Cmd, +} + +#[derive(Subcommand)] +enum Cmd { + /// Run the long-lived harness loop. Polls inbox; prints messages to stdout. + Serve { + /// Inbox poll interval in milliseconds. + #[arg(long, default_value_t = 1000)] + poll_ms: u64, + }, + /// Send a message to another agent. + Send { to: String, body: String }, + /// Pop one message from the inbox. + Recv, +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt() + .with_env_filter( + tracing_subscriber::EnvFilter::try_from_default_env() + .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")), + ) + .init(); + + let cli = Cli::parse(); + match cli.cmd { + Cmd::Serve { poll_ms } => serve(&cli.socket, Duration::from_millis(poll_ms)).await, + Cmd::Send { to, body } => { + let resp = client::request(&cli.socket, AgentRequest::Send { to, body }).await?; + render(&resp)?; + check(&resp) + } + Cmd::Recv => { + let resp = client::request(&cli.socket, AgentRequest::Recv).await?; + render(&resp)?; + check(&resp) + } + } +} + +async fn serve(socket: &std::path::Path, interval: Duration) -> Result<()> { + tracing::info!(socket = %socket.display(), "hive-ag3nt serve"); + loop { + match client::request(socket, AgentRequest::Recv).await { + Ok(AgentResponse::Message { from, body }) => { + tracing::info!(%from, %body, "inbox"); + } + Ok(AgentResponse::Empty) => {} + Ok(AgentResponse::Ok) => { + tracing::warn!("recv produced Ok (unexpected)"); + } + Ok(AgentResponse::Err { message }) => { + tracing::warn!(%message, "recv error"); + } + Err(e) => { + tracing::warn!(error = ?e, "recv failed; retrying"); + } + } + tokio::time::sleep(interval).await; + } +} + +fn render(resp: &AgentResponse) -> Result<()> { + println!("{}", serde_json::to_string_pretty(resp)?); + Ok(()) +} + +fn check(resp: &AgentResponse) -> Result<()> { + if let AgentResponse::Err { message } = resp { + bail!("{message}"); + } + Ok(()) } diff --git a/hive-ag3nt/src/bin/hive-m1nd.rs b/hive-ag3nt/src/bin/hive-m1nd.rs index 314550ca..a63ce9d6 100644 --- a/hive-ag3nt/src/bin/hive-m1nd.rs +++ b/hive-ag3nt/src/bin/hive-m1nd.rs @@ -1,3 +1,5 @@ fn main() { + // Phase 4 — manager tool surface. For now, a placeholder so the binary + // exists and can be referenced from the manager nixos-container template. println!("hive-m1nd placeholder"); } diff --git a/hive-ag3nt/src/client.rs b/hive-ag3nt/src/client.rs new file mode 100644 index 00000000..8deb726c --- /dev/null +++ b/hive-ag3nt/src/client.rs @@ -0,0 +1,27 @@ +use std::path::Path; + +use anyhow::{Context, Result, bail}; +use hive_sh4re::{AgentRequest, AgentResponse}; +use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; +use tokio::net::UnixStream; + +pub async fn request(socket: &Path, req: AgentRequest) -> Result { + let stream = UnixStream::connect(socket) + .await + .with_context(|| format!("connect to {}", socket.display()))?; + let (read, mut write) = stream.into_split(); + + let mut payload = serde_json::to_string(&req)?; + payload.push('\n'); + write.write_all(payload.as_bytes()).await?; + write.flush().await?; + + let mut reader = BufReader::new(read); + let mut line = String::new(); + reader.read_line(&mut line).await?; + if line.is_empty() { + bail!("server closed connection without responding"); + } + let resp: AgentResponse = serde_json::from_str(line.trim())?; + Ok(resp) +} diff --git a/hive-ag3nt/src/lib.rs b/hive-ag3nt/src/lib.rs index 8b137891..3890473f 100644 --- a/hive-ag3nt/src/lib.rs +++ b/hive-ag3nt/src/lib.rs @@ -1 +1,7 @@ +//! Shared in-container harness code used by both `hive-ag3nt` (agent) and +//! `hive-m1nd` (manager) binaries. +pub mod client; + +/// Default socket path inside the container — bind-mounted by `hive-c0re`. +pub const DEFAULT_SOCKET: &str = "/run/hive/mcp.sock"; diff --git a/nix/templates/agent-base.nix b/nix/templates/agent-base.nix index af425b51..fa0b8e68 100644 --- a/nix/templates/agent-base.nix +++ b/nix/templates/agent-base.nix @@ -7,9 +7,11 @@ systemd.services.hive-ag3nt = { description = "hive-ag3nt harness"; wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; serviceConfig = { - ExecStart = "${pkgs.hyperhive}/bin/hive-ag3nt"; - Type = "oneshot"; + ExecStart = "${pkgs.hyperhive}/bin/hive-ag3nt serve"; + Restart = "on-failure"; + RestartSec = 2; }; }; From 7b05450d1067e32030cb1b223b9d5d0ca1a39bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 21:44:23 +0200 Subject: [PATCH 0522/1295] cargo: enable tokio time feature --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ec8e622f..8faa519e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,6 @@ clap = { version = "4", features = ["derive"] } hive-sh4re = { path = "hive-sh4re" } serde = { version = "1", features = ["derive"] } serde_json = "1" -tokio = { version = "1", features = ["io-util", "macros", "net", "process", "rt-multi-thread", "signal"] } +tokio = { version = "1", features = ["io-util", "macros", "net", "process", "rt-multi-thread", "signal", "time"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } From 58141bdcf0fceefb43895f4a073743e5a0ef7a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 21:44:43 +0200 Subject: [PATCH 0523/1295] Cargo.lock: tokio time feature --- Cargo.lock | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index dba829eb..06ee7d5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -144,6 +144,16 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hive-ag3nt" version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "hive-sh4re", + "serde", + "serde_json", + "tokio", + "tracing", + "tracing-subscriber", +] [[package]] name = "hive-c0re" From f6cf4223a42da6641e3b2d4ba5129eacafc8f660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 21:48:23 +0200 Subject: [PATCH 0524/1295] lifecycle: surface nixos-container stderr in error + log --- hive-c0re/src/lifecycle.rs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index 72c26cdf..8d7cddc7 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -54,13 +54,26 @@ pub async fn list() -> Result> { } async fn run(args: &[&str]) -> Result<()> { - let status = Command::new("nixos-container") + let out = Command::new("nixos-container") .args(args) - .status() + .output() .await .with_context(|| format!("invoke nixos-container {}", args.join(" ")))?; - if !status.success() { - bail!("nixos-container {} exited with {status}", args.join(" ")); + let stdout = String::from_utf8_lossy(&out.stdout); + let stderr = String::from_utf8_lossy(&out.stderr); + if !stdout.trim().is_empty() { + tracing::info!(target: "nixos-container", "{}", stdout.trim()); + } + if !stderr.trim().is_empty() { + tracing::warn!(target: "nixos-container", "{}", stderr.trim()); + } + if !out.status.success() { + bail!( + "nixos-container {} failed ({}): {}", + args.join(" "), + out.status, + stderr.trim() + ); } Ok(()) } From 7ce0f0022f67a7cffd6358b36529d6cc9de24303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 21:52:17 +0200 Subject: [PATCH 0525/1295] lifecycle: bind agent dir via /run/systemd/nspawn override (nixos-container lacks --bind) --- hive-c0re/src/lifecycle.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index 8d7cddc7..20d51f6c 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -17,11 +17,27 @@ pub fn container_name(name: &str) -> String { pub async fn spawn(name: &str, agent_flake: &str, agent_dir: &Path) -> Result<()> { let container = container_name(name); - let bind = format!("{}:{CONTAINER_RUNTIME_MOUNT}", agent_dir.display()); - run(&["create", &container, "--flake", agent_flake, "--bind", &bind]).await?; + run(&["create", &container, "--flake", agent_flake]).await?; + write_nspawn_override(&container, agent_dir)?; run(&["start", &container]).await } +/// `nixos-container` in this stack doesn't expose `--bind`, so we drop a +/// `.nspawn` override that systemd-nspawn picks up at start time. +fn write_nspawn_override(container: &str, agent_dir: &Path) -> Result<()> { + const NSPAWN_DIR: &str = "/run/systemd/nspawn"; + std::fs::create_dir_all(NSPAWN_DIR) + .with_context(|| format!("create {NSPAWN_DIR}"))?; + let path = format!("{NSPAWN_DIR}/{container}.nspawn"); + let content = format!( + "[Files]\nBind={}:{CONTAINER_RUNTIME_MOUNT}\n", + agent_dir.display() + ); + std::fs::write(&path, content).with_context(|| format!("write {path}"))?; + tracing::info!(%path, "wrote nspawn bind override"); + Ok(()) +} + pub async fn kill(name: &str) -> Result<()> { let container = container_name(name); run(&["stop", &container]).await From 326da5a7bf7ff166e422a6099fed63c8afa61e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 21:59:01 +0200 Subject: [PATCH 0526/1295] naming: h- for agents, hm1nd for manager (11-char limit) --- PLAN.md | 10 +++++----- hive-c0re/src/lifecycle.rs | 27 ++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/PLAN.md b/PLAN.md index fe5fd7a4..a6e74bef 100644 --- a/PLAN.md +++ b/PLAN.md @@ -54,7 +54,7 @@ A multi-Claude-Code-agent setup on a single host: │ ├── /run/hyperhive/manager.sock → manager container │ │ └── /run/hyperhive/agents/.sock → that agent │ │ │ -│ ┌─ nixos-container: hive-manager ───────────────┐ │ +│ ┌─ nixos-container: hm1nd ──────────────────────┐ │ │ │ hive-m1nd (Rust, hive-ag3nt crate) │ │ │ │ ├ MCP client → /run/hyperhive/manager.sock │ │ │ │ ├ turn loop driving `claude` │ │ @@ -68,7 +68,7 @@ A multi-Claude-Code-agent setup on a single host: │ │ update_shared_instructions │ │ │ └────────────────────────────────────────────────┘ │ │ │ -│ ┌─ nixos-container: hive-agent- ──────────┐ │ +│ ┌─ nixos-container: h- ───────────────────┐ │ │ │ hive-ag3nt (Rust) │ │ │ │ MCP client → /run/hyperhive/agents/.sock │ │ │ state/ RW, config/ + prompts/ + shared RO │ │ @@ -82,7 +82,7 @@ A multi-Claude-Code-agent setup on a single host: **Sockets, not identity gating.** One unix socket per principal, bind-mounted into the right place. The socket *is* the principal — no `SO_PEERCRED` lookups, no token plumbing. Perms are filesystem perms on the host side, plus the fact that only the matching container has the bind-mount. Each socket runs the MCP tool surface appropriate to its principal. -**Container naming.** All nixos-containers managed by `hive-c0re` are prefixed `hive-`. The manager runs as `hive-manager`. Sub-agents run as `hive-agent-` — the extra `-agent-` segment keeps sub-agents from colliding with the manager slot (even if someone names an agent `manager`) and makes ownership obvious. On-disk paths (`/var/lib/hyperhive/agents/foo/`) and socket paths (`/run/hyperhive/agents/foo.sock`) use the bare logical name; the prefixing lives only at the nixos-container layer. +**Container naming.** `nixos-container` caps the total container name at 11 chars (it gets encoded into network interface names). The manager runs as `hm1nd` (a compressed form of `hive-m1nd`). Sub-agents run as `h-` with `` capped to 9 chars (`MAX_AGENT_NAME`). The two namespaces don't collide. On-disk paths (`/var/lib/hyperhive/agents/foo/`) and socket paths (`/run/hyperhive/agents/foo/mcp.sock`) use the bare logical name; the prefixing lives only at the nixos-container layer. **Approvals are git commits.** `hive-c0re` maintains a `state-repo` on host that records the world (which agents exist, their roles, etc.). Per-agent flake configs (`agents//config/`) are themselves git repos. The manager edits clones with plain `git` CLI inside its container and asks `hive-c0re` to apply a commit via `request_apply_commit(agent, sha)`. `hive-c0re` queues it; once approved, fast-forwards `main` and reconciles state (rebuild containers, etc.). **No abstract "approval token" — the commit hash is the token.** @@ -117,7 +117,7 @@ A multi-Claude-Code-agent setup on a single host: - **Exit:** `nixos-container create test-agent --flake .#agent-base && nixos-container start test-agent` brings up a container whose `hive-ag3nt` prints "hello" and exits. ### Phase 1 — container lifecycle + Risk 1 -- `hive-c0re`: open host admin socket (`/run/hyperhive/host.sock`); verbs `spawn(name)`, `kill(name)`, `rebuild(name)`, `list()`. Uses `nixos-container` underneath; container name on the host is `hive-agent-`. +- `hive-c0re`: open host admin socket (`/run/hyperhive/host.sock`); verbs `spawn(name)`, `kill(name)`, `rebuild(name)`, `list()`. Uses `nixos-container` underneath; container name on the host is `h-` (sub-agents) or `hm1nd` (manager). - CLI tool talking to the admin socket (same `hive-c0re` binary, subcommand-driven). - Manually mutate an agent's config flake, call `rebuild`, observe whether `hive-ag3nt` survives. - **Decision:** if hot-reload doesn't preserve the harness, that becomes a hard requirement of `hive-ag3nt`'s design (resume from disk state). Document the outcome. @@ -136,7 +136,7 @@ A multi-Claude-Code-agent setup on a single host: ### Phase 4 — `hive-m1nd` + privileged surface - `hive-m1nd` binary (second `[[bin]]` in `hive-ag3nt`) wires the manager tool surface. -- Manager container (`hive-manager`) declared in host NixOS module (auto-restart). Bind-mount `agents/**` RW. +- Manager container (`hm1nd`) declared in host NixOS module (auto-restart). Bind-mount `agents/**` RW. - Manager socket gets the privileged tool surface: `request_spawn`/`request_kill`, `request_apply_commit`, `inject_peer_info`, `send(..., wait_for_reply=true)`. - Smoke: attach a terminal to the manager container (`nixos-container root-login`); ask `hive-m1nd` to spawn an agent and route a message to it. - **Exit:** manager spawns, routes, kills a child agent end-to-end; lifecycle still gated by manual CLI approval (no GUI yet). diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index 20d51f6c..06453d8b 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -5,8 +5,13 @@ use std::path::Path; use anyhow::{Context, Result, bail}; use tokio::process::Command; -pub const AGENT_PREFIX: &str = "hive-agent-"; -pub const HIVE_PREFIX: &str = "hive-"; +/// Sub-agent container prefix. `nixos-container` caps the total container name +/// at 11 chars (it gets encoded into network interface names), so the agent +/// name itself can be at most `MAX_AGENT_NAME` chars. +pub const AGENT_PREFIX: &str = "h-"; +pub const MAX_AGENT_NAME: usize = 9; +/// Container name of the manager (a separate slot from sub-agents). +pub const MANAGER_NAME: &str = "hm1nd"; /// Mount point of the per-agent runtime directory inside the container. pub const CONTAINER_RUNTIME_MOUNT: &str = "/run/hive"; @@ -15,7 +20,21 @@ pub fn container_name(name: &str) -> String { format!("{AGENT_PREFIX}{name}") } +fn validate(name: &str) -> Result<()> { + if name.is_empty() { + bail!("agent name must not be empty"); + } + if name.len() > MAX_AGENT_NAME { + bail!( + "agent name '{name}' is too long ({} chars); max {MAX_AGENT_NAME}", + name.len() + ); + } + Ok(()) +} + pub async fn spawn(name: &str, agent_flake: &str, agent_dir: &Path) -> Result<()> { + validate(name)?; let container = container_name(name); run(&["create", &container, "--flake", agent_flake]).await?; write_nspawn_override(&container, agent_dir)?; @@ -39,11 +58,13 @@ fn write_nspawn_override(container: &str, agent_dir: &Path) -> Result<()> { } pub async fn kill(name: &str) -> Result<()> { + validate(name)?; let container = container_name(name); run(&["stop", &container]).await } pub async fn rebuild(name: &str, agent_flake: &str) -> Result<()> { + validate(name)?; let container = container_name(name); run(&["update", &container, "--flake", agent_flake]).await } @@ -64,7 +85,7 @@ pub async fn list() -> Result> { Ok(String::from_utf8_lossy(&out.stdout) .lines() .map(str::trim) - .filter(|line| line.starts_with(HIVE_PREFIX)) + .filter(|line| line.starts_with(AGENT_PREFIX) || *line == MANAGER_NAME) .map(str::to_owned) .collect()) } From 377eb994a18bed5de12387c1220248b725db84b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:06:27 +0200 Subject: [PATCH 0527/1295] lifecycle: bind via EXTRA_NSPAWN_FLAGS in /etc/nixos-containers/.conf --- hive-c0re/src/lifecycle.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index 06453d8b..f8e4f1e7 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -37,23 +37,23 @@ pub async fn spawn(name: &str, agent_flake: &str, agent_dir: &Path) -> Result<() validate(name)?; let container = container_name(name); run(&["create", &container, "--flake", agent_flake]).await?; - write_nspawn_override(&container, agent_dir)?; + append_bind_flag(&container, agent_dir)?; run(&["start", &container]).await } -/// `nixos-container` in this stack doesn't expose `--bind`, so we drop a -/// `.nspawn` override that systemd-nspawn picks up at start time. -fn write_nspawn_override(container: &str, agent_dir: &Path) -> Result<()> { - const NSPAWN_DIR: &str = "/run/systemd/nspawn"; - std::fs::create_dir_all(NSPAWN_DIR) - .with_context(|| format!("create {NSPAWN_DIR}"))?; - let path = format!("{NSPAWN_DIR}/{container}.nspawn"); - let content = format!( - "[Files]\nBind={}:{CONTAINER_RUNTIME_MOUNT}\n", +/// `nixos-container` doesn't expose `--bind` on the CLI, but its start script +/// expands `$EXTRA_NSPAWN_FLAGS` (from `/etc/nixos-containers/.conf`) +/// unquoted into the `systemd-nspawn` invocation. Append a `--bind` flag there. +fn append_bind_flag(container: &str, agent_dir: &Path) -> Result<()> { + let path = format!("/etc/nixos-containers/{container}.conf"); + let line = format!( + "\nEXTRA_NSPAWN_FLAGS=\"--bind={}:{CONTAINER_RUNTIME_MOUNT}\"\n", agent_dir.display() ); + let mut content = std::fs::read_to_string(&path).with_context(|| format!("read {path}"))?; + content.push_str(&line); std::fs::write(&path, content).with_context(|| format!("write {path}"))?; - tracing::info!(%path, "wrote nspawn bind override"); + tracing::info!(%path, "appended EXTRA_NSPAWN_FLAGS for bind mount"); Ok(()) } From 764d6497dd1cfe5d66073fdcb893f2c834918955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:09:22 +0200 Subject: [PATCH 0528/1295] lifecycle: rebuild reconciles bind flag idempotently and restarts --- hive-c0re/src/lifecycle.rs | 33 ++++++++++++++++++++++----------- hive-c0re/src/server.rs | 3 ++- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index f8e4f1e7..bdb0ffa1 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -37,23 +37,30 @@ pub async fn spawn(name: &str, agent_flake: &str, agent_dir: &Path) -> Result<() validate(name)?; let container = container_name(name); run(&["create", &container, "--flake", agent_flake]).await?; - append_bind_flag(&container, agent_dir)?; + set_bind_flag(&container, agent_dir)?; run(&["start", &container]).await } /// `nixos-container` doesn't expose `--bind` on the CLI, but its start script /// expands `$EXTRA_NSPAWN_FLAGS` (from `/etc/nixos-containers/.conf`) -/// unquoted into the `systemd-nspawn` invocation. Append a `--bind` flag there. -fn append_bind_flag(container: &str, agent_dir: &Path) -> Result<()> { +/// unquoted into the `systemd-nspawn` invocation. Idempotently replace the +/// `EXTRA_NSPAWN_FLAGS` line with the bind we want. +fn set_bind_flag(container: &str, agent_dir: &Path) -> Result<()> { let path = format!("/etc/nixos-containers/{container}.conf"); - let line = format!( - "\nEXTRA_NSPAWN_FLAGS=\"--bind={}:{CONTAINER_RUNTIME_MOUNT}\"\n", + let original = std::fs::read_to_string(&path).with_context(|| format!("read {path}"))?; + let mut lines: Vec = original + .lines() + .filter(|line| !line.trim_start().starts_with("EXTRA_NSPAWN_FLAGS=")) + .map(str::to_owned) + .collect(); + lines.push(format!( + "EXTRA_NSPAWN_FLAGS=\"--bind={}:{CONTAINER_RUNTIME_MOUNT}\"", agent_dir.display() - ); - let mut content = std::fs::read_to_string(&path).with_context(|| format!("read {path}"))?; - content.push_str(&line); + )); + let mut content = lines.join("\n"); + content.push('\n'); std::fs::write(&path, content).with_context(|| format!("write {path}"))?; - tracing::info!(%path, "appended EXTRA_NSPAWN_FLAGS for bind mount"); + tracing::info!(%path, "set EXTRA_NSPAWN_FLAGS for bind mount"); Ok(()) } @@ -63,10 +70,14 @@ pub async fn kill(name: &str) -> Result<()> { run(&["stop", &container]).await } -pub async fn rebuild(name: &str, agent_flake: &str) -> Result<()> { +pub async fn rebuild(name: &str, agent_flake: &str, agent_dir: &Path) -> Result<()> { validate(name)?; let container = container_name(name); - run(&["update", &container, "--flake", agent_flake]).await + set_bind_flag(&container, agent_dir)?; + run(&["update", &container, "--flake", agent_flake]).await?; + // Restart so any nspawn-level changes (bind mounts, networking, etc.) apply. + run(&["stop", &container]).await?; + run(&["start", &container]).await } pub async fn list() -> Result> { diff --git a/hive-c0re/src/server.rs b/hive-c0re/src/server.rs index 131e1b43..487c92f5 100644 --- a/hive-c0re/src/server.rs +++ b/hive-c0re/src/server.rs @@ -77,7 +77,8 @@ async fn dispatch(req: &HostRequest, agent_flake: &str, coord: &Coordinator) -> } HostRequest::Rebuild { name } => { tracing::info!(%name, "rebuild"); - lifecycle::rebuild(name, agent_flake).await?; + let agent_dir = Coordinator::agent_dir(name); + lifecycle::rebuild(name, agent_flake, &agent_dir).await?; HostResponse::success() } HostRequest::List => HostResponse::list(lifecycle::list().await?), From 746132d41eac0088d3b789d3cc1f5cccae4b4663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:10:18 +0200 Subject: [PATCH 0529/1295] agent-base: boot.isNspawnContainer (required on 25.11+) --- nix/templates/agent-base.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/templates/agent-base.nix b/nix/templates/agent-base.nix index fa0b8e68..66353252 100644 --- a/nix/templates/agent-base.nix +++ b/nix/templates/agent-base.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { - boot.isContainer = true; + boot.isNspawnContainer = true; environment.systemPackages = [ pkgs.hyperhive ]; From af464e27f44362f119fe6d7de3ebb6cc21172948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:13:00 +0200 Subject: [PATCH 0530/1295] rebuild re-registers agent; preserve /run/hyperhive across restarts --- hive-c0re/src/coordinator.rs | 3 +++ hive-c0re/src/server.rs | 2 +- nix/modules/hive-c0re.nix | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index 66d8b7dd..105e92ad 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -26,6 +26,9 @@ impl Coordinator { } pub async fn register_agent(&self, name: &str) -> Result { + // Idempotent: drop any existing listener so re-registration (e.g. on rebuild, + // or after a hive-c0re restart cleared /run/hyperhive) gets a fresh socket. + self.unregister_agent(name); let agent_dir = Self::agent_dir(name); std::fs::create_dir_all(&agent_dir) .with_context(|| format!("create agent dir {}", agent_dir.display()))?; diff --git a/hive-c0re/src/server.rs b/hive-c0re/src/server.rs index 487c92f5..2e34a9b0 100644 --- a/hive-c0re/src/server.rs +++ b/hive-c0re/src/server.rs @@ -77,7 +77,7 @@ async fn dispatch(req: &HostRequest, agent_flake: &str, coord: &Coordinator) -> } HostRequest::Rebuild { name } => { tracing::info!(%name, "rebuild"); - let agent_dir = Coordinator::agent_dir(name); + let agent_dir = coord.register_agent(name).await?; lifecycle::rebuild(name, agent_flake, &agent_dir).await?; HostResponse::success() } diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index ba778257..dc9c383e 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -37,6 +37,7 @@ in RestartSec = 2; RuntimeDirectory = "hyperhive"; RuntimeDirectoryMode = "0750"; + RuntimeDirectoryPreserve = "yes"; StateDirectory = "hyperhive"; }; }; From d220720f6aa6077531e36f85309e0e4c54ffc5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:17:16 +0200 Subject: [PATCH 0531/1295] broker: sqlite-backed (survives hive-c0re restart) --- Cargo.toml | 1 + hive-c0re/Cargo.toml | 1 + hive-c0re/src/agent_server.rs | 17 +++++--- hive-c0re/src/broker.rs | 80 ++++++++++++++++++++++++++++------- hive-c0re/src/coordinator.rs | 11 ++--- hive-c0re/src/main.rs | 7 ++- 6 files changed, 90 insertions(+), 27 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8faa519e..dec6e1c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ version = "0.1.0" anyhow = "1" clap = { version = "4", features = ["derive"] } hive-sh4re = { path = "hive-sh4re" } +rusqlite = { version = "0.37", features = ["bundled"] } serde = { version = "1", features = ["derive"] } serde_json = "1" tokio = { version = "1", features = ["io-util", "macros", "net", "process", "rt-multi-thread", "signal", "time"] } diff --git a/hive-c0re/Cargo.toml b/hive-c0re/Cargo.toml index be3ed947..2d84474b 100644 --- a/hive-c0re/Cargo.toml +++ b/hive-c0re/Cargo.toml @@ -7,6 +7,7 @@ version.workspace = true anyhow.workspace = true clap.workspace = true hive-sh4re.workspace = true +rusqlite.workspace = true serde.workspace = true serde_json.workspace = true tokio.workspace = true diff --git a/hive-c0re/src/agent_server.rs b/hive-c0re/src/agent_server.rs index 89104a8a..05aae47e 100644 --- a/hive-c0re/src/agent_server.rs +++ b/hive-c0re/src/agent_server.rs @@ -83,19 +83,26 @@ async fn serve(stream: UnixStream, agent: String, broker: Arc) -> Result fn dispatch(req: &AgentRequest, agent: &str, broker: &Broker) -> AgentResponse { match req { AgentRequest::Send { to, body } => { - broker.send(Message { + match broker.send(Message { from: agent.to_owned(), to: to.clone(), body: body.clone(), - }); - AgentResponse::Ok + }) { + Ok(()) => AgentResponse::Ok, + Err(e) => AgentResponse::Err { + message: format!("{e:#}"), + }, + } } AgentRequest::Recv => match broker.recv(agent) { - Some(msg) => AgentResponse::Message { + Ok(Some(msg)) => AgentResponse::Message { from: msg.from, body: msg.body, }, - None => AgentResponse::Empty, + Ok(None) => AgentResponse::Empty, + Err(e) => AgentResponse::Err { + message: format!("{e:#}"), + }, }, } } diff --git a/hive-c0re/src/broker.rs b/hive-c0re/src/broker.rs index 2867c1f7..0eb25552 100644 --- a/hive-c0re/src/broker.rs +++ b/hive-c0re/src/broker.rs @@ -1,30 +1,80 @@ -//! In-memory message broker. Phase 3 replaces this with a sqlite-backed store. +//! Sqlite-backed message broker. Survives `hive-c0re` restart. -use std::collections::{HashMap, VecDeque}; +use std::path::Path; use std::sync::Mutex; +use std::time::{SystemTime, UNIX_EPOCH}; +use anyhow::{Context, Result}; use hive_sh4re::Message; +use rusqlite::{Connection, OptionalExtension, params}; + +const SCHEMA: &str = r#" +CREATE TABLE IF NOT EXISTS messages ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + sender TEXT NOT NULL, + recipient TEXT NOT NULL, + body TEXT NOT NULL, + sent_at INTEGER NOT NULL, + delivered_at INTEGER +); +CREATE INDEX IF NOT EXISTS idx_messages_undelivered + ON messages (recipient, id) WHERE delivered_at IS NULL; +"#; -#[derive(Default)] pub struct Broker { - queues: Mutex>>, + conn: Mutex, } impl Broker { - pub fn new() -> Self { - Self::default() + pub fn open(path: &Path) -> Result { + if let Some(parent) = path.parent() { + std::fs::create_dir_all(parent) + .with_context(|| format!("create db parent {}", parent.display()))?; + } + let conn = Connection::open(path) + .with_context(|| format!("open broker db {}", path.display()))?; + conn.execute_batch(SCHEMA).context("apply broker schema")?; + Ok(Self { + conn: Mutex::new(conn), + }) } - pub fn send(&self, message: Message) { - let mut queues = self.queues.lock().unwrap(); - queues - .entry(message.to.clone()) - .or_default() - .push_back(message); + pub fn send(&self, message: Message) -> Result<()> { + let conn = self.conn.lock().unwrap(); + conn.execute( + "INSERT INTO messages (sender, recipient, body, sent_at) VALUES (?1, ?2, ?3, ?4)", + params![message.from, message.to, message.body, now_unix()], + )?; + Ok(()) } - pub fn recv(&self, recipient: &str) -> Option { - let mut queues = self.queues.lock().unwrap(); - queues.get_mut(recipient).and_then(|q| q.pop_front()) + pub fn recv(&self, recipient: &str) -> Result> { + let conn = self.conn.lock().unwrap(); + let row: Option<(i64, String, String, String)> = conn + .query_row( + "SELECT id, sender, recipient, body + FROM messages + WHERE recipient = ?1 AND delivered_at IS NULL + ORDER BY id ASC + LIMIT 1", + params![recipient], + |row| Ok((row.get(0)?, row.get(1)?, row.get(2)?, row.get(3)?)), + ) + .optional()?; + let Some((id, from, to, body)) = row else { + return Ok(None); + }; + conn.execute( + "UPDATE messages SET delivered_at = ?1 WHERE id = ?2", + params![now_unix(), id], + )?; + Ok(Some(Message { from, to, body })) } } + +fn now_unix() -> i64 { + SystemTime::now() + .duration_since(UNIX_EPOCH) + .map(|d| d.as_secs() as i64) + .unwrap_or(0) +} diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index 105e92ad..04b5e6ba 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -2,7 +2,7 @@ //! sockets: the broker plus a map of `name -> AgentSocket`. use std::collections::HashMap; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex}; use anyhow::{Context, Result}; @@ -18,11 +18,12 @@ pub struct Coordinator { } impl Coordinator { - pub fn new() -> Self { - Self { - broker: Arc::new(Broker::new()), + pub fn open(db_path: &Path) -> Result { + let broker = Broker::open(db_path).context("open broker")?; + Ok(Self { + broker: Arc::new(broker), agents: Mutex::new(HashMap::new()), - } + }) } pub async fn register_agent(&self, name: &str) -> Result { diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index 760d1933..6346cf9e 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -32,6 +32,9 @@ enum Cmd { /// Flake reference for the agent base template. #[arg(long, default_value = "/etc/hyperhive#agent-base")] agent_flake: String, + /// Path to the sqlite message store. + #[arg(long, default_value = "/var/lib/hyperhive/broker.sqlite")] + db: PathBuf, }, /// Spawn a new agent container (`hive-agent-`). Spawn { name: String }, @@ -54,8 +57,8 @@ async fn main() -> Result<()> { let cli = Cli::parse(); match cli.cmd { - Cmd::Serve { agent_flake } => { - let coord = Arc::new(Coordinator::new()); + Cmd::Serve { agent_flake, db } => { + let coord = Arc::new(Coordinator::open(&db)?); server::serve(&cli.socket, &agent_flake, coord).await } Cmd::Spawn { name } => { From 28b3477216bd34f9e680fbd95e44e11d3eda3270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:17:58 +0200 Subject: [PATCH 0532/1295] Cargo.lock: rusqlite --- Cargo.lock | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 06ee7d5f..7e58d09a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,12 +67,28 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + [[package]] name = "bytes" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +[[package]] +name = "cc" +version = "1.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" +dependencies = [ + "find-msvc-tools", + "shlex", +] + [[package]] name = "cfg-if" version = "1.0.4" @@ -135,6 +151,48 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown", +] + [[package]] name = "heck" version = "0.5.0" @@ -162,6 +220,7 @@ dependencies = [ "anyhow", "clap", "hive-sh4re", + "rusqlite", "serde", "serde_json", "tokio", @@ -200,6 +259,17 @@ version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" +[[package]] +name = "libsqlite3-sys" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + [[package]] name = "log" version = "0.4.29" @@ -259,6 +329,12 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + [[package]] name = "proc-macro2" version = "1.0.106" @@ -294,6 +370,20 @@ version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +[[package]] +name = "rusqlite" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165ca6e57b20e1351573e3729b958bc62f0e48025386970b6e4d29e7a7e71f3f" +dependencies = [ + "bitflags", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", +] + [[package]] name = "serde" version = "1.0.228" @@ -346,6 +436,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.8" @@ -504,6 +600,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" From 2fe9e91005f8f4044990c8d9c7bc2f2ddf880a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:19:05 +0200 Subject: [PATCH 0533/1295] hive-ag3nt: echo turn (placeholder until claude integration) --- hive-ag3nt/src/bin/hive-ag3nt.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hive-ag3nt/src/bin/hive-ag3nt.rs b/hive-ag3nt/src/bin/hive-ag3nt.rs index 021c400a..58327eb8 100644 --- a/hive-ag3nt/src/bin/hive-ag3nt.rs +++ b/hive-ag3nt/src/bin/hive-ag3nt.rs @@ -62,6 +62,18 @@ async fn serve(socket: &std::path::Path, interval: Duration) -> Result<()> { match client::request(socket, AgentRequest::Recv).await { Ok(AgentResponse::Message { from, body }) => { tracing::info!(%from, %body, "inbox"); + // Placeholder "turn": echo back, prefixed. Phase 3c replaces this + // with `claude --print` once API-key plumbing exists. Don't echo + // an echo, so a manual `send` produces exactly one reply. + if !body.starts_with("echo: ") { + let reply = AgentRequest::Send { + to: from.clone(), + body: format!("echo: {body}"), + }; + if let Err(e) = client::request(socket, reply).await { + tracing::warn!(error = ?e, "send reply failed"); + } + } } Ok(AgentResponse::Empty) => {} Ok(AgentResponse::Ok) => { From 6e7fd2e897c10aa58ce49f0be56e64dcdb626944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:26:14 +0200 Subject: [PATCH 0534/1295] Phase 3c: nixpkgs-unstable for claude-code; harness calls claude --print, falls back to echo --- flake.nix | 26 ++++++++++++-- hive-ag3nt/src/bin/hive-ag3nt.rs | 59 ++++++++++++++++++++++++++------ hive-c0re/src/coordinator.rs | 5 +-- hive-c0re/src/lifecycle.rs | 50 +++++++++++++-------------- nix/modules/hive-c0re.nix | 1 - nix/templates/agent-base.nix | 10 +++++- 6 files changed, 106 insertions(+), 45 deletions(-) diff --git a/flake.nix b/flake.nix index ad0007d2..4d845932 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; naersk = { url = "github:nix-community/naersk"; inputs.nixpkgs.follows = "nixpkgs"; @@ -17,6 +18,7 @@ inputs@{ self, nixpkgs, + nixpkgs-unstable, naersk, treefmt-nix, }: @@ -57,8 +59,21 @@ } ); - overlays.default = final: prev: { - hyperhive = self.packages.${prev.stdenv.hostPlatform.system}.default; + overlays = { + default = final: prev: { + hyperhive = self.packages.${prev.stdenv.hostPlatform.system}.default; + }; + claude-unstable = + final: prev: + let + unstable = import nixpkgs-unstable { + inherit (prev.stdenv.hostPlatform) system; + config.allowUnfreePredicate = pkg: builtins.elem (prev.lib.getName pkg) [ "claude-code" ]; + }; + in + { + inherit (unstable) claude-code; + }; }; nixosModules = { @@ -70,7 +85,12 @@ system = "x86_64-linux"; modules = [ self.nixosModules.agent-base - { nixpkgs.overlays = [ self.overlays.default ]; } + { + nixpkgs.overlays = [ + self.overlays.default + self.overlays.claude-unstable + ]; + } ]; }; diff --git a/hive-ag3nt/src/bin/hive-ag3nt.rs b/hive-ag3nt/src/bin/hive-ag3nt.rs index 58327eb8..33d2ecb3 100644 --- a/hive-ag3nt/src/bin/hive-ag3nt.rs +++ b/hive-ag3nt/src/bin/hive-ag3nt.rs @@ -1,10 +1,11 @@ -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::time::Duration; use anyhow::{Result, bail}; use clap::{Parser, Subcommand}; use hive_ag3nt::{DEFAULT_SOCKET, client}; use hive_sh4re::{AgentRequest, AgentResponse}; +use tokio::process::Command; #[derive(Parser)] #[command(name = "hive-ag3nt", about = "hyperhive sub-agent harness")] @@ -19,7 +20,8 @@ struct Cli { #[derive(Subcommand)] enum Cmd { - /// Run the long-lived harness loop. Polls inbox; prints messages to stdout. + /// Run the long-lived harness loop. Polls inbox; replies via `claude --print` + /// when available, falling back to a simple echo otherwise. Serve { /// Inbox poll interval in milliseconds. #[arg(long, default_value_t = 1000)] @@ -56,21 +58,26 @@ async fn main() -> Result<()> { } } -async fn serve(socket: &std::path::Path, interval: Duration) -> Result<()> { +async fn serve(socket: &Path, interval: Duration) -> Result<()> { tracing::info!(socket = %socket.display(), "hive-ag3nt serve"); loop { match client::request(socket, AgentRequest::Recv).await { Ok(AgentResponse::Message { from, body }) => { tracing::info!(%from, %body, "inbox"); - // Placeholder "turn": echo back, prefixed. Phase 3c replaces this - // with `claude --print` once API-key plumbing exists. Don't echo - // an echo, so a manual `send` produces exactly one reply. + // Don't auto-reply to echoes — prevents infinite ping-pong when + // both ends are falling back to echo. Real loop control is the + // manager's job (Phase 4+). if !body.starts_with("echo: ") { - let reply = AgentRequest::Send { - to: from.clone(), - body: format!("echo: {body}"), - }; - if let Err(e) = client::request(socket, reply).await { + let reply = compute_reply(&body).await; + if let Err(e) = client::request( + socket, + AgentRequest::Send { + to: from, + body: reply, + }, + ) + .await + { tracing::warn!(error = ?e, "send reply failed"); } } @@ -90,6 +97,36 @@ async fn serve(socket: &std::path::Path, interval: Duration) -> Result<()> { } } +async fn compute_reply(prompt: &str) -> String { + match invoke_claude(prompt).await { + Ok(s) => s, + Err(e) => { + tracing::warn!(error = %format!("{e:#}"), "claude failed; falling back to echo"); + format!("echo: {prompt}") + } + } +} + +async fn invoke_claude(prompt: &str) -> Result { + let out = Command::new("claude") + .arg("--print") + .arg(prompt) + .output() + .await?; + if !out.status.success() { + bail!( + "claude exited {}: {}", + out.status, + String::from_utf8_lossy(&out.stderr).trim() + ); + } + let text = String::from_utf8_lossy(&out.stdout).trim().to_owned(); + if text.is_empty() { + bail!("claude produced empty output"); + } + Ok(text) +} + fn render(resp: &AgentResponse) -> Result<()> { println!("{}", serde_json::to_string_pretty(resp)?); Ok(()) diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index 04b5e6ba..20c510f9 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -36,10 +36,7 @@ impl Coordinator { let socket_path = Self::socket_path(name); let socket = agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?; - self.agents - .lock() - .unwrap() - .insert(name.to_owned(), socket); + self.agents.lock().unwrap().insert(name.to_owned(), socket); Ok(agent_dir) } diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index bdb0ffa1..7399ff74 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -37,33 +37,10 @@ pub async fn spawn(name: &str, agent_flake: &str, agent_dir: &Path) -> Result<() validate(name)?; let container = container_name(name); run(&["create", &container, "--flake", agent_flake]).await?; - set_bind_flag(&container, agent_dir)?; + set_nspawn_flags(&container, agent_dir)?; run(&["start", &container]).await } -/// `nixos-container` doesn't expose `--bind` on the CLI, but its start script -/// expands `$EXTRA_NSPAWN_FLAGS` (from `/etc/nixos-containers/.conf`) -/// unquoted into the `systemd-nspawn` invocation. Idempotently replace the -/// `EXTRA_NSPAWN_FLAGS` line with the bind we want. -fn set_bind_flag(container: &str, agent_dir: &Path) -> Result<()> { - let path = format!("/etc/nixos-containers/{container}.conf"); - let original = std::fs::read_to_string(&path).with_context(|| format!("read {path}"))?; - let mut lines: Vec = original - .lines() - .filter(|line| !line.trim_start().starts_with("EXTRA_NSPAWN_FLAGS=")) - .map(str::to_owned) - .collect(); - lines.push(format!( - "EXTRA_NSPAWN_FLAGS=\"--bind={}:{CONTAINER_RUNTIME_MOUNT}\"", - agent_dir.display() - )); - let mut content = lines.join("\n"); - content.push('\n'); - std::fs::write(&path, content).with_context(|| format!("write {path}"))?; - tracing::info!(%path, "set EXTRA_NSPAWN_FLAGS for bind mount"); - Ok(()) -} - pub async fn kill(name: &str) -> Result<()> { validate(name)?; let container = container_name(name); @@ -73,7 +50,7 @@ pub async fn kill(name: &str) -> Result<()> { pub async fn rebuild(name: &str, agent_flake: &str, agent_dir: &Path) -> Result<()> { validate(name)?; let container = container_name(name); - set_bind_flag(&container, agent_dir)?; + set_nspawn_flags(&container, agent_dir)?; run(&["update", &container, "--flake", agent_flake]).await?; // Restart so any nspawn-level changes (bind mounts, networking, etc.) apply. run(&["stop", &container]).await?; @@ -101,6 +78,29 @@ pub async fn list() -> Result> { .collect()) } +/// Idempotently rewrite the `EXTRA_NSPAWN_FLAGS` line in +/// `/etc/nixos-containers/.conf`. The start script expands this +/// variable unquoted into the `systemd-nspawn` command. +fn set_nspawn_flags(container: &str, agent_dir: &Path) -> Result<()> { + let path = format!("/etc/nixos-containers/{container}.conf"); + let original = std::fs::read_to_string(&path).with_context(|| format!("read {path}"))?; + let flag = format!( + "EXTRA_NSPAWN_FLAGS=\"--bind={}:{CONTAINER_RUNTIME_MOUNT}\"", + agent_dir.display() + ); + let mut lines: Vec = original + .lines() + .filter(|line| !line.trim_start().starts_with("EXTRA_NSPAWN_FLAGS=")) + .map(str::to_owned) + .collect(); + lines.push(flag); + let mut content = lines.join("\n"); + content.push('\n'); + std::fs::write(&path, content).with_context(|| format!("write {path}"))?; + tracing::info!(%path, "set EXTRA_NSPAWN_FLAGS"); + Ok(()) +} + async fn run(args: &[&str]) -> Result<()> { let out = Command::new("nixos-container") .args(args) diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index dc9c383e..86ba5909 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -29,7 +29,6 @@ in systemd.services.hive-c0re = { description = "hyperhive coordinator daemon"; wantedBy = [ "multi-user.target" ]; - # `nixos-container` lives in the system path; make it reachable from the unit. path = [ "/run/current-system/sw" ]; serviceConfig = { ExecStart = "${cfg.package}/bin/hive-c0re --socket /run/hyperhive/host.sock serve --agent-flake ${cfg.agentFlake}"; diff --git a/nix/templates/agent-base.nix b/nix/templates/agent-base.nix index 66353252..4a56a340 100644 --- a/nix/templates/agent-base.nix +++ b/nix/templates/agent-base.nix @@ -2,7 +2,15 @@ { boot.isNspawnContainer = true; - environment.systemPackages = [ pkgs.hyperhive ]; + nixpkgs.config.allowUnfreePredicate = + pkg: builtins.elem (pkgs.lib.getName pkg) [ "claude-code" ]; + + environment.systemPackages = with pkgs; [ + hyperhive + claude-code + git + coreutils-full + ]; systemd.services.hive-ag3nt = { description = "hive-ag3nt harness"; From 2a98e3ca87204ea7c604dfe99fadb6ee7d67a210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:27:03 +0200 Subject: [PATCH 0535/1295] fmt --- flake.lock | 17 +++++++++++++++++ hive-c0re/src/broker.rs | 4 ++-- hive-c0re/src/coordinator.rs | 3 +-- nix/templates/agent-base.nix | 3 +-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index b97b56a2..06e16854 100644 --- a/flake.lock +++ b/flake.lock @@ -59,10 +59,27 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1778672786, + "narHash": "sha256-Blg88K1jwG+P0Mr27+rKMFCufdrWkV3wWh9AdYtz0FQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eef00dfd8a712b34af845f9350bac681b1228bd1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "naersk": "naersk", "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", "treefmt-nix": "treefmt-nix" } }, diff --git a/hive-c0re/src/broker.rs b/hive-c0re/src/broker.rs index 0eb25552..a88bbd8e 100644 --- a/hive-c0re/src/broker.rs +++ b/hive-c0re/src/broker.rs @@ -31,8 +31,8 @@ impl Broker { std::fs::create_dir_all(parent) .with_context(|| format!("create db parent {}", parent.display()))?; } - let conn = Connection::open(path) - .with_context(|| format!("open broker db {}", path.display()))?; + let conn = + Connection::open(path).with_context(|| format!("open broker db {}", path.display()))?; conn.execute_batch(SCHEMA).context("apply broker schema")?; Ok(Self { conn: Mutex::new(conn), diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index 20c510f9..b2ba2f90 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -34,8 +34,7 @@ impl Coordinator { std::fs::create_dir_all(&agent_dir) .with_context(|| format!("create agent dir {}", agent_dir.display()))?; let socket_path = Self::socket_path(name); - let socket = - agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?; + let socket = agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?; self.agents.lock().unwrap().insert(name.to_owned(), socket); Ok(agent_dir) } diff --git a/nix/templates/agent-base.nix b/nix/templates/agent-base.nix index 4a56a340..c633925a 100644 --- a/nix/templates/agent-base.nix +++ b/nix/templates/agent-base.nix @@ -2,8 +2,7 @@ { boot.isNspawnContainer = true; - nixpkgs.config.allowUnfreePredicate = - pkg: builtins.elem (pkgs.lib.getName pkg) [ "claude-code" ]; + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) [ "claude-code" ]; environment.systemPackages = with pkgs; [ hyperhive From 4f191b2e4361ef228de652cdaf45b24b32febea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:29:25 +0200 Subject: [PATCH 0536/1295] tests: roundtrip smoke; CLAUDE.md --- CLAUDE.md | 157 +++++++++++++++++++++++++++++++++++++++++++++ tests/roundtrip.sh | 61 ++++++++++++++++++ 2 files changed, 218 insertions(+) create mode 100644 CLAUDE.md create mode 100755 tests/roundtrip.sh diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..1f2f80af --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,157 @@ +# hyperhive + +Multi-Claude-Code-agent orchestration on **nixos-containers**. A host-side Rust +daemon spawns nspawn-isolated agent containers and brokers messages between +them. Eventually a manager agent (another Claude Code session in its own +container) coordinates the swarm and gates lifecycle changes on user approval +via git commits. + +**PLAN.md** is the living design doc. Read it for the *why* and the phase +roadmap; this file is the operator/developer reference for the *how*. + +## Architecture + +``` +host +├── hive-c0re (Rust daemon, NixOS service) +│ ├── lifecycle — nixos-container CRUD +│ ├── broker — sqlite message store (/var/lib/hyperhive/broker.sqlite) +│ ├── server — host admin socket (JSON line protocol) +│ └── agent_server — per-agent MCP-ish sockets +│ +├── /run/hyperhive/ +│ ├── host.sock — admin CLI ↔ daemon +│ └── agents//mcp.sock — bind-mounted into each container at /run/hive +│ +└── nixos-containers + ├── h- (sub-agents, hive-ag3nt binary) + └── hm1nd (manager, hive-m1nd binary — Phase 4+) +``` + +## Crates / file map + +``` +hive-c0re/ host daemon + CLI (one binary, subcommand-dispatched) + main.rs clap setup; serve vs spawn/kill/rebuild/list + server.rs host admin socket + client.rs host admin socket client (for spawn/kill/rebuild/list) + broker.rs sqlite-backed Message store (rusqlite) + agent_server.rs per-agent socket listener + coordinator.rs shared runtime state (broker + map) + lifecycle.rs `nixos-container` shellouts (spawn/kill/rebuild/list) + +hive-ag3nt/ in-container harness; produces TWO binaries from one crate + src/lib.rs DEFAULT_SOCKET, re-exports + src/client.rs AgentRequest/AgentResponse over /run/hive/mcp.sock + src/bin/hive-ag3nt.rs sub-agent CLI (serve/send/recv) + src/bin/hive-m1nd.rs manager placeholder (Phase 4) + +hive-sh4re/ wire types (HostRequest/Response, AgentRequest/Response, Message) + +nix/ + modules/hive-c0re.nix systemd service wiring + templates/agent-base.nix nixos-container template (boot.isNspawnContainer = true) + +tests/roundtrip.sh Phase 3 end-to-end smoke test +``` + +## Conventions + +- **Naming.** Containers are length-bounded (`nixos-container` ≤ 11 chars). + Sub-agents are `h-` with `` ≤ 9 chars; the manager is `hm1nd`. + `MAX_AGENT_NAME` enforces the cap in `lifecycle.rs`. +- **Identity = socket.** No auth/tokens on the per-agent sockets. The socket + *path* identifies the principal; perms come from "who has the bind-mount." +- **Wire protocol.** JSON line-delimited over unix sockets in both directions. + See `hive-sh4re` for the types. (Phase 6+ may swap to real MCP stdio.) +- **Commit messages.** Short, lowercase, no Co-Authored-By trailer. +- **Commit before test.** Stage and commit when work *looks* ready, then run + validation (`cargo check`, `nix flake check`, real lpt2 deploy). Failures get + a follow-up commit rather than an amend. +- **`rebuild` is the reconcile verb.** It rewrites `/etc/nixos-containers/.conf` + EXTRA_NSPAWN_FLAGS idempotently *and* does `nixos-container update` *and* + stop+start so nspawn-level changes (bind mounts) take effect. Anything that + changes per-container state on the host should be re-applied here. + +## Gotchas / lessons learned + +- **`nixos-container` doesn't expose `--bind` on the CLI.** Path is via + `EXTRA_NSPAWN_FLAGS` in `/etc/nixos-containers/.conf` — the start + script (`/nix/store/.../container_-start`) expands it unquoted into the + `systemd-nspawn` invocation. We rewrite this line in `set_nspawn_flags()`. +- **`/run/systemd/nspawn/*.nspawn` overrides are *ignored*** by `nixos-container`'s + start script (it builds the nspawn cmd line directly). Don't bother. +- **`boot.isNspawnContainer = true`**, not `boot.isContainer = true`. The + latter was renamed in nixos-25.11+. +- **systemd service PATH ≠ host PATH.** Our service explicitly sets + `path = [ "/run/current-system/sw" ]` so `nixos-container` (which lives in + the system profile, not nixpkgs) is reachable. +- **`RuntimeDirectoryPreserve = "yes"`** keeps `/run/hyperhive/` (and the + agent sub-dirs) across `hive-c0re` restarts. Without it, every restart wipes + bind sources and existing containers can't be started. +- **`register_agent` is idempotent** — drops any prior socket task before + rebinding. Required so a `hive-c0re` restart followed by `rebuild alice` + recreates the agent's socket without needing a clean reinstall. +- **`claude-code` is unfree.** `agent-base.nix` allow-list's it specifically. + The flake pins it to **nixpkgs-unstable** via `overlays.claude-unstable` + (stable lags too far). The overlay imports unstable with its own + `allowUnfreePredicate` so the access inside the overlay doesn't itself trip. +- **Claude credentials are stateful and per-container.** No `ANTHROPIC_API_KEY` + env var path. For now: `nixos-container root-login h-` → `claude` + (interactive) → log in once. The harness falls back to echo replies when + `claude --print` fails. Future: bind-mount a shared `~/.claude` dir from the + host so creds survive container destroy/recreate. +- **Echo guard.** `hive-ag3nt serve` skips auto-reply when the incoming body + starts with `"echo: "`. Prevents ping-pong loops when both sides fall back to + echo. Real conversations between claude-backed agents *will* runaway — that's + the manager's job to bound (Phase 4+). + +## Build / deploy / test + +```sh +# inside the repo (devshell first; no global cargo) +nix develop -c cargo check +nix develop -c cargo build + +# evaluate everything (incl. fmt check) +nix flake check + +# build only the workspace package +nix build .#default +./result/bin/{hive-c0re,hive-ag3nt,hive-m1nd} + +# deploy to an existing host that imports hyperhive.nixosModules.hive-c0re +cd ~/Repos/ +nix flake update --update-input hyperhive +sudo nixos-rebuild switch --flake .# + +# end-to-end test (lpt2 or any host with the module enabled) +sudo bash tests/roundtrip.sh +``` + +The host config also needs `hyperhive.overlays.default` applied — the module's +default `package = pkgs.hyperhive` requires the overlay to bring the package +in. + +## Phase status + +- ✅ Phase 0 — repo + Cargo workspace + flake + agent-base template +- ✅ Phase 1 — container lifecycle (spawn/kill/rebuild/list); nixos-container update + hot-reload works under the patch stack (validated empirically on muede-lpt2) +- ✅ Phase 2 — per-agent sockets, in-memory broker, agent harness round-trips messages +- ✅ Phase 3 — sqlite broker (durable across restart) + claude-or-echo turn loop +- 🔜 Phase 4 — `hm1nd` manager binary with privileged tool surface +- 🔜 Phase 5 — git-commit approval flow (`state-repo` + per-agent config flakes) +- 🔜 Phase 6 — per-agent web UI + dashboard MVP +- 🔜 Phase 7 — dashboard commit-view + polish + +See PLAN.md for the full design and the deferred-out-of-scope list. + +## Inspirations + +- **`~/Repos/bitburner-agent`** — sibling project, drives Claude Code in a turn + loop against a Bitburner CDP session. Patterns to steal as we grow: + per-cycle prompt diffing (vs full state), notes compaction as a separate + short-lived Claude session, MCP server registering tools from a single + `TOOLS` array, dashboard with SSE + xterm.js + sqlite stats sampler, opaque + "terminal event" stream that unifies tool-call / sleep / op-notice / etc. diff --git a/tests/roundtrip.sh b/tests/roundtrip.sh new file mode 100755 index 00000000..8f152070 --- /dev/null +++ b/tests/roundtrip.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# Phase 3 end-to-end smoke test: spawn alice + bob, send alice→bob, observe +# bob's harness echo-reply land in alice's journal. +# +# Run as root (uses nixos-container + hive-c0re). Idempotent — wipes any prior +# h-alice / h-bob first. +# +# With claude not logged in inside the containers, both fall back to echo and +# the chain terminates after one round trip (the "echo: " guard). + +set -euo pipefail + +cleanup() { + echo "=== cleaning up any prior test agents ===" + sudo hive-c0re kill alice 2>/dev/null || true + sudo hive-c0re kill bob 2>/dev/null || true + sudo nixos-container destroy h-alice 2>/dev/null || true + sudo nixos-container destroy h-bob 2>/dev/null || true +} + +cleanup + +echo "=== spawn alice + bob ===" +sudo hive-c0re spawn alice +sudo hive-c0re spawn bob + +echo "=== wait for harnesses to come up ===" +sleep 3 + +T=$(date +"%Y-%m-%d %H:%M:%S") +echo "test start: $T" + +echo "=== alice → bob: 'ping' ===" +sudo nixos-container run h-alice -- hive-ag3nt send bob "ping" + +echo "=== wait for bob to reply, alice to receive ===" +sleep 4 + +echo +echo "=== bob's journal since test start ===" +sudo journalctl -M h-bob -u hive-ag3nt --since "$T" --no-pager | tail -20 || true + +echo +echo "=== alice's journal since test start ===" +sudo journalctl -M h-alice -u hive-ag3nt --since "$T" --no-pager | tail -20 || true + +echo +echo "=== broker rows (last 10) ===" +sudo sqlite3 /var/lib/hyperhive/broker.sqlite \ + "SELECT id, sender, recipient, substr(body,1,60) AS body, sent_at, delivered_at FROM messages ORDER BY id DESC LIMIT 10;" \ + 2>/dev/null || echo "(sqlite3 not available — skip)" + +echo +echo "=== expected ===" +echo " bob's journal: 'inbox from=alice body=ping' then 'claude failed; falling back to echo'" +echo " alice's journal: 'inbox from=bob body=echo: ping' (no reply, echo guard stopped the chain)" +echo " broker rows: 2 messages — alice→bob 'ping' (delivered) and bob→alice 'echo: ping' (delivered)" + +echo +read -r -p "Press enter to tear down test agents, Ctrl-C to leave them up: " +cleanup From aa67e5a481f2f7a455532c5d5a83a83bd8aba509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:35:08 +0200 Subject: [PATCH 0537/1295] Phase 4: manager socket + manager_server with privileged tool surface --- flake.nix | 1 + hive-c0re/src/coordinator.rs | 21 +++++- hive-c0re/src/main.rs | 6 +- hive-c0re/src/manager_server.rs | 128 ++++++++++++++++++++++++++++++++ hive-c0re/src/server.rs | 17 ++--- hive-sh4re/src/lib.rs | 30 ++++++++ 6 files changed, 188 insertions(+), 15 deletions(-) create mode 100644 hive-c0re/src/manager_server.rs diff --git a/flake.nix b/flake.nix index 4d845932..660dcf2d 100644 --- a/flake.nix +++ b/flake.nix @@ -105,6 +105,7 @@ rust-analyzer rustc rustfmt + sqlite ]; }; } diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index b2ba2f90..c79e04db 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -1,5 +1,6 @@ -//! Runtime state shared between the host admin socket and the per-agent -//! sockets: the broker plus a map of `name -> AgentSocket`. +//! Runtime state + config shared between the host admin socket, the manager +//! socket, and the per-agent sockets: the broker, configured `agent_flake`, +//! and the map of registered agent sockets. use std::collections::HashMap; use std::path::{Path, PathBuf}; @@ -11,17 +12,20 @@ use crate::agent_server::{self, AgentSocket}; use crate::broker::Broker; const AGENT_RUNTIME_ROOT: &str = "/run/hyperhive/agents"; +const MANAGER_RUNTIME_ROOT: &str = "/run/hyperhive/manager"; pub struct Coordinator { pub broker: Arc, + pub agent_flake: String, agents: Mutex>, } impl Coordinator { - pub fn open(db_path: &Path) -> Result { + pub fn open(db_path: &Path, agent_flake: String) -> Result { let broker = Broker::open(db_path).context("open broker")?; Ok(Self { broker: Arc::new(broker), + agent_flake, agents: Mutex::new(HashMap::new()), }) } @@ -34,7 +38,8 @@ impl Coordinator { std::fs::create_dir_all(&agent_dir) .with_context(|| format!("create agent dir {}", agent_dir.display()))?; let socket_path = Self::socket_path(name); - let socket = agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?; + let socket = + agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?; self.agents.lock().unwrap().insert(name.to_owned(), socket); Ok(agent_dir) } @@ -53,4 +58,12 @@ impl Coordinator { pub fn socket_path(name: &str) -> PathBuf { Self::agent_dir(name).join("mcp.sock") } + + pub fn manager_dir() -> PathBuf { + PathBuf::from(MANAGER_RUNTIME_ROOT) + } + + pub fn manager_socket_path() -> PathBuf { + Self::manager_dir().join("mcp.sock") + } } diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index 6346cf9e..c3f57cc0 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -10,6 +10,7 @@ mod broker; mod client; mod coordinator; mod lifecycle; +mod manager_server; mod server; use coordinator::Coordinator; @@ -58,8 +59,9 @@ async fn main() -> Result<()> { let cli = Cli::parse(); match cli.cmd { Cmd::Serve { agent_flake, db } => { - let coord = Arc::new(Coordinator::open(&db)?); - server::serve(&cli.socket, &agent_flake, coord).await + let coord = Arc::new(Coordinator::open(&db, agent_flake)?); + manager_server::start(coord.clone()).await?; + server::serve(&cli.socket, coord).await } Cmd::Spawn { name } => { render(client::request(&cli.socket, HostRequest::Spawn { name }).await?) diff --git a/hive-c0re/src/manager_server.rs b/hive-c0re/src/manager_server.rs new file mode 100644 index 00000000..f784c6dc --- /dev/null +++ b/hive-c0re/src/manager_server.rs @@ -0,0 +1,128 @@ +//! Manager socket listener. Privileged tool surface: agent-style send/recv +//! plus lifecycle verbs (Phase 4). Phase 5 will gate Spawn/Kill behind the +//! commit-approval flow; for now they hit the same code path the host admin +//! socket uses. + +use std::sync::Arc; + +use anyhow::{Context, Result}; +use hive_sh4re::{MANAGER_AGENT, ManagerRequest, ManagerResponse, Message}; +use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; +use tokio::net::{UnixListener, UnixStream}; + +use crate::coordinator::Coordinator; +use crate::lifecycle; + +pub async fn start(coord: Arc) -> Result<()> { + let dir = Coordinator::manager_dir(); + std::fs::create_dir_all(&dir) + .with_context(|| format!("create manager dir {}", dir.display()))?; + let socket = Coordinator::manager_socket_path(); + if socket.exists() { + std::fs::remove_file(&socket).context("remove stale manager socket")?; + } + let listener = UnixListener::bind(&socket) + .with_context(|| format!("bind manager socket {}", socket.display()))?; + tracing::info!(socket = %socket.display(), "manager socket listening"); + + tokio::spawn(async move { + loop { + match listener.accept().await { + Ok((stream, _)) => { + let coord = coord.clone(); + tokio::spawn(async move { + if let Err(e) = serve(stream, coord).await { + tracing::warn!(error = ?e, "manager connection failed"); + } + }); + } + Err(e) => { + tracing::warn!(error = ?e, "manager listener accept failed"); + return; + } + } + } + }); + Ok(()) +} + +async fn serve(stream: UnixStream, coord: Arc) -> Result<()> { + let (read, mut write) = stream.into_split(); + let mut reader = BufReader::new(read); + let mut line = String::new(); + loop { + line.clear(); + let n = reader.read_line(&mut line).await?; + if n == 0 { + return Ok(()); + } + let resp = match serde_json::from_str::(line.trim()) { + Ok(req) => dispatch(&req, &coord).await, + Err(e) => ManagerResponse::Err { + message: format!("parse error: {e}"), + }, + }; + let mut payload = serde_json::to_string(&resp)?; + payload.push('\n'); + write.write_all(payload.as_bytes()).await?; + write.flush().await?; + } +} + +async fn dispatch(req: &ManagerRequest, coord: &Coordinator) -> ManagerResponse { + match req { + ManagerRequest::Send { to, body } => match coord.broker.send(Message { + from: MANAGER_AGENT.to_owned(), + to: to.clone(), + body: body.clone(), + }) { + Ok(()) => ManagerResponse::Ok, + Err(e) => ManagerResponse::Err { + message: format!("{e:#}"), + }, + }, + ManagerRequest::Recv => match coord.broker.recv(MANAGER_AGENT) { + Ok(Some(msg)) => ManagerResponse::Message { + from: msg.from, + body: msg.body, + }, + Ok(None) => ManagerResponse::Empty, + Err(e) => ManagerResponse::Err { + message: format!("{e:#}"), + }, + }, + ManagerRequest::Spawn { name } => { + tracing::info!(%name, "manager: spawn"); + let result: Result<()> = async { + let agent_dir = coord.register_agent(name).await?; + if let Err(e) = lifecycle::spawn(name, &coord.agent_flake, &agent_dir).await { + coord.unregister_agent(name); + return Err(e); + } + Ok(()) + } + .await; + match result { + Ok(()) => ManagerResponse::Ok, + Err(e) => ManagerResponse::Err { + message: format!("{e:#}"), + }, + } + } + ManagerRequest::Kill { name } => { + tracing::info!(%name, "manager: kill"); + let result: Result<()> = async { + lifecycle::kill(name).await?; + coord.unregister_agent(name); + Ok(()) + } + .await; + match result { + Ok(()) => ManagerResponse::Ok, + Err(e) => ManagerResponse::Err { + message: format!("{e:#}"), + }, + } + } + } +} diff --git a/hive-c0re/src/server.rs b/hive-c0re/src/server.rs index 2e34a9b0..06a3635c 100644 --- a/hive-c0re/src/server.rs +++ b/hive-c0re/src/server.rs @@ -9,7 +9,7 @@ use tokio::net::{UnixListener, UnixStream}; use crate::coordinator::Coordinator; use crate::lifecycle; -pub async fn serve(socket: &Path, agent_flake: &str, coord: Arc) -> Result<()> { +pub async fn serve(socket: &Path, coord: Arc) -> Result<()> { if let Some(parent) = socket.parent() { std::fs::create_dir_all(parent) .with_context(|| format!("create socket parent {}", parent.display()))?; @@ -20,21 +20,20 @@ pub async fn serve(socket: &Path, agent_flake: &str, coord: Arc) -> let listener = UnixListener::bind(socket) .with_context(|| format!("bind admin socket {}", socket.display()))?; - tracing::info!(socket = %socket.display(), %agent_flake, "hive-c0re listening"); + tracing::info!(socket = %socket.display(), agent_flake = %coord.agent_flake, "hive-c0re admin listening"); loop { let (stream, _) = listener.accept().await.context("accept connection")?; - let agent_flake = agent_flake.to_owned(); let coord = coord.clone(); tokio::spawn(async move { - if let Err(e) = handle(stream, &agent_flake, coord).await { + if let Err(e) = handle(stream, coord).await { tracing::warn!(error = ?e, "connection failed"); } }); } } -async fn handle(stream: UnixStream, agent_flake: &str, coord: Arc) -> Result<()> { +async fn handle(stream: UnixStream, coord: Arc) -> Result<()> { let (read, mut write) = stream.into_split(); let mut reader = BufReader::new(read); let mut line = String::new(); @@ -46,7 +45,7 @@ async fn handle(stream: UnixStream, agent_flake: &str, coord: Arc) return Ok(()); } let resp = match serde_json::from_str::(line.trim()) { - Ok(req) => dispatch(&req, agent_flake, &coord).await, + Ok(req) => dispatch(&req, &coord).await, Err(e) => HostResponse::error(format!("parse error: {e}")), }; let mut payload = serde_json::to_string(&resp)?; @@ -56,13 +55,13 @@ async fn handle(stream: UnixStream, agent_flake: &str, coord: Arc) } } -async fn dispatch(req: &HostRequest, agent_flake: &str, coord: &Coordinator) -> HostResponse { +async fn dispatch(req: &HostRequest, coord: &Coordinator) -> HostResponse { let result: anyhow::Result = async { Ok(match req { HostRequest::Spawn { name } => { tracing::info!(%name, "spawn"); let agent_dir = coord.register_agent(name).await?; - if let Err(e) = lifecycle::spawn(name, agent_flake, &agent_dir).await { + if let Err(e) = lifecycle::spawn(name, &coord.agent_flake, &agent_dir).await { // Roll back socket registration if container creation failed. coord.unregister_agent(name); return Err(e); @@ -78,7 +77,7 @@ async fn dispatch(req: &HostRequest, agent_flake: &str, coord: &Coordinator) -> HostRequest::Rebuild { name } => { tracing::info!(%name, "rebuild"); let agent_dir = coord.register_agent(name).await?; - lifecycle::rebuild(name, agent_flake, &agent_dir).await?; + lifecycle::rebuild(name, &coord.agent_flake, &agent_dir).await?; HostResponse::success() } HostRequest::List => HostResponse::list(lifecycle::list().await?), diff --git a/hive-sh4re/src/lib.rs b/hive-sh4re/src/lib.rs index 06683116..fed41763 100644 --- a/hive-sh4re/src/lib.rs +++ b/hive-sh4re/src/lib.rs @@ -94,3 +94,33 @@ pub enum AgentResponse { /// `Recv` found nothing pending. Empty, } + +// ----------------------------------------------------------------------------- +// Manager socket — /run/hyperhive/manager/mcp.sock on the host, bind-mounted +// into the manager container at /run/hive/mcp.sock. +// ----------------------------------------------------------------------------- + +/// Logical name the broker uses for the manager. +pub const MANAGER_AGENT: &str = "manager"; + +/// Requests on the manager socket. Manager has the agent surface (send/recv) +/// plus privileged lifecycle verbs. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "cmd", rename_all = "snake_case")] +pub enum ManagerRequest { + Send { to: String, body: String }, + Recv, + /// Spawn a sub-agent. Phase 5 will gate this on user approval. + Spawn { name: String }, + /// Stop a sub-agent (graceful). + Kill { name: String }, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "kind", rename_all = "snake_case")] +pub enum ManagerResponse { + Ok, + Err { message: String }, + Message { from: String, body: String }, + Empty, +} From 17092961a2a1f099ed2d7c4f8b45534d9541b531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:36:34 +0200 Subject: [PATCH 0538/1295] Phase 4: hive-m1nd harness + manager nixos template; devshell sqlite --- flake.nix | 34 ++++++++---- hive-ag3nt/src/bin/hive-ag3nt.rs | 17 +++--- hive-ag3nt/src/bin/hive-m1nd.rs | 94 ++++++++++++++++++++++++++++++-- hive-ag3nt/src/client.rs | 16 ++++-- nix/templates/manager.nix | 26 +++++++++ 5 files changed, 159 insertions(+), 28 deletions(-) create mode 100644 nix/templates/manager.nix diff --git a/flake.nix b/flake.nix index 660dcf2d..d465fba2 100644 --- a/flake.nix +++ b/flake.nix @@ -79,20 +79,30 @@ nixosModules = { agent-base = ./nix/templates/agent-base.nix; hive-c0re = ./nix/modules/hive-c0re.nix; + manager = ./nix/templates/manager.nix; }; - nixosConfigurations.agent-base = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - self.nixosModules.agent-base - { - nixpkgs.overlays = [ - self.overlays.default - self.overlays.claude-unstable - ]; - } - ]; - }; + nixosConfigurations = + let + mkContainer = + module: + nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + module + { + nixpkgs.overlays = [ + self.overlays.default + self.overlays.claude-unstable + ]; + } + ]; + }; + in + { + agent-base = mkContainer self.nixosModules.agent-base; + manager = mkContainer self.nixosModules.manager; + }; devShells = forAllSystems ( { pkgs, ... }: diff --git a/hive-ag3nt/src/bin/hive-ag3nt.rs b/hive-ag3nt/src/bin/hive-ag3nt.rs index 33d2ecb3..b1556d1f 100644 --- a/hive-ag3nt/src/bin/hive-ag3nt.rs +++ b/hive-ag3nt/src/bin/hive-ag3nt.rs @@ -46,12 +46,14 @@ async fn main() -> Result<()> { match cli.cmd { Cmd::Serve { poll_ms } => serve(&cli.socket, Duration::from_millis(poll_ms)).await, Cmd::Send { to, body } => { - let resp = client::request(&cli.socket, AgentRequest::Send { to, body }).await?; + let resp: AgentResponse = + client::request(&cli.socket, &AgentRequest::Send { to, body }).await?; render(&resp)?; check(&resp) } Cmd::Recv => { - let resp = client::request(&cli.socket, AgentRequest::Recv).await?; + let resp: AgentResponse = + client::request(&cli.socket, &AgentRequest::Recv).await?; render(&resp)?; check(&resp) } @@ -61,7 +63,8 @@ async fn main() -> Result<()> { async fn serve(socket: &Path, interval: Duration) -> Result<()> { tracing::info!(socket = %socket.display(), "hive-ag3nt serve"); loop { - match client::request(socket, AgentRequest::Recv).await { + let recv: Result = client::request(socket, &AgentRequest::Recv).await; + match recv { Ok(AgentResponse::Message { from, body }) => { tracing::info!(%from, %body, "inbox"); // Don't auto-reply to echoes — prevents infinite ping-pong when @@ -69,15 +72,15 @@ async fn serve(socket: &Path, interval: Duration) -> Result<()> { // manager's job (Phase 4+). if !body.starts_with("echo: ") { let reply = compute_reply(&body).await; - if let Err(e) = client::request( + let send: Result = client::request( socket, - AgentRequest::Send { + &AgentRequest::Send { to: from, body: reply, }, ) - .await - { + .await; + if let Err(e) = send { tracing::warn!(error = ?e, "send reply failed"); } } diff --git a/hive-ag3nt/src/bin/hive-m1nd.rs b/hive-ag3nt/src/bin/hive-m1nd.rs index a63ce9d6..b4f9a10d 100644 --- a/hive-ag3nt/src/bin/hive-m1nd.rs +++ b/hive-ag3nt/src/bin/hive-m1nd.rs @@ -1,5 +1,91 @@ -fn main() { - // Phase 4 — manager tool surface. For now, a placeholder so the binary - // exists and can be referenced from the manager nixos-container template. - println!("hive-m1nd placeholder"); +//! Manager harness. Talks to the manager socket (bind-mounted from the host +//! at `/run/hive/mcp.sock` inside the `hm1nd` container) using the privileged +//! tool surface. Phase 4 minimum: a CLI to exercise the verbs from a shell, +//! plus a `serve` loop that logs the manager's inbox. + +use std::path::{Path, PathBuf}; +use std::time::Duration; + +use anyhow::{Result, bail}; +use clap::{Parser, Subcommand}; +use hive_ag3nt::{DEFAULT_SOCKET, client}; +use hive_sh4re::{ManagerRequest, ManagerResponse}; + +#[derive(Parser)] +#[command(name = "hive-m1nd", about = "hyperhive manager harness")] +struct Cli { + /// Path to the manager MCP socket (bind-mounted from the host). + #[arg(long, global = true, default_value = DEFAULT_SOCKET)] + socket: PathBuf, + + #[command(subcommand)] + cmd: Cmd, +} + +#[derive(Subcommand)] +enum Cmd { + /// Long-lived loop polling the manager inbox. + Serve { + #[arg(long, default_value_t = 1000)] + poll_ms: u64, + }, + /// Send a message to a sub-agent (or anywhere — the broker doesn't validate). + Send { to: String, body: String }, + /// Pop one message from the manager's inbox. + Recv, + /// Spawn a sub-agent. + Spawn { name: String }, + /// Kill a sub-agent. + Kill { name: String }, +} + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::fmt() + .with_env_filter( + tracing_subscriber::EnvFilter::try_from_default_env() + .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")), + ) + .init(); + + let cli = Cli::parse(); + match cli.cmd { + Cmd::Serve { poll_ms } => serve(&cli.socket, Duration::from_millis(poll_ms)).await, + Cmd::Send { to, body } => one_shot(&cli.socket, ManagerRequest::Send { to, body }).await, + Cmd::Recv => one_shot(&cli.socket, ManagerRequest::Recv).await, + Cmd::Spawn { name } => one_shot(&cli.socket, ManagerRequest::Spawn { name }).await, + Cmd::Kill { name } => one_shot(&cli.socket, ManagerRequest::Kill { name }).await, + } +} + +async fn one_shot(socket: &Path, req: ManagerRequest) -> Result<()> { + let resp: ManagerResponse = client::request(socket, &req).await?; + println!("{}", serde_json::to_string_pretty(&resp)?); + if let ManagerResponse::Err { message } = resp { + bail!("{message}"); + } + Ok(()) +} + +async fn serve(socket: &Path, interval: Duration) -> Result<()> { + tracing::info!(socket = %socket.display(), "hive-m1nd serve"); + loop { + let recv: Result = client::request(socket, &ManagerRequest::Recv).await; + match recv { + Ok(ManagerResponse::Message { from, body }) => { + tracing::info!(%from, %body, "manager inbox"); + } + Ok(ManagerResponse::Empty) => {} + Ok(ManagerResponse::Ok) => { + tracing::warn!("recv produced Ok (unexpected)"); + } + Ok(ManagerResponse::Err { message }) => { + tracing::warn!(%message, "recv error"); + } + Err(e) => { + tracing::warn!(error = ?e, "recv failed; retrying"); + } + } + tokio::time::sleep(interval).await; + } } diff --git a/hive-ag3nt/src/client.rs b/hive-ag3nt/src/client.rs index 8deb726c..5a314bd4 100644 --- a/hive-ag3nt/src/client.rs +++ b/hive-ag3nt/src/client.rs @@ -1,17 +1,24 @@ use std::path::Path; use anyhow::{Context, Result, bail}; -use hive_sh4re::{AgentRequest, AgentResponse}; +use serde::Serialize; +use serde::de::DeserializeOwned; use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; use tokio::net::UnixStream; -pub async fn request(socket: &Path, req: AgentRequest) -> Result { +/// Generic JSON-line request/response over a unix socket. One request, one +/// response, then drop. Used by both the agent and manager harnesses. +pub async fn request(socket: &Path, req: &Req) -> Result +where + Req: Serialize + ?Sized, + Resp: DeserializeOwned, +{ let stream = UnixStream::connect(socket) .await .with_context(|| format!("connect to {}", socket.display()))?; let (read, mut write) = stream.into_split(); - let mut payload = serde_json::to_string(&req)?; + let mut payload = serde_json::to_string(req)?; payload.push('\n'); write.write_all(payload.as_bytes()).await?; write.flush().await?; @@ -22,6 +29,5 @@ pub async fn request(socket: &Path, req: AgentRequest) -> Result if line.is_empty() { bail!("server closed connection without responding"); } - let resp: AgentResponse = serde_json::from_str(line.trim())?; - Ok(resp) + Ok(serde_json::from_str(line.trim())?) } diff --git a/nix/templates/manager.nix b/nix/templates/manager.nix new file mode 100644 index 00000000..b1912955 --- /dev/null +++ b/nix/templates/manager.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: +{ + boot.isNspawnContainer = true; + + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) [ "claude-code" ]; + + environment.systemPackages = with pkgs; [ + hyperhive + claude-code + git + coreutils-full + ]; + + systemd.services.hive-m1nd = { + description = "hive-m1nd manager harness"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + serviceConfig = { + ExecStart = "${pkgs.hyperhive}/bin/hive-m1nd serve"; + Restart = "on-failure"; + RestartSec = 2; + }; + }; + + system.stateVersion = "25.11"; +} From 4a733401501883af3e66e7edffbdacb0c44147a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:38:07 +0200 Subject: [PATCH 0539/1295] fmt --- hive-ag3nt/src/bin/hive-ag3nt.rs | 3 +-- hive-c0re/src/coordinator.rs | 3 +-- hive-sh4re/src/lib.rs | 13 ++++++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/hive-ag3nt/src/bin/hive-ag3nt.rs b/hive-ag3nt/src/bin/hive-ag3nt.rs index b1556d1f..f8a66f91 100644 --- a/hive-ag3nt/src/bin/hive-ag3nt.rs +++ b/hive-ag3nt/src/bin/hive-ag3nt.rs @@ -52,8 +52,7 @@ async fn main() -> Result<()> { check(&resp) } Cmd::Recv => { - let resp: AgentResponse = - client::request(&cli.socket, &AgentRequest::Recv).await?; + let resp: AgentResponse = client::request(&cli.socket, &AgentRequest::Recv).await?; render(&resp)?; check(&resp) } diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index c79e04db..48f0bcf4 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -38,8 +38,7 @@ impl Coordinator { std::fs::create_dir_all(&agent_dir) .with_context(|| format!("create agent dir {}", agent_dir.display()))?; let socket_path = Self::socket_path(name); - let socket = - agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?; + let socket = agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?; self.agents.lock().unwrap().insert(name.to_owned(), socket); Ok(agent_dir) } diff --git a/hive-sh4re/src/lib.rs b/hive-sh4re/src/lib.rs index fed41763..1014293f 100644 --- a/hive-sh4re/src/lib.rs +++ b/hive-sh4re/src/lib.rs @@ -108,12 +108,19 @@ pub const MANAGER_AGENT: &str = "manager"; #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(tag = "cmd", rename_all = "snake_case")] pub enum ManagerRequest { - Send { to: String, body: String }, + Send { + to: String, + body: String, + }, Recv, /// Spawn a sub-agent. Phase 5 will gate this on user approval. - Spawn { name: String }, + Spawn { + name: String, + }, /// Stop a sub-agent (graceful). - Kill { name: String }, + Kill { + name: String, + }, } #[derive(Debug, Clone, Serialize, Deserialize)] From f12837fe32157909187942c5f75ceb2ebf30fb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:50:19 +0200 Subject: [PATCH 0540/1295] Phase 5a: approval queue (request_apply_commit, pending/approve/deny) --- hive-ag3nt/src/bin/hive-m1nd.rs | 9 ++ hive-c0re/src/approvals.rs | 167 ++++++++++++++++++++++++++++++++ hive-c0re/src/coordinator.rs | 4 + hive-c0re/src/main.rs | 10 ++ hive-c0re/src/manager_server.rs | 12 +++ hive-c0re/src/server.rs | 19 ++++ hive-sh4re/src/lib.rs | 49 ++++++++++ 7 files changed, 270 insertions(+) create mode 100644 hive-c0re/src/approvals.rs diff --git a/hive-ag3nt/src/bin/hive-m1nd.rs b/hive-ag3nt/src/bin/hive-m1nd.rs index b4f9a10d..89fb8214 100644 --- a/hive-ag3nt/src/bin/hive-m1nd.rs +++ b/hive-ag3nt/src/bin/hive-m1nd.rs @@ -37,6 +37,8 @@ enum Cmd { Spawn { name: String }, /// Kill a sub-agent. Kill { name: String }, + /// Submit a config commit on the agent's config repo for user approval. + RequestApplyCommit { agent: String, commit_ref: String }, } #[tokio::main] @@ -55,6 +57,13 @@ async fn main() -> Result<()> { Cmd::Recv => one_shot(&cli.socket, ManagerRequest::Recv).await, Cmd::Spawn { name } => one_shot(&cli.socket, ManagerRequest::Spawn { name }).await, Cmd::Kill { name } => one_shot(&cli.socket, ManagerRequest::Kill { name }).await, + Cmd::RequestApplyCommit { agent, commit_ref } => { + one_shot( + &cli.socket, + ManagerRequest::RequestApplyCommit { agent, commit_ref }, + ) + .await + } } } diff --git a/hive-c0re/src/approvals.rs b/hive-c0re/src/approvals.rs new file mode 100644 index 00000000..b482e16d --- /dev/null +++ b/hive-c0re/src/approvals.rs @@ -0,0 +1,167 @@ +//! Approval queue. Manager submits via `RequestApplyCommit`; the user +//! approves/denies via the host admin CLI; on approval the host runs the +//! corresponding action (Phase 5a: `lifecycle::rebuild(agent)`). + +use std::path::Path; +use std::sync::Mutex; +use std::time::{SystemTime, UNIX_EPOCH}; + +use anyhow::{Context, Result, bail}; +use hive_sh4re::{Approval, ApprovalStatus}; +use rusqlite::{Connection, OptionalExtension, params}; + +const SCHEMA: &str = r#" +CREATE TABLE IF NOT EXISTS approvals ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + agent TEXT NOT NULL, + commit_ref TEXT NOT NULL, + requested_at INTEGER NOT NULL, + status TEXT NOT NULL, + resolved_at INTEGER, + note TEXT +); +CREATE INDEX IF NOT EXISTS idx_approvals_pending + ON approvals (id) WHERE status = 'pending'; +"#; + +pub struct Approvals { + conn: Mutex, +} + +impl Approvals { + pub fn open(path: &Path) -> Result { + if let Some(parent) = path.parent() { + std::fs::create_dir_all(parent) + .with_context(|| format!("create approvals db parent {}", parent.display()))?; + } + let conn = Connection::open(path) + .with_context(|| format!("open approvals db {}", path.display()))?; + conn.execute_batch(SCHEMA).context("apply approvals schema")?; + Ok(Self { + conn: Mutex::new(conn), + }) + } + + pub fn submit(&self, agent: &str, commit_ref: &str) -> Result { + let conn = self.conn.lock().unwrap(); + conn.execute( + "INSERT INTO approvals (agent, commit_ref, requested_at, status) + VALUES (?1, ?2, ?3, 'pending')", + params![agent, commit_ref, now_unix()], + )?; + Ok(conn.last_insert_rowid()) + } + + pub fn pending(&self) -> Result> { + let conn = self.conn.lock().unwrap(); + let mut stmt = conn.prepare( + "SELECT id, agent, commit_ref, requested_at, status, resolved_at, note + FROM approvals + WHERE status = 'pending' + ORDER BY id ASC", + )?; + let rows = stmt.query_map([], row_to_approval)?; + rows.collect::>>() + .map_err(Into::into) + } + + pub fn get(&self, id: i64) -> Result> { + let conn = self.conn.lock().unwrap(); + conn.query_row( + "SELECT id, agent, commit_ref, requested_at, status, resolved_at, note + FROM approvals WHERE id = ?1", + params![id], + row_to_approval, + ) + .optional() + .map_err(Into::into) + } + + /// Mark pending -> approved (or fail if not pending). Returns the (now-updated) + /// approval so the caller can run the action and pass the agent name. + pub fn mark_approved(&self, id: i64) -> Result { + let conn = self.conn.lock().unwrap(); + let current: Option<(String, String, i64, String)> = conn + .query_row( + "SELECT agent, commit_ref, requested_at, status FROM approvals WHERE id = ?1", + params![id], + |row| Ok((row.get(0)?, row.get(1)?, row.get(2)?, row.get(3)?)), + ) + .optional()?; + let Some((agent, commit_ref, requested_at, status)) = current else { + bail!("approval {id} not found"); + }; + if status != "pending" { + bail!("approval {id} is {status}, not pending"); + } + let resolved_at = now_unix(); + conn.execute( + "UPDATE approvals SET status = 'approved', resolved_at = ?1 WHERE id = ?2", + params![resolved_at, id], + )?; + Ok(Approval { + id, + agent, + commit_ref, + requested_at, + status: ApprovalStatus::Approved, + resolved_at: Some(resolved_at), + note: None, + }) + } + + pub fn mark_denied(&self, id: i64) -> Result<()> { + let conn = self.conn.lock().unwrap(); + let affected = conn.execute( + "UPDATE approvals SET status = 'denied', resolved_at = ?1 + WHERE id = ?2 AND status = 'pending'", + params![now_unix(), id], + )?; + if affected == 0 { + bail!("approval {id} not pending"); + } + Ok(()) + } + + pub fn mark_failed(&self, id: i64, note: &str) -> Result<()> { + let conn = self.conn.lock().unwrap(); + conn.execute( + "UPDATE approvals SET status = 'failed', resolved_at = ?1, note = ?2 WHERE id = ?3", + params![now_unix(), note, id], + )?; + Ok(()) + } +} + +fn row_to_approval(row: &rusqlite::Row<'_>) -> rusqlite::Result { + let status: String = row.get(4)?; + let status = match status.as_str() { + "pending" => ApprovalStatus::Pending, + "approved" => ApprovalStatus::Approved, + "denied" => ApprovalStatus::Denied, + "failed" => ApprovalStatus::Failed, + other => { + return Err(rusqlite::Error::FromSqlConversionFailure( + 4, + rusqlite::types::Type::Text, + format!("unknown approval status '{other}'").into(), + )); + } + }; + Ok(Approval { + id: row.get(0)?, + agent: row.get(1)?, + commit_ref: row.get(2)?, + requested_at: row.get(3)?, + status, + resolved_at: row.get(5)?, + note: row.get(6)?, + }) +} + +fn now_unix() -> i64 { + SystemTime::now() + .duration_since(UNIX_EPOCH) + .map(|d| d.as_secs() as i64) + .unwrap_or(0) +} diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index 48f0bcf4..e7c9896d 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -9,6 +9,7 @@ use std::sync::{Arc, Mutex}; use anyhow::{Context, Result}; use crate::agent_server::{self, AgentSocket}; +use crate::approvals::Approvals; use crate::broker::Broker; const AGENT_RUNTIME_ROOT: &str = "/run/hyperhive/agents"; @@ -16,6 +17,7 @@ const MANAGER_RUNTIME_ROOT: &str = "/run/hyperhive/manager"; pub struct Coordinator { pub broker: Arc, + pub approvals: Arc, pub agent_flake: String, agents: Mutex>, } @@ -23,8 +25,10 @@ pub struct Coordinator { impl Coordinator { pub fn open(db_path: &Path, agent_flake: String) -> Result { let broker = Broker::open(db_path).context("open broker")?; + let approvals = Approvals::open(db_path).context("open approvals")?; Ok(Self { broker: Arc::new(broker), + approvals: Arc::new(approvals), agent_flake, agents: Mutex::new(HashMap::new()), }) diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index c3f57cc0..823e4655 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -6,6 +6,7 @@ use clap::{Parser, Subcommand}; use hive_sh4re::{HostRequest, HostResponse}; mod agent_server; +mod approvals; mod broker; mod client; mod coordinator; @@ -45,6 +46,12 @@ enum Cmd { Rebuild { name: String }, /// List managed containers. List, + /// List pending approval requests submitted by the manager. + Pending, + /// Approve a pending request by id; the action runs immediately. + Approve { id: i64 }, + /// Deny a pending request by id. + Deny { id: i64 }, } #[tokio::main] @@ -73,6 +80,9 @@ async fn main() -> Result<()> { render(client::request(&cli.socket, HostRequest::Rebuild { name }).await?) } Cmd::List => render(client::request(&cli.socket, HostRequest::List).await?), + Cmd::Pending => render(client::request(&cli.socket, HostRequest::Pending).await?), + Cmd::Approve { id } => render(client::request(&cli.socket, HostRequest::Approve { id }).await?), + Cmd::Deny { id } => render(client::request(&cli.socket, HostRequest::Deny { id }).await?), } } diff --git a/hive-c0re/src/manager_server.rs b/hive-c0re/src/manager_server.rs index f784c6dc..38b54f68 100644 --- a/hive-c0re/src/manager_server.rs +++ b/hive-c0re/src/manager_server.rs @@ -124,5 +124,17 @@ async fn dispatch(req: &ManagerRequest, coord: &Coordinator) -> ManagerResponse }, } } + ManagerRequest::RequestApplyCommit { agent, commit_ref } => { + tracing::info!(%agent, %commit_ref, "manager: request_apply_commit"); + match coord.approvals.submit(agent, commit_ref) { + Ok(id) => { + tracing::info!(%id, %agent, %commit_ref, "approval queued"); + ManagerResponse::Ok + } + Err(e) => ManagerResponse::Err { + message: format!("{e:#}"), + }, + } + } } } diff --git a/hive-c0re/src/server.rs b/hive-c0re/src/server.rs index 06a3635c..3caff99d 100644 --- a/hive-c0re/src/server.rs +++ b/hive-c0re/src/server.rs @@ -81,6 +81,25 @@ async fn dispatch(req: &HostRequest, coord: &Coordinator) -> HostResponse { HostResponse::success() } HostRequest::List => HostResponse::list(lifecycle::list().await?), + HostRequest::Pending => HostResponse::pending(coord.approvals.pending()?), + HostRequest::Approve { id } => { + let approval = coord.approvals.mark_approved(*id)?; + tracing::info!(%approval.id, %approval.agent, %approval.commit_ref, "approval applied: rebuilding agent"); + let agent_dir = coord.register_agent(&approval.agent).await?; + if let Err(e) = + lifecycle::rebuild(&approval.agent, &coord.agent_flake, &agent_dir).await + { + let note = format!("{e:#}"); + let _ = coord.approvals.mark_failed(approval.id, ¬e); + return Err(e); + } + HostResponse::success() + } + HostRequest::Deny { id } => { + coord.approvals.mark_denied(*id)?; + tracing::info!(%id, "approval denied"); + HostResponse::success() + } }) } .await; diff --git a/hive-sh4re/src/lib.rs b/hive-sh4re/src/lib.rs index 1014293f..5f609639 100644 --- a/hive-sh4re/src/lib.rs +++ b/hive-sh4re/src/lib.rs @@ -20,6 +20,12 @@ pub enum HostRequest { Rebuild { name: String }, /// List managed containers. List, + /// List pending approval requests. + Pending, + /// Approve a pending request by id; the action runs immediately. + Approve { id: i64 }, + /// Deny a pending request by id. + Deny { id: i64 }, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -29,6 +35,30 @@ pub struct HostResponse { pub error: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub agents: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub approvals: Option>, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Approval { + pub id: i64, + pub agent: String, + pub commit_ref: String, + pub requested_at: i64, + pub status: ApprovalStatus, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resolved_at: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub note: Option, +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[serde(rename_all = "snake_case")] +pub enum ApprovalStatus { + Pending, + Approved, + Denied, + Failed, } impl HostResponse { @@ -37,6 +67,7 @@ impl HostResponse { ok: true, error: None, agents: None, + approvals: None, } } @@ -45,6 +76,7 @@ impl HostResponse { ok: false, error: Some(message.into()), agents: None, + approvals: None, } } @@ -53,6 +85,16 @@ impl HostResponse { ok: true, error: None, agents: Some(agents), + approvals: None, + } + } + + pub fn pending(approvals: Vec) -> Self { + Self { + ok: true, + error: None, + agents: None, + approvals: Some(approvals), } } } @@ -121,6 +163,13 @@ pub enum ManagerRequest { Kill { name: String, }, + /// Submit a config commit for the user to approve. `commit_ref` is opaque + /// to the host (typically a git sha pointing into the agent's config repo). + /// On approval the host applies the change via `nixos-container update`. + RequestApplyCommit { + agent: String, + commit_ref: String, + }, } #[derive(Debug, Clone, Serialize, Deserialize)] From fef2dee92a28d424081bb79bfb980bca95dd7612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:57:47 +0200 Subject: [PATCH 0541/1295] clippy pedantic clean + wired into flake checks --- Cargo.toml | 8 ++++++++ flake.nix | 11 ++++++++++- hive-ag3nt/Cargo.toml | 3 +++ hive-c0re/Cargo.toml | 3 +++ hive-c0re/src/agent_server.rs | 17 +++++++++-------- hive-c0re/src/approvals.rs | 8 +++++--- hive-c0re/src/broker.rs | 9 +++++---- hive-c0re/src/coordinator.rs | 4 ++-- hive-c0re/src/main.rs | 2 +- hive-c0re/src/manager_server.rs | 6 +++--- hive-c0re/src/server.rs | 6 +++--- hive-sh4re/Cargo.toml | 3 +++ 12 files changed, 55 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dec6e1c0..f18cf761 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,14 @@ members = [ edition = "2024" version = "0.1.0" +[workspace.lints.clippy] +pedantic = { level = "warn", priority = -1 } +# Tolerated stylistic pedantic lints (noisy, not actionable). +missing_errors_doc = "allow" +missing_panics_doc = "allow" +module_name_repetitions = "allow" +must_use_candidate = "allow" + [workspace.dependencies] anyhow = "1" clap = { version = "4", features = ["derive"] } diff --git a/flake.nix b/flake.nix index d465fba2..9b480bbc 100644 --- a/flake.nix +++ b/flake.nix @@ -124,9 +124,18 @@ formatter = forAllSystems ({ treefmt-eval, ... }: treefmt-eval.config.build.wrapper); checks = forAllSystems ( - { treefmt-eval, ... }: + { + treefmt-eval, + naersk-lib, + ... + }: { formatting = treefmt-eval.config.build.check self; + clippy = naersk-lib.buildPackage { + src = ./.; + mode = "clippy"; + cargoClippyOptions = orig: orig ++ [ "--all-targets" "--" "-D" "warnings" ]; + }; } ); }; diff --git a/hive-ag3nt/Cargo.toml b/hive-ag3nt/Cargo.toml index f5bc59d7..8154257c 100644 --- a/hive-ag3nt/Cargo.toml +++ b/hive-ag3nt/Cargo.toml @@ -3,6 +3,9 @@ name = "hive-ag3nt" edition.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] anyhow.workspace = true clap.workspace = true diff --git a/hive-c0re/Cargo.toml b/hive-c0re/Cargo.toml index 2d84474b..8eafdfa9 100644 --- a/hive-c0re/Cargo.toml +++ b/hive-c0re/Cargo.toml @@ -3,6 +3,9 @@ name = "hive-c0re" edition.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] anyhow.workspace = true clap.workspace = true diff --git a/hive-c0re/src/agent_server.rs b/hive-c0re/src/agent_server.rs index 05aae47e..66d484d5 100644 --- a/hive-c0re/src/agent_server.rs +++ b/hive-c0re/src/agent_server.rs @@ -2,7 +2,7 @@ //! authenticates the caller: connecting to `<.../agents/foo/mcp.sock>` means //! you are `foo`. -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::sync::Arc; use anyhow::{Context, Result}; @@ -18,23 +18,24 @@ pub struct AgentSocket { pub handle: JoinHandle<()>, } -pub async fn start( - agent: String, - socket_path: PathBuf, +pub fn start( + agent: &str, + socket_path: &Path, broker: Arc, ) -> Result { + let agent = agent.to_owned(); if let Some(parent) = socket_path.parent() { std::fs::create_dir_all(parent) .with_context(|| format!("create agent socket dir {}", parent.display()))?; } if socket_path.exists() { - std::fs::remove_file(&socket_path).context("remove stale agent socket")?; + std::fs::remove_file(socket_path).context("remove stale agent socket")?; } - let listener = UnixListener::bind(&socket_path) + let listener = UnixListener::bind(socket_path) .with_context(|| format!("bind agent socket {}", socket_path.display()))?; tracing::info!(%agent, socket = %socket_path.display(), "agent socket listening"); - let path = socket_path.clone(); + let path = socket_path.to_path_buf(); let handle = tokio::spawn(async move { loop { match listener.accept().await { @@ -83,7 +84,7 @@ async fn serve(stream: UnixStream, agent: String, broker: Arc) -> Result fn dispatch(req: &AgentRequest, agent: &str, broker: &Broker) -> AgentResponse { match req { AgentRequest::Send { to, body } => { - match broker.send(Message { + match broker.send(&Message { from: agent.to_owned(), to: to.clone(), body: body.clone(), diff --git a/hive-c0re/src/approvals.rs b/hive-c0re/src/approvals.rs index b482e16d..0dbeac17 100644 --- a/hive-c0re/src/approvals.rs +++ b/hive-c0re/src/approvals.rs @@ -10,7 +10,7 @@ use anyhow::{Context, Result, bail}; use hive_sh4re::{Approval, ApprovalStatus}; use rusqlite::{Connection, OptionalExtension, params}; -const SCHEMA: &str = r#" +const SCHEMA: &str = r" CREATE TABLE IF NOT EXISTS approvals ( id INTEGER PRIMARY KEY AUTOINCREMENT, agent TEXT NOT NULL, @@ -22,7 +22,7 @@ CREATE TABLE IF NOT EXISTS approvals ( ); CREATE INDEX IF NOT EXISTS idx_approvals_pending ON approvals (id) WHERE status = 'pending'; -"#; +"; pub struct Approvals { conn: Mutex, @@ -65,6 +65,7 @@ impl Approvals { .map_err(Into::into) } + #[allow(dead_code)] // used by Phase 5b commit verification pub fn get(&self, id: i64) -> Result> { let conn = self.conn.lock().unwrap(); conn.query_row( @@ -162,6 +163,7 @@ fn row_to_approval(row: &rusqlite::Row<'_>) -> rusqlite::Result { fn now_unix() -> i64 { SystemTime::now() .duration_since(UNIX_EPOCH) - .map(|d| d.as_secs() as i64) + .ok() + .and_then(|d| i64::try_from(d.as_secs()).ok()) .unwrap_or(0) } diff --git a/hive-c0re/src/broker.rs b/hive-c0re/src/broker.rs index a88bbd8e..98719eea 100644 --- a/hive-c0re/src/broker.rs +++ b/hive-c0re/src/broker.rs @@ -8,7 +8,7 @@ use anyhow::{Context, Result}; use hive_sh4re::Message; use rusqlite::{Connection, OptionalExtension, params}; -const SCHEMA: &str = r#" +const SCHEMA: &str = r" CREATE TABLE IF NOT EXISTS messages ( id INTEGER PRIMARY KEY AUTOINCREMENT, sender TEXT NOT NULL, @@ -19,7 +19,7 @@ CREATE TABLE IF NOT EXISTS messages ( ); CREATE INDEX IF NOT EXISTS idx_messages_undelivered ON messages (recipient, id) WHERE delivered_at IS NULL; -"#; +"; pub struct Broker { conn: Mutex, @@ -39,7 +39,7 @@ impl Broker { }) } - pub fn send(&self, message: Message) -> Result<()> { + pub fn send(&self, message: &Message) -> Result<()> { let conn = self.conn.lock().unwrap(); conn.execute( "INSERT INTO messages (sender, recipient, body, sent_at) VALUES (?1, ?2, ?3, ?4)", @@ -75,6 +75,7 @@ impl Broker { fn now_unix() -> i64 { SystemTime::now() .duration_since(UNIX_EPOCH) - .map(|d| d.as_secs() as i64) + .ok() + .and_then(|d| i64::try_from(d.as_secs()).ok()) .unwrap_or(0) } diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index e7c9896d..ce2032e6 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -34,7 +34,7 @@ impl Coordinator { }) } - pub async fn register_agent(&self, name: &str) -> Result { + pub fn register_agent(&self, name: &str) -> Result { // Idempotent: drop any existing listener so re-registration (e.g. on rebuild, // or after a hive-c0re restart cleared /run/hyperhive) gets a fresh socket. self.unregister_agent(name); @@ -42,7 +42,7 @@ impl Coordinator { std::fs::create_dir_all(&agent_dir) .with_context(|| format!("create agent dir {}", agent_dir.display()))?; let socket_path = Self::socket_path(name); - let socket = agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?; + let socket = agent_server::start(name, &socket_path, self.broker.clone())?; self.agents.lock().unwrap().insert(name.to_owned(), socket); Ok(agent_dir) } diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index 823e4655..f31f2c1a 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -67,7 +67,7 @@ async fn main() -> Result<()> { match cli.cmd { Cmd::Serve { agent_flake, db } => { let coord = Arc::new(Coordinator::open(&db, agent_flake)?); - manager_server::start(coord.clone()).await?; + manager_server::start(coord.clone())?; server::serve(&cli.socket, coord).await } Cmd::Spawn { name } => { diff --git a/hive-c0re/src/manager_server.rs b/hive-c0re/src/manager_server.rs index 38b54f68..086c9ba3 100644 --- a/hive-c0re/src/manager_server.rs +++ b/hive-c0re/src/manager_server.rs @@ -13,7 +13,7 @@ use tokio::net::{UnixListener, UnixStream}; use crate::coordinator::Coordinator; use crate::lifecycle; -pub async fn start(coord: Arc) -> Result<()> { +pub fn start(coord: Arc) -> Result<()> { let dir = Coordinator::manager_dir(); std::fs::create_dir_all(&dir) .with_context(|| format!("create manager dir {}", dir.display()))?; @@ -71,7 +71,7 @@ async fn serve(stream: UnixStream, coord: Arc) -> Result<()> { async fn dispatch(req: &ManagerRequest, coord: &Coordinator) -> ManagerResponse { match req { - ManagerRequest::Send { to, body } => match coord.broker.send(Message { + ManagerRequest::Send { to, body } => match coord.broker.send(&Message { from: MANAGER_AGENT.to_owned(), to: to.clone(), body: body.clone(), @@ -94,7 +94,7 @@ async fn dispatch(req: &ManagerRequest, coord: &Coordinator) -> ManagerResponse ManagerRequest::Spawn { name } => { tracing::info!(%name, "manager: spawn"); let result: Result<()> = async { - let agent_dir = coord.register_agent(name).await?; + let agent_dir = coord.register_agent(name)?; if let Err(e) = lifecycle::spawn(name, &coord.agent_flake, &agent_dir).await { coord.unregister_agent(name); return Err(e); diff --git a/hive-c0re/src/server.rs b/hive-c0re/src/server.rs index 3caff99d..8ed0c15c 100644 --- a/hive-c0re/src/server.rs +++ b/hive-c0re/src/server.rs @@ -60,7 +60,7 @@ async fn dispatch(req: &HostRequest, coord: &Coordinator) -> HostResponse { Ok(match req { HostRequest::Spawn { name } => { tracing::info!(%name, "spawn"); - let agent_dir = coord.register_agent(name).await?; + let agent_dir = coord.register_agent(name)?; if let Err(e) = lifecycle::spawn(name, &coord.agent_flake, &agent_dir).await { // Roll back socket registration if container creation failed. coord.unregister_agent(name); @@ -76,7 +76,7 @@ async fn dispatch(req: &HostRequest, coord: &Coordinator) -> HostResponse { } HostRequest::Rebuild { name } => { tracing::info!(%name, "rebuild"); - let agent_dir = coord.register_agent(name).await?; + let agent_dir = coord.register_agent(name)?; lifecycle::rebuild(name, &coord.agent_flake, &agent_dir).await?; HostResponse::success() } @@ -85,7 +85,7 @@ async fn dispatch(req: &HostRequest, coord: &Coordinator) -> HostResponse { HostRequest::Approve { id } => { let approval = coord.approvals.mark_approved(*id)?; tracing::info!(%approval.id, %approval.agent, %approval.commit_ref, "approval applied: rebuilding agent"); - let agent_dir = coord.register_agent(&approval.agent).await?; + let agent_dir = coord.register_agent(&approval.agent)?; if let Err(e) = lifecycle::rebuild(&approval.agent, &coord.agent_flake, &agent_dir).await { diff --git a/hive-sh4re/Cargo.toml b/hive-sh4re/Cargo.toml index 45f43cfb..e4f7600c 100644 --- a/hive-sh4re/Cargo.toml +++ b/hive-sh4re/Cargo.toml @@ -3,5 +3,8 @@ name = "hive-sh4re" edition.workspace = true version.workspace = true +[lints] +workspace = true + [dependencies] serde.workspace = true From 1c6d7f7a8f4a835257c7f3e01e3a4ff6b61bb365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 22:58:25 +0200 Subject: [PATCH 0542/1295] fmt --- flake.nix | 10 +++++++++- hive-c0re/src/agent_server.rs | 6 +----- hive-c0re/src/approvals.rs | 3 ++- hive-c0re/src/main.rs | 4 +++- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 9b480bbc..67cbe783 100644 --- a/flake.nix +++ b/flake.nix @@ -134,7 +134,15 @@ clippy = naersk-lib.buildPackage { src = ./.; mode = "clippy"; - cargoClippyOptions = orig: orig ++ [ "--all-targets" "--" "-D" "warnings" ]; + cargoClippyOptions = + orig: + orig + ++ [ + "--all-targets" + "--" + "-D" + "warnings" + ]; }; } ); diff --git a/hive-c0re/src/agent_server.rs b/hive-c0re/src/agent_server.rs index 66d484d5..b08e18f2 100644 --- a/hive-c0re/src/agent_server.rs +++ b/hive-c0re/src/agent_server.rs @@ -18,11 +18,7 @@ pub struct AgentSocket { pub handle: JoinHandle<()>, } -pub fn start( - agent: &str, - socket_path: &Path, - broker: Arc, -) -> Result { +pub fn start(agent: &str, socket_path: &Path, broker: Arc) -> Result { let agent = agent.to_owned(); if let Some(parent) = socket_path.parent() { std::fs::create_dir_all(parent) diff --git a/hive-c0re/src/approvals.rs b/hive-c0re/src/approvals.rs index 0dbeac17..8c32c407 100644 --- a/hive-c0re/src/approvals.rs +++ b/hive-c0re/src/approvals.rs @@ -36,7 +36,8 @@ impl Approvals { } let conn = Connection::open(path) .with_context(|| format!("open approvals db {}", path.display()))?; - conn.execute_batch(SCHEMA).context("apply approvals schema")?; + conn.execute_batch(SCHEMA) + .context("apply approvals schema")?; Ok(Self { conn: Mutex::new(conn), }) diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index f31f2c1a..ce5aa10e 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -81,7 +81,9 @@ async fn main() -> Result<()> { } Cmd::List => render(client::request(&cli.socket, HostRequest::List).await?), Cmd::Pending => render(client::request(&cli.socket, HostRequest::Pending).await?), - Cmd::Approve { id } => render(client::request(&cli.socket, HostRequest::Approve { id }).await?), + Cmd::Approve { id } => { + render(client::request(&cli.socket, HostRequest::Approve { id }).await?) + } Cmd::Deny { id } => render(client::request(&cli.socket, HostRequest::Deny { id }).await?), } } From ad9e60dad39824b9ad84b1ad3fa44d027016429a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:00:16 +0200 Subject: [PATCH 0543/1295] flake clippy: cargoBuildOptions with -- -D warnings --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 67cbe783..029ab70c 100644 --- a/flake.nix +++ b/flake.nix @@ -134,11 +134,11 @@ clippy = naersk-lib.buildPackage { src = ./.; mode = "clippy"; - cargoClippyOptions = + cargoBuildOptions = orig: orig ++ [ - "--all-targets" + "--workspace" "--" "-D" "warnings" From cf4c84d7c9ccb9e057a736f778eb8f71fef048bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:01:13 +0200 Subject: [PATCH 0544/1295] flake clippy: override build phase to bypass naersk mode --- flake.nix | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index 029ab70c..1bb82f51 100644 --- a/flake.nix +++ b/flake.nix @@ -126,24 +126,38 @@ checks = forAllSystems ( { treefmt-eval, + pkgs, naersk-lib, ... }: { formatting = treefmt-eval.config.build.check self; - clippy = naersk-lib.buildPackage { - src = ./.; - mode = "clippy"; - cargoBuildOptions = - orig: - orig - ++ [ - "--workspace" - "--" - "-D" - "warnings" - ]; - }; + # Clippy as a check: reuse naersk's vendored-deps environment but + # replace the build phase with `cargo clippy --workspace --all-targets + # -- -D warnings`. Naersk's own `mode = "clippy"` mangles the `--` + # separator, so we go through overrideAttrs instead. + clippy = + (naersk-lib.buildPackage { + src = ./.; + # Skip the actual build; we only care about the clippy lint. + doCheck = false; + copyTarget = false; + }).overrideAttrs + (old: { + pname = "${old.pname}-clippy"; + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.clippy ]; + buildPhase = '' + runHook preBuild + cargo clippy --workspace --all-targets -- -D warnings + runHook postBuild + ''; + installPhase = '' + runHook preInstall + mkdir -p $out + touch $out/.clippy-passed + runHook postInstall + ''; + }); } ); }; From b0fb623e088c140d4ac2762091c36d6742eea137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:01:32 +0200 Subject: [PATCH 0545/1295] flake clippy: use name not pname --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 1bb82f51..67d2ab40 100644 --- a/flake.nix +++ b/flake.nix @@ -144,7 +144,7 @@ copyTarget = false; }).overrideAttrs (old: { - pname = "${old.pname}-clippy"; + name = "${old.name}-clippy"; nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.clippy ]; buildPhase = '' runHook preBuild From 22b65d35f34e7de65f9d130d7b84ea008f6b532f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:02:42 +0200 Subject: [PATCH 0546/1295] treefmt: add taplo (toml) formatter --- Cargo.toml | 16 ++++++++++------ flake.nix | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f18cf761..a19750c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,6 @@ [workspace] resolver = "3" -members = [ - "hive-ag3nt", - "hive-c0re", - "hive-sh4re", -] +members = ["hive-ag3nt", "hive-c0re", "hive-sh4re"] [workspace.package] edition = "2024" @@ -25,6 +21,14 @@ hive-sh4re = { path = "hive-sh4re" } rusqlite = { version = "0.37", features = ["bundled"] } serde = { version = "1", features = ["derive"] } serde_json = "1" -tokio = { version = "1", features = ["io-util", "macros", "net", "process", "rt-multi-thread", "signal", "time"] } +tokio = { version = "1", features = [ + "io-util", + "macros", + "net", + "process", + "rt-multi-thread", + "signal", + "time", +] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/flake.nix b/flake.nix index 67d2ab40..18f109cc 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,7 @@ keep-sorted.enable = true; nixfmt.enable = true; rustfmt.enable = true; + taplo.enable = true; }; }; forAllSystems = From 433c0d212efc2cc97b973452a4f4cb00cc25119e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:09:35 +0200 Subject: [PATCH 0547/1295] Phase 5b: per-agent config flakes; approve validates + advances commit --- hive-c0re/src/coordinator.rs | 13 +++- hive-c0re/src/lifecycle.rs | 134 ++++++++++++++++++++++++++++++-- hive-c0re/src/main.rs | 14 ++-- hive-c0re/src/manager_server.rs | 5 +- hive-c0re/src/server.rs | 28 +++++-- nix/modules/hive-c0re.nix | 13 +++- 6 files changed, 182 insertions(+), 25 deletions(-) diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index ce2032e6..caed7aa6 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -14,22 +14,25 @@ use crate::broker::Broker; const AGENT_RUNTIME_ROOT: &str = "/run/hyperhive/agents"; const MANAGER_RUNTIME_ROOT: &str = "/run/hyperhive/manager"; +const AGENT_STATE_ROOT: &str = "/var/lib/hyperhive/agents"; pub struct Coordinator { pub broker: Arc, pub approvals: Arc, - pub agent_flake: String, + /// URL of the hyperhive flake (no fragment). Inlined into per-agent + /// `flake.nix` files as `inputs.hyperhive.url`. + pub hyperhive_flake: String, agents: Mutex>, } impl Coordinator { - pub fn open(db_path: &Path, agent_flake: String) -> Result { + pub fn open(db_path: &Path, hyperhive_flake: String) -> Result { let broker = Broker::open(db_path).context("open broker")?; let approvals = Approvals::open(db_path).context("open approvals")?; Ok(Self { broker: Arc::new(broker), approvals: Arc::new(approvals), - agent_flake, + hyperhive_flake, agents: Mutex::new(HashMap::new()), }) } @@ -69,4 +72,8 @@ impl Coordinator { pub fn manager_socket_path() -> PathBuf { Self::manager_dir().join("mcp.sock") } + + pub fn agent_config_dir(name: &str) -> PathBuf { + PathBuf::from(format!("{AGENT_STATE_ROOT}/{name}/config")) + } } diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index 7399ff74..2bedff0b 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -1,4 +1,4 @@ -//! Thin async wrappers over `nixos-container`. +//! `nixos-container` lifecycle + per-agent config flake generation. use std::path::Path; @@ -16,6 +16,9 @@ pub const MANAGER_NAME: &str = "hm1nd"; /// Mount point of the per-agent runtime directory inside the container. pub const CONTAINER_RUNTIME_MOUNT: &str = "/run/hive"; +const GIT_NAME: &str = "hive-c0re"; +const GIT_EMAIL: &str = "hive-c0re@hyperhive"; + pub fn container_name(name: &str) -> String { format!("{AGENT_PREFIX}{name}") } @@ -33,10 +36,17 @@ fn validate(name: &str) -> Result<()> { Ok(()) } -pub async fn spawn(name: &str, agent_flake: &str, agent_dir: &Path) -> Result<()> { +pub async fn spawn( + name: &str, + hyperhive_flake: &str, + agent_dir: &Path, + config_dir: &Path, +) -> Result<()> { validate(name)?; + setup_config(config_dir, name, hyperhive_flake).await?; let container = container_name(name); - run(&["create", &container, "--flake", agent_flake]).await?; + let flake_ref = format!("{}#default", config_dir.display()); + run(&["create", &container, "--flake", &flake_ref]).await?; set_nspawn_flags(&container, agent_dir)?; run(&["start", &container]).await } @@ -47,11 +57,18 @@ pub async fn kill(name: &str) -> Result<()> { run(&["stop", &container]).await } -pub async fn rebuild(name: &str, agent_flake: &str, agent_dir: &Path) -> Result<()> { +pub async fn rebuild( + name: &str, + hyperhive_flake: &str, + agent_dir: &Path, + config_dir: &Path, +) -> Result<()> { validate(name)?; + setup_config(config_dir, name, hyperhive_flake).await?; let container = container_name(name); + let flake_ref = format!("{}#default", config_dir.display()); set_nspawn_flags(&container, agent_dir)?; - run(&["update", &container, "--flake", agent_flake]).await?; + run(&["update", &container, "--flake", &flake_ref]).await?; // Restart so any nspawn-level changes (bind mounts, networking, etc.) apply. run(&["stop", &container]).await?; run(&["start", &container]).await @@ -78,6 +95,113 @@ pub async fn list() -> Result> { .collect()) } +/// Ensure `config_dir` exists as a git repo containing a per-agent flake. The +/// `flake.nix` is rewritten every call (so a new hyperhive store path +/// propagates on rebuild); `agent.nix` is written only the first time +/// (manager-editable thereafter). +pub async fn setup_config(config_dir: &Path, name: &str, hyperhive_flake: &str) -> Result<()> { + std::fs::create_dir_all(config_dir) + .with_context(|| format!("create {}", config_dir.display()))?; + + let flake_path = config_dir.join("flake.nix"); + let flake_body = format!( + r#"{{ + description = "hyperhive sub-agent {name}"; + inputs.hyperhive.url = "{hyperhive_flake}"; + outputs = + {{ hyperhive, ... }}: + {{ + nixosConfigurations.default = hyperhive.nixosConfigurations.agent-base.extendModules {{ + modules = [ ./agent.nix ]; + }}; + }}; +}} +"#, + ); + std::fs::write(&flake_path, flake_body) + .with_context(|| format!("write {}", flake_path.display()))?; + + let agent_path = config_dir.join("agent.nix"); + if !agent_path.exists() { + let initial = format!( + "{{ ... }}:\n{{\n # Per-agent overrides for {name}. The manager edits this\n # file (and commits) to customise the agent's NixOS config.\n}}\n", + ); + std::fs::write(&agent_path, initial) + .with_context(|| format!("write {}", agent_path.display()))?; + } + + if !config_dir.join(".git").exists() { + git(config_dir, &["init", "--initial-branch=main"]).await?; + } + git(config_dir, &["add", "-A"]).await?; + let clean = git_status(config_dir, &["diff", "--cached", "--quiet"]).await?; + if !clean { + git( + config_dir, + &[ + "-c", + &format!("user.name={GIT_NAME}"), + "-c", + &format!("user.email={GIT_EMAIL}"), + "commit", + "-m", + "hive-c0re sync", + ], + ) + .await?; + } + Ok(()) +} + +/// Verify `commit_ref` exists in the config repo, advance `main` to it, and +/// reset the working tree. Caller is responsible for the subsequent rebuild. +pub async fn apply_commit(config_dir: &Path, commit_ref: &str) -> Result<()> { + let st = Command::new("git") + .current_dir(config_dir) + .args(["cat-file", "-e", commit_ref]) + .status() + .await + .with_context(|| format!("git cat-file in {}", config_dir.display()))?; + if !st.success() { + bail!( + "commit {commit_ref} not found in {}", + config_dir.display() + ); + } + git(config_dir, &["update-ref", "refs/heads/main", commit_ref]).await?; + git(config_dir, &["reset", "--hard", commit_ref]).await?; + Ok(()) +} + +async fn git(dir: &Path, args: &[&str]) -> Result<()> { + let out = Command::new("git") + .current_dir(dir) + .args(args) + .output() + .await + .with_context(|| format!("git {} in {}", args.join(" "), dir.display()))?; + if !out.status.success() { + bail!( + "git {} failed ({}): {}", + args.join(" "), + out.status, + String::from_utf8_lossy(&out.stderr).trim() + ); + } + Ok(()) +} + +/// Returns true if the command exits 0. +async fn git_status(dir: &Path, args: &[&str]) -> Result { + let st = Command::new("git") + .current_dir(dir) + .args(args) + .status() + .await + .with_context(|| format!("git {} in {}", args.join(" "), dir.display()))?; + Ok(st.success()) +} + /// Idempotently rewrite the `EXTRA_NSPAWN_FLAGS` line in /// `/etc/nixos-containers/.conf`. The start script expands this /// variable unquoted into the `systemd-nspawn` command. diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index ce5aa10e..fd8329e1 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -31,9 +31,10 @@ struct Cli { enum Cmd { /// Run the coordinator daemon. Serve { - /// Flake reference for the agent base template. - #[arg(long, default_value = "/etc/hyperhive#agent-base")] - agent_flake: String, + /// URL of the hyperhive flake. Inlined into each per-agent + /// `flake.nix` as the `hyperhive` input. + #[arg(long, default_value = "/etc/hyperhive")] + hyperhive_flake: String, /// Path to the sqlite message store. #[arg(long, default_value = "/var/lib/hyperhive/broker.sqlite")] db: PathBuf, @@ -65,8 +66,11 @@ async fn main() -> Result<()> { let cli = Cli::parse(); match cli.cmd { - Cmd::Serve { agent_flake, db } => { - let coord = Arc::new(Coordinator::open(&db, agent_flake)?); + Cmd::Serve { + hyperhive_flake, + db, + } => { + let coord = Arc::new(Coordinator::open(&db, hyperhive_flake)?); manager_server::start(coord.clone())?; server::serve(&cli.socket, coord).await } diff --git a/hive-c0re/src/manager_server.rs b/hive-c0re/src/manager_server.rs index 086c9ba3..6f4e6be6 100644 --- a/hive-c0re/src/manager_server.rs +++ b/hive-c0re/src/manager_server.rs @@ -95,7 +95,10 @@ async fn dispatch(req: &ManagerRequest, coord: &Coordinator) -> ManagerResponse tracing::info!(%name, "manager: spawn"); let result: Result<()> = async { let agent_dir = coord.register_agent(name)?; - if let Err(e) = lifecycle::spawn(name, &coord.agent_flake, &agent_dir).await { + let config_dir = Coordinator::agent_config_dir(name); + if let Err(e) = + lifecycle::spawn(name, &coord.hyperhive_flake, &agent_dir, &config_dir).await + { coord.unregister_agent(name); return Err(e); } diff --git a/hive-c0re/src/server.rs b/hive-c0re/src/server.rs index 8ed0c15c..cbca5a8a 100644 --- a/hive-c0re/src/server.rs +++ b/hive-c0re/src/server.rs @@ -20,7 +20,7 @@ pub async fn serve(socket: &Path, coord: Arc) -> Result<()> { let listener = UnixListener::bind(socket) .with_context(|| format!("bind admin socket {}", socket.display()))?; - tracing::info!(socket = %socket.display(), agent_flake = %coord.agent_flake, "hive-c0re admin listening"); + tracing::info!(socket = %socket.display(), hyperhive_flake = %coord.hyperhive_flake, "hive-c0re admin listening"); loop { let (stream, _) = listener.accept().await.context("accept connection")?; @@ -61,7 +61,10 @@ async fn dispatch(req: &HostRequest, coord: &Coordinator) -> HostResponse { HostRequest::Spawn { name } => { tracing::info!(%name, "spawn"); let agent_dir = coord.register_agent(name)?; - if let Err(e) = lifecycle::spawn(name, &coord.agent_flake, &agent_dir).await { + let config_dir = Coordinator::agent_config_dir(name); + if let Err(e) = + lifecycle::spawn(name, &coord.hyperhive_flake, &agent_dir, &config_dir).await + { // Roll back socket registration if container creation failed. coord.unregister_agent(name); return Err(e); @@ -77,18 +80,29 @@ async fn dispatch(req: &HostRequest, coord: &Coordinator) -> HostResponse { HostRequest::Rebuild { name } => { tracing::info!(%name, "rebuild"); let agent_dir = coord.register_agent(name)?; - lifecycle::rebuild(name, &coord.agent_flake, &agent_dir).await?; + let config_dir = Coordinator::agent_config_dir(name); + lifecycle::rebuild(name, &coord.hyperhive_flake, &agent_dir, &config_dir).await?; HostResponse::success() } HostRequest::List => HostResponse::list(lifecycle::list().await?), HostRequest::Pending => HostResponse::pending(coord.approvals.pending()?), HostRequest::Approve { id } => { let approval = coord.approvals.mark_approved(*id)?; - tracing::info!(%approval.id, %approval.agent, %approval.commit_ref, "approval applied: rebuilding agent"); + tracing::info!(%approval.id, %approval.agent, %approval.commit_ref, "approval applied: advancing main + rebuilding"); let agent_dir = coord.register_agent(&approval.agent)?; - if let Err(e) = - lifecycle::rebuild(&approval.agent, &coord.agent_flake, &agent_dir).await - { + let config_dir = Coordinator::agent_config_dir(&approval.agent); + let result: anyhow::Result<()> = async { + lifecycle::apply_commit(&config_dir, &approval.commit_ref).await?; + lifecycle::rebuild( + &approval.agent, + &coord.hyperhive_flake, + &agent_dir, + &config_dir, + ) + .await + } + .await; + if let Err(e) = result { let note = format!("{e:#}"); let _ = coord.approvals.mark_failed(approval.id, ¬e); return Err(e); diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index 86ba5909..96b8f34c 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -16,10 +16,15 @@ in defaultText = lib.literalExpression "pkgs.hyperhive"; description = "Package that provides /bin/hive-c0re."; }; - agentFlake = lib.mkOption { + hyperhiveFlake = lib.mkOption { type = lib.types.str; - default = "/etc/hyperhive#agent-base"; - description = "Flake reference passed to `nixos-container create --flake` when spawning sub-agents."; + default = "/etc/hyperhive"; + description = '' + URL of the hyperhive flake (no fragment). Inlined into each + per-agent `flake.nix` at `inputs.hyperhive.url`. The per-agent + flake then pulls `hyperhive.nixosConfigurations.agent-base` to + build the container. + ''; }; }; @@ -31,7 +36,7 @@ in wantedBy = [ "multi-user.target" ]; path = [ "/run/current-system/sw" ]; serviceConfig = { - ExecStart = "${cfg.package}/bin/hive-c0re --socket /run/hyperhive/host.sock serve --agent-flake ${cfg.agentFlake}"; + ExecStart = "${cfg.package}/bin/hive-c0re --socket /run/hyperhive/host.sock serve --hyperhive-flake ${cfg.hyperhiveFlake}"; Restart = "on-failure"; RestartSec = 2; RuntimeDirectory = "hyperhive"; From 3c702cf43fe574a43c798bdfe1585feb47d59e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:10:37 +0200 Subject: [PATCH 0548/1295] fmt --- hive-c0re/src/lifecycle.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index 2bedff0b..3acee14f 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -163,10 +163,7 @@ pub async fn apply_commit(config_dir: &Path, commit_ref: &str) -> Result<()> { .await .with_context(|| format!("git cat-file in {}", config_dir.display()))?; if !st.success() { - bail!( - "commit {commit_ref} not found in {}", - config_dir.display() - ); + bail!("commit {commit_ref} not found in {}", config_dir.display()); } git(config_dir, &["update-ref", "refs/heads/main", commit_ref]).await?; git(config_dir, &["reset", "--hard", commit_ref]).await?; From da655d31c854f1d8ef00c36df2d5bd0c248a383e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:11:57 +0200 Subject: [PATCH 0549/1295] manager: /etc/gitconfig so commits in /agents work out of the box --- nix/templates/manager.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nix/templates/manager.nix b/nix/templates/manager.nix index b1912955..3bf9e87c 100644 --- a/nix/templates/manager.nix +++ b/nix/templates/manager.nix @@ -11,6 +11,14 @@ coreutils-full ]; + environment.etc."gitconfig".text = '' + [user] + name = hm1nd + email = hm1nd@hyperhive + [init] + defaultBranch = main + ''; + systemd.services.hive-m1nd = { description = "hive-m1nd manager harness"; wantedBy = [ "multi-user.target" ]; From f6d681c2e29cb0ecca1b5f089d964e4f0250d4ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:12:43 +0200 Subject: [PATCH 0550/1295] CLAUDE.md: Phases 4 + 5 status, approval-flow runbook --- CLAUDE.md | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 1f2f80af..0190186f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -140,11 +140,48 @@ in. hot-reload works under the patch stack (validated empirically on muede-lpt2) - ✅ Phase 2 — per-agent sockets, in-memory broker, agent harness round-trips messages - ✅ Phase 3 — sqlite broker (durable across restart) + claude-or-echo turn loop -- 🔜 Phase 4 — `hm1nd` manager binary with privileged tool surface -- 🔜 Phase 5 — git-commit approval flow (`state-repo` + per-agent config flakes) +- ✅ Phase 4 — `hm1nd` manager binary + manager socket + declarative `containers.hm1nd` +- ✅ Phase 5 — git-commit approval flow: + - 5a — sqlite approval queue (`request_apply_commit` / `pending` / `approve` / `deny`) + - 5b — per-agent config flakes at `/var/lib/hyperhive/agents//config/`; + `approve ` validates the commit + advances `main` + rebuilds - 🔜 Phase 6 — per-agent web UI + dashboard MVP - 🔜 Phase 7 — dashboard commit-view + polish +## Approval flow (Phase 5) + +End-to-end: manager edits per-agent config repo → commits → submits commit sha +for approval → user approves on host CLI → `hive-c0re` advances `main` + rebuilds. + +``` +# Inside the hm1nd container (manager has /agents bind-mounted RW): +cd /agents/alice/config +$EDITOR agent.nix # add `environment.systemPackages = [ pkgs.htop ];` +git commit -am "add htop" +SHA=$(git rev-parse HEAD) +hive-m1nd request-apply-commit alice $SHA +exit + +# On the host: +sudo hive-c0re pending # shows the queued approval with id N +sudo hive-c0re approve N # validates, advances main, rebuilds h-alice +sudo nixos-container run h-alice -- which htop # /run/current-system/sw/bin/htop +``` + +Per-agent flake layout (generated by `setup_config` on every spawn / rebuild): + +``` +/var/lib/hyperhive/agents//config/ +├── .git/ +├── flake.nix # managed by hive-c0re — rewritten when hyperhive flake URL changes +└── agent.nix # manager-editable; per-agent NixOS overrides +``` + +The flake's `inputs.hyperhive.url` is the same URL `hive-c0re` was launched with +(`services.hive-c0re.hyperhiveFlake`), inlined as a string. The flake's +`nixosConfigurations.default` extends `hyperhive.nixosConfigurations.agent-base` +with `./agent.nix`. So adding packages is a one-line edit in `agent.nix`. + See PLAN.md for the full design and the deferred-out-of-scope list. ## Inspirations From 2fd80dbd685bf50ca2315c36625bc16bded32cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:20:32 +0200 Subject: [PATCH 0551/1295] Phase 5c: separate proposed (manager) and applied (hive-c0re) repos; per-agent gitconfig --- hive-c0re/src/coordinator.rs | 16 +++- hive-c0re/src/lifecycle.rs | 155 +++++++++++++++++++++----------- hive-c0re/src/manager_server.rs | 13 ++- hive-c0re/src/server.rs | 27 ++++-- 4 files changed, 147 insertions(+), 64 deletions(-) diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index caed7aa6..5f7a0295 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -14,7 +14,14 @@ use crate::broker::Broker; const AGENT_RUNTIME_ROOT: &str = "/run/hyperhive/agents"; const MANAGER_RUNTIME_ROOT: &str = "/run/hyperhive/manager"; +/// Manager-editable per-agent config repos. Bind-mounted RW into the manager +/// container as `/agents//`. Hive-c0re only writes to these on first +/// spawn (initial commit); after that it's manager-only. const AGENT_STATE_ROOT: &str = "/var/lib/hyperhive/agents"; +/// Hive-c0re-only authoritative per-agent config repos. Containers build from +/// these. Manager has no filesystem access; the only way to update is via +/// `request_apply_commit` + user approval. +const APPLIED_STATE_ROOT: &str = "/var/lib/hyperhive/applied"; pub struct Coordinator { pub broker: Arc, @@ -73,7 +80,14 @@ impl Coordinator { Self::manager_dir().join("mcp.sock") } - pub fn agent_config_dir(name: &str) -> PathBuf { + /// Manager-editable proposed config repo. Bind-mounted into the manager + /// container as `/agents//config/`. + pub fn agent_proposed_dir(name: &str) -> PathBuf { PathBuf::from(format!("{AGENT_STATE_ROOT}/{name}/config")) } + + /// Authoritative applied config repo. Hive-c0re-only. + pub fn agent_applied_dir(name: &str) -> PathBuf { + PathBuf::from(format!("{APPLIED_STATE_ROOT}/{name}")) + } } diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index 3acee14f..0dc4672b 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -40,12 +40,14 @@ pub async fn spawn( name: &str, hyperhive_flake: &str, agent_dir: &Path, - config_dir: &Path, + proposed_dir: &Path, + applied_dir: &Path, ) -> Result<()> { validate(name)?; - setup_config(config_dir, name, hyperhive_flake).await?; + setup_proposed(proposed_dir, name).await?; + setup_applied(applied_dir, name, hyperhive_flake).await?; let container = container_name(name); - let flake_ref = format!("{}#default", config_dir.display()); + let flake_ref = format!("{}#default", applied_dir.display()); run(&["create", &container, "--flake", &flake_ref]).await?; set_nspawn_flags(&container, agent_dir)?; run(&["start", &container]).await @@ -61,12 +63,12 @@ pub async fn rebuild( name: &str, hyperhive_flake: &str, agent_dir: &Path, - config_dir: &Path, + applied_dir: &Path, ) -> Result<()> { validate(name)?; - setup_config(config_dir, name, hyperhive_flake).await?; + setup_applied(applied_dir, name, hyperhive_flake).await?; let container = container_name(name); - let flake_ref = format!("{}#default", config_dir.display()); + let flake_ref = format!("{}#default", applied_dir.display()); set_nspawn_flags(&container, agent_dir)?; run(&["update", &container, "--flake", &flake_ref]).await?; // Restart so any nspawn-level changes (bind mounts, networking, etc.) apply. @@ -95,15 +97,34 @@ pub async fn list() -> Result> { .collect()) } -/// Ensure `config_dir` exists as a git repo containing a per-agent flake. The -/// `flake.nix` is rewritten every call (so a new hyperhive store path -/// propagates on rebuild); `agent.nix` is written only the first time -/// (manager-editable thereafter). -pub async fn setup_config(config_dir: &Path, name: &str, hyperhive_flake: &str) -> Result<()> { - std::fs::create_dir_all(config_dir) - .with_context(|| format!("create {}", config_dir.display()))?; +/// Initialize the manager-editable proposed repo. Contains only `agent.nix` +/// (the file the manager edits). Touched by hive-c0re only on first spawn — +/// never again — so the manager can't be surprised by hive-c0re commits or +/// working-tree resets. +pub async fn setup_proposed(proposed_dir: &Path, name: &str) -> Result<()> { + if proposed_dir.join(".git").exists() { + return Ok(()); + } + std::fs::create_dir_all(proposed_dir) + .with_context(|| format!("create {}", proposed_dir.display()))?; + let agent_path = proposed_dir.join("agent.nix"); + if !agent_path.exists() { + std::fs::write(&agent_path, initial_agent_nix(name)) + .with_context(|| format!("write {}", agent_path.display()))?; + } + git(proposed_dir, &["init", "--initial-branch=main"]).await?; + git(proposed_dir, &["add", "agent.nix"]).await?; + git_commit(proposed_dir, "hive-c0re init").await?; + Ok(()) +} + +/// Maintain the authoritative applied repo. Rewrites `flake.nix` every call +/// (so a new hyperhive flake URL propagates on rebuild); seeds `agent.nix` +/// only on first call. `apply_commit` overwrites `agent.nix` later. +pub async fn setup_applied(applied_dir: &Path, name: &str, hyperhive_flake: &str) -> Result<()> { + std::fs::create_dir_all(applied_dir) + .with_context(|| format!("create {}", applied_dir.display()))?; - let flake_path = config_dir.join("flake.nix"); let flake_body = format!( r#"{{ description = "hyperhive sub-agent {name}"; @@ -112,64 +133,96 @@ pub async fn setup_config(config_dir: &Path, name: &str, hyperhive_flake: &str) {{ hyperhive, ... }}: {{ nixosConfigurations.default = hyperhive.nixosConfigurations.agent-base.extendModules {{ - modules = [ ./agent.nix ]; + modules = [ + ./agent.nix + {{ + environment.etc."gitconfig".text = '' + [user] + name = {name} + email = {name}@hyperhive + [init] + defaultBranch = main + ''; + }} + ]; }}; }}; }} "#, ); - std::fs::write(&flake_path, flake_body) - .with_context(|| format!("write {}", flake_path.display()))?; + std::fs::write(applied_dir.join("flake.nix"), flake_body) + .with_context(|| format!("write {}/flake.nix", applied_dir.display()))?; - let agent_path = config_dir.join("agent.nix"); + let agent_path = applied_dir.join("agent.nix"); if !agent_path.exists() { - let initial = format!( - "{{ ... }}:\n{{\n # Per-agent overrides for {name}. The manager edits this\n # file (and commits) to customise the agent's NixOS config.\n}}\n", - ); - std::fs::write(&agent_path, initial) + std::fs::write(&agent_path, initial_agent_nix(name)) .with_context(|| format!("write {}", agent_path.display()))?; } - if !config_dir.join(".git").exists() { - git(config_dir, &["init", "--initial-branch=main"]).await?; + if !applied_dir.join(".git").exists() { + git(applied_dir, &["init", "--initial-branch=main"]).await?; } - git(config_dir, &["add", "-A"]).await?; - let clean = git_status(config_dir, &["diff", "--cached", "--quiet"]).await?; + git(applied_dir, &["add", "-A"]).await?; + let clean = git_status(applied_dir, &["diff", "--cached", "--quiet"]).await?; if !clean { - git( - config_dir, - &[ - "-c", - &format!("user.name={GIT_NAME}"), - "-c", - &format!("user.email={GIT_EMAIL}"), - "commit", - "-m", - "hive-c0re sync", - ], - ) - .await?; + git_commit(applied_dir, "hive-c0re sync").await?; } Ok(()) } -/// Verify `commit_ref` exists in the config repo, advance `main` to it, and -/// reset the working tree. Caller is responsible for the subsequent rebuild. -pub async fn apply_commit(config_dir: &Path, commit_ref: &str) -> Result<()> { - let st = Command::new("git") - .current_dir(config_dir) - .args(["cat-file", "-e", commit_ref]) - .status() +/// Apply a manager-proposed commit: read `agent.nix` at `commit_ref` from the +/// proposed repo, write it into the applied repo, commit. Hive-c0re alone +/// advances `applied`'s `main`; the manager only sees `proposed/`. +pub async fn apply_commit( + applied_dir: &Path, + proposed_dir: &Path, + commit_ref: &str, +) -> Result<()> { + let out = Command::new("git") + .current_dir(proposed_dir) + .args(["show", &format!("{commit_ref}:agent.nix")]) + .output() .await - .with_context(|| format!("git cat-file in {}", config_dir.display()))?; - if !st.success() { - bail!("commit {commit_ref} not found in {}", config_dir.display()); + .with_context(|| format!("git show in {}", proposed_dir.display()))?; + if !out.status.success() { + bail!( + "agent.nix at commit {commit_ref} not found in {}: {}", + proposed_dir.display(), + String::from_utf8_lossy(&out.stderr).trim() + ); + } + std::fs::write(applied_dir.join("agent.nix"), &out.stdout) + .with_context(|| format!("write {}/agent.nix", applied_dir.display()))?; + git(applied_dir, &["add", "agent.nix"]).await?; + let clean = git_status(applied_dir, &["diff", "--cached", "--quiet"]).await?; + if !clean { + git_commit(applied_dir, &format!("apply {commit_ref}")).await?; } - git(config_dir, &["update-ref", "refs/heads/main", commit_ref]).await?; - git(config_dir, &["reset", "--hard", commit_ref]).await?; Ok(()) } +fn initial_agent_nix(name: &str) -> String { + format!( + "{{ ... }}:\n{{\n # Per-agent overrides for {name}. The manager edits this\n # file (and commits) to customise the agent's NixOS config.\n}}\n", + ) +} + +async fn git_commit(dir: &Path, message: &str) -> Result<()> { + git( + dir, + &[ + "-c", + &format!("user.name={GIT_NAME}"), + "-c", + &format!("user.email={GIT_EMAIL}"), + "commit", + "-m", + message, + ], + ) + .await +} + async fn git(dir: &Path, args: &[&str]) -> Result<()> { let out = Command::new("git") .current_dir(dir) diff --git a/hive-c0re/src/manager_server.rs b/hive-c0re/src/manager_server.rs index 6f4e6be6..408bc4a5 100644 --- a/hive-c0re/src/manager_server.rs +++ b/hive-c0re/src/manager_server.rs @@ -95,9 +95,16 @@ async fn dispatch(req: &ManagerRequest, coord: &Coordinator) -> ManagerResponse tracing::info!(%name, "manager: spawn"); let result: Result<()> = async { let agent_dir = coord.register_agent(name)?; - let config_dir = Coordinator::agent_config_dir(name); - if let Err(e) = - lifecycle::spawn(name, &coord.hyperhive_flake, &agent_dir, &config_dir).await + let proposed_dir = Coordinator::agent_proposed_dir(name); + let applied_dir = Coordinator::agent_applied_dir(name); + if let Err(e) = lifecycle::spawn( + name, + &coord.hyperhive_flake, + &agent_dir, + &proposed_dir, + &applied_dir, + ) + .await { coord.unregister_agent(name); return Err(e); diff --git a/hive-c0re/src/server.rs b/hive-c0re/src/server.rs index cbca5a8a..6c1acb7a 100644 --- a/hive-c0re/src/server.rs +++ b/hive-c0re/src/server.rs @@ -61,9 +61,16 @@ async fn dispatch(req: &HostRequest, coord: &Coordinator) -> HostResponse { HostRequest::Spawn { name } => { tracing::info!(%name, "spawn"); let agent_dir = coord.register_agent(name)?; - let config_dir = Coordinator::agent_config_dir(name); - if let Err(e) = - lifecycle::spawn(name, &coord.hyperhive_flake, &agent_dir, &config_dir).await + let proposed_dir = Coordinator::agent_proposed_dir(name); + let applied_dir = Coordinator::agent_applied_dir(name); + if let Err(e) = lifecycle::spawn( + name, + &coord.hyperhive_flake, + &agent_dir, + &proposed_dir, + &applied_dir, + ) + .await { // Roll back socket registration if container creation failed. coord.unregister_agent(name); @@ -80,24 +87,26 @@ async fn dispatch(req: &HostRequest, coord: &Coordinator) -> HostResponse { HostRequest::Rebuild { name } => { tracing::info!(%name, "rebuild"); let agent_dir = coord.register_agent(name)?; - let config_dir = Coordinator::agent_config_dir(name); - lifecycle::rebuild(name, &coord.hyperhive_flake, &agent_dir, &config_dir).await?; + let applied_dir = Coordinator::agent_applied_dir(name); + lifecycle::rebuild(name, &coord.hyperhive_flake, &agent_dir, &applied_dir).await?; HostResponse::success() } HostRequest::List => HostResponse::list(lifecycle::list().await?), HostRequest::Pending => HostResponse::pending(coord.approvals.pending()?), HostRequest::Approve { id } => { let approval = coord.approvals.mark_approved(*id)?; - tracing::info!(%approval.id, %approval.agent, %approval.commit_ref, "approval applied: advancing main + rebuilding"); + tracing::info!(%approval.id, %approval.agent, %approval.commit_ref, "approval: applying + rebuilding"); let agent_dir = coord.register_agent(&approval.agent)?; - let config_dir = Coordinator::agent_config_dir(&approval.agent); + let proposed_dir = Coordinator::agent_proposed_dir(&approval.agent); + let applied_dir = Coordinator::agent_applied_dir(&approval.agent); let result: anyhow::Result<()> = async { - lifecycle::apply_commit(&config_dir, &approval.commit_ref).await?; + lifecycle::apply_commit(&applied_dir, &proposed_dir, &approval.commit_ref) + .await?; lifecycle::rebuild( &approval.agent, &coord.hyperhive_flake, &agent_dir, - &config_dir, + &applied_dir, ) .await } From 967ec7c9d7be0abb1aa72502f8974ea2f9cea1f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:22:00 +0200 Subject: [PATCH 0552/1295] fmt --- hive-c0re/src/lifecycle.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index 0dc4672b..fd3555f5 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -173,11 +173,7 @@ pub async fn setup_applied(applied_dir: &Path, name: &str, hyperhive_flake: &str /// Apply a manager-proposed commit: read `agent.nix` at `commit_ref` from the /// proposed repo, write it into the applied repo, commit. Hive-c0re alone /// advances `applied`'s `main`; the manager only sees `proposed/`. -pub async fn apply_commit( - applied_dir: &Path, - proposed_dir: &Path, - commit_ref: &str, -) -> Result<()> { +pub async fn apply_commit(applied_dir: &Path, proposed_dir: &Path, commit_ref: &str) -> Result<()> { let out = Command::new("git") .current_dir(proposed_dir) .args(["show", &format!("{commit_ref}:agent.nix")]) From 2a33697cda3df16b3ac40af25862c35224463a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:24:28 +0200 Subject: [PATCH 0553/1295] CLAUDE.md: Phase 5c split --- CLAUDE.md | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 0190186f..02030052 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -143,8 +143,11 @@ in. - ✅ Phase 4 — `hm1nd` manager binary + manager socket + declarative `containers.hm1nd` - ✅ Phase 5 — git-commit approval flow: - 5a — sqlite approval queue (`request_apply_commit` / `pending` / `approve` / `deny`) - - 5b — per-agent config flakes at `/var/lib/hyperhive/agents//config/`; - `approve ` validates the commit + advances `main` + rebuilds + - 5b — per-agent config flakes (proposed + applied repos) + - 5c — split: manager edits `proposed`, hive-c0re writes-only `applied`; the + container builds from `applied`. Approve = read `agent.nix` at the + approved commit from `proposed`, copy into `applied`, commit + rebuild. + Manager cannot move `main` on its own. - 🔜 Phase 6 — per-agent web UI + dashboard MVP - 🔜 Phase 7 — dashboard commit-view + polish @@ -168,19 +171,30 @@ sudo hive-c0re approve N # validates, advances main, rebuilds h-alice sudo nixos-container run h-alice -- which htop # /run/current-system/sw/bin/htop ``` -Per-agent flake layout (generated by `setup_config` on every spawn / rebuild): +Per-agent layout — two separate git repos: ``` -/var/lib/hyperhive/agents//config/ +/var/lib/hyperhive/agents//config/ # proposed — manager edits, hive-c0re reads only ├── .git/ -├── flake.nix # managed by hive-c0re — rewritten when hyperhive flake URL changes -└── agent.nix # manager-editable; per-agent NixOS overrides +└── agent.nix # the only file the manager can change + # (initial commit by hive-c0re on first spawn, + # never touched by hive-c0re again) + +/var/lib/hyperhive/applied// # applied — hive-c0re-only; container builds here +├── .git/ +├── flake.nix # hive-c0re-managed; references hyperhive_flake +└── agent.nix # overwritten by approve from the proposed commit ``` -The flake's `inputs.hyperhive.url` is the same URL `hive-c0re` was launched with -(`services.hive-c0re.hyperhiveFlake`), inlined as a string. The flake's +The container's `--flake` ref is `#default`. The flake's `nixosConfigurations.default` extends `hyperhive.nixosConfigurations.agent-base` -with `./agent.nix`. So adding packages is a one-line edit in `agent.nix`. +with `./agent.nix` plus an inline module setting `environment.etc."gitconfig".text` +with the agent's name as the git committer identity. + +On approve: `git show :agent.nix` from `proposed/`, write the bytes +into `applied//agent.nix`, commit there as `hive-c0re`, then +`nixos-container update`. The manager can only propose; only hive-c0re advances +`applied`'s `main`. See PLAN.md for the full design and the deferred-out-of-scope list. From a751e544bef580c966f2a908fc939853b5232fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:26:58 +0200 Subject: [PATCH 0554/1295] =?UTF-8?q?tests:=20approval.sh=20=E2=80=94=20Ph?= =?UTF-8?q?ase=205c=20end-to-end?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/approval.sh | 91 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 tests/approval.sh diff --git a/tests/approval.sh b/tests/approval.sh new file mode 100755 index 00000000..5848823b --- /dev/null +++ b/tests/approval.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash +# Phase 5c end-to-end approval flow: +# manager edits proposed -> commits -> request_apply_commit +# user approves on host -> hive-c0re applies into authoritative repo -> rebuild +# sub-agent container has the new package +# +# Runs as root on a host with services.hive-c0re enabled and the hm1nd +# container declared. Idempotent — wipes any prior alice state. + +set -euo pipefail + +AGENT=alice +PKG=htop + +cleanup() { + echo "=== cleanup ===" + sudo hive-c0re kill "$AGENT" 2>/dev/null || true + sudo nixos-container destroy "h-${AGENT}" 2>/dev/null || true + sudo rm -rf \ + "/var/lib/hyperhive/agents/${AGENT}" \ + "/var/lib/hyperhive/applied/${AGENT}" +} + +cleanup + +echo "=== spawn ${AGENT} ===" +sudo hive-c0re spawn "$AGENT" + +echo "=== two-repo split visible ===" +echo " proposed (manager-editable):" +sudo ls -la "/var/lib/hyperhive/agents/${AGENT}/config/" | sed 's/^/ /' +echo " applied (hive-c0re only):" +sudo ls -la "/var/lib/hyperhive/applied/${AGENT}/" | sed 's/^/ /' + +echo "=== manager cannot see the applied repo ===" +if sudo nixos-container run hm1nd -- ls "/var/lib/hyperhive/applied/${AGENT}" 2>/dev/null; then + echo "FAIL: manager can see applied/ — bind-mount leak" + exit 1 +fi +echo " manager has no path to applied/ ✓" + +echo "=== ${PKG} not installed in h-${AGENT} (pre-approve) ===" +if sudo nixos-container run "h-${AGENT}" -- which "$PKG" 2>/dev/null; then + echo "FAIL: ${PKG} already in path" + exit 1 +fi +echo " not in path ✓" + +echo "=== manager: edit agent.nix + commit + request_apply_commit ===" +sudo nixos-container run hm1nd -- bash -c " + set -euo pipefail + cd /agents/${AGENT}/config + cat > agent.nix <<'EOF' +{ pkgs, ... }: +{ + environment.systemPackages = [ pkgs.${PKG} ]; +} +EOF + git commit -am 'add ${PKG}' + SHA=\$(git rev-parse HEAD) + echo \" manager commit SHA=\$SHA\" + hive-m1nd request-apply-commit ${AGENT} \$SHA +" + +echo "=== pending approvals ===" +sudo hive-c0re pending + +ID=$(sudo hive-c0re pending \ + | python3 -c 'import sys,json;print(json.load(sys.stdin)["approvals"][-1]["id"])') +echo " using approval id ${ID}" + +echo "=== approve ${ID} (advances applied/main + rebuilds h-${AGENT}) ===" +sudo hive-c0re approve "$ID" + +echo "=== verify ${PKG} now in path ===" +sudo nixos-container run "h-${AGENT}" -- which "$PKG" + +echo "=== applied repo git log ===" +sudo git -C "/var/lib/hyperhive/applied/${AGENT}" log --oneline -5 + +echo "=== approvals table ===" +if command -v sqlite3 >/dev/null; then + sudo sqlite3 /var/lib/hyperhive/broker.sqlite \ + "SELECT id, agent, substr(commit_ref,1,12) AS sha, status FROM approvals ORDER BY id DESC LIMIT 5;" +else + echo " (sqlite3 not on host PATH — skip)" +fi + +echo +read -r -p "press enter to tear down, Ctrl-C to leave running: " +cleanup From e53315465588cece34892e9974b0dba3f2b5ad0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:30:04 +0200 Subject: [PATCH 0555/1295] tests/approval.sh: precheck + auto-start hm1nd --- tests/approval.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/approval.sh b/tests/approval.sh index 5848823b..7e9986a0 100755 --- a/tests/approval.sh +++ b/tests/approval.sh @@ -21,6 +21,22 @@ cleanup() { "/var/lib/hyperhive/applied/${AGENT}" } +echo "=== precheck: hm1nd container is up ===" +if ! sudo machinectl status hm1nd >/dev/null 2>&1; then + echo " hm1nd is not running. Starting via systemd..." + sudo systemctl start "container@hm1nd.service" || { + echo "FAIL: could not start container@hm1nd.service." + echo " Did you 'nixos-rebuild switch' after declaring containers.hm1nd in your host config?" + exit 1 + } + # wait briefly for it to come up + for i in 1 2 3 4 5 6 7 8 9 10; do + sudo machinectl status hm1nd >/dev/null 2>&1 && break + sleep 0.5 + done +fi +echo " hm1nd is up ✓" + cleanup echo "=== spawn ${AGENT} ===" From 14cb1071251ec98d1f9b427158c09912326f708f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:32:03 +0200 Subject: [PATCH 0556/1295] tests/approval.sh: parse id via sed (no python dep) --- tests/approval.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/approval.sh b/tests/approval.sh index 7e9986a0..2210d5ab 100755 --- a/tests/approval.sh +++ b/tests/approval.sh @@ -82,7 +82,12 @@ echo "=== pending approvals ===" sudo hive-c0re pending ID=$(sudo hive-c0re pending \ - | python3 -c 'import sys,json;print(json.load(sys.stdin)["approvals"][-1]["id"])') + | sed -nE 's/^[[:space:]]*"id":[[:space:]]*([0-9]+).*/\1/p' \ + | tail -1) +if [ -z "$ID" ]; then + echo "FAIL: could not parse approval id" + exit 1 +fi echo " using approval id ${ID}" echo "=== approve ${ID} (advances applied/main + rebuilds h-${AGENT}) ===" From d0f954bbc1acdf008a9684e930a5c00d9a044752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:39:06 +0200 Subject: [PATCH 0557/1295] Phase 6a: per-container web UI (axum); per-agent port hashed from name --- Cargo.toml | 1 + hive-ag3nt/Cargo.toml | 1 + hive-ag3nt/src/bin/hive-ag3nt.rs | 16 +++++++++++-- hive-ag3nt/src/bin/hive-m1nd.rs | 16 +++++++++++-- hive-ag3nt/src/lib.rs | 4 ++++ hive-ag3nt/src/web_ui.rs | 40 ++++++++++++++++++++++++++++++++ hive-c0re/src/lifecycle.rs | 23 ++++++++++++++++++ nix/modules/hive-c0re.nix | 11 +++++++++ nix/templates/manager.nix | 4 ++++ 9 files changed, 112 insertions(+), 4 deletions(-) create mode 100644 hive-ag3nt/src/web_ui.rs diff --git a/Cargo.toml b/Cargo.toml index a19750c1..7f348719 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ must_use_candidate = "allow" [workspace.dependencies] anyhow = "1" +axum = "0.8" clap = { version = "4", features = ["derive"] } hive-sh4re = { path = "hive-sh4re" } rusqlite = { version = "0.37", features = ["bundled"] } diff --git a/hive-ag3nt/Cargo.toml b/hive-ag3nt/Cargo.toml index 8154257c..09ae0911 100644 --- a/hive-ag3nt/Cargo.toml +++ b/hive-ag3nt/Cargo.toml @@ -8,6 +8,7 @@ workspace = true [dependencies] anyhow.workspace = true +axum.workspace = true clap.workspace = true hive-sh4re.workspace = true serde.workspace = true diff --git a/hive-ag3nt/src/bin/hive-ag3nt.rs b/hive-ag3nt/src/bin/hive-ag3nt.rs index f8a66f91..6796bcac 100644 --- a/hive-ag3nt/src/bin/hive-ag3nt.rs +++ b/hive-ag3nt/src/bin/hive-ag3nt.rs @@ -3,7 +3,7 @@ use std::time::Duration; use anyhow::{Result, bail}; use clap::{Parser, Subcommand}; -use hive_ag3nt::{DEFAULT_SOCKET, client}; +use hive_ag3nt::{DEFAULT_SOCKET, DEFAULT_WEB_PORT, client, web_ui}; use hive_sh4re::{AgentRequest, AgentResponse}; use tokio::process::Command; @@ -44,7 +44,19 @@ async fn main() -> Result<()> { let cli = Cli::parse(); match cli.cmd { - Cmd::Serve { poll_ms } => serve(&cli.socket, Duration::from_millis(poll_ms)).await, + Cmd::Serve { poll_ms } => { + let port = std::env::var("HIVE_PORT") + .ok() + .and_then(|s| s.parse::().ok()) + .unwrap_or(DEFAULT_WEB_PORT); + let label = std::env::var("HIVE_LABEL").unwrap_or_else(|_| "hive-ag3nt".into()); + tokio::spawn(async move { + if let Err(e) = web_ui::serve(label, port).await { + tracing::error!(error = ?e, "web ui failed"); + } + }); + serve(&cli.socket, Duration::from_millis(poll_ms)).await + } Cmd::Send { to, body } => { let resp: AgentResponse = client::request(&cli.socket, &AgentRequest::Send { to, body }).await?; diff --git a/hive-ag3nt/src/bin/hive-m1nd.rs b/hive-ag3nt/src/bin/hive-m1nd.rs index 89fb8214..9b704dcc 100644 --- a/hive-ag3nt/src/bin/hive-m1nd.rs +++ b/hive-ag3nt/src/bin/hive-m1nd.rs @@ -8,7 +8,7 @@ use std::time::Duration; use anyhow::{Result, bail}; use clap::{Parser, Subcommand}; -use hive_ag3nt::{DEFAULT_SOCKET, client}; +use hive_ag3nt::{DEFAULT_SOCKET, DEFAULT_WEB_PORT, client, web_ui}; use hive_sh4re::{ManagerRequest, ManagerResponse}; #[derive(Parser)] @@ -52,7 +52,19 @@ async fn main() -> Result<()> { let cli = Cli::parse(); match cli.cmd { - Cmd::Serve { poll_ms } => serve(&cli.socket, Duration::from_millis(poll_ms)).await, + Cmd::Serve { poll_ms } => { + let port = std::env::var("HIVE_PORT") + .ok() + .and_then(|s| s.parse::().ok()) + .unwrap_or(DEFAULT_WEB_PORT); + let label = std::env::var("HIVE_LABEL").unwrap_or_else(|_| "hm1nd".into()); + tokio::spawn(async move { + if let Err(e) = web_ui::serve(label, port).await { + tracing::error!(error = ?e, "web ui failed"); + } + }); + serve(&cli.socket, Duration::from_millis(poll_ms)).await + } Cmd::Send { to, body } => one_shot(&cli.socket, ManagerRequest::Send { to, body }).await, Cmd::Recv => one_shot(&cli.socket, ManagerRequest::Recv).await, Cmd::Spawn { name } => one_shot(&cli.socket, ManagerRequest::Spawn { name }).await, diff --git a/hive-ag3nt/src/lib.rs b/hive-ag3nt/src/lib.rs index 3890473f..a5608ad0 100644 --- a/hive-ag3nt/src/lib.rs +++ b/hive-ag3nt/src/lib.rs @@ -2,6 +2,10 @@ //! `hive-m1nd` (manager) binaries. pub mod client; +pub mod web_ui; /// Default socket path inside the container — bind-mounted by `hive-c0re`. pub const DEFAULT_SOCKET: &str = "/run/hive/mcp.sock"; + +/// Default web UI port — used when `HIVE_PORT` env is unset. +pub const DEFAULT_WEB_PORT: u16 = 8042; diff --git a/hive-ag3nt/src/web_ui.rs b/hive-ag3nt/src/web_ui.rs new file mode 100644 index 00000000..141b9c61 --- /dev/null +++ b/hive-ag3nt/src/web_ui.rs @@ -0,0 +1,40 @@ +//! Per-container HTTP UI. Phase 6 minimum — a status page on a host port. +//! Containers share the host's network namespace (privateNetwork = false), so +//! each instance must bind a distinct port. `HIVE_PORT` is set per agent by +//! `hive-c0re`'s generated per-agent flake (deterministic from agent name). + +use std::net::SocketAddr; + +use anyhow::{Context, Result}; +use axum::{Router, extract::State, response::Html, routing::get}; + +#[derive(Clone)] +struct AppState { + label: String, +} + +pub async fn serve(label: String, port: u16) -> Result<()> { + let state = AppState { label }; + let app = Router::new().route("/", get(index)).with_state(state); + let addr = SocketAddr::from(([0, 0, 0, 0], port)); + let listener = tokio::net::TcpListener::bind(addr) + .await + .with_context(|| format!("bind web UI on port {port}"))?; + tracing::info!(%port, "web UI listening"); + axum::serve(listener, app).await?; + Ok(()) +} + +async fn index(State(state): State) -> Html { + Html(format!( + "\n\ + \n\ + {label}\n\ + \n\ +

{label}

\n\ +

hyperhive harness placeholder. Phase 6a: this page exists.

\n\ + \n\ + \n", + label = state.label, + )) +} diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index fd3555f5..d8b586ff 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -19,6 +19,24 @@ pub const CONTAINER_RUNTIME_MOUNT: &str = "/run/hive"; const GIT_NAME: &str = "hive-c0re"; const GIT_EMAIL: &str = "hive-c0re@hyperhive"; +/// Sub-agent web UI port range. Deterministic from the agent's name (FNV-1a +/// hash mod range size), so the dashboard can compute the same port without +/// asking hive-c0re. +const WEB_PORT_BASE: u16 = 8100; +const WEB_PORT_RANGE: u16 = 900; + +/// Returns the per-agent web UI port. Same hash on both sides — manager, +/// dashboard, and agent harness all agree. +#[must_use] +pub fn agent_web_port(name: &str) -> u16 { + let mut hash: u32 = 2_166_136_261; + for b in name.bytes() { + hash ^= u32::from(b); + hash = hash.wrapping_mul(16_777_619); + } + WEB_PORT_BASE + (hash % u32::from(WEB_PORT_RANGE)) as u16 +} + pub fn container_name(name: &str) -> String { format!("{AGENT_PREFIX}{name}") } @@ -125,6 +143,7 @@ pub async fn setup_applied(applied_dir: &Path, name: &str, hyperhive_flake: &str std::fs::create_dir_all(applied_dir) .with_context(|| format!("create {}", applied_dir.display()))?; + let port = agent_web_port(name); let flake_body = format!( r#"{{ description = "hyperhive sub-agent {name}"; @@ -143,6 +162,10 @@ pub async fn setup_applied(applied_dir: &Path, name: &str, hyperhive_flake: &str [init] defaultBranch = main ''; + systemd.services.hive-ag3nt.environment = {{ + HIVE_PORT = "{port}"; + HIVE_LABEL = "{name}"; + }}; }} ]; }}; diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index 96b8f34c..c3c4cfdb 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -31,6 +31,17 @@ in config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; + # Per-container web UIs share the host's network namespace and need their + # ports reachable. Manager: 8000. Sub-agents: 8100..8999 (deterministic + # hash; see `lifecycle::agent_web_port`). + networking.firewall.allowedTCPPorts = [ 8000 ]; + networking.firewall.allowedTCPPortRanges = [ + { + from = 8100; + to = 8999; + } + ]; + systemd.services.hive-c0re = { description = "hyperhive coordinator daemon"; wantedBy = [ "multi-user.target" ]; diff --git a/nix/templates/manager.nix b/nix/templates/manager.nix index 3bf9e87c..7920ec46 100644 --- a/nix/templates/manager.nix +++ b/nix/templates/manager.nix @@ -23,6 +23,10 @@ description = "hive-m1nd manager harness"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; + environment = { + HIVE_PORT = "8000"; + HIVE_LABEL = "hm1nd"; + }; serviceConfig = { ExecStart = "${pkgs.hyperhive}/bin/hive-m1nd serve"; Restart = "on-failure"; From 6dbf4eedd76d67e9e2b79bff63a81e277d6540ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:39:53 +0200 Subject: [PATCH 0558/1295] lifecycle: u16::try_from instead of as-cast --- Cargo.lock | 269 +++++++++++++++++++++++++++++++++++++ hive-c0re/src/lifecycle.rs | 3 +- 2 files changed, 271 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 7e58d09a..f29ce764 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,6 +67,64 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "axum" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" +dependencies = [ + "axum-core", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "bitflags" version = "2.11.1" @@ -175,6 +233,48 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] + [[package]] name = "hashbrown" version = "0.15.5" @@ -204,6 +304,7 @@ name = "hive-ag3nt" version = "0.1.0" dependencies = [ "anyhow", + "axum", "clap", "hive-sh4re", "serde", @@ -235,6 +336,86 @@ dependencies = [ "serde", ] +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "bytes", + "http", + "http-body", + "hyper", + "pin-project-lite", + "tokio", + "tower-service", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.2" @@ -285,12 +466,24 @@ dependencies = [ "regex-automata", ] +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + [[package]] name = "memchr" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + [[package]] name = "mio" version = "1.2.0" @@ -323,6 +516,12 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + [[package]] name = "pin-project-lite" version = "0.2.17" @@ -384,6 +583,12 @@ dependencies = [ "smallvec", ] +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + [[package]] name = "serde" version = "1.0.228" @@ -427,6 +632,29 @@ dependencies = [ "zmij", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -452,6 +680,12 @@ dependencies = [ "libc", ] +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + [[package]] name = "smallvec" version = "1.15.1" @@ -485,6 +719,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + [[package]] name = "thread_local" version = "1.1.9" @@ -521,12 +761,41 @@ dependencies = [ "syn", ] +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + [[package]] name = "tracing" version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", diff --git a/hive-c0re/src/lifecycle.rs b/hive-c0re/src/lifecycle.rs index d8b586ff..b85d9ad6 100644 --- a/hive-c0re/src/lifecycle.rs +++ b/hive-c0re/src/lifecycle.rs @@ -34,7 +34,8 @@ pub fn agent_web_port(name: &str) -> u16 { hash ^= u32::from(b); hash = hash.wrapping_mul(16_777_619); } - WEB_PORT_BASE + (hash % u32::from(WEB_PORT_RANGE)) as u16 + // Modulo of a u32 by a u16's value is guaranteed < u16::MAX, so try_from never fails. + WEB_PORT_BASE + u16::try_from(hash % u32::from(WEB_PORT_RANGE)).unwrap_or(0) } pub fn container_name(name: &str) -> String { From 8cf5d72798a3399d18858bf1d2bae62ffcf299cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:43:20 +0200 Subject: [PATCH 0559/1295] Phase 6b: vibec0re-styled dashboard on hive-c0re + agent web UI restyled --- hive-ag3nt/src/web_ui.rs | 51 ++++++++-- hive-c0re/Cargo.toml | 1 + hive-c0re/src/dashboard.rs | 197 +++++++++++++++++++++++++++++++++++++ hive-c0re/src/main.rs | 11 +++ nix/modules/hive-c0re.nix | 19 +++- 5 files changed, 266 insertions(+), 13 deletions(-) create mode 100644 hive-c0re/src/dashboard.rs diff --git a/hive-ag3nt/src/web_ui.rs b/hive-ag3nt/src/web_ui.rs index 141b9c61..132304a1 100644 --- a/hive-ag3nt/src/web_ui.rs +++ b/hive-ag3nt/src/web_ui.rs @@ -27,14 +27,49 @@ pub async fn serve(label: String, port: u16) -> Result<()> { async fn index(State(state): State) -> Html { Html(format!( - "\n\ - \n\ - {label}\n\ - \n\ -

{label}

\n\ -

hyperhive harness placeholder. Phase 6a: this page exists.

\n\ - \n\ - \n", + "\n\n\n\n{label} // hyperhive\n{STYLE}\n\n\n
░▒▓█▓▒░  {label}  ░▒▓█▓▒░  hyperhive ag3nt  ░▒▓█▓▒░
\n

◆ {label} ◆

\n
══════════════════════════════════════════════════════════════
\n

▓█▓▒░ harness alive ▓█▓▒░

\n

phase 6a placeholder — turn-loop status / inbox / xterm.js coming in 6b+

\n\n\n", label = state.label, )) } + +const STYLE: &str = r#" + +"#; diff --git a/hive-c0re/Cargo.toml b/hive-c0re/Cargo.toml index 8eafdfa9..553a7d3c 100644 --- a/hive-c0re/Cargo.toml +++ b/hive-c0re/Cargo.toml @@ -8,6 +8,7 @@ workspace = true [dependencies] anyhow.workspace = true +axum.workspace = true clap.workspace = true hive-sh4re.workspace = true rusqlite.workspace = true diff --git a/hive-c0re/src/dashboard.rs b/hive-c0re/src/dashboard.rs new file mode 100644 index 00000000..d3055725 --- /dev/null +++ b/hive-c0re/src/dashboard.rs @@ -0,0 +1,197 @@ +//! Hyperhive dashboard. Lists managed containers (with deep-links to each +//! container's web UI), pending approvals, and the manager. + +use std::net::SocketAddr; +use std::sync::Arc; + +use anyhow::{Context, Result}; +use axum::{Router, extract::State, http::HeaderMap, response::Html, routing::get}; +use hive_sh4re::Approval; + +use crate::coordinator::Coordinator; +use crate::lifecycle::{self, AGENT_PREFIX, MANAGER_NAME}; + +const MANAGER_PORT: u16 = 8000; + +#[derive(Clone)] +struct AppState { + coord: Arc, +} + +pub async fn serve(port: u16, coord: Arc) -> Result<()> { + let app = Router::new() + .route("/", get(index)) + .with_state(AppState { coord }); + let addr = SocketAddr::from(([0, 0, 0, 0], port)); + let listener = tokio::net::TcpListener::bind(addr) + .await + .with_context(|| format!("bind dashboard on port {port}"))?; + tracing::info!(%port, "dashboard listening"); + axum::serve(listener, app).await?; + Ok(()) +} + +async fn index(headers: HeaderMap, State(state): State) -> Html { + let host = headers + .get("host") + .and_then(|h| h.to_str().ok()) + .unwrap_or("localhost"); + let hostname = host.split(':').next().unwrap_or(host).to_owned(); + + let containers = lifecycle::list().await.unwrap_or_default(); + let approvals = state.coord.approvals.pending().unwrap_or_default(); + + Html(format!( + "\n\n\n\nhyperhive // h1ve-c0re\n{style}\n\n\n{banner}\n{containers}\n{approvals}\n{footer}\n\n\n", + style = STYLE, + banner = BANNER, + containers = render_containers(&containers, &hostname), + approvals = render_approvals(&approvals), + footer = FOOTER, + )) +} + +fn render_containers(containers: &[String], hostname: &str) -> String { + let mut out = String::from( + "

◆ C0NTAINERS ◆

\n
══════════════════════════════════════════════════════════════
\n", + ); + if containers.is_empty() { + out.push_str("

▓ no managed containers ▓

\n"); + return out; + } + out.push_str("
    \n"); + for container in containers { + if container == MANAGER_NAME { + out.push_str(&format!( + "
  • ▓█▓▒░ {container} m1nd :{MANAGER_PORT}
  • \n", + )); + } else if let Some(name) = container.strip_prefix(AGENT_PREFIX) { + let port = lifecycle::agent_web_port(name); + out.push_str(&format!( + "
  • ▒░▒░░ {name} ag3nt {container} :{port}
  • \n", + )); + } + } + out.push_str("
\n"); + out +} + +fn render_approvals(approvals: &[Approval]) -> String { + let mut out = String::from( + "

◆ P3NDING APPR0VALS ◆

\n
══════════════════════════════════════════════════════════════
\n", + ); + if approvals.is_empty() { + out.push_str("

▓ queue empty ▓

\n"); + return out; + } + out.push_str("
    \n"); + for a in approvals { + let sha_short = &a.commit_ref[..a.commit_ref.len().min(12)]; + out.push_str(&format!( + "
  • #{id} {agent} {sha_short} approve via hive-c0re approve {id}
  • \n", + id = a.id, + agent = a.agent, + )); + } + out.push_str("
\n"); + out +} + +const BANNER: &str = r#""#; + +const FOOTER: &str = r#"
+
══════════════════════════════════════════════════════════════
+

▲△▲ hyperhive ▲△▲ hive-c0re on this host ▲△▲

+
"#; + +const STYLE: &str = r#" + +"#; diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index fd8329e1..84974893 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -10,6 +10,7 @@ mod approvals; mod broker; mod client; mod coordinator; +mod dashboard; mod lifecycle; mod manager_server; mod server; @@ -38,6 +39,9 @@ enum Cmd { /// Path to the sqlite message store. #[arg(long, default_value = "/var/lib/hyperhive/broker.sqlite")] db: PathBuf, + /// Dashboard HTTP port. + #[arg(long, default_value_t = 7000)] + dashboard_port: u16, }, /// Spawn a new agent container (`hive-agent-`). Spawn { name: String }, @@ -69,9 +73,16 @@ async fn main() -> Result<()> { Cmd::Serve { hyperhive_flake, db, + dashboard_port, } => { let coord = Arc::new(Coordinator::open(&db, hyperhive_flake)?); manager_server::start(coord.clone())?; + let dash_coord = coord.clone(); + tokio::spawn(async move { + if let Err(e) = dashboard::serve(dashboard_port, dash_coord).await { + tracing::error!(error = ?e, "dashboard failed"); + } + }); server::serve(&cli.socket, coord).await } Cmd::Spawn { name } => { diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index c3c4cfdb..5438b259 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -26,15 +26,24 @@ in build the container. ''; }; + dashboardPort = lib.mkOption { + type = lib.types.port; + default = 7000; + description = "TCP port the hive-c0re dashboard listens on."; + }; }; config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; - # Per-container web UIs share the host's network namespace and need their - # ports reachable. Manager: 8000. Sub-agents: 8100..8999 (deterministic - # hash; see `lifecycle::agent_web_port`). - networking.firewall.allowedTCPPorts = [ 8000 ]; + # Dashboard + per-container web UIs share the host's network namespace and + # need their ports reachable. Dashboard: `cfg.dashboardPort` (default 7000). + # Manager: 8000. Sub-agents: 8100..8999 (deterministic hash; see + # `lifecycle::agent_web_port`). + networking.firewall.allowedTCPPorts = [ + cfg.dashboardPort + 8000 + ]; networking.firewall.allowedTCPPortRanges = [ { from = 8100; @@ -47,7 +56,7 @@ in wantedBy = [ "multi-user.target" ]; path = [ "/run/current-system/sw" ]; serviceConfig = { - ExecStart = "${cfg.package}/bin/hive-c0re --socket /run/hyperhive/host.sock serve --hyperhive-flake ${cfg.hyperhiveFlake}"; + ExecStart = "${cfg.package}/bin/hive-c0re --socket /run/hyperhive/host.sock serve --hyperhive-flake ${cfg.hyperhiveFlake} --dashboard-port ${toString cfg.dashboardPort}"; Restart = "on-failure"; RestartSec = 2; RuntimeDirectory = "hyperhive"; From 2e2989ef8cc2e7f4c02332f180301cc9d179c6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:44:19 +0200 Subject: [PATCH 0560/1295] dashboard: writeln! instead of push_str(format!) --- hive-c0re/src/dashboard.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hive-c0re/src/dashboard.rs b/hive-c0re/src/dashboard.rs index d3055725..83ec30cd 100644 --- a/hive-c0re/src/dashboard.rs +++ b/hive-c0re/src/dashboard.rs @@ -1,6 +1,7 @@ //! Hyperhive dashboard. Lists managed containers (with deep-links to each //! container's web UI), pending approvals, and the manager. +use std::fmt::Write as _; use std::net::SocketAddr; use std::sync::Arc; @@ -62,14 +63,16 @@ fn render_containers(containers: &[String], hostname: &str) -> String { out.push_str("
    \n"); for container in containers { if container == MANAGER_NAME { - out.push_str(&format!( - "
  • ▓█▓▒░ {container} m1nd :{MANAGER_PORT}
  • \n", - )); + let _ = writeln!( + out, + "
  • ▓█▓▒░ {container} m1nd :{MANAGER_PORT}
  • ", + ); } else if let Some(name) = container.strip_prefix(AGENT_PREFIX) { let port = lifecycle::agent_web_port(name); - out.push_str(&format!( - "
  • ▒░▒░░ {name} ag3nt {container} :{port}
  • \n", - )); + let _ = writeln!( + out, + "
  • ▒░▒░░ {name} ag3nt {container} :{port}
  • ", + ); } } out.push_str("
\n"); @@ -87,11 +90,12 @@ fn render_approvals(approvals: &[Approval]) -> String { out.push_str("
    \n"); for a in approvals { let sha_short = &a.commit_ref[..a.commit_ref.len().min(12)]; - out.push_str(&format!( - "
  • #{id} {agent} {sha_short} approve via hive-c0re approve {id}
  • \n", + let _ = writeln!( + out, + "
  • #{id} {agent} {sha_short} approve via hive-c0re approve {id}
  • ", id = a.id, agent = a.agent, - )); + ); } out.push_str("
\n"); out From 2b4213d32a357f0e00e8cfca227fcb582028502d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:44:32 +0200 Subject: [PATCH 0561/1295] Cargo.lock: axum deps --- Cargo.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.lock b/Cargo.lock index f29ce764..fe9c026c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -319,6 +319,7 @@ name = "hive-c0re" version = "0.1.0" dependencies = [ "anyhow", + "axum", "clap", "hive-sh4re", "rusqlite", From 75df5f6c29467a2912adcb320fe3817f9ca95ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 23:48:40 +0200 Subject: [PATCH 0562/1295] CLAUDE.md: Phase 6 status --- CLAUDE.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 02030052..134fecde 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -148,8 +148,15 @@ in. container builds from `applied`. Approve = read `agent.nix` at the approved commit from `proposed`, copy into `applied`, commit + rebuild. Manager cannot move `main` on its own. -- 🔜 Phase 6 — per-agent web UI + dashboard MVP -- 🔜 Phase 7 — dashboard commit-view + polish +- ✅ Phase 6 — per-container web UIs + hive-c0re dashboard: + - Each `hive-ag3nt` / `hive-m1nd` serves an `axum` HTTP page on `HIVE_PORT` + (deterministic hash for sub-agents in 8100–8999; fixed 8000 for the manager). + Vibec0re-styled placeholder for now (status / inbox / xterm coming later). + - `hive-c0re` serves a dashboard on `cfg.dashboardPort` (default 7000) + listing containers (deep-linked to their per-container UI) + pending + approvals. Same aesthetic. + - Firewall opens 7000, 8000, 8100–8999 when the module is enabled. +- 🔜 Phase 7 — dashboard approval-actions + live message-flow + xterm.js terminal ## Approval flow (Phase 5) From c82d41728c8c0d2873396ff71f6f349dd5f37758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Fri, 15 May 2026 00:06:10 +0200 Subject: [PATCH 0563/1295] Phase 7a: dashboard approve/deny + unified diff (similar crate) --- Cargo.toml | 1 + hive-c0re/Cargo.toml | 1 + hive-c0re/src/actions.rs | 45 ++++++++++++ hive-c0re/src/dashboard.rs | 141 ++++++++++++++++++++++++++++++++++--- hive-c0re/src/main.rs | 1 + hive-c0re/src/server.rs | 27 +------ 6 files changed, 181 insertions(+), 35 deletions(-) create mode 100644 hive-c0re/src/actions.rs diff --git a/Cargo.toml b/Cargo.toml index 7f348719..a01086ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ hive-sh4re = { path = "hive-sh4re" } rusqlite = { version = "0.37", features = ["bundled"] } serde = { version = "1", features = ["derive"] } serde_json = "1" +similar = "2" tokio = { version = "1", features = [ "io-util", "macros", diff --git a/hive-c0re/Cargo.toml b/hive-c0re/Cargo.toml index 553a7d3c..f48ad29e 100644 --- a/hive-c0re/Cargo.toml +++ b/hive-c0re/Cargo.toml @@ -14,6 +14,7 @@ hive-sh4re.workspace = true rusqlite.workspace = true serde.workspace = true serde_json.workspace = true +similar.workspace = true tokio.workspace = true tracing.workspace = true tracing-subscriber.workspace = true diff --git a/hive-c0re/src/actions.rs b/hive-c0re/src/actions.rs new file mode 100644 index 00000000..aebc5d71 --- /dev/null +++ b/hive-c0re/src/actions.rs @@ -0,0 +1,45 @@ +//! Operations that are exposed through more than one surface (the host admin +//! socket *and* the dashboard's POST endpoints). Each function takes a +//! `&Coordinator` and the request parameters; callers stitch the response +//! shape they want (HTTP redirect vs JSON). + +use anyhow::Result; + +use crate::coordinator::Coordinator; +use crate::lifecycle; + +/// Approve a pending request: read the agent.nix at the approval's commit from +/// the proposed repo, copy into the applied repo, commit there, and rebuild +/// the agent container. On failure marks the approval failed (with the error +/// note) and returns the error. +pub async fn approve(coord: &Coordinator, id: i64) -> Result<()> { + let approval = coord.approvals.mark_approved(id)?; + tracing::info!(%approval.id, %approval.agent, %approval.commit_ref, "approval: applying + rebuilding"); + + let agent_dir = coord.register_agent(&approval.agent)?; + let proposed_dir = Coordinator::agent_proposed_dir(&approval.agent); + let applied_dir = Coordinator::agent_applied_dir(&approval.agent); + let result: Result<()> = async { + lifecycle::apply_commit(&applied_dir, &proposed_dir, &approval.commit_ref).await?; + lifecycle::rebuild( + &approval.agent, + &coord.hyperhive_flake, + &agent_dir, + &applied_dir, + ) + .await + } + .await; + if let Err(e) = result { + let note = format!("{e:#}"); + let _ = coord.approvals.mark_failed(approval.id, ¬e); + return Err(e); + } + Ok(()) +} + +pub fn deny(coord: &Coordinator, id: i64) -> Result<()> { + coord.approvals.mark_denied(id)?; + tracing::info!(%id, "approval denied"); + Ok(()) +} diff --git a/hive-c0re/src/dashboard.rs b/hive-c0re/src/dashboard.rs index 83ec30cd..11789360 100644 --- a/hive-c0re/src/dashboard.rs +++ b/hive-c0re/src/dashboard.rs @@ -1,14 +1,24 @@ //! Hyperhive dashboard. Lists managed containers (with deep-links to each -//! container's web UI), pending approvals, and the manager. +//! container's web UI), pending approvals (with unified diff vs the applied +//! repo, plus approve/deny buttons), and the manager. use std::fmt::Write as _; use std::net::SocketAddr; +use std::path::Path; use std::sync::Arc; use anyhow::{Context, Result}; -use axum::{Router, extract::State, http::HeaderMap, response::Html, routing::get}; +use axum::{ + Router, + extract::{Path as AxumPath, State}, + http::{HeaderMap, StatusCode}, + response::{Html, IntoResponse, Redirect, Response}, + routing::{get, post}, +}; use hive_sh4re::Approval; +use tokio::process::Command; +use crate::actions; use crate::coordinator::Coordinator; use crate::lifecycle::{self, AGENT_PREFIX, MANAGER_NAME}; @@ -22,6 +32,8 @@ struct AppState { pub async fn serve(port: u16, coord: Arc) -> Result<()> { let app = Router::new() .route("/", get(index)) + .route("/approve/{id}", post(post_approve)) + .route("/deny/{id}", post(post_deny)) .with_state(AppState { coord }); let addr = SocketAddr::from(([0, 0, 0, 0], port)); let listener = tokio::net::TcpListener::bind(addr) @@ -41,17 +53,42 @@ async fn index(headers: HeaderMap, State(state): State) -> Html\n\n\n\nhyperhive // h1ve-c0re\n{style}\n\n\n{banner}\n{containers}\n{approvals}\n{footer}\n\n\n", - style = STYLE, - banner = BANNER, + "\n\n\n\nhyperhive // h1ve-c0re\n{STYLE}\n\n\n{BANNER}\n{containers}\n{approvals_html}\n{FOOTER}\n\n\n", containers = render_containers(&containers, &hostname), - approvals = render_approvals(&approvals), - footer = FOOTER, )) } +async fn post_approve( + State(state): State, + AxumPath(id): AxumPath, +) -> Response { + match actions::approve(&state.coord, id).await { + Ok(()) => Redirect::to("/").into_response(), + Err(e) => error_response(format!("approve {id} failed: {e:#}")), + } +} + +async fn post_deny(State(state): State, AxumPath(id): AxumPath) -> Response { + match actions::deny(&state.coord, id) { + Ok(()) => Redirect::to("/").into_response(), + Err(e) => error_response(format!("deny {id} failed: {e:#}")), + } +} + +fn error_response(message: String) -> Response { + ( + StatusCode::INTERNAL_SERVER_ERROR, + Html(format!( + "\n\n{STYLE}\n{BANNER}\n

◆ ERR0R ◆

\n
{message}
\n

← back

\n", + message = html_escape(&message), + )), + ) + .into_response() +} + fn render_containers(containers: &[String], hostname: &str) -> String { let mut out = String::from( "

◆ C0NTAINERS ◆

\n
══════════════════════════════════════════════════════════════
\n", @@ -79,7 +116,7 @@ fn render_containers(containers: &[String], hostname: &str) -> String { out } -fn render_approvals(approvals: &[Approval]) -> String { +async fn render_approvals(approvals: &[Approval]) -> String { let mut out = String::from( "

◆ P3NDING APPR0VALS ◆

\n
══════════════════════════════════════════════════════════════
\n", ); @@ -87,20 +124,63 @@ fn render_approvals(approvals: &[Approval]) -> String { out.push_str("

▓ queue empty ▓

\n"); return out; } - out.push_str("