From d61cd420a4b9fcf2e52cfc6b680f8a131158a4e0 Mon Sep 17 00:00:00 2001 From: kB01 Date: Fri, 14 Feb 2025 01:30:40 +0100 Subject: [PATCH] Added Host Ohybke --- README.md | 2 +- homes/x86_64-linux/kb@Ohybke/default.nix | 146 ++++++++++++++++++ .../t2-mac-WirelessReload/default.nix | 38 +++++ systems/README.md | 6 +- systems/x86_64-linux/Ohybke/default.nix | 97 ++++++++++++ systems/x86_64-linux/Ohybke/hardware.nix | 39 +++++ 6 files changed, 324 insertions(+), 4 deletions(-) create mode 100644 homes/x86_64-linux/kb@Ohybke/default.nix create mode 100644 modules/nixos/hardware/t2-mac-WirelessReload/default.nix create mode 100644 systems/x86_64-linux/Ohybke/default.nix create mode 100644 systems/x86_64-linux/Ohybke/hardware.nix diff --git a/README.md b/README.md index d485fe2..fac2ee8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Clone this Repository somewhere you can edit it easily: git clone https://git.kb-one.de/kb01/aux-config ~/Project/aux-config ``` -Check if the Hostname of your System matches one of the [Systems](./systems/README.md). +Check if the Hostname of your System matches one of the [Systems](./systems/). ```bash hostname ``` diff --git a/homes/x86_64-linux/kb@Ohybke/default.nix b/homes/x86_64-linux/kb@Ohybke/default.nix new file mode 100644 index 0000000..c958c6b --- /dev/null +++ b/homes/x86_64-linux/kb@Ohybke/default.nix @@ -0,0 +1,146 @@ +{ config, pkgs, lib, inputs, ... }: +let + # Firefox Profile Setting States + lock-false = { + Value = false; + Status = "locked"; + }; + lock-true = { + Value = true; + Status = "locked"; + }; + lock-empty-string = { + Value = ""; + Status = "locked"; + }; +in { + home.username = "kb"; + home.homeDirectory = "/home/kb"; + home.packages = with pkgs; [ + # System + kate + kdePackages.kcalc + # Office + thunderbird + libreoffice-qt6-fresh + logseq + # Security + gnupg + keepassxc + pass-wayland + veracrypt + protonvpn-gui + # Media + freetube + inkscape + blender + obs-studio + cheese + gimp + vlc + kid3 + #calibre + spotify-player + tidal-hifi + # Messengers + element-desktop # Matrix Client + telegram-desktop + signal-desktop + webcord + # Customization + razergenie + firefoxpwa + # Development + vscodium + scrcpy + # Experiments + yazi # Terminal File-Manager + # Gaming + ryujinx # Experimental Nitendo Switch Emulator + mangohud + prismlauncher + # Terminal Tools + mosh + btop + fastfetch + ]; + + services.syncthing.enable = true; + services.syncthing.extraOptions = [ + "--config=/home/kb/.config/syncthing" + "--data=/home/kb/sync" + ]; + + services.gpg-agent.enable = true; + + services.ssh-agent.enable = true; + + programs.firefox = { + enable = true; + nativeMessagingHosts = [ pkgs.firefoxpwa ]; + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableFirefoxAccounts = true; + AutofillAddressEnabled = false; + AutofillCreditCardEnabled = false; + OfferToSaveLogins = false; + FirefoxHome.TopSites = false; + FirefoxHome.SponsoredTopSites = false; + Preferences = { + "browser.newtabpage.pinned" = lock-empty-string; + "browser.topsites.contile.enabled" = lock-false; + }; + DontCheckDefaultBrowser = true; + DisableProfileImport = true; + SearchBar = "unified"; + SearchEngines.Add = [ # Only Available in ESR Releases https://mozilla.github.io/policy-templates/#searchengines--add + { + Name = "Brave"; + URLTemplate = "https://search.brave.com/search?q={SearchTerms}"; + Alias = "br"; + } + ]; + ExtensionSettings = { # See https://mozilla.github.io/policy-templates/#extensionsettings + "extension@tabliss.io" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/3940751/tabliss-2.6.0.xpi"; + installation_mode = "normal_installed"; + }; + "gdpr@cavi.au.dk" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4362793/consent_o_matic-1.1.3.xpi"; + installation_mode = "normal_installed"; + }; + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4382536/ublock_origin-1.61.0.xpi"; + installation_mode = "normal_installed"; + }; + "keepassxc-browser@keepassxc.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4376326/keepassxc_browser-1.9.4.xpi"; + installation_mode = "normal_installed"; + }; + "offline-qr-code@rugk.github.io" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4349427/offline_qr_code_generator-1.9.xpi"; + installation_mode = "normal_installed"; + }; + "addon@darkreader.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4378073/darkreader-4.9.96.xpi"; + installation_mode = "normal_installed"; + }; + "firefoxpwa@filips.si" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4383345/pwas_for_firefox-2.13.1.xpi"; + installation_mode = "normal_installed"; + }; + }; + Bookmarks = [ + { + Title = "Syncthing"; + URL = "localhost:8384"; + Placement = "toolbar"; + } + ]; + }; + }; + + home.stateVersion = "24.05"; +} diff --git a/modules/nixos/hardware/t2-mac-WirelessReload/default.nix b/modules/nixos/hardware/t2-mac-WirelessReload/default.nix new file mode 100644 index 0000000..14ed430 --- /dev/null +++ b/modules/nixos/hardware/t2-mac-WirelessReload/default.nix @@ -0,0 +1,38 @@ +{ + inputs, + config, + lib, + pkgs, + system, + ... +}: +let + cfg = config.hardware.t2-mac-WirelessReload; +in +{ + options.hardware.t2-mac-WirelessReload.enable = lib.mkOption { + type = with lib.types; uniq bool; + default = false; + description = "Reloads the Wireless Drivers"; + }; + + config = lib.mkIf (cfg.enable) { + # Service to load Driver with options + systemd.services."t2-mac-WirelessReload" = { + description = "Reloads Wireless Drivers for Mac"; + path = [ pkgs.kmod ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = '' + ${pkgs.kmod.out}/bin/modprobe -r brcmfmac_wcc || true + ${pkgs.kmod.out}/bin/modprobe -r brcmfmac || true + ${pkgs.kmod.out}/bin/modprobe brcmfmac || true + ${pkgs.kmod.out}/bin/modprobe -r hci_bcm4377 || true + ${pkgs.kmod.out}/bin/modprobe hci_bcm4377 || true + ''; + }; + wantedBy = [ "multi-user.target" ]; + }; + }; +} + diff --git a/systems/README.md b/systems/README.md index 2889cf3..60fa58f 100644 --- a/systems/README.md +++ b/systems/README.md @@ -58,7 +58,7 @@ -## Ohybke +## [Ohybke](./x86_64-linux/Ohybke) @@ -66,7 +66,7 @@
- + @@ -195,4 +195,4 @@
Userkb@Ohybkekb@Ohybke
Cpu
- \ No newline at end of file + diff --git a/systems/x86_64-linux/Ohybke/default.nix b/systems/x86_64-linux/Ohybke/default.nix new file mode 100644 index 0000000..95e7108 --- /dev/null +++ b/systems/x86_64-linux/Ohybke/default.nix @@ -0,0 +1,97 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./hardware.nix + ]; + + # Configure Nix + nix.package = pkgs.lix; + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + }; + nixpkgs.config.allowUnfree = true; + nixpkgs.config.permittedInsecurePackages = [ + "electron-27.3.11" + ]; + + + # Networking + networking.hostName = "Ohybke"; + networking.networkmanager.enable = true; + #networking.wireless.enable = true; + + # Enable Bluetooth + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + + # Locale + time.timeZone = "Europe/Berlin"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.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"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the KDE Plasma Desktop Environment. + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.enable = true; + + # Keyboard and Keymap + services.xserver.xkb = { + layout = "de"; + variant = "mac_nodeadkeys"; + options = ""; + }; + console = { + font = "Lat2-Terminus16"; + # keyMap = "de"; + useXkbConfig = true; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Users + users.users.kb = { # Managed by Homemanager + isNormalUser = true; + description = "kB"; + extraGroups = [ "networkmanager" "wheel" ]; + }; + + # Enable SSH-Agent + programs.ssh.startAgent = true; + + # Packages installed in system profile. Search Packages: $ nix search wget + environment.systemPackages = with pkgs; [ + vim + git + kb-one.numen + kb-one.dotool + kb-one.vosk-model-small-en-us + ]; + + system.stateVersion = "24.11"; # NEVER Change this! + +} + diff --git a/systems/x86_64-linux/Ohybke/hardware.nix b/systems/x86_64-linux/Ohybke/hardware.nix new file mode 100644 index 0000000..8370e0d --- /dev/null +++ b/systems/x86_64-linux/Ohybke/hardware.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, modulesPath, inputs, ... }: let + inherit (inputs) nixos-hardware; +in { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + nixos-hardware.nixosModules.apple-t2 + ]; + + # Nix Config + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "cryptd" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.efiSysMountPoint = "/boot"; + + # File Systems + fileSystems."/" = { + device = "/dev/disk/by-uuid/e36a3f85-020f-4d6c-844f-b81131ce7e63"; + fsType = "ext4"; + }; + boot.initrd.luks.devices."luks-a226aaf4-1250-447b-a5fc-fa37758d332a".device = "/dev/disk/by-uuid/a226aaf4-1250-447b-a5fc-fa37758d332a"; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/5F66-17ED"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + swapDevices = [ { device = "/swapfile"; size = 8 * 1024; } ]; + + # Misc + networking.useDHCP = lib.mkDefault true; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}