Move to new module system, allows for multiple computers
Change-Id: I9a76346b05dfff6157813c50f89d1254130fc26c
diff --git a/modules/browser.nix b/modules/browser.nix
deleted file mode 100644
index d3fa947..0000000
--- a/modules/browser.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{ pkgs, ... }: {
- home-manager.users.coded.programs.chromium = {
- enable = true;
- extensions = [
- { id = "nngceckbapebfimnlniiiahkandclblb"; } # bitwarden
- {
- id = "dkoaabhijcomjinndlgbmfnmnjnmdeeb";
- crxPath =
- ../extensions/chromium/adnauseam/adnauseam-3.18.0.chromium.crx;
- version = "3.18.0";
- }
- { id = "kekjfbackdeiabghhcdklcdoekaanoel"; } #MAL Sync
- { id = "mnjggcdmjocbbbhaepdhchncahnbgone"; } #Sponsor Block
- { id = "gebbhagfogifgggkldgodflihgfeippi"; } #return youtube dislike
- { id = "gmkiokemhjjdjmpnnjmnpkpfoenpnpne"; } #Lofi Girl
- { id = "fmkadmapgofadopljbjfkapdkoienihi"; } #React Dev Tools
- ];
- };
- home-manager.users.coded.programs.firefox = {
- enable = true;
- };
- # home-manager.users.coded.home.packages = [
- # pkgs.floorp
- #];
-}
diff --git a/modules/c.nix b/modules/c.nix
deleted file mode 100644
index f0279c8..0000000
--- a/modules/c.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{ pkgs, ... }: {
- environment.systemPackages = with pkgs; [
- libgccjit
- binutils
- gcc
- go
- ];
-}
diff --git a/modules/audio.nix b/modules/codedPC/audio.nix
similarity index 100%
rename from modules/audio.nix
rename to modules/codedPC/audio.nix
diff --git a/modules/bluetooth.nix b/modules/codedPC/bluetooth.nix
similarity index 100%
rename from modules/bluetooth.nix
rename to modules/codedPC/bluetooth.nix
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/cad.nix b/modules/codedPC/cad.nix
similarity index 100%
rename from modules/cad.nix
rename to modules/codedPC/cad.nix
diff --git a/modules/calibre.nix b/modules/codedPC/calibre.nix
similarity index 100%
rename from modules/calibre.nix
rename to modules/codedPC/calibre.nix
diff --git a/modules/games.nix b/modules/codedPC/games.nix
similarity index 100%
rename from modules/games.nix
rename to modules/codedPC/games.nix
diff --git a/modules/hardware-configuration.nix b/modules/codedPC/hardware-configuration.nix
similarity index 100%
rename from modules/hardware-configuration.nix
rename to modules/codedPC/hardware-configuration.nix
diff --git a/modules/kde_plasma.nix b/modules/codedPC/kde_plasma.nix
similarity index 100%
rename from modules/kde_plasma.nix
rename to modules/codedPC/kde_plasma.nix
diff --git a/modules/neovim.nix b/modules/codedPC/neovim.nix
similarity index 100%
rename from modules/neovim.nix
rename to modules/codedPC/neovim.nix
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/social.nix b/modules/codedPC/social.nix
similarity index 100%
rename from modules/social.nix
rename to modules/codedPC/social.nix
diff --git a/modules/uxplay.nix b/modules/codedPC/uxplay.nix
similarity index 100%
rename from modules/uxplay.nix
rename to modules/codedPC/uxplay.nix
diff --git a/modules/video.nix b/modules/codedPC/video.nix
similarity index 100%
rename from modules/video.nix
rename to modules/codedPC/video.nix
diff --git a/modules/vscode.nix b/modules/codedPC/vscode.nix
similarity index 100%
rename from modules/vscode.nix
rename to modules/codedPC/vscode.nix
diff --git a/modules/xdgopen.nix b/modules/codedPC/xdgopen.nix
similarity index 100%
rename from modules/xdgopen.nix
rename to modules/codedPC/xdgopen.nix
diff --git a/modules/basicServices.nix b/modules/common/basicServices.nix
similarity index 100%
rename from modules/basicServices.nix
rename to modules/common/basicServices.nix
diff --git a/modules/boot.nix b/modules/common/boot.nix
similarity index 65%
rename from modules/boot.nix
rename to modules/common/boot.nix
index 1948e91..605b789 100644
--- a/modules/boot.nix
+++ b/modules/common/boot.nix
@@ -15,9 +15,5 @@
};
loader.efi.canTouchEfiVariables = true;
- initrd.luks.devices."luks-bf23eee1-7cb7-43b9-822f-a9f49ea0a768".device =
- "/dev/disk/by-uuid/bf23eee1-7cb7-43b9-822f-a9f49ea0a768";
-
- initrd.kernelModules = [ "amdgpu" ];
};
}
diff --git a/modules/direnv.nix b/modules/common/direnv.nix
similarity index 100%
rename from modules/direnv.nix
rename to modules/common/direnv.nix
diff --git a/modules/docker.nix b/modules/common/docker.nix
similarity index 100%
rename from modules/docker.nix
rename to modules/common/docker.nix
diff --git a/modules/git.nix b/modules/common/git.nix
similarity index 100%
rename from modules/git.nix
rename to modules/common/git.nix
diff --git a/modules/home-manager.nix b/modules/common/home-manager.nix
similarity index 100%
rename from modules/home-manager.nix
rename to modules/common/home-manager.nix
diff --git a/modules/locale.nix b/modules/common/locale.nix
similarity index 100%
rename from modules/locale.nix
rename to modules/common/locale.nix
diff --git a/modules/common/networking.nix b/modules/common/networking.nix
new file mode 100644
index 0000000..bc3db33
--- /dev/null
+++ b/modules/common/networking.nix
@@ -0,0 +1,9 @@
+{
+ networking.hosts = {
+ "192.168.0.1" = [ "a1" ];
+ "192.168.0.2" = [ "a1d1" ];
+ "192.168.0.4" = [ "CodedPi" ];
+ "192.168.0.5" = [ "SamuelDesktop" "codedPC" "me" ];
+ "192.168.0.6" = [ "a1d2" ];
+ };
+}
diff --git a/modules/packages.nix b/modules/common/packages.nix
similarity index 64%
rename from modules/packages.nix
rename to modules/common/packages.nix
index f8c0f0b..5b7de8a 100644
--- a/modules/packages.nix
+++ b/modules/common/packages.nix
@@ -1,18 +1,10 @@
{ pkgs, ... }: {
hardware.enableRedistributableFirmware = true;
nixpkgs.config.allowUnfree = true;
- nixpkgs.config.permittedInsecurePackages = with pkgs; [
- "mailspring-1.11.0"
- ];
home-manager.users.coded.home.packages = with pkgs; [
- bitwarden
sops
nixfmt
nextcloud-client
- email
- mailspring
- ollama
- rpiplay
];
environment.systemPackages = with pkgs; [
tmux
diff --git a/modules/security.nix b/modules/common/security.nix
similarity index 72%
rename from modules/security.nix
rename to modules/common/security.nix
index e14fd8c..7466737 100644
--- a/modules/security.nix
+++ b/modules/common/security.nix
@@ -1,10 +1,10 @@
-{
+{ flakeRoot, ... }: {
security.pam.services = {
login.u2fAuth = true;
sudo.u2fAuth = true;
};
- security.pam.u2f.authFile = ../keys/u2f_mappings;
+ security.pam.u2f.authFile = "${flakeRoot}/keys/u2f_mappings";
security.sudo.extraRules = [
{
diff --git a/modules/shell.nix b/modules/common/shell.nix
similarity index 72%
rename from modules/shell.nix
rename to modules/common/shell.nix
index ec72963..1bf1ba6 100644
--- a/modules/shell.nix
+++ b/modules/common/shell.nix
@@ -2,7 +2,7 @@
programs.zsh.enable = true;
users.users.coded.shell = pkgs.zsh;
- environment.systemPackages = with pkgs; [
+ home-manager.users.coded.home.packages = with pkgs; [
bmon
wget
ripgrep
@@ -22,13 +22,10 @@
rebuild = "sudo nixos-rebuild switch --flake /home/coded/nixConfig/";
"gr!" = "git review";
clr = "clear";
- pnpx = "pnpm dlx";
- print3d = "sudo /run/current-system/sw/bin/pronsole.py";
nh = "wget -O ~/Documents/hashCheck $1 | nix hash file ~/Documents/hashCheck";
edit = "nvim";
neovim = "nvim";
v = "nvim";
- doom = "~/.config/emacs/bin/doom";
};
dirHashes = { code = "$HOME/Documents/programming"; };
@@ -47,20 +44,6 @@
enable = true;
settings = { format = "$all"; };
};
-
- # Alacritty
- alacritty = {
- enable = true;
- settings = {
- window.dimensions = {
- lines = 40;
- columns = 150;
- };
- import = [
- "${inputs.alacritty-themes}/themes/Catppuccin-Mocha.yml"
- ];
- };
- };
# Nix-index
nix-index.enable = true;
diff --git a/modules/ssh.nix b/modules/common/ssh.nix
similarity index 100%
rename from modules/ssh.nix
rename to modules/common/ssh.nix
diff --git a/modules/users.nix b/modules/common/users.nix
similarity index 93%
rename from modules/users.nix
rename to modules/common/users.nix
index 8b5cdba..25c3870 100644
--- a/modules/users.nix
+++ b/modules/common/users.nix
@@ -1,7 +1,7 @@
-{pkgs, ...}: {
+{ pkgs, ... }: {
users.users.minion = {
isNormalUser = true;
- extraGroups = [ "wheel" ];
+ extraGroups = [ "networkmanager" "wheel" ];
openssh.authorizedKeys.keys = [
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIIteIdlZv52nUDxW2SUsoJ2NZi/w9j1NZwuHanQ/o/DuAAAAHnNzaDpjb2xsYWJvcmFfeXViaWtleV9yZXNpZGVudA== collabora_yubikey_resident"
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIJRzQbQjXFpHKtt8lpNKmoNx57+EJ/z3wnKOn3/LjM6cAAAAFXNzaDppeXViaWtleV9yZXNpZGVudA== iyubikey_resident"
@@ -10,7 +10,7 @@
};
users.users.coded = {
isNormalUser = true;
- extraGroups = [ "wheel" ];
+ extraGroups = [ "networkmanager" "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCZGErwcw5YUlJS9tAfIYOSqkiuDRZZRTJjMlrDaAiNwTjqUML/Lrcau/1KA6a0+sXCM8DhQ1e0qhh2Qxmh/kxZWO6XMVK2EB7ELPNojqFI16T8Bbhq2t7yVAqbPUhXLQ4xKGvWMCPWOCo/dY72P9yu7kkMV0kTW3nq25+8nvqIvvuQOlOUx1uyR7qEfO706O86wjVTIuwfZKyzMDIC909vyg0xS+SfFlD7MkBuGzevQnOAV3U6tyafg6XW4PaJuDLyGXwpKz6asY08F7gRL/7/GhlMB09nfFfT4sZggmqPdGAtxwsFuwHPjNSlktHz5nlHtpS0LjefR9mWiGIhw5Hw1z33lxP0rfmiEU9J7kFcXv9B8QAWFwWfNEZfeqB7h7DJruo+QRStGeDz4SwRG3GR+DB4iNJLt7n0ALkVFJpOpskeo8TV4+Fwok+hYs2GsvdEmh9Cj7dC/9CyRhJeam9iLIi/iVGZhXEE3tIiqEktZPjiK7JwQyr97zhGJ7Rj4oE= samue@SamuelDesktop"
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIH+TJRuMpDPgh6Wp2h+E+O/WoyEAVyWo6SN8oxm2JZNVAAAABHNzaDo= samue@SamuelDesktop"
diff --git a/modules/emacs.nix b/modules/emacs.nix
deleted file mode 100644
index f2f7153..0000000
--- a/modules/emacs.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ pkgs, ... }: {
-
- home-manager.users.coded.programs.emacs = {
- enable = true;
- };
- home-manager.users.coded.services.emacs = {
- enable = true;
- client = {
- enable = true;
- };
- };
-}
diff --git a/modules/java.nix b/modules/java.nix
deleted file mode 100644
index abe03e8..0000000
--- a/modules/java.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ pkgs, ... }: {
- environment.systemPackages = with pkgs; [
- jdk8
- jdk21
- jdk
- ];
-}
diff --git a/modules/mongo.nix b/modules/mongo.nix
deleted file mode 100644
index e42b184..0000000
--- a/modules/mongo.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{ config, pkgs, ... }: {
- environment.systemPackages = [ pkgs.mongosh pkgs.mongodb-tools ];
- services.mongodb.enable = false;
- services.mongodb.package = pkgs.mongodb-6_0;
-}
diff --git a/modules/networking.nix b/modules/networking.nix
deleted file mode 100644
index 05997db..0000000
--- a/modules/networking.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- networking = {
- hostName = "codedPC";
- networkmanager.enable = true;
-
- hosts = {
- "192.168.0.1" = [ "a1" ];
- "192.168.0.2" = [ "a1d1" ];
- "192.168.0.4" = [ "CodedPi" ];
- "192.168.0.5" = [ "SamuelDesktop" "codedPC" "me" ];
- "192.168.0.6" = [ "a1d2" ];
- };
-
- firewall = {
- enable = true;
- allowedTCPPorts = [ 3000 ];
- };
- };
-
-
-}
diff --git a/modules/node.nix b/modules/node.nix
deleted file mode 100644
index 24c3e32..0000000
--- a/modules/node.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{ pkgs, ... }: {
- home-manager.users.coded.home.packages = with pkgs; [
- nodejs_20
- bun
- nodePackages.pnpm
- nodePackages.typescript
- ];
-}
diff --git a/modules/printing.nix b/modules/printing.nix
deleted file mode 100644
index 2c22100..0000000
--- a/modules/printing.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ pkgs, ... }: {
- environment.systemPackages = with pkgs; [
- cura
- printrun
- ];
-}
diff --git a/modules/python.nix b/modules/python.nix
deleted file mode 100644
index 5ba716d..0000000
--- a/modules/python.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ pkgs, ... }: {
- environment.systemPackages = with pkgs; [
- python311
- virtualenv
- ];
-}
diff --git a/modules/rust.nix b/modules/rust.nix
deleted file mode 100644
index 1e1490b..0000000
--- a/modules/rust.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{ pkgs, ... }: {
- home-manager.users.coded.home.packages = with pkgs; [
- bacon
- ];
-}
diff --git a/modules/yubikey.nix b/modules/yubikey.nix
deleted file mode 100644
index 752b77b..0000000
--- a/modules/yubikey.nix
+++ /dev/null
@@ -1,3 +0,0 @@
-{ pkgs, ... }: {
- home-manager.users.coded.home.packages = with pkgs; [ yubikey-manager ];
-}