chore: vastly expand notes about nixos

This commit is contained in:
Michele Cereda
2024-09-14 23:11:29 +02:00
parent df1d945284
commit 05283b54e7
9 changed files with 392 additions and 12 deletions

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env fish
nix-env -i --attr 'nixos.kubectl' 'nixos.k9s' 'nixos.helm'
sudo nixos-rebuild switch

View File

@@ -0,0 +1,77 @@
# Basic NIX modules.
{ config, pkgs, ... }:
/* Option definitions */
{
system.stateVersion = "23.11";
# Bootloader.
boot.loader.grub = {
enable = true;
device = "/dev/sda";
useOSProber = false;
};
# Localization.
console.keyMap = "us";
time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "nl_NL.UTF-8";
LC_IDENTIFICATION = "nl_NL.UTF-8";
LC_MEASUREMENT = "nl_NL.UTF-8";
LC_MONETARY = "nl_NL.UTF-8";
LC_NAME = "nl_NL.UTF-8";
LC_NUMERIC = "nl_NL.UTF-8";
LC_PAPER = "nl_NL.UTF-8";
LC_TELEPHONE = "nl_NL.UTF-8";
LC_TIME = "nl_NL.UTF-8";
};
# Networking.
networking.hostName = "nixos-vm";
## SSH.
# Automatically opens port 22 in the firewall.
services.openssh.enable = true;
# Package management.
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
git
tmux
vim
];
# SUID wrappers.
programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# Users.
users.users.mike = {
isNormalUser = true;
description = "Mike Wazowski";
extraGroups = [
"networkmanager"
"wheel"
];
packages = with pkgs; [
chezmoi
firefox
kate
lefthook
# thunderbird
vscode
];
};
# Include external configuration files.
imports = [
./hardware-configuration.nix # usually autogenerated by the system
./kde.nix
./k3s.nix
];
}

11
snippets/nixos/k3s.nix Normal file
View File

@@ -0,0 +1,11 @@
{
# Refer https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/cluster/k3s/README.md
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
networking.firewall.enable = false;
services.k3s = {
enable = true;
role = "server";
token = "12345";
clusterInit = true;
};
}

11
snippets/nixos/kde.nix Normal file
View File

@@ -0,0 +1,11 @@
{
services.xserver = {
enable = true;
desktopManager.plasma5.enable = true;
xkb = {
layout = "it";
variant = "";
};
};
services.displayManager.sddm.enable = true;
}