Move to new module system, allows for multiple computers

Change-Id: I9a76346b05dfff6157813c50f89d1254130fc26c
diff --git a/modules/codedPC/audio.nix b/modules/codedPC/audio.nix
new file mode 100644
index 0000000..4046f2b
--- /dev/null
+++ b/modules/codedPC/audio.nix
@@ -0,0 +1,35 @@
+{ config, pkgs, lib, inputs, ... }: {
+  sound.enable = true;
+  hardware.pulseaudio.enable = false;
+  security.rtkit.enable = true;
+
+  services.pipewire = {
+    enable = true;
+    alsa.enable = true;
+    alsa.support32Bit = true;
+    pulse.enable = true;
+    jack.enable = true;
+  };
+
+  environment.etc."pipewire/pipewire.conf.d/VirtualAudioDevice.conf".text = ''
+    context.objects = [
+      {
+        factory = adapter
+        args = {
+          factory.name = support.null-audio-sink
+          node.name = Microphone-Proxy
+          node.description = Microphone
+          media.class = Audio/Source/Virtual
+          audio.posistion = MONO
+        }
+      }
+    ]
+  '';
+
+  home-manager.users.coded.home.packages =
+    with pkgs; [
+      audacity
+      helvum
+      lmms
+    ];
+}
diff --git a/modules/codedPC/bluetooth.nix b/modules/codedPC/bluetooth.nix
new file mode 100644
index 0000000..4b79618
--- /dev/null
+++ b/modules/codedPC/bluetooth.nix
@@ -0,0 +1,6 @@
+{
+  hardware.bluetooth.enable = true;
+  hardware.bluetooth.powerOnBoot = true;
+
+  services.blueman.enable = true;
+}
diff --git a/modules/codedPC/boot.nix b/modules/codedPC/boot.nix
new file mode 100644
index 0000000..1963a31
--- /dev/null
+++ b/modules/codedPC/boot.nix
@@ -0,0 +1,8 @@
+{
+  boot.initrd = {
+    luks.devices."luks-bf23eee1-7cb7-43b9-822f-a9f49ea0a768".device =
+      "/dev/disk/by-uuid/bf23eee1-7cb7-43b9-822f-a9f49ea0a768";
+
+    kernelModules = [ "amdgpu" ];
+  };
+}
diff --git a/modules/codedPC/browser.nix b/modules/codedPC/browser.nix
new file mode 100644
index 0000000..f253a94
--- /dev/null
+++ b/modules/codedPC/browser.nix
@@ -0,0 +1,21 @@
+{ pkgs, flakeRoot, ... }: {
+  home-manager.users.coded.programs.chromium = {
+    enable = true;
+    extensions = [ #Chrome Web Store
+      { id = "nngceckbapebfimnlniiiahkandclblb"; } #Bitwarden
+      { id = "kekjfbackdeiabghhcdklcdoekaanoel"; } #MAL Sync
+      { id = "mnjggcdmjocbbbhaepdhchncahnbgone"; } #Sponsor Block
+      { id = "gebbhagfogifgggkldgodflihgfeippi"; } #Return youtube dislike
+      { id = "gmkiokemhjjdjmpnnjmnpkpfoenpnpne"; } #Lofi Girl
+      { id = "fmkadmapgofadopljbjfkapdkoienihi"; } #React Dev Tools
+      { id = "bmnlcjabgnpnenekpadlanbbkooimhnj"; } #PayPal Honey
+    ] ++ [ #Custom
+      {
+        id = "dkoaabhijcomjinndlgbmfnmnjnmdeeb";
+        crxPath =
+          "${flakeRoot}/extensions/chromium/adnauseam/adnauseam-3.18.0.chromium.crx";
+        version = "3.18.0";
+      }
+    ];
+  };
+}
diff --git a/modules/codedPC/cad.nix b/modules/codedPC/cad.nix
new file mode 100644
index 0000000..28b44fc
--- /dev/null
+++ b/modules/codedPC/cad.nix
@@ -0,0 +1,6 @@
+{ pkgs, ... }: {
+  home-manager.users.coded.home.packages = [
+    pkgs.freecad
+    pkgs.solvespace
+  ];
+}
diff --git a/modules/codedPC/calibre.nix b/modules/codedPC/calibre.nix
new file mode 100644
index 0000000..1f44dc8
--- /dev/null
+++ b/modules/codedPC/calibre.nix
@@ -0,0 +1,5 @@
+{ pkgs, ... }: {
+  environment.systemPackages = with pkgs; [
+    calibre
+  ];
+}
diff --git a/modules/codedPC/games.nix b/modules/codedPC/games.nix
new file mode 100644
index 0000000..2560d61
--- /dev/null
+++ b/modules/codedPC/games.nix
@@ -0,0 +1,14 @@
+{ pkgs, ... }: {
+  home-manager.users.coded.home.packages = with pkgs; [
+    minecraft
+    prismlauncher
+    BeatSaberModManager
+    gamemode
+    godot_4
+  ];
+  programs.steam = {
+    enable = true;
+    remotePlay.openFirewall = true;
+    dedicatedServer.openFirewall = true;
+  };
+}
diff --git a/modules/codedPC/hardware-configuration.nix b/modules/codedPC/hardware-configuration.nix
new file mode 100755
index 0000000..6c861fb
--- /dev/null
+++ b/modules/codedPC/hardware-configuration.nix
@@ -0,0 +1,42 @@
+# Do not modify this file!  It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations.  Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+  imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
+
+  boot.initrd.availableKernelModules =
+    [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
+  boot.initrd.kernelModules = [ "amdgpu" ];
+  boot.kernelModules = [ ];
+  boot.extraModulePackages = [ ];
+
+  fileSystems."/" = {
+    device = "/dev/disk/by-uuid/63caf2b5-90d4-49a7-99e9-98dcdd797859";
+    fsType = "ext4";
+  };
+
+  boot.initrd.luks.devices."luks-c38bc921-8979-4a25-9520-f3354dee3557".device =
+    "/dev/disk/by-uuid/c38bc921-8979-4a25-9520-f3354dee3557";
+
+  fileSystems."/boot" = {
+    device = "/dev/disk/by-uuid/5B78-4B2D";
+    fsType = "vfat";
+  };
+
+  swapDevices =
+    [{ device = "/dev/disk/by-uuid/3a9212d4-6c39-4d5b-abf0-49294bd991c9"; }];
+
+  # 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.<interface>.useDHCP`.
+  networking.useDHCP = lib.mkDefault true;
+  # networking.interfaces.enp42s0.useDHCP = lib.mkDefault true;
+  # networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
+
+  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+  hardware.cpu.amd.updateMicrocode =
+    lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/modules/codedPC/kde_plasma.nix b/modules/codedPC/kde_plasma.nix
new file mode 100644
index 0000000..55b028f
--- /dev/null
+++ b/modules/codedPC/kde_plasma.nix
@@ -0,0 +1,14 @@
+{ pkgs, ... }: {
+  environment.plasma5.excludePackages = with pkgs.libsForQt5; [
+    okular
+    konsole
+  ];
+
+  environment.systemPackages = with pkgs; [
+    sweet-nova
+    pitch-black
+    adapta-kde-theme
+    ocs-url
+  ];
+
+}
diff --git a/modules/codedPC/neovim.nix b/modules/codedPC/neovim.nix
new file mode 100644
index 0000000..bd5ba2c
--- /dev/null
+++ b/modules/codedPC/neovim.nix
@@ -0,0 +1,6 @@
+{ pkgs, ...}: {
+  home-manager.users.coded.programs.neovim = {
+    enable = true;
+    defaultEditor = true;
+  };
+}
diff --git a/modules/codedPC/networking.nix b/modules/codedPC/networking.nix
new file mode 100644
index 0000000..0a9c8d4
--- /dev/null
+++ b/modules/codedPC/networking.nix
@@ -0,0 +1,11 @@
+{
+  networking = {
+    hostName = "codedPC";
+    networkmanager.enable = true;
+
+    firewall = {
+      enable = true;
+      allowedTCPPorts = [ 3000 ];
+    };
+  };
+}
diff --git a/modules/codedPC/packages.nix b/modules/codedPC/packages.nix
new file mode 100644
index 0000000..90bad63
--- /dev/null
+++ b/modules/codedPC/packages.nix
@@ -0,0 +1,12 @@
+{ pkgs, ... }: {
+  hardware.enableRedistributableFirmware = true;
+  home-manager.users.coded.home.packages = with pkgs; [
+    bitwarden
+    nixfmt
+    email
+    thunderbird
+    ollama
+    rpiplay
+    kdocker
+  ];
+}
diff --git a/modules/codedPC/printing.nix b/modules/codedPC/printing.nix
new file mode 100644
index 0000000..68016f8
--- /dev/null
+++ b/modules/codedPC/printing.nix
@@ -0,0 +1,6 @@
+{ pkgs, ... }: {
+    home-manager.users.coded.home.packages = with pkgs; [
+        cura
+        printrun
+    ];
+}
diff --git a/modules/codedPC/shell.nix b/modules/codedPC/shell.nix
new file mode 100644
index 0000000..997afe8
--- /dev/null
+++ b/modules/codedPC/shell.nix
@@ -0,0 +1,18 @@
+{ inputs, ... }: {
+  home-manager.users.coded.programs.alacritty = {
+    enable = true;
+    settings = {
+      window.dimensions = {
+        lines = 40;
+        columns = 150;
+      };
+      import = [
+        "${inputs.alacritty-themes}/themes/Catppuccin-Mocha.yml"
+      ];
+    };
+  };
+
+  home-manager.users.coded.programs.zsh.shellAliases = {
+    print3d = "sudo /run/current-system/sw/bin/pronsole.py";
+  };
+}
diff --git a/modules/codedPC/social.nix b/modules/codedPC/social.nix
new file mode 100644
index 0000000..bee39ce
--- /dev/null
+++ b/modules/codedPC/social.nix
@@ -0,0 +1,3 @@
+{ pkgs, ... }: {
+  home-manager.users.coded.home.packages = with pkgs; [ discord ];
+}
diff --git a/modules/codedPC/uxplay.nix b/modules/codedPC/uxplay.nix
new file mode 100644
index 0000000..1b17c1a
--- /dev/null
+++ b/modules/codedPC/uxplay.nix
@@ -0,0 +1,21 @@
+{ pkgs, ... }: {
+
+  networking.firewall = {
+    allowedTCPPorts = [ 7100 7000 7001 ];
+    allowedUDPPorts = [ 6000 6001 7011 ];
+  };
+
+  services.avahi = {
+    # nssmdns = true;
+    enable = true;
+    publish = {
+      enable = true;
+      userServices = true;
+      domain = true;
+    };
+  };
+
+  home-manager.users.coded.home.packages = [
+    pkgs.uxplay
+  ];
+}
diff --git a/modules/codedPC/video.nix b/modules/codedPC/video.nix
new file mode 100644
index 0000000..00fdb9f
--- /dev/null
+++ b/modules/codedPC/video.nix
@@ -0,0 +1,18 @@
+{
+  services.xserver.enable = true;
+  services.xserver.videoDrivers = [ "amdgpu" ];
+
+  services.xserver.displayManager.sddm.enable = true;
+  services.xserver.desktopManager.plasma5.enable = true;
+
+  hardware.opengl.driSupport = true;
+  # For 32 bit applications
+  hardware.opengl.driSupport32Bit = true;
+
+  programs.dconf.enable = true;
+
+  services.xserver = {
+    layout = "us";
+    xkbVariant = "";
+  };
+}
diff --git a/modules/codedPC/vscode.nix b/modules/codedPC/vscode.nix
new file mode 100644
index 0000000..89911d3
--- /dev/null
+++ b/modules/codedPC/vscode.nix
@@ -0,0 +1,33 @@
+{ pkgs, nix-vscode-extensions, ... }: {
+  home-manager.users.coded.programs.vscode = {
+    enable = true;
+    enableUpdateCheck = false;
+    userSettings = {
+        "files.autoSave" = "off";
+        "explorer.confirmDelete" = false;
+        "files.autoSaveDelay" = 5000;
+        "workbench.iconTheme" = "catppuccin-macchiato";
+        "terminal.integrated.defaultProfile.linux" = "zsh";
+        "workbench.startupEditor" = "none";
+        "workbench.colorTheme" = "Catppuccin Macchiato";
+        "explorer.confirmDragAndDrop" = false;
+        "typescript.updateImportsOnFileMove.enabled" = "always";
+        "javascript.updateImportsOnFileMove.enabled" = "always";
+        "terminal.integrated.enableMultiLinePasteWarning" = false;
+        "liveshare.languages.allowGuestCommandControl" = true;
+    };
+    extensions = with pkgs.vscode-extensions;
+      [
+        ms-vsliveshare.vsliveshare
+        codezombiech.gitignore
+        editorconfig.editorconfig
+        zhuangtongfa.material-theme
+        bbenoist.nix
+      ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [{
+        name = "helium-icon-theme";
+        publisher = "helgardrichard";
+        version = "1.0.0";
+        sha256 = "sha256-uSApuTXQgvPiJpBL91d3mX35Sa2l2vLIAFpBo+cZ4h4=";
+      }];
+  };
+}
diff --git a/modules/codedPC/xdgopen.nix b/modules/codedPC/xdgopen.nix
new file mode 100644
index 0000000..a3b086d
--- /dev/null
+++ b/modules/codedPC/xdgopen.nix
@@ -0,0 +1,6 @@
+{
+  xdg.portal = {
+    enable = true;
+    xdgOpenUsePortal = true;
+  };
+}