add ssh to modules, export networking from blarm
This commit is contained in:
parent
cdf4b472ca
commit
56a64c1e0e
4 changed files with 86 additions and 40 deletions
|
@ -11,7 +11,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.${namespace}.apps.thunderbird = with types; {
|
options.${namespace}.apps.thunderbird = with types; {
|
||||||
enable = mkBoolOpt false "Whether or not to enable Firefox.";
|
enable = mkBoolOpt false "Whether or not to enable Thunderbird.";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
36
modules/nixos/services/ssh/default.nix
Normal file
36
modules/nixos/services/ssh/default.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
namespace,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
with lib.${namespace};
|
||||||
|
let
|
||||||
|
cfg = config.${namespace}.services.ssh;
|
||||||
|
defaultKeys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDwUGxdwTgjc61VNh7QNfrrZwz5yHkJ6AGsRsgoDV3a4 mobile"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJqbT8AdnS++ZoL7TYg2skQUvfWx29Iq+mEYv2Ok2QHb arbeit"
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.${namespace}.services.ssh = {
|
||||||
|
enable = mkBoolOpt false "OpenSSH";
|
||||||
|
keys = mkOption {
|
||||||
|
description = "Extra keys to add to config.";
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = defaultKeys;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# Enable the OpenSSH daemon.
|
||||||
|
services.openssh = enabled;
|
||||||
|
|
||||||
|
users.users.philipp.openssh.authorizedKeys = {
|
||||||
|
inherit (cfg)
|
||||||
|
keys;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
|
@ -10,6 +10,7 @@ with lib.${namespace};
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
|
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
|
||||||
|
./networking.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
|
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
|
||||||
|
@ -17,37 +18,6 @@ with lib.${namespace};
|
||||||
# Enables the generation of /boot/extlinux/extlinux.conf
|
# Enables the generation of /boot/extlinux/extlinux.conf
|
||||||
boot.loader.generic-extlinux-compatible.enable = true;
|
boot.loader.generic-extlinux-compatible.enable = true;
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "blarm";
|
|
||||||
firewall.enable = false;
|
|
||||||
networkmanager.enable = false;
|
|
||||||
dhcpcd.enable = true;
|
|
||||||
defaultGateway.address = "192.168.1.1";
|
|
||||||
interfaces.end0 = {
|
|
||||||
useDHCP = true;
|
|
||||||
ipv4.addresses = [
|
|
||||||
{
|
|
||||||
address = "192.168.1.251";
|
|
||||||
prefixLength = 32;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
address = "192.168.1.202";
|
|
||||||
prefixLength = 32;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
ipv6.addresses = [
|
|
||||||
{
|
|
||||||
address = "fd00:192:168:1::202";
|
|
||||||
prefixLength = 64;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
address = "fd00:192:168:1::251";
|
|
||||||
prefixLength = 64;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nix.settings.experimental-features = [
|
nix.settings.experimental-features = [
|
||||||
"nix-command"
|
"nix-command"
|
||||||
"flakes"
|
"flakes"
|
||||||
|
@ -83,15 +53,22 @@ with lib.${namespace};
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
|
||||||
services.openssh = enabled;
|
|
||||||
|
|
||||||
awesome-flake.services.caddy = enabled;
|
awesome-flake = {
|
||||||
awesome-flake.container.technitium = enabled;
|
services = {
|
||||||
awesome-flake.container.invidious = enabled;
|
ssh = enabled;
|
||||||
awesome-flake.cli.neovim = enabled;
|
caddy = enabled;
|
||||||
awesome-flake.services.restic = enabled;
|
restic = enabled;
|
||||||
awesome-flake.system.sops = enabled;
|
};
|
||||||
|
|
||||||
|
container = {
|
||||||
|
technitium = enabled;
|
||||||
|
invidious = enabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
system.sops = enabled;
|
||||||
|
cli.neovim = enabled;
|
||||||
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
git
|
git
|
||||||
|
|
33
systems/aarch64-linux/blarm/networking.nix
Normal file
33
systems/aarch64-linux/blarm/networking.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
networking = {
|
||||||
|
hostName = "blarm";
|
||||||
|
firewall.enable = false;
|
||||||
|
networkmanager.enable = false;
|
||||||
|
dhcpcd.enable = true;
|
||||||
|
defaultGateway.address = "192.168.1.1";
|
||||||
|
interfaces.end0 = {
|
||||||
|
useDHCP = true;
|
||||||
|
ipv4.addresses = [
|
||||||
|
{
|
||||||
|
address = "192.168.1.251";
|
||||||
|
prefixLength = 32;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
address = "192.168.1.202";
|
||||||
|
prefixLength = 32;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
ipv6.addresses = [
|
||||||
|
{
|
||||||
|
address = "fd00:192:168:1::202";
|
||||||
|
prefixLength = 64;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
address = "fd00:192:168:1::251";
|
||||||
|
prefixLength = 64;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue