diff --git a/dotfiles/.config/ghostty/config b/dotfiles/ghostty.linux similarity index 100% rename from dotfiles/.config/ghostty/config rename to dotfiles/ghostty.linux diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..eb3a77e --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,54 @@ +{ config, pkgs, inputs, ... }: + +{ + # Bootloader and EFI settings + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Hostname and networking + networking.hostName = "tongfang"; + networking.networkmanager.enable = true; + + # Time and locale settings + time.timeZone = "Europe/Amsterdam"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "nl_NL.UTF-8"; + LC_IDENTIFICATION = "nl_NL.UTF-8"; + LC_MEASUREMENT = "nl_NL.UTF-8"; + LC_MONETARY = "nl_NL.UTF-8"; + LC_NAME = "nl_NL.UTF-8"; + LC_NUMERIC = "nl_NL.UTF-8"; + LC_PAPER = "nl_NL.UTF-8"; + LC_TELEPHONE = "nl_NL.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Fonts configuration + fonts = { + enableDefaultPackages = true; + packages = with pkgs; [ + jetbrains-mono + ]; + }; + + # Optimization & Garbage Collection + + # Optimize Nix-Store During Rebuilds + # NOTE: Optimizes during builds - results in slower builds + nix.settings.auto-optimise-store = true; + + # Purge Unused Nix-Store Entries + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; + + # Enable Nix Flakes and experimental features + nixpkgs.config.allowUnfree = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # System state version + system.stateVersion = "24.11"; +} \ No newline at end of file diff --git a/nixos/flake.nix b/nixos/flake.nix index ef083c5..ce51051 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -9,6 +9,17 @@ outputs = { nixpkgs, ... } @ inputs: { nixosConfigurations = { + default = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + ./hardware/tongfang.nix + ./configuration.nix + ./users.nix + ./packages.nix + ./services.nix + ]; + }; + tongfang = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; modules = [ diff --git a/nixos/modules/gnome.nix b/nixos/modules/gnome.nix index 4089419..1f53d7b 100644 --- a/nixos/modules/gnome.nix +++ b/nixos/modules/gnome.nix @@ -1,8 +1,10 @@ { pkgs, ... }: { - # Enable Gnome - services.xserver.enable = true; - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; + services.xserver = { + enable = true; + xkb.layout = "us"; + desktopManager.gnome.enable = true; + displayManager.gdm.enable = true; + }; } \ No newline at end of file diff --git a/nixos/packages.nix b/nixos/packages.nix new file mode 100644 index 0000000..6c59c6d --- /dev/null +++ b/nixos/packages.nix @@ -0,0 +1,34 @@ +{ pkgs, inputs, config, ... }: + +let + customWallpaper = pkgs.fetchurl { + url = "https://w.wallhaven.cc/full/2y/wallhaven-2y2wg6.png"; + sha256 = "9c5a0d7e4ed8fc218a5adb1c384e463b1b212397859a9a56be1c47cce27a9820"; + }; +in +{ + environment.systemPackages = with pkgs; with inputs; [ + inputs.zen-browser.packages."${system}".default + firefox + git + vim + wget + curl + fzf + jq + silver-searcher + ranger + ripgrep + networkmanager-openvpn + (pkgs.writeTextDir "share/sddm/themes/breeze/theme.conf.user" '' + [General] + background=${customWallpaper} + '') + dig + caligula + zig + zls + spotify + texlive.combined.scheme-full + ]; +} \ No newline at end of file diff --git a/nixos/services.nix b/nixos/services.nix new file mode 100644 index 0000000..973c435 --- /dev/null +++ b/nixos/services.nix @@ -0,0 +1,43 @@ +{ pkgs, ... }: + +{ + # Desktop, display and greeter configuration + services.xserver.enable = true; + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + services.desktopManager.plasma6.enable = true; + + # Audio system with PipeWire + # Enable PipeWire and ALSA support + services.pipewire = { + enable = true; + alsa.enable = true; # Enable ALSA support + alsa.support32Bit = true; # Support for 32-bit applications + pulse.enable = true; # Enable PulseAudio compatibility layer + }; + + # Enable libinput for input device handling + services.libinput.enable = true; + + # Enable security-related service for realtime audio tasks + security.rtkit.enable = true; + + # Enable to update some devices' firmware + services.fwupd.enable = true; + + # Steam, Tailscale, and other programs/services + programs.steam.enable = true; + services.tailscale.enable = true; + programs.partition-manager.enable = true; + + # Environment variables + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + + # Printing and Bluetooth + # Disable browsed: https://discourse.nixos.org/t/newly-announced-vulnerabilities-in-cups + services.printing.enable = true; + services.printing.browsed.enable = false; + hardware.bluetooth.enable = true; +} \ No newline at end of file diff --git a/nixos/users.nix b/nixos/users.nix new file mode 100644 index 0000000..347bcf4 --- /dev/null +++ b/nixos/users.nix @@ -0,0 +1,71 @@ +{ config, pkgs, ... }: + +{ + users.users.bart = { + isNormalUser = true; + description = "Bart van der Braak"; + extraGroups = [ "networkmanager" "wheel" "libvirtd" "docker" ]; + packages = with pkgs; [ + vscodium + thunderbird + fastfetch + wezterm + neovim + logseq + element-desktop + go-task + opentofu + python3 + gnumake + gccgo + # nodejs_22 + # corepack_22 + azure-cli + sops + blender + inkscape + gimp + nixfmt-rfc-style + ]; + }; + + # Enable discovery of Google Cast and Spotify Connect devices + networking.firewall.allowedUDPPorts = [ 5353 ]; + + nixpkgs.config.permittedInsecurePackages = [ + # Workaround for electron dependency in Logseq + "electron-27.3.11" + ]; + + programs._1password.enable = true; + programs._1password-gui = { + enable = true; + # Certain features, including CLI integration and system authentication support, + # require enabling PolKit integration on some desktop environments (e.g. Plasma). + polkitPolicyOwners = [ "bart" ]; + }; + + # SSH agent configuration + programs.ssh.startAgent = true; + programs.ssh.extraConfig = '' + Host * + AddKeysToAgent yes + ServerAliveInterval 60 + ServerAliveCountMax 3 + ''; + + # GPG agent configuration + programs.gnupg.agent.enable = true; + programs.gnupg.dirmngr.enable = true; + + # Add KVM support + virtualisation.libvirtd.enable = true; + programs.virt-manager.enable = true; + + # Add Docker support + virtualisation.docker.enable = true; + virtualisation.docker.rootless = { + enable = true; + setSocketVariable = true; + }; +} \ No newline at end of file