mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore: vastly expand notes about nixos
This commit is contained in:
5
snippets/nixos/commands.fish
Normal file
5
snippets/nixos/commands.fish
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
nix-env -i --attr 'nixos.kubectl' 'nixos.k9s' 'nixos.helm'
|
||||
|
||||
sudo nixos-rebuild switch
|
||||
77
snippets/nixos/configuration.nix
Normal file
77
snippets/nixos/configuration.nix
Normal 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
11
snippets/nixos/k3s.nix
Normal 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
11
snippets/nixos/kde.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
desktopManager.plasma5.enable = true;
|
||||
xkb = {
|
||||
layout = "it";
|
||||
variant = "";
|
||||
};
|
||||
};
|
||||
services.displayManager.sddm.enable = true;
|
||||
}
|
||||
Reference in New Issue
Block a user