diff --git a/configuration.nix b/configuration.nix index d356ad27..d06fb662 100644 --- a/configuration.nix +++ b/configuration.nix @@ -12,44 +12,20 @@ ./modules/tlp.nix ./modules/osu ./modules/srb2 + ./modules/mullvad + ./modules/pipewire + ./modules/networking + ./modules/virtualization + ./modules/xserver ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - services.xserver.displayManager.lightdm.enable = false; - - networking.hostName = "nixos"; - networking.networkmanager.enable = true; - networking.networkmanager.unmanaged = [ "interface-name:ve-*" ]; - networking.networkmanager.dns = "none"; - networking.useHostResolvConf = true; - systemd.extraConfig = '' DefaultTimeoutStopSec=10s ''; - virtualisation.vmVariant = { - virtualisation = { - memorySize = 8192; - cores = 4; - }; - virtualisation.qemu.options = - [ "-device virtio-vga-gl" "-display sdl,gl=on" ]; - - services.xserver.desktopManager.gnome.enable = true; - services.xserver.displayManager.gdm.enable = true; - - i18n.inputMethod = lib.mkDefault { - enabled = "ibus"; - ibus.engines = with pkgs.ibus-engines; [ mozc ]; - }; - - services.gnome.core-utilities.enable = false; - environment.gnome.excludePackages = [ pkgs.gnome-tour ]; - hardware.pulseaudio.enable = false; - }; - environment.sessionVariables = { EDITOR = "nvim"; VISUAL = "nvim"; @@ -58,12 +34,7 @@ NODE_OPTIONS = "--max_old_space_size=16384"; }; - services.vnstat.enable = true; - services.tumbler.enable = true; - security.rtkit.enable = true; - users.defaultUserShell = pkgs.fish; - environment.shells = with pkgs; [ fish ]; time.timeZone = "America/New_York"; @@ -71,7 +42,6 @@ i18n.supportedLocales = [ "en_US.UTF-8/UTF-8" "ja_JP.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8" ]; - services.xserver.enable = true; programs.firejail.enable = true; nix.package = pkgs.nixFlakes; @@ -81,7 +51,6 @@ wget grim slurp - mullvad-vpn mullvad-browser papirus-icon-theme mediainfo @@ -110,7 +79,6 @@ rsync jq keepassxc - stow exa fd fzf @@ -120,16 +88,13 @@ typespeed slade gdu - ranger nixfmt whois lnch - libnotify dwt1-shell-color-scripts dig trashy swaybg - udiskie brightnessctl killall nodejs @@ -141,22 +106,13 @@ rustfmt cargo genact - (pkgs.callPackage ./pkgs/srb2.nix {}) ]; - services.mullvad-vpn.enable = true; - services.mullvad-vpn.enableExcludeWrapper = false; networking.networkmanager.wifi.macAddress = "random"; networking.networkmanager.ethernet.macAddress = "random"; services.resolved.llmnr = "false"; environment.defaultPackages = [ ]; - services.xserver.excludePackages = [ pkgs.xterm ]; - - # Force containers to use mullvad - networking.nat.enable = true; - networking.nat.internalInterfaces = [ "ve-+" ]; - networking.nat.externalInterface = "wg-mullvad"; system.stateVersion = "22.11"; } diff --git a/flake.nix b/flake.nix index 785f4e00..cd501aa1 100644 --- a/flake.nix +++ b/flake.nix @@ -30,7 +30,6 @@ ./home.nix ./home-manager hyprland.nixosModules.default - { programs.hyprland.enable = true; } stylix.nixosModules.stylix home-manager.nixosModules.home-manager ]; diff --git a/home-manager/dunst/default.nix b/home-manager/dunst/default.nix index 60dd0ed1..360249c5 100644 --- a/home-manager/dunst/default.nix +++ b/home-manager/dunst/default.nix @@ -1,4 +1,8 @@ +{ pkgs, ... }: + { + environment.systemPackages = [ pkgs.libnotify ]; + home-manager.sharedModules = [{ services.dunst = { enable = true; diff --git a/home-manager/hyprland/default.nix b/home-manager/hyprland/default.nix index b148830b..a097e084 100644 --- a/home-manager/hyprland/default.nix +++ b/home-manager/hyprland/default.nix @@ -1,4 +1,6 @@ { + programs.hyprland.enable = true; + home-manager.sharedModules = [{ xdg.configFile."hypr/hyprland.conf".text = '' env=XCURSOR_SIZE,24 diff --git a/home-manager/thunar/default.nix b/home-manager/thunar/default.nix index a7aff9d7..323880ea 100644 --- a/home-manager/thunar/default.nix +++ b/home-manager/thunar/default.nix @@ -2,6 +2,7 @@ { programs.thunar.enable = true; + services.tumbler.enable = true; environment.systemPackages = [ pkgs.xfce.exo ]; home-manager.sharedModules = [{ diff --git a/modules/fish.nix b/modules/fish.nix index c8c462a2..910ae9be 100644 --- a/modules/fish.nix +++ b/modules/fish.nix @@ -1,6 +1,12 @@ +{ pkgs, ... }: + { + users.defaultUserShell = pkgs.fish; + environment.shells = [ pkgs.fish ]; + programs.fish = { enable = true; + shellAliases = { ls = "exa --group-directories-first -I 'lost+found'"; tree = @@ -8,6 +14,7 @@ mv = "mv -i"; rg = "rg --max-columns=2000"; }; + shellAbbrs = { g = "git"; ga = "git add"; diff --git a/modules/mullvad/default.nix b/modules/mullvad/default.nix new file mode 100644 index 00000000..8b376046 --- /dev/null +++ b/modules/mullvad/default.nix @@ -0,0 +1,18 @@ +{ + services.mullvad-vpn = { + enable = true; + enableExcludeWrapper = false; + }; + + networking = { + nat = { + enable = true; + internalInterfaces = [ "ve-+" ]; + externalInterface = "wg-mullvad"; + }; + + networkmanager = { + unmanaged = [ "interface-name:ve-*" ]; + }; + }; +} diff --git a/modules/networking/default.nix b/modules/networking/default.nix new file mode 100644 index 00000000..8453aeec --- /dev/null +++ b/modules/networking/default.nix @@ -0,0 +1,12 @@ +{ + networking = { + hostName = "nixos"; + + networkmanager = { + enable = true; + dns = "none"; + }; + + useHostResolvConf = true; + }; +} diff --git a/modules/pipewire/default.nix b/modules/pipewire/default.nix new file mode 100644 index 00000000..89bccdd6 --- /dev/null +++ b/modules/pipewire/default.nix @@ -0,0 +1,15 @@ +{ + services.pipewire = { + enable = true; + + alsa = { + enable = true; + support32Bit = true; + }; + + pulse.enable = true; + jack.enable = true; + }; + + security.rtkit.enable = true; +} diff --git a/modules/virtualization/default.nix b/modules/virtualization/default.nix new file mode 100644 index 00000000..3de16b2a --- /dev/null +++ b/modules/virtualization/default.nix @@ -0,0 +1,25 @@ +{ pkgs, lib, ... }: + +{ + virtualisation.vmVariant = { + virtualisation = { + memorySize = 8192; + cores = 4; + }; + + virtualisation.qemu.options = + [ "-device virtio-vga-gl" "-display sdl,gl=on" ]; + + services.xserver.desktopManager.gnome.enable = true; + services.xserver.displayManager.gdm.enable = true; + + i18n.inputMethod = lib.mkDefault { + enabled = "ibus"; + ibus.engines = with pkgs.ibus-engines; [ mozc ]; + }; + + services.gnome.core-utilities.enable = false; + environment.gnome.excludePackages = [ pkgs.gnome-tour ]; + hardware.pulseaudio.enable = false; + }; +} diff --git a/modules/xserver/default.nix b/modules/xserver/default.nix new file mode 100644 index 00000000..52b1a213 --- /dev/null +++ b/modules/xserver/default.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +{ + services.xserver = { + enable = true; + displayManager.lightdm.enable = false; + excludePackages = [ pkgs.xterm ]; + }; +}