add ssh for server, add vscodium for pc, refactor hostnames

This commit is contained in:
Chris Kruining 2025-03-02 13:54:21 +01:00
parent b06525436b
commit f174b610d8
7 changed files with 55 additions and 8 deletions

View file

@ -2,6 +2,8 @@
{ {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
networking.hostName = "chris-laptop";
modules = { modules = {
themes = { themes = {
enable = true; enable = true;
@ -38,4 +40,3 @@
}; };
}; };
} }

View file

@ -13,6 +13,8 @@
options = [ "rw" "uid=chris" ]; options = [ "rw" "uid=chris" ];
}; };
networking.hostName = "chris-pc";
modules = { modules = {
themes = { themes = {
enable = true; enable = true;
@ -54,6 +56,7 @@
editors = { editors = {
default = "nano"; default = "nano";
vscodium.enable = true;
zed.enable = true; zed.enable = true;
nvim.enable = true; nvim.enable = true;
nano.enable = true; nano.enable = true;
@ -72,4 +75,3 @@
}; };
}; };
} }

View file

@ -7,6 +7,8 @@
fsType = "ext4"; fsType = "ext4";
}; };
networking.hostName = "chris-server";
modules = { modules = {
themes = { themes = {
enable = true; enable = true;
@ -15,6 +17,7 @@
}; };
networking.enable = true; networking.enable = true;
networking.ssh.enable = true;
services = { services = {
enable = true; enable = true;
@ -43,4 +46,3 @@
}; };
}; };
} }

View file

@ -2,6 +2,8 @@
{ {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
networking.hostName = "mam-laptop";
modules = { modules = {
themes = { themes = {
enable = true; enable = true;
@ -37,4 +39,3 @@
}; };
}; };
} }

View file

@ -0,0 +1,18 @@
{ config, options, lib, pkgs, ... }:
let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
cfg = config.modules.desktop.editors.vscodium;
in
{
options.modules.desktop.editors.vscodium = let
inherit (lib.options) mkEnableOption;
in { enable = mkEnableOption "vscodium"; };
config = mkIf cfg.enable {
user.packages = attrValues {
inherit (pkgs) vscodium;
};
};
}

View file

@ -0,0 +1,27 @@
{ config, options, lib, pkgs, ... }:
let
inherit (lib.modules) mkIf;
in
{
options.modules.networking.ssh = let
inherit (lib.options) mkEnableOption;
in {
enable = mkEnableOption "enable ssh";
};
config = mkIf config.modules.networking.ssh.enable {
services.openssh = {
enable = true;
openFirewall = true;
ports = [ 22 ];
settings = {
PassswordAuthentication = true;
AllowUsers = [ "chris", "root" ];
UseDns = true;
UsePAM = true;
PermitRootLogin = "prohibit-password";
PermitEmptyPasswords = "no";
};
};
};
}

View file

@ -1,7 +1,3 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
networking = {
hostName = "chris-pc";
networkmanager.enable = true;
};
} }