From 3acb8808667e896a7fe5a812166af6623324f4fd Mon Sep 17 00:00:00 2001 From: Superredstone Date: Mon, 5 May 2025 23:07:10 +0200 Subject: [PATCH] Made the configuration more modular --- lib/mksystem.nix | 3 +- machines/katana.nix | 9 ---- machines/katana/default.nix | 6 +++ machines/katana/networking.nix | 8 +++ machines/katana/services.nix | 23 ++------- machines/katana/virtualisation.nix | 10 ++++ modules/nix-config/default.nix | 82 ------------------------------ 7 files changed, 29 insertions(+), 112 deletions(-) delete mode 100644 machines/katana.nix create mode 100644 machines/katana/networking.nix create mode 100644 machines/katana/virtualisation.nix diff --git a/lib/mksystem.nix b/lib/mksystem.nix index e8d8624..c5e5872 100644 --- a/lib/mksystem.nix +++ b/lib/mksystem.nix @@ -35,7 +35,7 @@ let machineConfig = ../machines/${name}/default.nix; # OSConfig = ../modules/${if isDarwin then "darwin" else "nixos"}.nix; HMConfig = ../home; - # systemPackages = ../modules/packages.nix; + systemPackages = ../modules/packages.nix; # TODO: make this cleaner nix-homebrew = lib.optionalAttrs isDarwin inputs.nix-homebrew.darwinModules.nix-homebrew; nix-homebrew-config = lib.optionalAttrs isDarwin { @@ -74,6 +74,7 @@ systemFunc { { nixpkgs.config.allowUnfree = true; } (if isWSL then inputs.nixos-wsl.nixosModules.wsl else { }) nixConfig + systemPackages nix-homebrew nix-homebrew-config home-manager.home-manager diff --git a/machines/katana.nix b/machines/katana.nix deleted file mode 100644 index 2813d78..0000000 --- a/machines/katana.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - imports = [ - ./hardware/katana.nix - ../modules - ]; - - system.stateVersion = "24.05"; # Did you read the comment? -} diff --git a/machines/katana/default.nix b/machines/katana/default.nix index 48eb1ef..c044be9 100644 --- a/machines/katana/default.nix +++ b/machines/katana/default.nix @@ -5,5 +5,11 @@ ./boot.nix ./nvidia.nix ./services.nix + ./virtualisation.nix + ./networking.nix ]; + + networking.hostName = "katana"; # Define your hostname. + + system.stateVersion = "24.05"; # Did you read the comment? } diff --git a/machines/katana/networking.nix b/machines/katana/networking.nix new file mode 100644 index 0000000..e336fae --- /dev/null +++ b/machines/katana/networking.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + networking.networkmanager.enable = true; + networking.firewall.allowedUDPPorts = [ 25565 ]; + networking.firewall.allowedTCPPorts = [ 25565 ]; + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; +} diff --git a/machines/katana/services.nix b/machines/katana/services.nix index 5b0f37c..4d5fd68 100644 --- a/machines/katana/services.nix +++ b/machines/katana/services.nix @@ -8,26 +8,9 @@ services.desktopManager.plasma6.enable = true; services.displayManager.sddm.wayland.enable = true; - # services.xserver.displayManager.gdm.enable = true; - # services.xserver.desktopManager.gnome.enable = true; - # environment.gnome.excludePackages = (with pkgs; [ - # atomix # puzzle game - # cheese # webcam tool - # epiphany # web browser - # evince # document viewer - # geary # email reader - # gedit # text editor - # gnome-characters - # gnome-music - # gnome-photos - # gnome-terminal - # gnome-tour - # hitori # sudoku game - # iagno # go game - # tali # poker game - # totem # video player - # ]); - + # Enable sound with pipewire. + services.pulseaudio.enable = false; + security.rtkit.enable = true; # Configure keymap in X11 services.xserver.xkb = { diff --git a/machines/katana/virtualisation.nix b/machines/katana/virtualisation.nix new file mode 100644 index 0000000..f3ffe6d --- /dev/null +++ b/machines/katana/virtualisation.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + virtualisation.podman.enable = true; + virtualisation.podman.dockerCompat = true; + + programs.virt-manager.enable = true; + users.groups.libvirtd.members = ["r3ddy"]; + virtualisation.libvirtd.enable = true; + virtualisation.spiceUSBRedirection.enable = true; +} diff --git a/modules/nix-config/default.nix b/modules/nix-config/default.nix index b5a3d0a..a2511f4 100644 --- a/modules/nix-config/default.nix +++ b/modules/nix-config/default.nix @@ -15,13 +15,6 @@ }; }; - networking.hostName = "nixos"; # Define your hostname. - - networking.networkmanager.enable = true; - networking.firewall.allowedUDPPorts = [ 25565 ]; - networking.firewall.allowedTCPPorts = [ 25565 ]; - hardware.bluetooth.enable = true; - hardware.bluetooth.powerOnBoot = true; time.timeZone = "Europe/Rome"; @@ -46,11 +39,6 @@ GOPATH = "$HOME/.go"; }; - - # Enable sound with pipewire. - services.pulseaudio.enable = false; - security.rtkit.enable = true; - programs.fish.enable = true; # This must be true before initializing my user users.users.r3ddy = { isNormalUser = true; @@ -63,75 +51,5 @@ nerd-fonts.jetbrains-mono ]; - nixpkgs.config.allowUnfree = true; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - environment.systemPackages = with pkgs; [ - # CLI utils - appimage-run - btop - busybox - distrobox - docker - fish - fzf - git - gnumake - htop - jq - killall - md2pdf - nmap - python3 - ripgrep - tree - unzip - wget - wl-clipboard - xdotool - xorg.xwininfo - yad - zip - zoxide - zulu - - # Man pages - man-pages - - vim # The only and one great editor - # neovim # The only and one great editor improved even further - - # Video card - vulkan-tools - - # Gaming - dolphin-emu - heroic - mangohud - prismlauncher - steam - vesktop - - # GUI applications - baobab - brave - kdePackages.xdg-desktop-portal-kde - kitty - libresprite - mpv - nextcloud-client - spotube - telegram-desktop - ]; - - programs.steam.enable = true; - programs.steam.remotePlay.openFirewall = true; - virtualisation.podman.enable = true; - virtualisation.podman.dockerCompat = true; - - programs.virt-manager.enable = true; - users.groups.libvirtd.members = ["r3ddy"]; - virtualisation.libvirtd.enable = true; - virtualisation.spiceUSBRedirection.enable = true; }