diff --git a/flake.nix b/flake.nix index 4e452b5..733c04b 100644 --- a/flake.nix +++ b/flake.nix @@ -25,10 +25,9 @@ let lib = nixpkgs.lib; lib' = import ./lib.nix { inherit lib; }; - mod = lib'.walk-dir ./mod; specialArgs = { - inherit inputs lib' mod; + inherit inputs lib'; var = (lib'.walk-dir ./var).map_import_with_lib; }; overlays = _: { @@ -44,9 +43,8 @@ }; modules = [ ./host/solo - mod.common.to_mod - mod.pc-common.to_mod - nixos-config-hidden.nixosModules.pc + ./host + ./mod overlays ]; }; @@ -58,9 +56,8 @@ }; modules = [ ./host/c2 - mod.common.to_mod - mod.pc-common.to_mod - nixos-config-hidden.nixosModules.pc + ./host + ./mod overlays ]; }; @@ -80,7 +77,8 @@ }; imports = [ ./host/roam - mod.common.to_mod + ./host + ./mod overlays ]; }; diff --git a/mod/common/boot.nix b/host/boot.nix similarity index 100% rename from mod/common/boot.nix rename to host/boot.nix diff --git a/host/c2/default.nix b/host/c2/default.nix index 3bcebf1..dbcb773 100644 --- a/host/c2/default.nix +++ b/host/c2/default.nix @@ -7,6 +7,7 @@ common-cpu-intel common-pc-laptop common-pc-laptop-ssd + ../../pc ]; boot.loader.efi.efiSysMountPoint = "/boot/efi"; diff --git a/host/default.nix b/host/default.nix new file mode 100644 index 0000000..e735632 --- /dev/null +++ b/host/default.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + imports = [ + ./boot.nix + ./locale.nix + ./nix.nix + ./shell.nix + ./users.nix + ]; +} diff --git a/mod/common/locale.nix b/host/locale.nix similarity index 100% rename from mod/common/locale.nix rename to host/locale.nix diff --git a/mod/common/nix.nix b/host/nix.nix similarity index 100% rename from mod/common/nix.nix rename to host/nix.nix diff --git a/host/roam/default.nix b/host/roam/default.nix index 13168c7..6de3ba0 100644 --- a/host/roam/default.nix +++ b/host/roam/default.nix @@ -1,11 +1,14 @@ { lib', ... }: -let - submodules = lib'.walk-dir ./.; -in { networking.hostName = "roam"; - imports = [ submodules.to_mod_without_default ]; + imports = [ + ./hardware-configuration.nix + ./networking.nix + ./secruity.nix + ./services.nix + ./wireguard.nix + ]; # ====== DON'T CHANGE ====== system.stateVersion = "24.11"; diff --git a/host/roam/modules/networking.nix b/host/roam/networking.nix similarity index 100% rename from host/roam/modules/networking.nix rename to host/roam/networking.nix diff --git a/host/roam/modules/security.nix b/host/roam/security.nix similarity index 100% rename from host/roam/modules/security.nix rename to host/roam/security.nix diff --git a/host/roam/modules/services.nix b/host/roam/services.nix similarity index 100% rename from host/roam/modules/services.nix rename to host/roam/services.nix diff --git a/host/roam/modules/wireguard.nix b/host/roam/wireguard.nix similarity index 100% rename from host/roam/modules/wireguard.nix rename to host/roam/wireguard.nix diff --git a/mod/common/shell.nix b/host/shell.nix similarity index 100% rename from mod/common/shell.nix rename to host/shell.nix diff --git a/host/solo/default.nix b/host/solo/default.nix index 25779da..ff1d737 100644 --- a/host/solo/default.nix +++ b/host/solo/default.nix @@ -1,11 +1,13 @@ -{ lib', ... }: -let - submodules = lib'.walk-dir ./.; -in +{ ... }: { networking.hostName = "solo"; - imports = [ submodules.to_mod_without_default ]; + imports = [ + ./hardware-configuration.nix + ./keyboard.nix + ./nvidia-gpu.nix + ../../pc + ]; powerManagement = { enable = true; diff --git a/mod/common/users.nix b/host/users.nix similarity index 100% rename from mod/common/users.nix rename to host/users.nix diff --git a/mod/default.nix b/mod/default.nix new file mode 100644 index 0000000..c915eb0 --- /dev/null +++ b/mod/default.nix @@ -0,0 +1 @@ +{ ... }: { } diff --git a/mod/pc-common/audio.nix b/pc/audio.nix similarity index 100% rename from mod/pc-common/audio.nix rename to pc/audio.nix diff --git a/pc/default.nix b/pc/default.nix new file mode 100644 index 0000000..38110fa --- /dev/null +++ b/pc/default.nix @@ -0,0 +1,21 @@ +{ + inputs, + lib, + config, + ... +}: +{ + imports = [ + ./audio.nix + ./fonts.nix + ./gpg.nix + ./home-manager.nix + ./network.nix + ./nix.nix + ./security.nix + ./services.nix + ./software + ./sync.nix + inputs.nixos-config-hidden.nixosModules.pc + ]; +} diff --git a/mod/pc-common/fonts.nix b/pc/fonts.nix similarity index 100% rename from mod/pc-common/fonts.nix rename to pc/fonts.nix diff --git a/mod/pc-common/gpg.nix b/pc/gpg.nix similarity index 100% rename from mod/pc-common/gpg.nix rename to pc/gpg.nix diff --git a/mod/pc-common/home-manager.nix b/pc/home-manager.nix similarity index 75% rename from mod/pc-common/home-manager.nix rename to pc/home-manager.nix index 4459f64..701a188 100644 --- a/mod/pc-common/home-manager.nix +++ b/pc/home-manager.nix @@ -6,6 +6,12 @@ ... }: { + options.home = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + default = { }; + description = "home-manager configuration."; + }; + imports = [ inputs.home-manager.nixosModules.home-manager { @@ -20,11 +26,4 @@ config = { home.home.stateVersion = config.system.stateVersion; }; - - options = { - home = lib.mkOption { - type = lib.types.attrs; - default = { }; - }; - }; } diff --git a/mod/pc-common/network.nix b/pc/network.nix similarity index 93% rename from mod/pc-common/network.nix rename to pc/network.nix index 3fbaa26..e1a919e 100644 --- a/mod/pc-common/network.nix +++ b/pc/network.nix @@ -9,10 +9,6 @@ systemd.network.wait-online.enable = false; services = { - tailscale = { - enable = true; - useRoutingFeatures = "client"; - }; mullvad-vpn.enable = true; blueman.enable = true; resolved = { @@ -41,10 +37,6 @@ }; }; - firewall = { - allowedUDPPorts = [ 51820 ]; - }; - networkmanager = { enable = true; wifi.macAddress = "random"; diff --git a/mod/pc-common/nix.nix b/pc/nix.nix similarity index 100% rename from mod/pc-common/nix.nix rename to pc/nix.nix diff --git a/mod/pc-common/security.nix b/pc/security.nix similarity index 100% rename from mod/pc-common/security.nix rename to pc/security.nix diff --git a/mod/pc-common/services.nix b/pc/services.nix similarity index 100% rename from mod/pc-common/services.nix rename to pc/services.nix diff --git a/pc/software/default.nix b/pc/software/default.nix new file mode 100644 index 0000000..652ceea --- /dev/null +++ b/pc/software/default.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + imports = [ + ./development.nix + ./editors.nix + ./programs.nix + ./window-manager.nix + ]; +} diff --git a/mod/pc-common/software/development.nix b/pc/software/development.nix similarity index 100% rename from mod/pc-common/software/development.nix rename to pc/software/development.nix diff --git a/mod/pc-common/software/editors.nix b/pc/software/editors.nix similarity index 100% rename from mod/pc-common/software/editors.nix rename to pc/software/editors.nix diff --git a/mod/pc-common/software/programs.nix b/pc/software/programs.nix similarity index 100% rename from mod/pc-common/software/programs.nix rename to pc/software/programs.nix diff --git a/mod/pc-common/software/window-manager.nix b/pc/software/window-manager.nix similarity index 100% rename from mod/pc-common/software/window-manager.nix rename to pc/software/window-manager.nix diff --git a/mod/pc-common/sync.nix b/pc/sync.nix similarity index 91% rename from mod/pc-common/sync.nix rename to pc/sync.nix index 365fb0e..4e93e05 100644 --- a/mod/pc-common/sync.nix +++ b/pc/sync.nix @@ -2,7 +2,6 @@ { home.services.unison = { enable = true; - package = pkgs.unison; pairs = { "docs".roots = [ "/home/hd/Documents"