first commit
This commit is contained in:
87
iso/customiso.nix
Normal file
87
iso/customiso.nix
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
pkgs,
|
||||
modulesPath,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
|
||||
];
|
||||
|
||||
# Use the latest Linux kernel
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# Create admin user
|
||||
users.users = {
|
||||
nixos = {
|
||||
isNormalUser = true;
|
||||
description = "Admin account";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
];
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAKMJ3TkEmRQcX7RQijNa2km6a2xXJk6M6FERh7C9nTJ"
|
||||
];
|
||||
};
|
||||
root = {
|
||||
password = null;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAKMJ3TkEmRQcX7RQijNa2km6a2xXJk6M6FERh7C9nTJ"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PermitRootLogin = "prohibit-password";
|
||||
};
|
||||
};
|
||||
|
||||
# Allow sudo from admin user without password
|
||||
security.sudo = {
|
||||
enable = true;
|
||||
extraRules = [
|
||||
{
|
||||
users = [ "nixos" ];
|
||||
host = "ALL";
|
||||
runAs = "ALL:ALL";
|
||||
commands = [
|
||||
{
|
||||
command = "ALL";
|
||||
options = [ "NOPASSWD" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Packages for maintenance mode
|
||||
environment.systemPackages = [
|
||||
pkgs.neovim
|
||||
pkgs.git
|
||||
pkgs.curl
|
||||
pkgs.nixos-anywhere
|
||||
pkgs.nixos-generators
|
||||
];
|
||||
|
||||
# Needed for https://github.com/NixOS/nixpkgs/issues/58959
|
||||
boot.supportedFilesystems = lib.mkForce [
|
||||
"btrfs"
|
||||
"reiserfs"
|
||||
"vfat"
|
||||
"f2fs"
|
||||
"xfs"
|
||||
"ntfs"
|
||||
"cifs"
|
||||
"nfs"
|
||||
];
|
||||
|
||||
environment.etc."xdg/nvim/init.lua" = {
|
||||
source = ./config/nvim/init.lua;
|
||||
mode = "0440";
|
||||
};
|
||||
}
|
||||
|
||||
# Config nvim
|
||||
Reference in New Issue
Block a user