feat: add base configuration and hardware-config files
This commit is contained in:
125
configuration.nix
Normal file
125
configuration.nix
Normal file
@@ -0,0 +1,125 @@
|
||||
# 0x29a nixos conifg
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.kernelParams = [
|
||||
"quiet"
|
||||
"console.ttyS0,115200n8" # allow terminals on serial console
|
||||
];
|
||||
|
||||
# boot eye candy
|
||||
boot.initrd.systemd.enable = true;
|
||||
boot.plymouth.enable = true;
|
||||
boot.plymouth.theme = "spinner";
|
||||
|
||||
# use latest kernel
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# guest agent for proxmox
|
||||
services.qemuGuest.enable = true;
|
||||
|
||||
# networking
|
||||
networking.hostName = "nixos";
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# time zone.
|
||||
time.timeZone = "Europe/Amsterdam";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "de_CH-latin1";
|
||||
};
|
||||
|
||||
|
||||
# xserver config
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
xkb.layout = "ch";
|
||||
xkb.options = "eurosign:e,caps:escape";
|
||||
windowManager.i3 = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
dmenu
|
||||
i3status
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# window manager configs
|
||||
services.displayManager.defaultSession = "none+i3";
|
||||
programs.i3lock.enable = true;
|
||||
environment.pathsToLink = [ "/libexec" ];
|
||||
|
||||
# enable sound
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# define a user account
|
||||
users.users.aaron = {
|
||||
isNormalUser = true;
|
||||
group = "users";
|
||||
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||||
shell = pkgs.zsh;
|
||||
packages = with pkgs; [
|
||||
tree
|
||||
fastfetch
|
||||
];
|
||||
};
|
||||
|
||||
# browser
|
||||
programs.firefox.enable = true;
|
||||
|
||||
# zsh config
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestions.enable = true;
|
||||
ohMyZsh = {
|
||||
enable = true;
|
||||
plugins = [ "git" "sudo" "python" "ansible" ];
|
||||
theme = "agnoster";
|
||||
};
|
||||
};
|
||||
|
||||
# system packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
neovim
|
||||
git
|
||||
ghostty
|
||||
kitty
|
||||
wget
|
||||
gnupg
|
||||
];
|
||||
|
||||
# Some programs need SUID wrappers
|
||||
programs.mtr.enable = true;
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
# enable the OpenSSH daemon
|
||||
services.openssh.enable = true;
|
||||
|
||||
# firewall configs
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
|
||||
# install state version
|
||||
system.stateVersion = "25.05"; # Don't change
|
||||
}
|
||||
|
||||
40
hardware-configuration.nix
Normal file
40
hardware-configuration.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
# 0x29a nixos hardware configuration
|
||||
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
# boot and initrd configs
|
||||
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" "cryptd" ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/nixcrypt";
|
||||
|
||||
# file systems
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-label/nixroot";
|
||||
fsType = "ext4";
|
||||
};
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-label/nixboot";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
fileSystems."/home" =
|
||||
{ device = "/dev/disk/by-label/nixhome";
|
||||
fsType = "ext4";
|
||||
};
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-label/nixswap"; }
|
||||
];
|
||||
|
||||
# enable dhcp on all interfaces
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
# set host arch
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
Reference in New Issue
Block a user