diff --git a/flake.nix b/flake.nix index eb9c0dd..6f52bbf 100755 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,7 @@ in { nixosModules = { common = import ./modules/common.nix; + server = import ./modules/server.nix; }; nixosConfigurations = { diff --git a/hosts/marauder/default.nix b/hosts/marauder/default.nix index e73fda4..0f9ddbf 100755 --- a/hosts/marauder/default.nix +++ b/hosts/marauder/default.nix @@ -56,13 +56,6 @@ }; }; - users.users = { - nettika = { - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" ]; - }; - }; - environment.systemPackages = with pkgs; [ # Chat clients discord @@ -127,11 +120,6 @@ enable = true; }; - services.zerotierone = { - enable = true; - joinNetworks = secrets.zerotier.networks; - }; - time.timeZone = "America/Los_Angeles"; system.stateVersion = "24.05"; diff --git a/hosts/monolith/default.nix b/hosts/monolith/default.nix index 6927870..36c0f47 100755 --- a/hosts/monolith/default.nix +++ b/hosts/monolith/default.nix @@ -1,10 +1,13 @@ -{ self, pkgs, secrets, ... }: { - imports = [ self.nixosModules.common ]; +{ self, pkgs, secrets, ... }: +{ + imports = [ + self.nixosModules.common + self.nixosModules.server + ]; networking = { hostName = "monolith"; hostId = "44551c32"; - networkmanager.enable = true; }; fileSystems = { @@ -33,30 +36,7 @@ supportedFilesystems = [ "zfs" ]; }; - users.users = { - nettika = { - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHopty1QG8P+OfGxQ9CV0BI1IRB/q6yITzMZaZ6Zspid nettika@marauder" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM8s5w9uAFMguVbbAamI7pKysgeLTwULXAVn5F0UDVl2 nettika@pixeltablet" - ]; - }; - }; - - services.openssh = { - enable = true; - settings.PasswordAuthentication = false; - }; - - services.zerotierone = { - enable = true; - joinNetworks = secrets.zerotier.networks; - }; - - security.sudo.wheelNeedsPassword = false; - time.timeZone = "America/Los_Angeles"; - + system.stateVersion = "24.05"; } diff --git a/modules/common.nix b/modules/common.nix index 5971561..7347852 100755 --- a/modules/common.nix +++ b/modules/common.nix @@ -1,9 +1,16 @@ -{ pkgs, ... }: +{ pkgs, secrets, ... }: { nixpkgs.config.allowUnfree = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; + users.users.nettika = { + isNormalUser = true; + extraGroups = [ "wheel" "networkmanager" ]; + }; + + security.sudo.wheelNeedsPassword = false; + programs.git = { enable = true; lfs.enable = true; @@ -16,7 +23,7 @@ credential.helper = "store"; }; }; - + programs.nano = { enable = true; nanorc = '' @@ -24,6 +31,11 @@ set linenumbers ''; }; - + + services.zerotierone = { + enable = true; + joinNetworks = secrets.zerotier.networks; + }; + environment.systemPackages = [ pkgs.git-crypt ]; } diff --git a/modules/server.nix b/modules/server.nix new file mode 100644 index 0000000..e7ca1e5 --- /dev/null +++ b/modules/server.nix @@ -0,0 +1,14 @@ +{ ... }: +{ + networking.networkmanager.enable = true; + + users.users.nettika.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHopty1QG8P+OfGxQ9CV0BI1IRB/q6yITzMZaZ6Zspid nettika@marauder" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM8s5w9uAFMguVbbAamI7pKysgeLTwULXAVn5F0UDVl2 nettika@pixeltablet" + ]; + + services.openssh = { + enable = true; + settings.PasswordAuthentication = false; + }; +}