initial commit

This commit is contained in:
cswimr 2024-11-16 13:38:09 -05:00
commit 53dc0a539d
13 changed files with 701 additions and 0 deletions

118
nixos/configuration.nix Executable file
View file

@ -0,0 +1,118 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{
nix = {
settings.experimental-features = [ "nix-command" "flakes" ];
};
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "eclipse"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/New_York";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.cswimr = {
isNormalUser = true;
description = "Seaswimmer";
extraGroups = [ "networkmanager" "wheel" ];
# packages = with pkgs; []; use home-manager instead!
};
# Install firefox.
programs.firefox.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}

View file

@ -0,0 +1,48 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
"sr_mod"
"rtsx_usb_sdmmc"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/f65ec459-c974-4032-8224-fa78c57527c2";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/484E-279A";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[{ device = "/dev/disk/by-uuid/4eab8c8f-85c5-4a04-a03c-e111ada06ec0"; }];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

9
nixos/environment.nix Normal file
View file

@ -0,0 +1,9 @@
{ lib, ... }: {
environment.variables = {
EDITOR = lib.mkDefault (if builtins.hasAttr "SSH_CONNECTION"
builtins.currentSystemEnvironment then
"nvim"
else
"code");
};
}

22
nixos/git.nix Executable file
View file

@ -0,0 +1,22 @@
{
programs.git = {
config = {
init = { defaultBranch = "master"; };
safe = { directory = "/etc/nixos"; };
url = {
"https://www.coastalcommits.com/" = {
insteadOf = [
"cc:"
"coastalcommits:"
];
};
"https://github.com/" = {
insteadOf = [
"gh:"
"github:"
];
};
};
};
};
}

37
nixos/nvidia.nix Executable file
View file

@ -0,0 +1,37 @@
{ config, ... }: {
# Enable OpenGL
hardware.graphics = { enable = true; };
# Load nvidia driver for Xorg / Wayland
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have grapihcal corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
open = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
}

12
nixos/nvim.nix Executable file
View file

@ -0,0 +1,12 @@
{ pkgs, ... }: {
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [ neovim ];
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
}

66
nixos/pkg.nix Executable file
View file

@ -0,0 +1,66 @@
{ pkgs, ... }: {
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
wget
curl
git
(nnn.override { withNerdIcons = true; })
fzf
ripgrep
fastfetch
zip
xz
unzip
jq
yq-go
eza
dnsutils
nmap
which
tree
gnupg
nix-output-monitor
glow
btop
strace
ltrace
lsof
sysstat
lm_sensors
ethtool
pciutils
usbutils
nil
lazygit
lazydocker
bat
nixfmt
# python stuff 🐍
uv
python313
python312
python311
# javascript stuff 🤮
nodejs
corepack
# catppuccin
(catppuccin-kde.override {
flavour = [ "mocha" "macchiato" "frappe" "latte" ];
accents = [ "blue" ];
winDecStyles = [ "classic" ];
})
];
fonts.packages = with pkgs;
[ (nerdfonts.override { fonts = [ "FiraCode" ]; }) ];
# install docker
virtualisation.docker = { enable = true; };
# remove nano
programs.nano.enable = false;
}

9
nixos/sudo.nix Executable file
View file

@ -0,0 +1,9 @@
{
security.sudo.extraRules = [{
users = [ "cswimr" ];
commands = [{
command = "ALL";
options = [ "SETENV" "NOPASSWD" ];
}];
}];
}

7
nixos/tailscale.nix Executable file
View file

@ -0,0 +1,7 @@
{
services.tailscale = {
enable = true;
authKeyFile = "/run/secrets/tailscale_key";
extraUpFlags = [ "--ssh" ];
};
}

49
nixos/zsh.nix Executable file
View file

@ -0,0 +1,49 @@
{ pkgs, ... }: {
# starship - an customizable prompt for any shell
#programs.starship = {
#enable = true;
# custom settings
#settings = {
#format = "$all$nix_shell$python$nodejs$lua$golang$rust$php$git_branch$git_commit$git_state$git_status\n$username$hostname$directory";
#add_newline = true;
#aws.disabled = true;
#gcloud.disabled = true;
#line_break.disabled = true;
#};
#};
users.defaultUserShell = pkgs.zsh;
programs.zsh = {
enable = true;
enableCompletion = true;
enableBashCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
shellInit = ''
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
'';
histSize = 10000;
histFile = "$HOME/.zsh_history";
ohMyZsh = {
enable = true;
theme = "agnoster";
};
shellAliases = {
ff = "fastfetch";
neofetch = "fastfetch";
nf = "fastfetch";
ls = "eza --icons";
l = "eza -lhg --icons";
upd = "sudo nixos-rebuild switch";
c = "clear";
# alias sudo to itself so user aliases can be sudoed
sudo = "sudo ";
s = "sudo ";
};
};
}