diff --git a/flake.nix b/flake.nix index fd5a246..a653908 100644 --- a/flake.nix +++ b/flake.nix @@ -34,8 +34,8 @@ let constants = import ./lib/constants.nix; user = constants.user; - darwinHosts = builtins.attrNames (builtins.readDir ./hosts/darwin); - nixosHosts = builtins.attrNames (builtins.readDir ./hosts/nixos); + darwinHosts = ["chidi" "jason"]; + nixosHosts = ["tahani"]; overlays = import ./overlays {inherit inputs;}; in { systems = [ @@ -68,7 +68,7 @@ mutableTaps = true; }; } - ./hosts/darwin/${hostname} + ./hosts/${hostname} ]; } ); @@ -87,7 +87,7 @@ { nixpkgs.overlays = overlays; } - ./hosts/nixos/${hostname} + ./hosts/${hostname} ]; } ); diff --git a/hosts/darwin/chidi/default.nix b/hosts/chidi/default.nix similarity index 94% rename from hosts/darwin/chidi/default.nix rename to hosts/chidi/default.nix index c89e559..348a668 100644 --- a/hosts/darwin/chidi/default.nix +++ b/hosts/chidi/default.nix @@ -4,7 +4,7 @@ ... }: { imports = [ - ../shared.nix + ../../modules/darwin ]; networking.hostName = "chidi"; diff --git a/hosts/darwin/shared.nix b/hosts/darwin/shared.nix deleted file mode 100644 index ad82181..0000000 --- a/hosts/darwin/shared.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ../../modules/darwin - ]; -} diff --git a/hosts/darwin/jason/default.nix b/hosts/jason/default.nix similarity index 93% rename from hosts/darwin/jason/default.nix rename to hosts/jason/default.nix index f7a7189..4cc7123 100644 --- a/hosts/darwin/jason/default.nix +++ b/hosts/jason/default.nix @@ -1,6 +1,6 @@ {user, ...}: { imports = [ - ../shared.nix + ../../modules/darwin ]; networking.hostName = "jason"; diff --git a/hosts/nixos/tahani/default.nix b/hosts/tahani/default.nix similarity index 56% rename from hosts/nixos/tahani/default.nix rename to hosts/tahani/default.nix index 136515b..f2a775a 100644 --- a/hosts/nixos/tahani/default.nix +++ b/hosts/tahani/default.nix @@ -1,12 +1,45 @@ { + config, hostname, user, ... }: { imports = [ - ../../../modules/nixos + ../../modules/nixos ]; + services.adguardhome = { + enable = true; + port = 10000; + settings = { + dns = { + upstream_dns = [ + "1.1.1.1" + "1.0.0.1" + ]; + }; + filtering = { + protection_enabled = true; + filtering_enabled = true; + safe_search = { + enabled = false; + }; + }; + }; + }; + + virtualisation.docker = { + enable = true; + }; + + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "yes"; + PasswordAuthentication = false; + }; + }; + fileSystems."/" = { device = "/dev/disk/by-label/NIXROOT"; fsType = "ext4"; @@ -28,17 +61,24 @@ ]; defaultGateway = "192.168.1.1"; nameservers = ["1.1.1.1"]; + firewall = { + enable = true; + trustedInterfaces = ["eno1" "tailscale0"]; + allowedUDPPorts = [config.services.tailscale.port]; + allowedTCPPorts = [22]; + checkReversePath = "loose"; + }; }; sops.secrets = { tahani-syncthing-cert = { - sopsFile = ../../../secrets/tahani-syncthing-cert; + sopsFile = ../../secrets/tahani-syncthing-cert; format = "binary"; owner = user; path = "/home/${user}/.config/syncthing/cert.pem"; }; tahani-syncthing-key = { - sopsFile = ../../../secrets/tahani-syncthing-key; + sopsFile = ../../secrets/tahani-syncthing-key; format = "binary"; owner = user; path = "/home/${user}/.config/syncthing/key.pem"; diff --git a/modules/nixos/adguard.nix b/modules/nixos/adguard.nix deleted file mode 100644 index 138866f..0000000 --- a/modules/nixos/adguard.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - services.adguardhome = { - enable = true; - port = 10000; - settings = { - dns = { - upstream_dns = [ - "1.1.1.1" - "1.0.0.1" - ]; - }; - filtering = { - protection_enabled = true; - filtering_enabled = true; - safe_search = { - enabled = false; - }; - }; - }; - }; -} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 55abe07..f6bad57 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -10,10 +10,6 @@ ../core.nix ../syncthing.nix ../tailscale.nix - ./adguard.nix - ./docker.nix - ./firewall.nix - ./ssh.nix sops-nix.nixosModules.sops ]; diff --git a/modules/nixos/docker.nix b/modules/nixos/docker.nix deleted file mode 100644 index a0f86ac..0000000 --- a/modules/nixos/docker.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - virtualisation.docker = { - enable = true; - }; -} diff --git a/modules/nixos/firewall.nix b/modules/nixos/firewall.nix deleted file mode 100644 index 1ee64cd..0000000 --- a/modules/nixos/firewall.nix +++ /dev/null @@ -1,9 +0,0 @@ -{config, ...}: { - networking.firewall = { - enable = true; - trustedInterfaces = ["eno1" "tailscale0"]; - allowedUDPPorts = [config.services.tailscale.port]; - allowedTCPPorts = [22]; - checkReversePath = "loose"; - }; -} diff --git a/modules/nixos/ssh.nix b/modules/nixos/ssh.nix deleted file mode 100644 index aae2c60..0000000 --- a/modules/nixos/ssh.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - services.openssh = { - enable = true; - settings = { - PermitRootLogin = "yes"; - PasswordAuthentication = false; - }; - }; -}