dotfiles/hosts/myputer/default.nix

528 lines
11 KiB
Nix
Raw Normal View History

{
2025-08-01 12:45:28 +10:00
lib,
2024-10-30 13:51:36 +10:00
pkgs,
pkgs-unstable,
2024-10-30 13:51:36 +10:00
inputs,
2025-08-01 12:45:28 +10:00
config,
...
}: let
2024-10-30 19:45:26 +10:00
home-manager = builtins.fetchTarball {
url = "https://github.com/nix-community/home-manager/archive/release-25.05.tar.gz";
2025-10-08 10:59:14 +10:00
sha256 = "0q3lv288xlzxczh6lc5lcw0zj9qskvjw3pzsrgvdh8rl8ibyq75s";
2024-10-30 19:45:26 +10:00
};
in {
2024-10-30 13:51:36 +10:00
imports = [
2024-10-30 19:45:26 +10:00
./hardware-configuration.nix
(import "${home-manager}/nixos")
2025-10-06 09:30:18 +10:00
../modules/bashistrans.nix
../modules/wm/hyprland.nix
../modules/steam.nix
2025-10-24 11:51:49 +10:00
2025-08-01 12:45:28 +10:00
../modules/obsidian.nix
2025-10-24 11:51:49 +10:00
../modules/apps/winbox.nix
2025-08-01 12:45:28 +10:00
#../modules/flipperzero.nix
#../modules/chameleonultragui.nix
2024-10-30 19:45:26 +10:00
];
2024-10-30 13:51:36 +10:00
2025-08-01 13:17:12 +10:00
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# nixpkgs.overlays = [
# (self: super: {
# jdk17 = super.jdk17.override (prev: {
# enableJavaFX = true;
# });
# })
# ];
2025-08-01 13:17:12 +10:00
2025-08-01 12:45:28 +10:00
nixpkgs.config.allowUnfreePredicate = let
2025-10-24 11:50:00 +10:00
whitelist = let
vscext = pkgs.vscode-extensions;
in
with pkgs;
map lib.getName [
discord
steam
steamcmd
steam-unwrapped
dwarf-fortress
2025-10-24 11:51:49 +10:00
winbox
2025-10-24 11:50:00 +10:00
obsidian
gitkraken
vscode
vscext.ms-dotnettools.csharp
vscext.ms-dotnettools.csdevkit
vscext.github.copilot
vscext.github.copilot-chat
];
2025-08-01 12:45:28 +10:00
in
pkg: builtins.elem (lib.getName pkg) whitelist;
2024-11-04 11:59:14 +10:00
boot.loader = {
efi = {
canTouchEfiVariables = true;
2025-08-01 12:45:28 +10:00
efiSysMountPoint = "/boot/efi";
2024-11-04 11:59:14 +10:00
};
grub = {
efiSupport = true;
device = "nodev";
2025-08-01 12:45:28 +10:00
# useOSProber = true;
2025-02-11 15:47:56 +10:00
};
2025-08-01 12:45:28 +10:00
# GitHub: vinceliuice/grub2-themes
2025-02-11 15:47:56 +10:00
grub2-theme = {
enable = true;
theme = "whitesur"; # stylish, vimix, or whitesur
footer = true;
2025-08-01 13:17:12 +10:00
# TODO: switch my cables to switch default grub display
customResolution = "3840x2160";
2024-11-04 11:59:14 +10:00
};
};
2024-10-30 13:51:36 +10:00
time.timeZone = "Australia/Brisbane";
2025-08-01 12:45:28 +10:00
i18n.defaultLocale = "en_US.UTF-8"; # internationalisation
2024-10-30 13:51:36 +10:00
2025-07-10 21:57:46 +10:00
# Enable initrd hook for virtual console customisation
# aka cool colours when bootting yay!!
2024-10-30 13:51:36 +10:00
console = {
2025-07-10 21:57:46 +10:00
enable = true;
earlySetup = true; # initrd pre hook
2024-10-30 13:51:36 +10:00
keyMap = "us";
2025-07-10 21:57:46 +10:00
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"
];
2024-10-30 13:51:36 +10:00
};
2025-08-01 12:45:28 +10:00
# ----- NETWORKING -----
2025-08-01 12:32:52 +10:00
networking = {
hostName = "myputer";
networkmanager.enable = true;
2024-10-30 13:51:36 +10:00
2025-10-24 11:51:49 +10:00
firewall = {
enable = true;
allowedTCPPorts = [
22 # SSH
80 # HTTP
443 # HTTPS
5678 # MikroTik WinBox
];
};
2025-08-01 12:32:52 +10:00
};
2024-10-30 13:51:36 +10:00
# ----- SERVICES -----
services = {
# Set display manager (login screen)
displayManager = {
2025-08-01 12:32:52 +10:00
# sddm relies on pkgs.libsForQt5.qt5.qtgraphicaleffects
2024-10-30 13:51:36 +10:00
sddm = {
enable = true;
2025-08-01 12:32:52 +10:00
wayland.enable = true; # experimental
2025-02-11 15:47:56 +10:00
theme = "corners";
2024-10-30 13:51:36 +10:00
};
defaultSession =
"hyprland"
+ (
if config.programs.hyprland.withUWSM
then "-uwsm"
else null
);
2024-10-30 13:51:36 +10:00
};
2025-08-01 12:32:52 +10:00
# Multimedia Framework
# With backwards compatability for alsa/pulseaudio/jack
2024-10-30 13:51:36 +10:00
pipewire = {
enable = true;
2025-02-11 15:47:56 +10:00
wireplumber.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
2024-10-30 13:51:36 +10:00
pulse.enable = true;
2025-02-11 15:47:56 +10:00
jack.enable = true;
2024-10-30 13:51:36 +10:00
};
2025-02-11 15:47:56 +10:00
tumbler.enable = true; # Thunar image thumbnail support
gvfs.enable = true; # Thunar mount, trash, and other functionality
2024-10-30 13:51:36 +10:00
};
2025-02-11 15:47:56 +10:00
security.rtkit.enable = true; # I *think* this is for pipewire
2024-10-30 13:51:36 +10:00
2025-08-01 13:17:12 +10:00
# ------- USERS -------
2024-11-07 17:37:15 +10:00
security.sudo.wheelNeedsPassword = false;
2024-10-30 19:45:26 +10:00
users = {
2025-08-01 13:17:12 +10:00
# 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 :)
2024-10-30 19:45:26 +10:00
defaultUserShell = pkgs.bash;
users = {
# just me fr (personal account)
me = {
isNormalUser = true;
2025-08-01 13:17:12 +10:00
extraGroups = ["wheel" "netdev" "docker"];
shell = pkgs.bash;
packages = let
2025-02-19 12:14:25 +10:00
# 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
2025-02-19 12:14:25 +10:00
gitkraken
2025-02-19 23:34:08 +10:00
# 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"];
2025-08-01 13:17:12 +10:00
shell = pkgs.bash;
};
};
2024-10-30 13:51:36 +10:00
};
2024-11-07 17:37:15 +10:00
home-manager = {
users.me = import ../../homes/me;
extraSpecialArgs = {inherit inputs pkgs pkgs-unstable;};
2024-11-07 17:37:15 +10:00
sharedModules = [
2025-02-11 15:47:56 +10:00
inputs.ags.homeManagerModules.default
];
2024-11-07 17:37:15 +10:00
};
2025-08-01 13:17:12 +10:00
# ---- ENVIRONMENT VARIABLES ----
2025-09-03 11:13:13 +10:00
environment = {
# always install "dev" derivation outputs
2025-09-18 19:48:07 +10:00
extraOutputsToInstall = ["dev" "man"];
2025-09-03 11:13:13 +10:00
sessionVariables = {
# folder names with capitalisation look awful!
XDG_DOWNLOAD_DIR = "$HOME/downloads";
# Hint Electrons apps to use Wayland
NIXOS_OZONE_WL = "1";
};
};
2024-10-30 13:51:36 +10:00
# ---- SYSTEM PACKAGES -----
environment.systemPackages = with pkgs; [
2024-11-04 11:59:14 +10:00
# User Environment
2025-07-29 14:05:05 +10:00
swww
helvum
easyeffects
pavucontrol
ani-cli
2025-07-10 23:47:59 +10:00
bluetui
wl-clipboard # clipboard for wayland
2025-02-11 15:47:56 +10:00
hyprpicker
2025-08-31 14:55:27 +10:00
hyprshot # screenshot utility
2025-08-01 13:17:12 +10:00
qbittorrent
signal-desktop
2025-08-12 21:11:08 +10:00
kdePackages.gwenview # image viewer
libreoffice
2025-02-11 15:47:56 +10:00
2025-08-31 14:56:23 +10:00
# TEST: WARNING
# ospd-openvas
# openvas-scanner
# openvas-smb
2025-08-01 13:17:12 +10:00
(callPackage ../sddm-theme-corners.nix {}).sddm-theme-corners
2025-02-11 15:47:56 +10:00
# dependencies for my sddm theme:
pkgs.libsForQt5.qt5.qtgraphicaleffects
2024-11-04 11:59:14 +10:00
2025-08-01 13:17:12 +10:00
# Shell
bash
fish
shellcheck
grc # colorise command outputs
2025-09-24 13:30:20 +10:00
moreutils
2024-10-30 23:34:23 +10:00
2025-08-31 14:56:01 +10:00
# Systems Programming & Compilation
2025-08-01 13:39:02 +10:00
qemu # Fellice Bellard's Quick Emulator
2025-08-31 15:15:47 +10:00
# GNU Utils
2025-08-01 13:17:12 +10:00
gnumake
2025-08-31 23:26:30 +10:00
# Binaries
2025-08-31 15:15:47 +10:00
binutils
2025-08-31 14:56:01 +10:00
strace
ltrace
2025-10-06 09:43:26 +10:00
perf-tools # ftrace + perf
radare2
gdb
2025-08-31 23:26:30 +10:00
# ASM
nasm
(callPackage ../packages/x86-manpages {})
2025-08-01 13:17:12 +10:00
# C Family
gcc
clang
2025-08-31 15:15:47 +10:00
clang-tools
2025-10-06 09:43:26 +10:00
2025-08-01 13:17:12 +10:00
# Rust
cargo
rustc
2025-10-06 09:43:26 +10:00
# Go
go
2025-08-01 13:17:12 +10:00
# Nim
nim
2025-08-07 10:45:00 +10:00
nimble
2025-09-03 00:37:55 +10:00
# Haskell
ghc
ghcid
2025-09-03 03:24:39 +10:00
haskell-language-server
ormolu
2025-08-01 13:17:12 +10:00
# Java
# jdk17
# (jre8.overrideAttrs
# (oldAttrs: {
# enableJavaFX = true;
# }))
# (jdk8.overrideAttrs
# (oldAttrs: {
# enableJavaFX = true;
# }))
visualvm
2025-08-01 13:17:12 +10:00
# 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
2025-10-06 09:20:37 +10:00
# .NET
dotnetCorePackages.dotnet_9.sdk
dotnetCorePackages.dotnet_9.aspnetcore
dotnetCorePackages.dotnet_9.runtime
2025-10-06 21:19:26 +10:00
omnisharp-roslyn
2025-10-08 10:59:14 +10:00
netcoredbg
2025-10-06 09:20:37 +10:00
2025-08-01 13:17:12 +10:00
openvpn
inetutils
# security tools
rustscan
nmap
dig
gobuster
nth
zap
2024-11-07 17:37:15 +10:00
httpie
curlie
zoxide
doggo
2025-02-11 15:47:56 +10:00
tldr
2025-08-01 13:17:12 +10:00
# btop
eza
yazi
lazygit
ripgrep
viddy # modern `watch` command
thefuck
2024-11-07 17:37:15 +10:00
2025-02-19 12:14:25 +10:00
tesseract # for my work with Agribit
2025-08-01 13:17:12 +10:00
# 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
2025-02-19 12:14:25 +10:00
2024-10-30 17:35:16 +10:00
# Pretty necessary
2024-10-30 13:51:36 +10:00
git
2025-02-21 21:49:44 +10:00
git-filter-repo
2025-08-01 13:17:12 +10:00
nix-prefetch-git
2024-11-07 17:37:15 +10:00
brightnessctl
acpi
2025-02-11 15:47:56 +10:00
vim
2025-08-01 13:17:12 +10:00
powertop
imagemagick
2024-11-07 17:37:15 +10:00
2025-08-01 13:17:12 +10:00
# "Standard" Unix Commands
file
2024-10-30 17:35:16 +10:00
wget
tree
2025-10-06 09:21:56 +10:00
pstree
2025-02-11 15:47:56 +10:00
unzip
2025-08-01 13:17:12 +10:00
unrar-free
2025-10-06 09:21:56 +10:00
lz4
man-pages
man-pages-posix
2025-02-19 23:34:08 +10:00
# Cryptography
2025-08-01 13:17:12 +10:00
gnupg
2025-02-19 23:34:08 +10:00
openssl
libargon2
# Games
2025-08-01 13:17:12 +10:00
prismlauncher # minecraft
2024-10-30 13:51:36 +10:00
];
# 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
# ];
#};
2024-10-30 13:51:36 +10:00
programs = {
2024-11-04 11:59:14 +10:00
zsh.enable = true;
fish.enable = true;
2024-10-30 19:45:26 +10:00
2025-08-01 13:17:12 +10:00
nix-ld.enable = true;
2024-10-30 17:35:16 +10:00
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
configure = {
customRC = ''
2025-02-11 15:47:56 +10:00
set number
set tabstop=4
set shiftwidth=4
2024-10-30 17:35:16 +10:00
'';
};
};
2024-11-04 11:59:14 +10:00
# Thunar also (optionally) requires: `services.tumbler` & `services.gvfs`
2025-02-11 15:47:56 +10:00
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;
java = let
# XXX: WARNING: TEST :WARNING: XXX
# Test for CrazyCraft VoidLauncher
myjdk = pkgs.jdk17.override {
enableJavaFX = true;
# openjfx_jdk = pkgs.openjfx17.override {withWebKit = true;};
};
in {
enable = true;
package = myjdk;
};
2024-10-30 17:35:16 +10:00
};
# ----- 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
);
2025-02-11 15:47:56 +10:00
# TODO: change my default fonts
fontconfig = {
defaultFonts = {
2025-02-11 15:47:56 +10:00
serif = ["Iosevka"];
sansSerif = ["Iosevka "];
monospace = ["Cousine"];
emoji = ["Noto Emoji"];
};
};
2024-10-30 13:51:36 +10:00
};
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;
};
};
2025-02-19 12:14:25 +10:00
virtualisation.docker.enable = true;
2024-11-04 11:59:14 +10:00
hardware = {
2025-08-31 15:14:20 +10:00
graphics = {
enable = true;
enable32Bit = true;
};
2025-07-10 23:47:59 +10:00
2025-08-01 13:17:12 +10:00
# opengl = {
# enable = true;
# driSupport = true;
# driSupport32Bit = true;
# }
2025-07-10 23:47:59 +10:00
bluetooth = {
enable = true;
powerOnBoot = true;
};
2024-11-04 11:59:14 +10:00
};
2024-10-30 13:51:36 +10:00
# DO NOT MODIFY
system.stateVersion = "24.05"; # Did you read the comment?
}