add generators and clean up directories

This commit is contained in:
Noah Masur
2025-03-14 00:13:56 +00:00
parent bdf163a50a
commit a3ad019f4b
11 changed files with 145 additions and 115 deletions

View File

@ -14,17 +14,16 @@ in
config = lib.mkIf cfg.enable {
# AWS settings require this
permitRootLogin = "prohibit-password";
nmasur.presets.services.openssh-aws.enable = lib.mkDefault true;
# Make sure disk size is large enough
# https://github.com/nix-community/nixos-generators/issues/150
amazonImage.sizeMB = 16 * 1024;
virtualisation.diskSize = lib.mkDefault (16 * 1024); # In MB
boot.kernelPackages = pkgs.legacyPackages.x86_64-linux.linuxKernel.packages.linux_6_6;
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.loader.efi.canTouchEfiVariables = lib.mkForce false;
services.amazon-ssm-agent.enable = true;
boot.kernelPackages = lib.mkDefault pkgs.linuxKernel.packages.linux_6_6;
boot.loader.systemd-boot.enable = false;
boot.loader.efi.canTouchEfiVariables = false;
services.amazon-ssm-agent.enable = lib.mkDefault true;
users.users.ssm-user.extraGroups = [ "wheel" ];
};

View File

@ -1,9 +0,0 @@
{ lib, ... }:
{
imports = lib.pipe (lib.filesystem.listFilesRecursive ./.) [
# Get only files ending in .nix
(builtins.filter (name: lib.hasSuffix ".nix" name))
# Remove this file
(builtins.filter (name: name != ./default.nix))
];
}

View File

@ -1,9 +0,0 @@
{ lib, ... }:
{
imports = lib.pipe (lib.filesystem.listFilesRecursive ./.) [
# Get only files ending in .nix
(builtins.filter (name: lib.hasSuffix ".nix" name))
# Remove this file
(builtins.filter (name: name != ./default.nix))
];
}

View File

@ -1,9 +0,0 @@
{ lib, ... }:
{
imports = lib.pipe (lib.filesystem.listFilesRecursive ./.) [
# Get only files ending in .nix
(builtins.filter (name: lib.hasSuffix ".nix" name))
# Remove this file
(builtins.filter (name: name != ./default.nix))
];
}

View File

@ -1,9 +0,0 @@
{ lib, ... }:
{
imports = lib.pipe (lib.filesystem.listFilesRecursive ./.) [
# Get only files ending in .nix
(builtins.filter (name: lib.hasSuffix ".nix" name))
# Remove this file
(builtins.filter (name: name != ./default.nix))
];
}

View File

@ -0,0 +1,27 @@
# SSHD settings for AWS machines
{
config,
lib,
...
}:
let
cfg = config.nmasur.presets.services.openssh-aws;
in
{
options.nmasur.presets.services.openssh-aws = {
enable = lib.mkEnableOption "OpenSSH on AWS VMs";
};
config = lib.mkIf cfg.enable {
services.openssh = {
settings = {
# AWS settings require this
PermitRootLogin = lib.mkForce "prohibit-password";
};
};
};
}

View File

@ -52,19 +52,6 @@ in
pkgs.curl
];
# Include home-manager config in NixOS
home-manager = {
sharedModules = [ ../../../../home-manager ];
# Use the system-level nixpkgs instead of Home Manager's
useGlobalPkgs = lib.mkDefault true;
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
# using multiple profiles for one user
useUserPackages = lib.mkDefault true;
};
# Extending time for home-manager build for things like nix-index cache
systemd.services."home-manager-${username}" = {
serviceConfig.TimeoutStartSec = lib.mkForce "45m";