dotfiles/hosts/myputer/default.nix

471 lines
11 KiB
Nix
Executable file

{
lib,
pkgs,
pkgs-unstable,
inputs,
config,
...
}: let
home-manager = builtins.fetchTarball {
url = "https://github.com/nix-community/home-manager/archive/release-25.05.tar.gz";
sha256 = "1wl2plp37a8qw26h6cj3ah6rq8bd3awl2938h5cm9b8ncxn4s1k8";
};
in {
imports = [
./hardware-configuration.nix
(import "${home-manager}/nixos")
../modules/wm/hyprland.nix
../modules/steam.nix
../modules/obsidian.nix
../modules/flipperzero.nix
../modules/chameleonultragui.nix
];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfreePredicate = let
whitelist = map lib.getName [
pkgs.obsidian
pkgs.gitkraken
pkgs.steam
pkgs.steamcmd
pkgs.steam-unwrapped
pkgs.dwarf-fortress
];
in
pkg: builtins.elem (lib.getName pkg) whitelist;
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
grub = {
efiSupport = true;
device = "nodev";
# useOSProber = true;
};
# GitHub: vinceliuice/grub2-themes
grub2-theme = {
enable = true;
theme = "whitesur"; # stylish, vimix, or whitesur
footer = true;
# TODO: switch my cables to switch default grub display
customResolution = "3840x2160";
};
};
time.timeZone = "Australia/Brisbane";
i18n.defaultLocale = "en_US.UTF-8"; # internationalisation
# Enable initrd hook for virtual console customisation
# aka cool colours when bootting yay!!
console = {
enable = true;
earlySetup = true; # initrd pre hook
keyMap = "us";
font = "Lat2-Terminus16";
# ANSI 24-bit color definitions (theme: dracula)
colors = [
"21222c"
"ff5555"
"50fa7b"
"f1fa8c"
"bd93f9"
"ff79c6"
"8be9fd"
"f8f8f2"
"6272a4"
"ff6e6e"
"69ff94"
"ffffa5"
"d6acff"
"ff92df"
"a4ffff"
"ffffff"
];
};
# ----- NETWORKING -----
networking = {
hostName = "myputer";
networkmanager.enable = true;
firewall.enable = true;
};
# ----- SERVICES -----
services = {
# Set display manager (login screen)
displayManager = {
# sddm relies on pkgs.libsForQt5.qt5.qtgraphicaleffects
sddm = {
enable = true;
wayland.enable = true; # experimental
theme = "corners";
};
defaultSession =
"hyprland"
+ (
if config.programs.hyprland.withUWSM
then "-uwsm"
else null
);
};
# Multimedia Framework
# With backwards compatability for alsa/pulseaudio/jack
pipewire = {
enable = true;
wireplumber.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
tumbler.enable = true; # Thunar image thumbnail support
gvfs.enable = true; # Thunar mount, trash, and other functionality
};
security.rtkit.enable = true; # I *think* this is for pipewire
# ------- USERS -------
security.sudo.wheelNeedsPassword = false;
users = {
# Using fish as the login shell tends to go very poorly because it isn't
# POSIX compliant, so we default the login shell to Bash instead :)
defaultUserShell = pkgs.bash;
users = {
# just me fr (personal account)
me = {
isNormalUser = true;
extraGroups = ["wheel" "netdev" "docker"];
shell = pkgs.bash;
packages = let
# TODO: can I just do this: https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-flake#url-like-syntax
# instead to use colmena's flake.nix by specifying a rev hash in the flake input?
colmena-src = pkgs.fetchFromGitHub {
owner = "zhaofengli";
repo = "colmena";
rev = "47b6414d800c8471e98ca072bc0835345741a56a";
sha256 = "rINodqeUuezuCWOnpJgrH7u9vJ86fYT+Dj8Mu8T/IBc=";
};
colmena-latest = pkgs.callPackage "${colmena-src}/package.nix" {};
in
with pkgs; [
firefox
nitch
starfetch
colmena-latest
gitkraken
# NOTE: downloadthing this causes my PC to freak!! ("too many open files" error)
#keyguard # bitwarden client app
];
};
# user for my professional jobs and stuff
ae = {
isNormalUser = true;
extraGroups = ["wheel"];
shell = pkgs.bash;
};
};
};
home-manager = {
users.me = import ../../homes/me;
extraSpecialArgs = {inherit inputs pkgs pkgs-unstable;};
sharedModules = [
inputs.ags.homeManagerModules.default
];
};
# ---- ENVIRONMENT VARIABLES ----
environment = {
# always install "dev" derivation outputs
extraOutputsToInstall = ["dev" "man"];
sessionVariables = {
# folder names with capitalisation look awful!
XDG_DOWNLOAD_DIR = "$HOME/downloads";
# Hint Electrons apps to use Wayland
NIXOS_OZONE_WL = "1";
};
};
# ---- SYSTEM PACKAGES -----
environment.systemPackages = with pkgs; [
# User Environment
swww
helvum
easyeffects
pavucontrol
ani-cli
bluetui
wl-clipboard # clipboard for wayland
hyprpicker
hyprshot # screenshot utility
qbittorrent
signal-desktop
kdePackages.gwenview # image viewer
libreoffice
# TEST: WARNING
# ospd-openvas
# openvas-scanner
# openvas-smb
(callPackage ../sddm-theme-corners.nix {}).sddm-theme-corners
# dependencies for my sddm theme:
pkgs.libsForQt5.qt5.qtgraphicaleffects
# Shell
bash
fish
shellcheck
grc # colorise command outputs
# Systems Programming & Compilation
qemu # Fellice Bellard's Quick Emulator
# GNU Utils
gnumake
# Binaries
binutils
strace
ltrace
# ASM
nasm
(callPackage ../packages/x86-manpages {})
# C Family
gcc
clang
clang-tools
# Rust
cargo
rustc
# Nim
nim
nimble
# Go
go
# Haskell
ghc
ghcid
haskell-language-server
ormolu
# Python
python312 # I use 3.12 since it's in a pretty stable state now
python314 # also 3.14 for latest features
poetry
# Sage
sageWithDoc # SageMath + HTML Documentation
openvpn
inetutils
# security tools
rustscan
nmap
dig
gobuster
nth
zap
httpie
curlie
zoxide
doggo
tldr
# btop
eza
yazi
lazygit
ripgrep
viddy # modern `watch` command
thefuck
tesseract # for my work with Agribit
# TODO: once upgraded past Nix-24.07 this line won't be necessary (I think)
# helix will support nixd by default
# SOURCE: https://github.com/nix-community/nixd/blob/main/nixd/docs/editor-setup.md#Helix
# nixd # lsp for nix # DEBUG
# Pretty necessary
git
git-filter-repo
nix-prefetch-git
brightnessctl
acpi
vim
powertop
imagemagick
# "Standard" Unix Commands
file
wget
tree
unzip
unrar-free
man-pages
man-pages-posix
# Cryptography
gnupg
openssl
libargon2
# Games
prismlauncher # minecraft
];
# DEBUG: configuring xdg portal here instead?
# REFERENCE: https://discourse.nixos.org/t/hyprland-screen-sharing/43658
#xdg.portal = {
# enable = true;
# xdgOpenUsePortal = true;
# config = {
# common.default = ["gtk"];
# hyprland.default = ["gtk" "hyprland"];
# };
# extraPortals = with pkgs; [
# #xdg-desktop-portal-gtk
# #xdg-desktop-portal-wlr
# xdg-desktop-portal-hyprland
# ];
#};
programs = {
zsh.enable = true;
fish.enable = true;
nix-ld.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
configure = {
customRC = ''
set number
set tabstop=4
set shiftwidth=4
'';
};
};
# I want to use fish as my login shell but it always goes terrible
# cause it isn't POSIX compliant, so instead Bash is my login and
# will just exec fish (^-^)
bash = {
completion.enable = true;
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
# Thunar also (optionally) requires: `services.tumbler` & `services.gvfs`
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-volman # for removable drives (ie USBs)
thunar-archive-plugin # create and extract archives
thunar-media-tags-plugin # change metadata for media files
];
};
# mozilla's email client
thunderbird.enable = true;
};
# ----- FONTS -----
fonts = {
enableDefaultPackages = true; # no clue what this line does tbh
packages = with pkgs;
[
# (nerdfonts.override {
# fonts = [
# "Cousine" # its ok i guess
# "Iosevka" # nah nah
# "IosevkaTerm" # big nah
# "CascadiaCode" # potential
# "FiraCode" # potential
# "JetBrainsMono" # for my rofi theme
# "Hasklig"
# "Hack"
# ];
# })
geist-font # for my hyprlock theme
# texlive maintains a noto-emoji flake
texlivePackages.noto-emoji
]
++ builtins.filter lib.attrsets.isDerivation (
builtins.attrValues pkgs.nerd-fonts
);
# TODO: change my default fonts
fontconfig = {
defaultFonts = {
serif = ["Iosevka"];
sansSerif = ["Iosevka "];
monospace = ["Cousine"];
emoji = ["Noto Emoji"];
};
};
};
documentation = {
enable = true;
doc.enable = true; # install /share/doc packages
man.enable = true; # install manpages
info.enable = true; # install GNU info
dev.enable = true; # install docs intended for developers
nixos = {
enable = true; # install NixOS documentation (ie man -k nix, & nixos-help)
options.splitBuild = true;
# includeAllModules = true;
};
};
virtualisation.docker.enable = true;
hardware = {
graphics = {
enable = true;
enable32Bit = true;
};
# opengl = {
# enable = true;
# driSupport = true;
# driSupport32Bit = true;
# }
bluetooth = {
enable = true;
powerOnBoot = true;
};
};
# DO NOT MODIFY
system.stateVersion = "24.05"; # Did you read the comment?
}