Move server configs into a reusable module
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
in {
|
||||
nixosModules = {
|
||||
common = import ./modules/common.nix;
|
||||
server = import ./modules/server.nix;
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
|
@@ -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";
|
||||
|
@@ -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,29 +36,6 @@
|
||||
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";
|
||||
|
@@ -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;
|
||||
@@ -25,5 +32,10 @@
|
||||
'';
|
||||
};
|
||||
|
||||
services.zerotierone = {
|
||||
enable = true;
|
||||
joinNetworks = secrets.zerotier.networks;
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.git-crypt ];
|
||||
}
|
||||
|
14
modules/server.nix
Normal file
14
modules/server.nix
Normal file
@@ -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;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user