From a620f86204722d88a2bfb314a4b3d42e151a58fb Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 15 Mar 2025 10:25:44 +0100 Subject: [PATCH 1/7] 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 13ff561..8290bf2 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 2/7] 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 195e98a..da0baf6 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 0000000..81b5be8 --- /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 fb7d547..0000000 --- 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 0000000..f63120e --- /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 0000000..c4b747d --- /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 288cd46..0000000 --- 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 0000000..b17a1c8 --- /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 2231494..0000000 --- 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 bf4fdc4..0000000 --- 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 0000000..0e4a769 --- /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 c2944b1..0000000 --- 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 0000000..7f18417 --- /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 0000000..a163141 --- /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 e0bbd9d..0000000 --- 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 0000000..ff296b9 --- /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 03499cc..6cb625f 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 b4e6aa0..5a2d422 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 3/7] 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 5352918..1ff08c4 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 8290bf2..5ec9e83 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 4/7] 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 42d7c03..03c9c0c 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 35fa2d9..b4bebd0 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 29f5046..79ab666 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 1ff08c4..1f2ff01 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 8eb3987..496c714 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 3aee6da..ddaa890 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 4e70618..b0f6e3d 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 ae25099..260185f 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 0faf92e..098fc4a 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 5ec9e83..0b5ed96 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 0e4a769..7ad1351 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 7f18417..a37f1ff 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 a163141..ea29735 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 ff296b9..1834b06 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 5/7] 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 ddbf3bc..0000000 --- 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 a11515e..c4b1858 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 da0baf6..9b21548 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 d59fbbb..0000000 --- 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 0310a7e..0000000 --- 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 dbc3d59..0000000 --- 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 0000000..1927780 --- /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 1f2ff01..695270b 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 0000000..378e310 --- /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 0000000..ae245a1 --- /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 7ad1351..d880b42 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 a37f1ff..2526b3f 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 ea29735..aa01095 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 1834b06..2526b3f 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 4b0d1ff..c510a9d 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 0000000..9af6a19 --- /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 0000000..42af734 --- /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 03c9c0c..aba3504 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 5a2d422..aeb4926 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 6/7] 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 0000000..85f4772 --- /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 b4bebd0..46aa848 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 695270b..5d68bfc 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 ae245a1..413036d 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 d880b42..7ad1351 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 2526b3f..7e9f61a 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 2526b3f..cf430db 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 3ed2b8a..0000000 --- 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 aeb4926..0000000 --- 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 7/7] 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 378e310..b801c6b 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 413036d..145e15a 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}%"; + }; }; }; };