added stuff
This commit is contained in:
parent
e8d9044d2b
commit
9d0ebdfbd0
907 changed files with 70990 additions and 0 deletions
7
nyx/modules/core/roles/microvm/system/default.nix
Normal file
7
nyx/modules/core/roles/microvm/system/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
./nix
|
||||
./os
|
||||
./securiy
|
||||
];
|
||||
}
|
12
nyx/modules/core/roles/microvm/system/nix/default.nix
Normal file
12
nyx/modules/core/roles/microvm/system/nix/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{pkgs, ...}: {
|
||||
nix = {
|
||||
settings.trusted-users = ["admin"];
|
||||
package = pkgs.nixUnstable;
|
||||
keep-outputs = true;
|
||||
keep-derivations = true;
|
||||
extra-experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
};
|
||||
}
|
9
nyx/modules/core/roles/microvm/system/os/default.nix
Normal file
9
nyx/modules/core/roles/microvm/system/os/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
imports = [
|
||||
./programs
|
||||
./users
|
||||
|
||||
./environment.nix
|
||||
./networking.nix
|
||||
];
|
||||
}
|
31
nyx/modules/core/roles/microvm/system/os/environment.nix
Normal file
31
nyx/modules/core/roles/microvm/system/os/environment.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{pkgs, ...}: {
|
||||
time.timeZone = "UTC";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
console = {
|
||||
font = "ter-v32n";
|
||||
packages = [pkgs.terminus-font];
|
||||
};
|
||||
|
||||
environment = {
|
||||
shells = with pkgs; [bash zsh];
|
||||
systemPackages = with pkgs; [
|
||||
vim
|
||||
git
|
||||
killall
|
||||
bind.dnsutils
|
||||
tcpdump
|
||||
nmap
|
||||
usbutils
|
||||
wget
|
||||
tmux
|
||||
direnv
|
||||
nix-direnv
|
||||
sops
|
||||
rage
|
||||
ssh-to-age
|
||||
pwgen
|
||||
w3m
|
||||
];
|
||||
};
|
||||
}
|
17
nyx/modules/core/roles/microvm/system/os/networking.nix
Normal file
17
nyx/modules/core/roles/microvm/system/os/networking.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{lib, ...}: {
|
||||
systemd.network.enable = true;
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh.enable = true;
|
||||
|
||||
networking = {
|
||||
useDHCP = false;
|
||||
networkmanager.enable = false;
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowPing = lib.mkForce false;
|
||||
allowedTCPPorts = lib.mkForce [];
|
||||
allowedUDPPorts = lib.mkForce [];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
imports = [
|
||||
./git.nix
|
||||
./neovim.nix
|
||||
./tmux.nix
|
||||
./zsh.nix
|
||||
];
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{programs.git.enable = true;}
|
23
nyx/modules/core/roles/microvm/system/os/programs/neovim.nix
Normal file
23
nyx/modules/core/roles/microvm/system/os/programs/neovim.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
configure.customRC = ''
|
||||
syntax enable
|
||||
|
||||
set noexpandtab
|
||||
set shiftwidth=2
|
||||
set tabstop=2
|
||||
|
||||
set cindent
|
||||
set smartindent
|
||||
set autoindent
|
||||
set foldmethod=syntax
|
||||
nmap <F2> zA
|
||||
nmap <F3> zR
|
||||
nmap <F4> zM
|
||||
'';
|
||||
};
|
||||
}
|
20
nyx/modules/core/roles/microvm/system/os/programs/tmux.nix
Normal file
20
nyx/modules/core/roles/microvm/system/os/programs/tmux.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
baseIndex = 1;
|
||||
clock24 = true;
|
||||
historyLimit = 10000;
|
||||
terminal = "tmux-256color";
|
||||
extraConfig = ''
|
||||
unbind C-b
|
||||
set-option -g prefix C-a
|
||||
bind-key C-a last-window
|
||||
set-option -g set-titles on
|
||||
set-option -g set-titles-string '#H:#S.#I.#P #W #T'
|
||||
setw -g monitor-activity on
|
||||
set-option -g status-justify left
|
||||
set-option -g status-bg yellow
|
||||
set-option -g status-fg black
|
||||
'';
|
||||
};
|
||||
}
|
11
nyx/modules/core/roles/microvm/system/os/programs/zsh.nix
Normal file
11
nyx/modules/core/roles/microvm/system/os/programs/zsh.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
environment.pathsToLink = ["/share/zsh"];
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestions = {
|
||||
enable = true;
|
||||
async = true;
|
||||
};
|
||||
};
|
||||
}
|
7
nyx/modules/core/roles/microvm/system/os/users/admin.nix
Normal file
7
nyx/modules/core/roles/microvm/system/os/users/admin.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
users.users.admin = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel"];
|
||||
openssh.authorizedKeys.keys = [];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./admin.nix
|
||||
];
|
||||
}
|
13
nyx/modules/core/roles/microvm/system/security/default.nix
Normal file
13
nyx/modules/core/roles/microvm/system/security/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = ["admin"];
|
||||
commands = [
|
||||
{
|
||||
command = "ALL";
|
||||
options = ["SETENV" "NOPASSWD"];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue