diff --git a/.gitignore b/.gitignore index d3f13a7..8e21b1d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ .directory result -secrets diff --git a/README.md b/README.md new file mode 100644 index 0000000..3195c03 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# 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 diff --git a/check b/check deleted file mode 100755 index 1760cfe..0000000 --- a/check +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail - -nix fmt - -nix flake check --show-trace diff --git a/flake.lock b/flake.lock deleted file mode 100644 index f0e3317..0000000 --- a/flake.lock +++ /dev/null @@ -1,436 +0,0 @@ -{ - "nodes": { - "fenix": { - "inputs": { - "nixpkgs": [ - "servicepoint-cli", - "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" - } - }, - "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" - }, - "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": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1758463745, - "narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-25.05", - "repo": "home-manager", - "type": "github" - } - }, - "naersk": { - "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" - ] - }, - "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" - } - }, - "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": 1760106247, - "narHash": "sha256-6eoVSzv2sNlZx3wgIGvwYrbL8X/FpCb/5cw/N/f/v6c=", - "owner": "sodiboo", - "repo": "niri-flake", - "rev": "8ba0df9f335050044eddae848a7be8d9269ecc76", - "type": "github" - }, - "original": { - "owner": "sodiboo", - "repo": "niri-flake", - "type": "github" - } - }, - "niri-stable": { - "flake": false, - "locked": { - "lastModified": 1756556321, - "narHash": "sha256-RLD89dfjN0RVO86C/Mot0T7aduCygPGaYbog566F0Qo=", - "owner": "YaLTeR", - "repo": "niri", - "rev": "01be0e65f4eb91a9cd624ac0b76aaeab765c7294", - "type": "github" - }, - "original": { - "owner": "YaLTeR", - "ref": "v25.08", - "repo": "niri", - "type": "github" - } - }, - "niri-unstable": { - "flake": false, - "locked": { - "lastModified": 1759395653, - "narHash": "sha256-sv9J1z6CrTPf9lRJLyCN90fZVdQz7LFeX7pIlInH8BQ=", - "owner": "YaLTeR", - "repo": "niri", - "rev": "ba6e5e082a79901dc89b0d49c5da1b769d652aec", - "type": "github" - }, - "original": { - "owner": "YaLTeR", - "repo": "niri", - "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" - } - }, - "nix-vscode-extensions": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1760071578, - "narHash": "sha256-MZUsqax6PoXPDzhpLyduHoPY4CYYrzL97uKbsx/iGPE=", - "owner": "nix-community", - "repo": "nix-vscode-extensions", - "rev": "65365fe8c09b6c1b6bba1885a126723815376b1b", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nix-vscode-extensions", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1759994382, - "narHash": "sha256-wSK+3UkalDZRVHGCRikZ//CyZUJWDJkBDTQX1+G77Ow=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5da4a26309e796daa7ffca72df93dbe53b8164c7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-25.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1759977445, - "narHash": "sha256-LYr4IDfuihCkFAkSYz5//gT2r1ewcWBYgd5AxPzPLIo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "2dad7af78a183b6c486702c18af8a9544f298377", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "home-manager": "home-manager", - "niri": "niri", - "nix-vscode-extensions": "nix-vscode-extensions", - "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable", - "servicepoint-cli": "servicepoint-cli", - "servicepoint-simulator": "servicepoint-simulator", - "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" - } - }, - "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", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1757763404, - "narHash": "sha256-a1h+58wDOtbQXrHoZwLwB7PhXwFhBXRHhNRhAQGq/oY=", - "ref": "refs/heads/main", - "rev": "07a5fbca27ec941c841ad93f2ac65bc529225a51", - "revCount": 46, - "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_2", - "nix-filter": "nix-filter_2", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1757763091, - "narHash": "sha256-V3E6JKGzCrq5u+hp38sAdKv/EoxU+X0qfSoBIPxALi4=", - "ref": "refs/heads/main", - "rev": "493b7b0343334019b372176f811a966839ba9aa5", - "revCount": 121, - "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, - "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": { - "lastModified": 1755491097, - "narHash": "sha256-m+9tUfsmBeF2Gn4HWa6vSITZ4Gz1eA1F5Kh62B0N4oE=", - "owner": "Supreeeme", - "repo": "xwayland-satellite", - "rev": "388d291e82ffbc73be18169d39470f340707edaa", - "type": "github" - }, - "original": { - "owner": "Supreeeme", - "ref": "v0.7", - "repo": "xwayland-satellite", - "type": "github" - } - }, - "xwayland-satellite-unstable": { - "flake": false, - "locked": { - "lastModified": 1759707084, - "narHash": "sha256-0pkftKs6/LReNvxw7DVTN2AJEheZVgyeK0Aarbagi70=", - "owner": "Supreeeme", - "repo": "xwayland-satellite", - "rev": "a9188e70bd748118b4d56a529871b9de5adb9988", - "type": "github" - }, - "original": { - "owner": "Supreeeme", - "repo": "xwayland-satellite", - "type": "github" - } - }, - "zerforschen-plus": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1757965108, - "narHash": "sha256-V2U1XbtfvWQ6Bt2dvbUWAlKjqY3zjrbkVveLsyxnq1w=", - "ref": "refs/heads/main", - "rev": "d794fafc25c8fdead19dcbffc4c0b4bb7ff98272", - "revCount": 32, - "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", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index 863a4c0..0000000 --- a/flake.nix +++ /dev/null @@ -1,259 +0,0 @@ -{ - inputs = { - 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-25.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - niri = { - url = "github:sodiboo/niri-flake"; - 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"; - }; - - servicepoint-cli = { - url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-cli.git"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - servicepoint-simulator = { - url = "git+https://git.berlin.ccc.de/servicepoint/servicepoint-simulator.git"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - nix-vscode-extensions = { - url = "github:nix-community/nix-vscode-extensions"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = - { - self, - nixpkgs, - home-manager, - niri, - zerforschen-plus, - nixpkgs-unstable, - servicepoint-cli, - servicepoint-simulator, - nix-vscode-extensions, - ... - }: - let - 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 - ]; - 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 - ]; - 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 ]; - }; - }; - 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 = - f: - lib.genAttrs supported-systems ( - system: - f rec { - inherit system; - pkgs = nixpkgs.legacyPackages.${system}; - } - ); - importModuleDir = - directory: - nixpkgs.lib.packagesFromDirectoryRecursive { - inherit directory; - callPackage = path: _args: path; - }; - in - { - overlays = { - unstable-packages = final: prev: { - unstable = import nixpkgs-unstable { - inherit (prev) system config; - }; - }; - }; - - nixosModules = (importModuleDir ./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 = importModuleDir ./homeModules; - homeConfigurations = { - vinzenz = ./homeConfigurations/vinzenz; - ronja = ./homeConfigurations/ronja; - }; - - formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); - - nixosConfigurations = forDevice ( - { - device, - system, - home-manager-users ? { }, - additional-modules ? [ ], - }: - let - specialArgs = { - inherit device; - }; - in - nixpkgs.lib.nixosSystem { - inherit system specialArgs; - 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"; - }; - - 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} - - self.nixosModules.default - self.nixosModules.lix-is-nix - self.nixosModules.globalinstalls - self.nixosModules.autoupdate - self.nixosModules.openssh - self.nixosModules.tailscale - self.nixosModules.allowed-unfree-list - self.nixosModules.extra-caches - self.nixosModules.systemd-boot - - zerforschen-plus.nixosModules.default - ] - ++ (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"; } - self.homeModules.adwaita - self.homeModules.git - self.homeModules.templates - self.homeModules.zsh-basics - self.homeModules.nano - self.homeModules.gnome-extensions - self.homeModules.zsh-powerlevel10k - ]; - - 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 - - home-manager.nixosModules.home-manager - servicepoint-simulator.nixosModules.default - servicepoint-cli.nixosModules.default - ]) - ++ additional-modules; - } - ); - }; -} diff --git a/hetzner-vpn1.nix b/hetzner-vpn1.nix new file mode 100644 index 0000000..b362a87 --- /dev/null +++ b/hetzner-vpn1.nix @@ -0,0 +1,76 @@ +{pkgs, ...}: let + wg_port = 51820; +in { + imports = [ + (import ./modules { + hostName = "hetzner-vpn1"; + enableHomeManager = false; + }) + ]; + + config = { + my = { + enabledUsers = ["vinzenz"]; + server.enable = true; + }; + + # TODO change to user "vinzenz" when tested + users.users.root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ]; + + environment = { + systemPackages = with pkgs; [iptables wireguard-tools]; + }; + + # wireguard server for public ip + # enable NAT + networking.nat.enable = true; + networking.nat.externalInterface = "eth0"; + networking.nat.internalInterfaces = ["wg0"]; + networking.firewall = { + allowedUDPPorts = [wg_port]; + }; + + networking.wireguard.interfaces = { + # "wg0" is the network interface name. You can name the interface arbitrarily. + wg0 = { + # Determines the IP address and subnet of the server's end of the tunnel interface. + ips = ["10.100.0.1/32"]; + + # The port that WireGuard listens to. Must be accessible by the client. + listenPort = wg_port; + + # This allows the wireguard server to route your traffic to the internet and hence be like a VPN + # For this to work you have to set the dnsserver IP of your router (or dnsserver of choice) in your clients + postSetup = '' + ${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE + ''; + + # This undoes the above command + postShutdown = '' + ${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE + ''; + + # Path to the private key file + privateKeyFile = "/root/wireguard/keys/private"; + + peers = [ + # List of allowed peers. + { + # Phone + publicKey = "/sjNk9rXaMdrCHD2kmut1AXD1UhF1xcZ4ju+EmFGcCk="; + # List of IPs assigned to this peer within the tunnel subnet. Used to configure routing. + allowedIPs = ["10.100.0.2/32"]; + } + { + # vinzenz-lpt + publicKey = "D/6431f8oJ61C5vjjEIpY5Rc750oK4yVh9B/32q4xAE="; + # List of IPs assigned to this peer within the tunnel subnet. Used to configure routing. + allowedIPs = ["10.100.0.3/32"]; + } + ]; + }; + }; + }; +} diff --git a/homeConfigurations/ronja/default.nix b/homeConfigurations/ronja/default.nix deleted file mode 100644 index 0f202cd..0000000 --- a/homeConfigurations/ronja/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ config, pkgs, ... }: -{ - imports = [ ./vscode.nix ]; - 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/vscode.nix b/homeConfigurations/ronja/vscode.nix deleted file mode 100644 index 5a4ac7f..0000000 --- a/homeConfigurations/ronja/vscode.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ pkgs, lib, ... }: -{ - config = { - home.sessionVariables.NIXOS_OZONE_WL = "1"; - programs.vscode = { - enable = true; - 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 - ]; - 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"; - - "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt"; - - "\[makefile\]" = { - "editor.insertSpaces" = false; - "editor.detectIndentation" = false; - }; - - "\[nix\]" = { - "editor.formatOnSave" = false; - }; - }; - }; - }; - }; -} diff --git a/homeConfigurations/vinzenz/.config/containers/policy.json b/homeConfigurations/vinzenz/.config/containers/policy.json deleted file mode 100644 index d1f9b60..0000000 --- a/homeConfigurations/vinzenz/.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/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix deleted file mode 100644 index 4af562b..0000000 --- a/homeConfigurations/vinzenz/default.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ./editorconfig.nix - ./fuzzel.nix - ./git.nix - ./gnome.nix - ./ssh.nix - ./vscode.nix - ./zsh.nix - ./starship.nix - ./fonts.nix - #./niri.nix - #./swaylock.nix - #./waybar.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"; - }; - }; -} diff --git a/homeConfigurations/vinzenz/editorconfig.nix b/homeConfigurations/vinzenz/editorconfig.nix deleted file mode 100644 index 1ebffa8..0000000 --- a/homeConfigurations/vinzenz/editorconfig.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - 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/homeConfigurations/vinzenz/fonts.nix b/homeConfigurations/vinzenz/fonts.nix deleted file mode 100644 index 6553c2a..0000000 --- a/homeConfigurations/vinzenz/fonts.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ 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/homeConfigurations/vinzenz/fuzzel.nix b/homeConfigurations/vinzenz/fuzzel.nix deleted file mode 100644 index db700e8..0000000 --- a/homeConfigurations/vinzenz/fuzzel.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ 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/homeConfigurations/vinzenz/git.nix b/homeConfigurations/vinzenz/git.nix deleted file mode 100644 index 537fe61..0000000 --- a/homeConfigurations/vinzenz/git.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - 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"; - }; - - extraConfig = { - pull.ff = "only"; - merge.tool = "kdiff3"; - push.autoSetupRemote = "true"; - credential.credentialStore = "cache"; - }; - - ignores = [ - ".direnv" - ".idea" - ".envrc" - ]; - }; -} diff --git a/homeConfigurations/vinzenz/gnome.nix b/homeConfigurations/vinzenz/gnome.nix deleted file mode 100644 index ce5416e..0000000 --- a/homeConfigurations/vinzenz/gnome.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ pkgs, lib, ... }: -{ - config = { - 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 = { - "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" ]; - }; - "org/gnome/desktop/session".idle-delay = lib.hm.gvariant.mkUint32 300; - "org/gnome/Connections".first-run = false; - }; - }; -} diff --git a/homeConfigurations/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix deleted file mode 100644 index 3562ae1..0000000 --- a/homeConfigurations/vinzenz/niri.nix +++ /dev/null @@ -1,298 +0,0 @@ -{ - pkgs, - config, - ... -}: -{ - config = { - home.sessionVariables.NIXOS_OZONE_WL = "1"; - home.packages = with pkgs; [ - xwayland-satellite - alacritty - ]; - - qt.style = { - package = pkgs.adwaita-qt; - name = "adwaita-dark"; - }; - - 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; - - # 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+Numbersign".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 = "${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. - # 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/homeConfigurations/vinzenz/ssh.nix b/homeConfigurations/vinzenz/ssh.nix deleted file mode 100644 index 20b4bae..0000000 --- a/homeConfigurations/vinzenz/ssh.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - config.programs.ssh = { - enable = true; - matchBlocks = { - "vpn2" = { - host = "vpn2 hetzner-vpn2"; - hostname = "2a01:4f8:c013:65dd::1"; - 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"; - }; - "builder.berlin.ccc.de" = { - 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; - }; - "forgejo-runner-1" = { - hostname = "forgejo-runner-1.dev.zerforschen.plus"; - user = "root"; - }; - }; - }; -} diff --git a/homeConfigurations/vinzenz/starship.nix b/homeConfigurations/vinzenz/starship.nix deleted file mode 100644 index 470870a..0000000 --- a/homeConfigurations/vinzenz/starship.nix +++ /dev/null @@ -1,179 +0,0 @@ -{ ... }: -{ - config.programs.starship = { - enable = true; - enableZshIntegration = true; - settings = { - "$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"; - }; - - 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 = ""; - - }; - }; -} diff --git a/homeConfigurations/vinzenz/swaylock.nix b/homeConfigurations/vinzenz/swaylock.nix deleted file mode 100644 index 9255f04..0000000 --- a/homeConfigurations/vinzenz/swaylock.nix +++ /dev/null @@ -1,51 +0,0 @@ -# based on https://codeberg.org/kiara/cfg/src/commit/b9c472acd78c9c08dfe8b6a643c5c82cc5828433/home-manager/kiara/swaylock.nix# -{ pkgs, config, ... }: -{ - 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; - systemdTarget = "graphical-session.target"; - timeouts = [ - { - 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"; - } - ]; - }; - }; -} diff --git a/homeConfigurations/vinzenz/vscode.nix b/homeConfigurations/vinzenz/vscode.nix deleted file mode 100644 index c4ff381..0000000 --- a/homeConfigurations/vinzenz/vscode.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ pkgs, lib, ... }: -{ - config = { - home.sessionVariables.NIXOS_OZONE_WL = "1"; - programs.vscode = { - enable = true; - package = pkgs.vscodium; - profiles.default = { - enableUpdateCheck = false; - 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; - "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; - "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"; - - "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-tree}/bin/nixfmt-tree" ]; - }; - }; - }; - - "dotnetAcquisitionExtension.sharedExistingDotnetPath" = "${lib.getBin pkgs.dotnet-sdk}/bin/dotnet"; - - "\[makefile\]" = { - "editor.insertSpaces" = false; - "editor.detectIndentation" = false; - }; - - "\[nix\]" = { - "editor.formatOnSave" = false; - }; - }; - }; - }; - }; -} diff --git a/homeConfigurations/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix deleted file mode 100644 index af276ac..0000000 --- a/homeConfigurations/vinzenz/waybar.nix +++ /dev/null @@ -1,271 +0,0 @@ -{ - pkgs, - device, - config, - ... -}: -{ - home.packages = with pkgs; [ - playerctl - cava - ]; - - programs.waybar = { - enable = true; - systemd.enable = true; - systemd.target = "graphical-session.target"; - settings = { - mainBar = { - layer = "top"; - position = "top"; - output = [ - "eDP-1" - "HDMI-A-1" - ]; - mode = "dock"; - spacing = "8"; - modules-left = [ - "niri/workspaces" - "tray" - "niri/window" - ]; - modules-center = [ - "privacy" - "clock" - ]; - modules-right = [ - "mpris" - "image" - "cava" - "gamemode" - - "temperature" - "cpu" - "memory" - "disk" - "wireplumber" - "bluetooth" - "backlight" - "network" - "power-profiles-daemon" - "battery" - "idle_inhibitor" - #"group/group-power" - ]; - "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}% "; - on-scroll-down = "light -U 1"; - on-scroll-up = "light -A 1"; - }; - 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 = [ - "" - "" - "" - "" - "" - "" - "" - "" - ]; - }; - 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}%"; - }; - }; - }; - }; -} diff --git a/homeConfigurations/vinzenz/zsh.nix b/homeConfigurations/vinzenz/zsh.nix deleted file mode 100644 index 7b84384..0000000 --- a/homeConfigurations/vinzenz/zsh.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, pkgs, ... }: -{ - config.programs.zsh = { - initContent = '' - export PATH=$PATH:/home/vinzenz/.cargo/bin - ''; - enableCompletion = true; - - shellAliases = { - 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 -- "; - statix = "nix run github:oppiliappan/statix -- "; - }; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - }; -} diff --git a/homeModules/adwaita.nix b/homeModules/adwaita.nix deleted file mode 100644 index 96d24c7..0000000 --- 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/homeModules/git.nix b/homeModules/git.nix deleted file mode 100644 index 76afceb..0000000 --- a/homeModules/git.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - programs = { - git = { - enable = true; - extraConfig.init.defaultBranch = "main"; - }; - - gh = { - enable = true; - gitCredentialHelper.enable = true; - }; - }; -} diff --git a/homeModules/gnome-extensions.nix b/homeModules/gnome-extensions.nix deleted file mode 100644 index 9c30c40..0000000 --- a/homeModules/gnome-extensions.nix +++ /dev/null @@ -1,101 +0,0 @@ -{ - 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/homeModules/nano.nix b/homeModules/nano.nix deleted file mode 100644 index ab3e7b2..0000000 --- a/homeModules/nano.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - home = { - sessionVariables.EDITOR = "nano"; - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; -} diff --git a/homeModules/templates.nix b/homeModules/templates.nix deleted file mode 100644 index 71d2e0b..0000000 --- a/homeModules/templates.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - 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 deleted file mode 100644 index 0b0e281..0000000 --- a/homeModules/zsh-basics.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - programs = { - command-not-found.enable = true; - dircolors.enable = true; - - zsh = { - enable = true; - syntaxHighlighting.enable = true; - autosuggestion.enable = true; - enableVteIntegration = true; - }; - }; -} diff --git a/homeModules/zsh-powerlevel10k.nix b/homeModules/zsh-powerlevel10k.nix deleted file mode 100644 index 295fd0c..0000000 --- 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/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..60755fa --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,18 @@ +modulesCfg: {lib, ...}: { + imports = + [ + ./i18n.nix + ./nixpkgs.nix + ./globalinstalls.nix + ./server.nix + ./desktop + ] + ++ (map (path: (import path modulesCfg)) [ + ./hardware + ./users + ]); + + config = { + my.modulesCfg = modulesCfg; + }; +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix new file mode 100644 index 0000000..d8f88b5 --- /dev/null +++ b/modules/desktop/default.nix @@ -0,0 +1,110 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.my.desktop; +in { + imports = [ + ./gnome.nix + ./kde.nix + ./gaming.nix + ]; + + options.my.desktop.enable = lib.mkEnableOption "desktop"; + + 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; + + # 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. + 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 = { + 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 + networking = { + networkmanager.enable = true; + firewall.enable = true; + + firewall = { + allowedTCPPortRanges = [ + { + # KDE Connect + from = 1714; + to = 1764; + } + ]; + allowedUDPPortRanges = [ + { + # KDE Connect + from = 1714; + to = 1764; + } + ]; + }; + }; + + systemd = { + # save some boot time because nothing actually requires network connectivity + services.NetworkManager-wait-online.enable = false; + + extraConfig = '' + DefaultTimeoutStopSec=12s + ''; + }; + + environment = { + pathsToLink = ["/share/zsh"]; + + systemPackages = with pkgs; [ + lm_sensors + ]; + }; + + nixpkgs.config.permittedInsecurePackages = [ + "electron-12.2.3" + ]; + + fonts = { + fontconfig.defaultFonts.monospace = ["FiraCode Nerd Font"]; + fonts = with pkgs; [ + (nerdfonts.override {fonts = ["FiraCode"];}) + ]; + }; + }; +} diff --git a/modules/desktop/gaming.nix b/modules/desktop/gaming.nix new file mode 100644 index 0000000..8b9cd34 --- /dev/null +++ b/modules/desktop/gaming.nix @@ -0,0 +1,32 @@ +{ + config, + pkgs, + lib, + ... +}: 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; + + 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/gnome.nix b/modules/desktop/gnome.nix new file mode 100644 index 0000000..9e754f3 --- /dev/null +++ b/modules/desktop/gnome.nix @@ -0,0 +1,66 @@ +{ + config, + pkgs, + lib, + ... +}: 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; + + services = { + xserver = { + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + }; + + 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 + ]; + }; + }) + (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 new file mode 100644 index 0000000..253ff29 --- /dev/null +++ b/modules/desktop/kde.nix @@ -0,0 +1,61 @@ +{ + config, + pkgs, + lib, + ... +}: 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; + + # 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; + + 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; + }; + } + ]; + }) + ]; +} diff --git a/modules/globalinstalls.nix b/modules/globalinstalls.nix new file mode 100644 index 0000000..412a50a --- /dev/null +++ b/modules/globalinstalls.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: { + config = { + environment = { + pathsToLink = ["/share/zsh"]; + systemPackages = with pkgs; [ + pciutils + ncdu + tldr + ]; + }; + + programs = { + git.enable = true; + zsh.enable = true; + htop.enable = true; + }; + }; +} diff --git a/modules/hardware/amdcpu.nix b/modules/hardware/amdcpu.nix new file mode 100644 index 0000000..6eedbb1 --- /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 0000000..5c847ae --- /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/common-desktop.nix b/modules/hardware/common-desktop.nix new file mode 100644 index 0000000..dea948e --- /dev/null +++ b/modules/hardware/common-desktop.nix @@ -0,0 +1,38 @@ +{ + lib, + pkgs, + 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"]; + supportedFilesystems = ["btrfs"]; + initrd.supportedFilesystems = ["btrfs"]; + consoleLogLevel = 0; + initrd.verbose = false; + loader = { + systemd-boot.enable = true; + timeout = 3; + 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/default.nix b/modules/hardware/default.nix new file mode 100644 index 0000000..a6dfabc --- /dev/null +++ b/modules/hardware/default.nix @@ -0,0 +1,41 @@ +modulesCfg: { + modulesPath, + lib, + ... +}: let + hostName = modulesCfg.hostName; +in { + imports = [ + (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 { + 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/hetzner-vpn1.nix b/modules/hardware/hetzner-vpn1.nix new file mode 100644 index 0000000..e147668 --- /dev/null +++ b/modules/hardware/hetzner-vpn1.nix @@ -0,0 +1,102 @@ +{ + 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/modules/hardware/intelcpu.nix b/modules/hardware/intelcpu.nix new file mode 100644 index 0000000..e9d5ba8 --- /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 new file mode 100644 index 0000000..bec7a08 --- /dev/null +++ b/modules/hardware/vinzenz-lpt.nix @@ -0,0 +1,31 @@ +{...}: { + config = { + my.hardware = { + enableCommonDesktopSettings = true; + isIntelCpu = true; + isAmdGpu = 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-pc2.nix b/modules/hardware/vinzenz-pc2.nix new file mode 100644 index 0000000..9fdaca7 --- /dev/null +++ b/modules/hardware/vinzenz-pc2.nix @@ -0,0 +1,54 @@ +{...}: { + config = { + my.hardware = { + enableCommonDesktopSettings = true; + isAmdCpu = true; + isAmdGpu = true; + }; + + boot = { + initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" + 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 = []; + }; +} diff --git a/modules/i18n.nix b/modules/i18n.nix new file mode 100644 index 0000000..3d38ec1 --- /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 0000000..b8299d3 --- /dev/null +++ b/modules/nixpkgs.nix @@ -0,0 +1,20 @@ +{...}: { + config = { + nixpkgs.config.allowUnfree = true; + + system = { + stateVersion = "22.11"; + # enable auto updates + autoUpgrade = { + enable = true; + dates = "weekly"; + }; + }; + + nix.gc = { + automatic = true; + dates = "monthly"; + options = "--delete-older-than 30d"; + }; + }; +} diff --git a/modules/server.nix b/modules/server.nix new file mode 100644 index 0000000..a79adad --- /dev/null +++ b/modules/server.nix @@ -0,0 +1,37 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.my.server; +in { + options.my.server = { + enable = lib.mkEnableOption "server role"; + }; + + 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; + } + ]; + }; + }; +} diff --git a/modules/users/default.nix b/modules/users/default.nix new file mode 100644 index 0000000..6e33607 --- /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 0000000..3e1982d --- /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 0000000..8ca8311 --- /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 0000000..351fcd8 --- /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 0000000..58cff2d --- /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/nixosConfigurations/forgejo-runner-1/default.nix b/nixosConfigurations/forgejo-runner-1/default.nix deleted file mode 100644 index f9d3c3f..0000000 --- a/nixosConfigurations/forgejo-runner-1/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - imports = [ - ./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/forgejo-runner-1/forgejo-runner.nix b/nixosConfigurations/forgejo-runner-1/forgejo-runner.nix deleted file mode 100644 index 4edc17e..0000000 --- a/nixosConfigurations/forgejo-runner-1/forgejo-runner.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ 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-24.04" - "ubuntu-24.04:docker://ghcr.io/catthehacker/ubuntu:rust-24.04" - ]; - settings = { - container.network = "bridge"; - }; - }; - }; - }; -} diff --git a/nixosConfigurations/forgejo-runner-1/hardware.nix b/nixosConfigurations/forgejo-runner-1/hardware.nix deleted file mode 100644 index e8fbc56..0000000 --- a/nixosConfigurations/forgejo-runner-1/hardware.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ modulesPath, ... }: -{ - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - - config = { - 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/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/bbd18a70-b0bb-4e1a-b45b-3c1f8ecc0c10"; } - ]; - - 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"; } - ]; - }; - }; - }; -} diff --git a/nixosConfigurations/hetzner-vpn2/default.nix b/nixosConfigurations/hetzner-vpn2/default.nix deleted file mode 100644 index 591dc20..0000000 --- a/nixosConfigurations/hetzner-vpn2/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - imports = [ - ./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/hetzner-vpn2/hardware.nix b/nixosConfigurations/hetzner-vpn2/hardware.nix deleted file mode 100644 index d7c96f0..0000000 --- a/nixosConfigurations/hetzner-vpn2/hardware.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ modulesPath, ... }: -{ - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - - config = { - 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"; } - ]; - }; - }; - }; -} diff --git a/nixosConfigurations/hetzner-vpn2/nginx.nix b/nixosConfigurations/hetzner-vpn2/nginx.nix deleted file mode 100644 index 2e5dc06..0000000 --- a/nixosConfigurations/hetzner-vpn2/nginx.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ pkgs, ... }: -let - blog-domain-socket = "/run/nginx/blog.sock"; - anubis-domain-socket = "/run/anubis/anubis-blog.sock"; -in -{ - security.acme = { - acceptTerms = true; - defaults.email = "acme@zerforschen.plus"; - }; - - systemd.services = { - nginx.serviceConfig.SupplementaryGroups = [ "anubis" ]; - anubis-main.serviceConfig.SupplementaryGroups = [ "nginx" ]; - }; - - services = { - nginx = { - enable = true; - recommendedProxySettings = true; - recommendedTlsSettings = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; - - 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 = { - enable = true; - settings = { - BIND = anubis-domain-socket; - TARGET = "unix://" + blog-domain-socket; - }; - }; - }; - - networking.firewall.allowedTCPPorts = [ - 80 - 443 - 5201 - ]; -} diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix deleted file mode 100644 index dd22382..0000000 --- a/nixosConfigurations/ronja-pc/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - config, - pkgs, - ... -}: -{ - imports = [ - ./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/ronja-pc/hardware.nix b/nixosConfigurations/ronja-pc/hardware.nix deleted file mode 100644 index e6ad854..0000000 --- a/nixosConfigurations/ronja-pc/hardware.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ lib, ... }: -{ - boot = { - supportedFilesystems = [ "btrfs" ]; - initrd.supportedFilesystems = [ "btrfs" ]; - 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"; } - ]; - - 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 deleted file mode 100644 index 255dd7a..0000000 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - imports = [ - ./hardware.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/hardware.nix b/nixosConfigurations/vinzenz-lpt2/hardware.nix deleted file mode 100644 index 175a168..0000000 --- a/nixosConfigurations/vinzenz-lpt2/hardware.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ pkgs, lib, ... }: -{ - # intel cpu - boot.kernelModules = [ - "kvm-intel" - "xe" - ]; - - networking = { - networkmanager.enable = true; - useDHCP = lib.mkDefault true; - }; - - 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"; - }; - }; - }; - }; - - 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 - - hardware.bluetooth.enable = true; -} diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix deleted file mode 100644 index 23505b1..0000000 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ./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 - ]; - }; -} diff --git a/nixosConfigurations/vinzenz-pc2/fstab.nix b/nixosConfigurations/vinzenz-pc2/fstab.nix deleted file mode 100644 index fbacbc8..0000000 --- a/nixosConfigurations/vinzenz-pc2/fstab.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - "/" = { - 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/nixosConfigurations/vinzenz-pc2/hardware.nix b/nixosConfigurations/vinzenz-pc2/hardware.nix deleted file mode 100644 index 9e875c3..0000000 --- a/nixosConfigurations/vinzenz-pc2/hardware.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ pkgs, lib, ... }: -{ - # 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; -} diff --git a/nixosConfigurations/vinzenz-pc2/hass.nix b/nixosConfigurations/vinzenz-pc2/hass.nix deleted file mode 100644 index 187cc30..0000000 --- a/nixosConfigurations/vinzenz-pc2/hass.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ 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"; - }; - }; - }; - }; -} diff --git a/nixosConfigurations/vinzenz-pc2/vscode-server.nix b/nixosConfigurations/vinzenz-pc2/vscode-server.nix deleted file mode 100644 index 6632b1f..0000000 --- a/nixosConfigurations/vinzenz-pc2/vscode-server.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs, ... }: -{ - services.openvscode-server = { - enable = true; - package = pkgs.unstable.openvscode-server; - telemetryLevel = "off"; - port = 8542; - host = "127.0.0.1"; - withoutConnectionToken = true; - extraPackages = with pkgs; [ - nodejs - git - gh - direnv - ]; - }; - - networking.firewall.allowedTCPPorts = [ - 8542 - 8543 - 8544 - 80 - 1313 - 5201 - ]; -} diff --git a/nixosModules/allowed-unfree-list.nix b/nixosModules/allowed-unfree-list.nix deleted file mode 100644 index 7bfa758..0000000 --- a/nixosModules/allowed-unfree-list.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ 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 = lib.mkDefault ( - pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages - ); - }; - }; -} diff --git a/nixosModules/amd-graphics.nix b/nixosModules/amd-graphics.nix deleted file mode 100644 index cca6393..0000000 --- a/nixosModules/amd-graphics.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ 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/nixosModules/autoupdate.nix b/nixosModules/autoupdate.nix deleted file mode 100644 index 0f26b7e..0000000 --- a/nixosModules/autoupdate.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - nix = { - optimise.automatic = true; - gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 7d"; - }; - }; - - system.autoUpgrade = { - enable = true; - dates = "daily"; - # do not forget to set `flake` when using this module! - }; -} diff --git a/nixosModules/en-de.nix b/nixosModules/en-de.nix deleted file mode 100644 index a91780e..0000000 --- a/nixosModules/en-de.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ 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"; - }; - }; - - 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 deleted file mode 100644 index 6af372f..0000000 --- a/nixosModules/extra-caches.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - 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/firmware-updates.nix b/nixosModules/firmware-updates.nix deleted file mode 100644 index 8e81b72..0000000 --- a/nixosModules/firmware-updates.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - hardware = { - enableRedistributableFirmware = true; - cpu = { - amd.updateMicrocode = true; - intel.updateMicrocode = true; - }; - }; - - services.fwupd.enable = true; -} diff --git a/nixosModules/globalinstalls.nix b/nixosModules/globalinstalls.nix deleted file mode 100644 index 47fb343..0000000 --- a/nixosModules/globalinstalls.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ 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; - }; - }; -} diff --git a/nixosModules/gnome.nix b/nixosModules/gnome.nix deleted file mode 100644 index 7a6f920..0000000 --- a/nixosModules/gnome.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ - 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; - }; - }; - - 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/nixosModules/intel-graphics.nix b/nixosModules/intel-graphics.nix deleted file mode 100644 index 74c6e67..0000000 --- a/nixosModules/intel-graphics.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs, ... }: -{ - config = { - hardware.graphics = { - extraPackages = with pkgs; [ - intel-media-driver - intel-vaapi-driver - intel-ocl - intel-compute-runtime - vpl-gpu-rt - ]; - extraPackages32 = with pkgs.driversi686Linux; [ - intel-vaapi-driver - intel-media-driver - ]; - }; - environment.systemPackages = with pkgs; [ nvtopPackages.intel ]; - allowedUnfreePackages = [ "intel-ocl" ]; - }; -} diff --git a/nixosModules/kdeconnect.nix b/nixosModules/kdeconnect.nix deleted file mode 100644 index 16b669f..0000000 --- a/nixosModules/kdeconnect.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - 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; - }; - } - ) - ]; - }) - ]; -} diff --git a/nixosModules/latex.nix b/nixosModules/latex.nix deleted file mode 100644 index 3d097f8..0000000 --- a/nixosModules/latex.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: -{ - config = { - environment.systemPackages = with pkgs; [ - fontconfig - texliveFull - texstudio - ]; - }; -} diff --git a/nixosModules/lix-is-nix.nix b/nixosModules/lix-is-nix.nix deleted file mode 100644 index 3480d06..0000000 --- a/nixosModules/lix-is-nix.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs, ... }: -{ - 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 deleted file mode 100644 index f1879bd..0000000 --- a/nixosModules/modern-desktop.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - 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/niri.nix b/nixosModules/niri.nix deleted file mode 100644 index 42af734..0000000 --- a/nixosModules/niri.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - programs.niri = { - enable = true; - package = pkgs.niri-stable; - }; -} diff --git a/nixosModules/nix-ld.nix b/nixosModules/nix-ld.nix deleted file mode 100644 index 382aa3d..0000000 --- a/nixosModules/nix-ld.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ 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/openssh.nix b/nixosModules/openssh.nix deleted file mode 100644 index ed24fe2..0000000 --- a/nixosModules/openssh.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - services.openssh = { - enable = true; - openFirewall = true; - settings = { - PermitRootLogin = "without-password"; - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - }; - }; -} diff --git a/nixosModules/podman.nix b/nixosModules/podman.nix deleted file mode 100644 index 93540f8..0000000 --- a/nixosModules/podman.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - 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 deleted file mode 100644 index c85edd7..0000000 --- a/nixosModules/printing.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - 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/quiet-boot.nix b/nixosModules/quiet-boot.nix deleted file mode 100644 index 8dbcd57..0000000 --- a/nixosModules/quiet-boot.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - boot = { - kernelParams = [ - "quiet" - "udev.log_level=3" - ]; - consoleLogLevel = 0; - initrd.verbose = false; - plymouth.enable = true; - }; -} diff --git a/nixosModules/steam.nix b/nixosModules/steam.nix deleted file mode 100644 index b0991e6..0000000 --- a/nixosModules/steam.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - 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" - ]; -} diff --git a/nixosModules/systemd-boot.nix b/nixosModules/systemd-boot.nix deleted file mode 100644 index 321a26c..0000000 --- a/nixosModules/systemd-boot.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - 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 deleted file mode 100644 index e51ee7f..0000000 --- a/nixosModules/tailscale.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - services.tailscale = { - enable = true; - openFirewall = true; - }; - - networking.firewall.checkReversePath = "loose"; -} diff --git a/nixosModules/user-ronja.nix b/nixosModules/user-ronja.nix deleted file mode 100644 index b374ab9..0000000 --- a/nixosModules/user-ronja.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ 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 deleted file mode 100644 index b48e750..0000000 --- a/nixosModules/user-vinzenz.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ 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" - ]; -} diff --git a/nixosModules/vinzenz-desktop-settings.nix b/nixosModules/vinzenz-desktop-settings.nix deleted file mode 100644 index ea02ed9..0000000 --- a/nixosModules/vinzenz-desktop-settings.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs, ... }: -{ - programs.firefox.enable = true; - - environment.systemPackages = with pkgs; [ - lm_sensors - libreoffice-qt6 - ]; - - fonts.enableDefaultPackages = true; - - hardware.logitech.wireless = { - enable = true; - enableGraphical = true; - }; - - # RDP connections - services.gnome.gnome-remote-desktop.enable = true; - networking.firewall.allowedTCPPorts = [ 3389 ]; -} diff --git a/nixosModules/wine-gaming.nix b/nixosModules/wine-gaming.nix deleted file mode 100644 index 2b9cb51..0000000 --- a/nixosModules/wine-gaming.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: -{ - hardware = { - graphics = { - enable32Bit = true; - extraPackages = with pkgs; [ mangohud ]; - extraPackages32 = with pkgs; [ mangohud ]; - }; - - xpadneo.enable = true; - }; - - environment.systemPackages = with pkgs; [ - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks - dxvk - mangohud - vulkan-tools - glxinfo - ]; -} diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix new file mode 100644 index 0000000..e184e77 --- /dev/null +++ b/vinzenz-lpt.nix @@ -0,0 +1,21 @@ +{...}: { + imports = [ + (import ./modules { + hostName = "vinzenz-lpt"; + enableHomeManager = true; + }) + ]; + + config = { + my = { + enabledUsers = ["vinzenz"]; + desktop = { + enableGnome = true; + enableGaming = true; + }; + }; + + # flatpak xdg-portal-kde crashes, otherwise this would be global + services.flatpak.enable = true; + }; +} diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix new file mode 100644 index 0000000..a67ce96 --- /dev/null +++ b/vinzenz-pc2.nix @@ -0,0 +1,22 @@ +{pkgs, ...}: { + imports = [ + (import ./modules { + hostName = "vinzenz-pc2"; + enableHomeManager = true; + }) + ]; + + config = { + my = { + enabledUsers = ["vinzenz" "ronja"]; + desktop = { + enableKde = true; + enableGaming = true; + }; + }; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" + ]; + }; +}