Compare commits

..

1 Commits

Author SHA1 Message Date
Dave Gallant
114d75da7f Add more mac defaults 2025-04-12 22:47:45 -04:00
19 changed files with 1123 additions and 537 deletions

5
.envrc Normal file
View File

@@ -0,0 +1,5 @@
if has lorri; then
eval "$(lorri direnv)"
else
use nix
fi

View File

@@ -14,7 +14,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.pre-commit-config.yaml
.vscode
git-crypt-key
result

View File

@@ -1,34 +1,12 @@
# nix-config
This repo stores nix configuration to manage my hosts running [NixOS](https://nixos.org/) and macOS.
This repo stores nix configuration to manage my machines running [NixOS](https://nixos.org/) and macOS.
The configuration is very specific to my own machines and setup, but it may be a useful reference for anyone else learning or experimenting with nix, whether it be on a personal workstation or a server environment.
```console
macchina
a8888b. Host - dave@hephaestus
d888888b. Machine - Micro-Star International Co., Ltd MS-7C02 1.0
8P"YP"Y88 Kernel - 6.12.61
8|o||o|88 Distro - NixOS 25.11 (Xantusia)
8' .88 DE - KDE
8`._.' Y8. Packages - 1 (cargo), 10998 (nix)
d/ `8b. Shell - fish
dP Y8b. Terminal - alacritty
d8: ::88b. Resolution - 2560x1440, 3840x2160
d8" 'Y88b Uptime - 26m
:8P :888 CPU - AMD Ryzen 7 5700X 8-Core Processor (16)
8a. _a88P CPU Load - 8%
._/"Yaa .| 88P| Memory - 10.7 GB / 32.8 GB
\ YP" `| `.
/ \.___.d| .'
`--..__) `._.'
```
## Prerequisites
- [NixOS](nixos.org) (Linux)
- [Determinate Nix](https://determinate.systems/nix-installer) (macOS)
- [Determine Nix](https://determinate.systems/nix-installer)
- [just](https://github.com/casey/just)
## Build
@@ -65,21 +43,6 @@ To cleanup previous files, run nix garbage collection:
just clean
```
## Restoring from a live USB
## Pre-commit hooks
If the bootloader for some reason breaks (i.e. motherboard firmware upgrade), restore it from a live USB by running the following commands:
```console
$ sudo cryptsetup luksOpen /dev/nvme0n1p2 crypted-nixos
Enter passphrase for /dev/nvme0n1p2: ********
$ sudo mount /dev/vg/root /mnt
$ sudo mount /dev/nvme0n1p1 /mnt/boot/efi
$ sudo nixos-enter --root /mnt
$ hostname <hostname>
```
Navigate to the nix-config directory and run:
```sh
just rebuild-boot
```
Pre-commit hooks are automatically activated when [direnv](https://github.com/direnv/direnv) is installed.

13
default.nix Normal file
View File

@@ -0,0 +1,13 @@
let
nix-pre-commit-hooks = import (
builtins.fetchTarball "https://github.com/cachix/git-hooks.nix/tarball/master"
);
in
{
pre-commit-check = nix-pre-commit-hooks.run {
src = ./.;
hooks = {
shellcheck.enable = true;
};
};
}

820
flake.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,43 +3,34 @@
inputs = {
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/*";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
fh.url = "https://flakehub.com/f/DeterminateSystems/fh/*";
nixpkgs-unstable.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*";
darwin = {
url = "github:lnl7/nix-darwin/nix-darwin-25.11";
url = "github:lnl7/nix-darwin/nix-darwin-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.url = "https://flakehub.com/f/nix-community/home-manager/*";
nixvim = {
url = "github:nix-community/nixvim/nixos-25.11";
url = "github:nix-community/nixvim/nixos-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix.url = "github:danth/stylix/release-24.11";
vpngate.url = "github:davegallant/vpngate";
};
outputs =
{
self,
darwin,
fh,
determinate,
home-manager,
nixpkgs,
nixpkgs-unstable,
nixpkgs-master,
stylix,
vpngate,
...
}@inputs:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in
{
nixosConfigurations =
let
@@ -47,23 +38,23 @@
system = "x86_64-linux";
config.allowUnfree = true;
};
master = import nixpkgs-master {
system = "x86_64-linux";
config.allowUnfree = true;
};
in
{
hephaestus = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit fh;
inherit unstable;
inherit master;
inherit vpngate;
inherit inputs;
};
modules = [
./hosts/hephaestus.nix
./common-packages.nix
./fonts.nix
./machines/hephaestus/configuration.nix
./packages.nix
./services/netdata/default.nix
./upgrade-diff.nix
determinate.nixosModules.default
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
(
{ ... }:
{
@@ -75,10 +66,9 @@
substituters = [ "https://davegallant.cachix.org" ];
trusted-users = [
"root"
"dave"
];
trusted-public-keys = [
"davegallant.cachix.org-1:SsUMqL4+tF2R3/G6X903E9laLlY1rES2QKFfePegF08="
];
trusted-public-keys = [ "davegallant.cachix.org-1:SsUMqL4+tF2R3/G6X903E9laLlY1rES2QKFfePegF08=" ];
};
registry = {
nixpkgs.flake = nixpkgs;
@@ -96,12 +86,11 @@
useGlobalPkgs = true;
useUserPackages = true;
users.dave.imports = [
./home.nix
inputs.nixvim.homeModules.nixvim
./home/default.nix
inputs.nixvim.homeManagerModules.nixvim
];
extraSpecialArgs = {
inherit unstable;
inherit master;
};
};
};
@@ -118,23 +107,21 @@
config.allowUnfree = true;
inherit system;
};
master = import nixpkgs-master {
config.allowUnfree = true;
inherit system;
};
in
{
zelus = darwin.lib.darwinSystem {
inherit system;
specialArgs = {
inherit unstable;
inherit master;
};
modules = [
home-manager.darwinModules.home-manager
./hosts/zelus.nix
./common-packages.nix
stylix.darwinModules.stylix
./machines/zelus/configuration.nix
./packages.nix
./upgrade-diff.nix
(
{ ... }:
{
@@ -144,12 +131,11 @@
useGlobalPkgs = true;
useUserPackages = true;
users."dave.gallant".imports = [
./home.nix
inputs.nixvim.homeModules.nixvim
./home/default.nix
inputs.nixvim.homeManagerModules.nixvim
];
extraSpecialArgs = {
inherit unstable;
inherit master;
};
};
};

24
fonts.nix Normal file
View File

@@ -0,0 +1,24 @@
{ pkgs, ... }:
{
fonts.packages = with pkgs; [
dejavu_fonts
fira-code
fira-code-symbols
fira-mono
font-awesome
google-fonts
liberation_ttf
nerdfonts
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
noto-fonts-extra
];
fonts.fontconfig.defaultFonts = {
sansSerif = [ "Noto Sans" ];
serif = [ "Noto Serif" ];
monospace = [ "Noto Sans Mono" ];
emoji = [ "Noto Color Emoji" ];
};
}

View File

@@ -8,10 +8,33 @@ let
inherit (pkgs) stdenv;
in
{
home.stateVersion = "25.11";
home.stateVersion = "24.11";
home.packages = with pkgs; [ just ];
stylix = {
enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-dark.yaml";
targets = {
alacritty.enable = true;
vscode.enable = false; # overrides synced settings
};
opacity.terminal = 1.0;
fonts.sizes = if stdenv.isLinux then { terminal = 20; } else { terminal = 16; };
fonts.monospace = {
name = "FiraCode Nerd Font Mono";
package = "${pkgs.fira-mono}";
};
fonts.sansSerif = {
name = "FiraCode Nerd Font";
package = "${pkgs.fira-code}";
};
};
services = {
gpg-agent = {
enable = stdenv.isLinux;
@@ -30,42 +53,40 @@ in
direnv.enable = true;
diff-so-fancy = {
enable = true;
enableGitIntegration = true;
};
git = {
enable = true;
userName = "Dave Gallant";
diff-so-fancy.enable = true;
lfs.enable = true;
settings = {
user.name = "Dave Gallant";
user.signingkey = "5A548984C7377E4D";
commit.gpgsign = true;
tag.gpgsign = true;
alias = {
aa = "add -A .";
br = "branch";
c = "commit";
cm = "commit -m";
ca = "commit --amend";
cane = "commit --amend --no-edit";
cb = "checkout -b";
co = "checkout";
cmp = "! git checkout main && git pl";
d = "diff";
dc = "diff --cached";
dcn = "diff --cached --name-only";
l = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
ms = "merge --squash";
p = "push origin";
pf = "push -f";
pl = "! git pull origin $(git rev-parse --abbrev-ref HEAD)";
st = "status";
wip = "for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads";
};
aliases = {
aa = "add -A .";
br = "branch";
c = "commit -S";
ca = "commit -S --amend";
cane = "commit -S --amend --no-edit";
cb = "checkout -b";
co = "checkout";
cmp = "! git checkout main && git pl";
d = "diff";
dc = "diff --cached";
dcn = "diff --cached --name-only";
ds = "! git diff origin | sed -r 's/value: (.*)/value: \"************\"/'";
l = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
ms = "merge --squash";
p = "push origin";
pf = "push -f";
pl = "! git pull origin $(git rev-parse --abbrev-ref HEAD)";
st = "status";
wip = "for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads";
};
includes = [ { path = "~/.gitconfig-work"; } ];
extraConfig = {
push = {
default = "current";
};
@@ -73,35 +94,15 @@ in
rebase = true;
};
};
includes = [ { path = "~/.gitconfig-work"; } ];
};
alacritty = {
enable = stdenv.isLinux;
settings = {
window.padding.x = 10;
window.padding.y = 10;
scrolling.history = 100000;
general.live_config_reload = true;
terminal.shell = {
program = "fish";
};
font = {
size = lib.mkForce 14.0;
};
window = {
opacity = lib.mkForce 0.9;
};
};
};
starship = {
enable = true;
enableFishIntegration = true;
enableZshIntegration = true;
settings = {
add_newline = false;
scan_timeout = 10;
gcloud = {
format = "";
};
@@ -111,45 +112,63 @@ in
};
};
fish = {
zsh = {
enable = true;
autosuggestion.enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
history.size = 1000000;
interactiveShellInit = ''
set fish_greeting
localVariables = {
CASE_SENSITIVE = "true";
DISABLE_UNTRACKED_FILES_DIRTY = "true";
RPROMPT = ""; # override because macOS defaults to filepath
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=#838383,underline";
ZSH_DISABLE_COMPFIX = "true";
};
bind \cw backward-kill-word
envExtra = ''
export PAGER=less
export EDITOR=vim
export DOCKER_CLI_HINTS=false
export TERM=xterm-256color
set -x DOCKER_CLI_HINTS false
set -x DOCKER_DEFAULT_PLATFORM linux/amd64
set -x EDITOR vim
set -x NNN_FIFO "$XDG_RUNTIME_DIR/nnn.fifo"
set -x PAGER less
set -x TERM xterm-256color
export PATH=$PATH:~/.cargo/bin
export PATH=$PATH:~/.local/bin
export PATH=$PATH:~/.npm-packages/bin
export PATH=$PATH:/opt/homebrew/bin
export PATH=$PATH:~/.krew/bin
export PATH=$PATH:~/bin
export GOPATH=~/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
'';
set -x PATH $PATH \
~/.cargo/bin \
~/.local/bin \
~/.npm-packages/bin \
/opt/homebrew/bin \
~/.krew/bin \
~/bin
initExtra = ''
setopt noincappendhistory
# golang
set -x GOPATH ~/go
set -x GOBIN $GOPATH/bin
set -x PATH $PATH $GOBIN
source $HOME/.zsh-work
source $HOME/work.fish
# '';
if [[ "$OSTYPE" == "darwin"* ]];
then
export PATH="$(brew --prefix)/opt/gnu-tar/libexec/gnubin:$PATH"
alias xdg-open=open
fi
shellInit = ''
atuin init fish | source
helm completion fish | source
kubectl completion fish | source
source <(helm completion zsh)
source <(kubectl completion zsh)
eval "$(atuin init zsh)"
# kubecolor
source <(kubectl completion zsh)
alias kubectl=kubecolor
# make completion work with kubecolor
compdef kubecolor=kubectl
'';
shellAliases = {
".." = "cd ..";
c = "code";
g = "git";
gc = "git checkout $(git branch | fzf)";
gco = "git checkout $(git branch -r | sed -e 's/^ origin\\///' | fzf)";
@@ -158,18 +177,22 @@ in
grep = "rg --smart-case";
j = "just";
k = "kubecolor";
kubectl = "kubecolor";
kp = "viddy 'kubectl get pods'";
kcx = "kubectx";
kns = "kubens";
l = "eza -la --git --group-directories-first";
m = "make";
nix-install = "nix-env -iA";
ps = "procs";
t = "cd-fzf";
tf = "terraform";
tree = "eza --tree";
v = "nvim";
};
"oh-my-zsh" = {
enable = true;
};
};
go = {
@@ -180,32 +203,6 @@ in
enable = true;
};
nnn = {
enable = stdenv.isLinux;
package = pkgs.nnn.override ({ withNerdIcons = true; });
bookmarks = {
d = "~/Downloads";
p = "~/src/";
c = "~/.config";
h = "~";
};
extraPackages = with pkgs; [
bat
eza
fzf
imv
mediainfo
ffmpegthumbnailer
];
plugins = {
src = "${pkgs.nnn.src}/plugins";
mappings = {
p = "preview-tui";
o = "fzopen";
};
};
};
nixvim = {
enable = true;
viAlias = true;
@@ -268,6 +265,7 @@ in
lualine.enable = true;
lsp.enable = true;
lsp.servers = {
ansiblels.enable = true;
bashls.enable = true;
dockerls.enable = true;
gopls.enable = true;
@@ -287,6 +285,10 @@ in
};
cmp.enable = true;
nvim-tree.enable = true;
packer = {
enable = true;
plugins = [ ];
};
rainbow-delimiters.enable = true;
treesitter.enable = true;
telescope = {
@@ -384,51 +386,27 @@ in
'';
};
zed-editor = {
enable = stdenv.isLinux;
package = unstable.zed-editor;
extensions = [
"ansible"
"color-highlight"
"dockerfile"
"html"
"make"
"material-icon-theme"
"nix"
"toml"
"vue"
];
userSettings = {
icon_theme = "Material Icon Theme";
features = {
edit_prediction_provider = "copilot";
};
vim_mode = true;
vim = {
use_system_clipboard = "on_yank";
};
autosave = "on_focus_change";
format_on_save = "off";
ui_font_size = lib.mkForce 18;
buffer_font_size = lib.mkForce 16;
};
userKeymaps = [
{
context = "Editor && !menu";
bindings = {
"ctrl-shift-c" = "editor::Copy";
"ctrl-shift-x" = "editor::Cut";
"ctrl-shift-v" = "editor::Paste";
"ctrl-z" = "editor::Undo";
};
}
];
vscode = {
enable = true;
package = pkgs.vscode;
extensions =
with pkgs.vscode-extensions;
[
bbenoist.nix
github.vscode-pull-request-github
golang.go
hashicorp.terraform
ms-dotnettools.csharp
ms-kubernetes-tools.vscode-kubernetes-tools
redhat.vscode-yaml
]
++ lib.optionals stdenv.isLinux [ ms-python.python ];
};
firefox = {
enable = stdenv.isLinux;
package = pkgs.librewolf;
package = unstable.librewolf;
profiles = {
default = {

View File

@@ -5,16 +5,13 @@ alias r := rebuild
arch := `uname -s`
cmd := if arch == "Linux" { "nixos-rebuild --sudo" } else { "sudo darwin-rebuild" }
cmd := if arch == "Linux" { "sudo nixos-rebuild --use-remote-sudo" } else { "darwin-rebuild" }
rebuild:
$cmd switch --flake .
rebuild-boot:
$cmd boot --flake . --install-bootloader
$cmd switch --flake . -I nixos-config="machines/$(hostname)/configuration.nix"
rollback:
sudo $cmd switch --rollback --flake .
$cmd switch --rollback --flake .
channel-update:
nix-channel --update

View File

@@ -1,33 +1,36 @@
{
config,
fh,
lib,
inputs,
master,
modulesPath,
pkgs,
unstable,
vpngate,
...
}:
let
gnomeExtensions = with pkgs.gnomeExtensions; [
caffeine
];
in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
security.sudo-rs = {
stylix = {
enable = true;
execWheelOnly = true;
wheelNeedsPassword = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-dark.yaml";
image = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/davegallant/nix-config/refs/heads/main/nixos-wallpaper.png";
sha256 = "Ztqn9+CHslr6wZdnOTeo/YNi/ICerpcFLyMArsZ/PIY=";
};
polarity = "dark";
fonts.sizes.desktop = 24;
};
boot = {
kernelModules = [
"kvm-amd"
];
kernelPackages = pkgs.linuxPackages;
kernelParams = [
"amd_iommu=on"
];
kernelModules = [ "kvm-amd" ];
kernelPackages = pkgs.linuxPackages_latest;
loader = {
efi.canTouchEfiVariables = true;
@@ -55,7 +58,7 @@
];
luks.devices."root" = {
allowDiscards = true;
device = "/dev/disk/by-uuid/89a14ac5-7723-4a0a-bb95-fb2fb2e92160";
device = "/dev/disk/by-uuid/21cd166c-1528-49a4-b31b-0d408d48aa80";
preLVM = true;
keyFile = "./keyfile0.bin";
};
@@ -68,71 +71,60 @@
environment.systemPackages =
with pkgs;
[
albert
android-studio
android-tools
bleachbit
calibre
clamtk
chromium
cryptsetup
dbeaver-bin
discord
docker-compose
fh.packages.x86_64-linux.default
freefilesync
gimp-with-plugins
google-chrome
hardinfo2
gnome-tweaks
httpie-desktop
heroic
iputils
kdePackages.bluedevil
kdePackages.kcalc
kdePackages.kcharselect
kdePackages.kclock
kdePackages.kcolorchooser
kdePackages.ksystemlog
kdePackages.partitionmanager
kdePackages.sddm-kcm
libation
lutris
mupen64plus
mission-center
netdata
nfs-utils
onlyoffice-desktopeditors
opensnitch-ui
pciutils
pavucontrol
pika-backup
pinentry-curses
pinta
protonup-qt
qbittorrent
protonvpn-gui
qemu
ryujinx
traceroute
unrar
unstable.beszel
unstable.ktailctl
unstable.mcpelauncher-ui-qt
unityhub
unstable.ghostty
unstable.obsidian
unstable.podman
unstable.podman-compose
unstable.podman-desktop
unstable.ryubing
unstable.signal-desktop-bin
unstable.signal-desktop
unstable.tailscale
unstable.zoom-us
usbutils
virt-manager
vlc
vpngate.packages.x86_64-linux.default
wayland-utils
whois
wine
wl-clipboard
];
]
++ gnomeExtensions;
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/7f4f0948-041c-47e9-ab28-53132026f158";
device = "/dev/disk/by-uuid/a6723178-6f18-428e-b541-9ac901861125";
fsType = "ext4";
};
"/home" = {
device = "/dev/disk/by-uuid/e3ab2e1a-bddf-4ae0-b00a-bf954c6c182b";
fsType = "ext4";
};
"/boot/efi" = {
device = "/dev/disk/by-uuid/F1BD-5227";
device = "/dev/disk/by-uuid/3CFD-D749";
fsType = "vfat";
};
"/mnt/synology-2b/media" = {
@@ -140,34 +132,11 @@
fsType = "nfs";
};
"/mnt/truenas/home/backups" = {
device = "192.168.1.132:/mnt/wd4t/data/home/backup/";
device = "192.168.1.32:/mnt/wd4t/data/home/backup/";
fsType = "nfs";
};
};
fonts.packages = with pkgs; [
dejavu_fonts
fira-mono
font-awesome
liberation_ttf
nerd-fonts.droid-sans-mono
nerd-fonts.fira-code
nerd-fonts.symbols-only
nerd-fonts.ubuntu
nerd-fonts.ubuntu-mono
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
noto-fonts
];
fonts.fontconfig.defaultFonts = {
sansSerif = [ "Noto Sans" ];
serif = [ "Noto Serif" ];
monospace = [ "Noto Sans Mono" ];
emoji = [ "Noto Color Emoji" ];
};
nixpkgs = {
hostPlatform = "x86_64-linux";
config = {
@@ -194,70 +163,28 @@
};
};
users.users.beszel = {
isSystemUser = true;
group = "beszel";
description = "Beszel Agent service user";
};
users.groups.beszel = { };
systemd.services = {
NetworkManager-wait-online.enable = false;
beszel-agent = {
description = "Beszel Agent Service";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Environment = [
"PORT=45876"
''KEY="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEaNtnkc+3+fJU+bTO6fibID9FHgFjei0sjJNqvcYtG8"''
];
ExecStart = "${lib.getBin unstable.beszel}/bin/beszel-agent";
User = "beszel";
Restart = "always";
RestartSec = 5;
};
};
};
services = {
mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
};
system = {
autoUpgrade.enable = true;
stateVersion = "25.11";
activationScripts = {
diff = {
supportsDryActivation = true;
text = ''
if [[ -e /run/current-system ]]; then
echo -e "\e[36mPackage version diffs:\e[0m"
${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
fi
'';
};
};
stateVersion = "24.11";
};
nix = {
extraOptions = "experimental-features = nix-command flakes";
settings.trusted-users = [ "root" "@wheel" ];
};
users.users.dave = {
isNormalUser = true;
extraGroups = [
"docker"
"wheel"
"libvirtd"
"corectrl"
];
shell = pkgs.fish;
shell = pkgs.zsh;
};
i18n.defaultLocale = "en_US.UTF-8";
@@ -270,8 +197,6 @@
time.timeZone = "America/Toronto";
hardware.bluetooth.enable = true;
hardware.graphics = {
enable = true;
enable32Bit = true;
@@ -279,20 +204,17 @@
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
documentation.man.generateCaches = false;
programs = {
fish.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
kdeconnect.enable = true;
nix-ld.enable = true;
steam = {
enable = true;
remotePlay.openFirewall = true;
};
zsh.enable = true;
};
services.avahi = {
@@ -308,11 +230,9 @@
};
};
services = {
desktopManager.plasma6.enable = true;
displayManager.sddm.enable = true;
displayManager.sddm.wayland.enable = true;
};
services.flatpak.enable = true;
services.gnome.gnome-keyring.enable = true;
services.printing.enable = true;
@@ -325,8 +245,43 @@
package = unstable.tailscale;
};
services.clamav.daemon.enable = true;
services.clamav.updater.enable = true;
services.xserver = {
enable = true;
displayManager = {
gdm = {
enable = true;
wayland = true;
};
};
desktopManager.gnome.enable = true;
videoDrivers = [ "amdgpu" ];
};
services.ollama = {
package = unstable.ollama;
enable = true;
acceleration = "rocm";
environmentVariables = {
HSA_OVERRIDE_GFX_VERSION = "11.0.2";
};
loadModels = [
"deepseek-r1:8b"
"dolphin3:8b"
];
};
services.open-webui = {
enable = true;
package = unstable.open-webui;
host = "0.0.0.0";
environment = {
ANONYMIZED_TELEMETRY = "False";
DO_NOT_TRACK = "True";
SCARF_NO_ANALYTICS = "True";
OLLAMA_API_BASE_URL = "http://127.0.0.1:11434/api";
OLLAMA_BASE_URL = "http://127.0.0.1:11434";
};
};
services.opensnitch = {
enable = true;
@@ -473,6 +428,7 @@
};
virtualisation = {
docker.enable = true;
podman.enable = true;
libvirtd = {
enable = true;

View File

@@ -12,14 +12,15 @@
nix.enable = false;
programs.zsh = {
enable = true;
# https://github.com/nix-community/home-manager/issues/108#issuecomment-340397178
enableCompletion = false;
};
system.stateVersion = 4;
users.users."dave.gallant".home = "/Users/dave.gallant";
users.users."dave.gallant".shell = pkgs.fish;
programs.fish.enable = true;
system.primaryUser = "dave.gallant";
system.defaults = {
@@ -36,11 +37,13 @@
tilesize = 50;
orientation = "bottom";
persistent-apps = [
"/Applications/iTerm.app"
"/Applications/Ghostty.app"
"/Applications/Google Chrome.app"
"/Applications/LibreWolf.app"
"/Applications/Obsidian.app"
"/Applications/Logseq.app"
"/Applications/Slack.app"
"/Applications/Spotify.app"
"/Applications/Visual Studio Code.app"
"/Applications/zoom.us.app"
];
};
@@ -64,7 +67,7 @@
finder.FXPreferredViewStyle = "Nlsv";
};
security.pam.services.sudo_local.touchIdAuth = true;
security.pam.enableSudoTouchIdAuth = true;
homebrew = {
enable = true;
@@ -78,32 +81,33 @@
};
brews = [
"argocd"
"azure-cli"
"coreutils"
"gnu-sed"
"gnu-tar"
"k6"
"netdata"
"node"
"oras"
"vault"
"k6"
];
casks = [
"claude-code"
"discord"
"dbeaver-community"
"font-fira-code-nerd-font"
"font-hack-nerd-font"
"fork"
"freelens"
"ghostty"
"iterm2"
"karabiner-elements"
"knockknock"
"librewolf"
"logseq"
"lulu"
"mitmproxy"
"notunes"
"obsidian"
"ollama"
"postman"
"raycast"
"rectangle"
"signal"
@@ -112,14 +116,11 @@
"stats"
"steam"
"taskexplorer"
"tailscale-app"
"tailscale"
"vlc"
"whisky"
"zed"
];
taps = [
"hashicorp/tap"
"homebrew/bundle"
"homebrew/cask-fonts"
"homebrew/cask-versions"
@@ -127,4 +128,9 @@
];
};
stylix = {
# enable = true;
image = "/Library/tokyo-night.jpg";
};
}

BIN
nixos-wallpaper.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 KiB

View File

@@ -1,8 +1,13 @@
{
config,
lib,
pkgs,
unstable,
...
}:
let
inherit (pkgs) stdenv;
in
{
environment.systemPackages = with pkgs; [
# essentials
@@ -16,33 +21,37 @@
zip
# modern cli
atuin
bat
cd-fzf
doggo
eza
fd
github-cli
hadolint
lazygit
macchina
ncdu
nodePackages.eslint
oha
pre-commit
progress
ripgrep
shellcheck
shfmt
tldr
atuin
github-cli
viddy
yq-go
# containers
unstable.argocd
unstable.k9s
unstable.krew
unstable.kubecolor
unstable.kubectl
unstable.kubectx
unstable.kubernetes-helm
unstable.stern
krew
kubecolor
kubectl
kubectx
minikube
stern
dive
helm-docs
k9s
kubernetes-helm
# cloud
awscli2
@@ -51,12 +60,12 @@
# lsp
nodePackages.bash-language-server
nodePackages.eslint
nodePackages.yaml-language-server
terraform-ls
# monitoring
btop
htop
procs
# golang
gofumpt
@@ -80,13 +89,17 @@
openvpn
tcpdump
# rice
fastfetch
# nix
nix-tree
nixfmt-rfc-style
nixpkgs-review
nvd
# python
poetry
python313
virtualenv
# media

View File

@@ -0,0 +1,43 @@
{ config, pkgs, ... }:
let
netdata = pkgs.netdata;
netdataConf = ./netdata.conf;
netdataDir = "/var/lib/netdata";
in
{
users.extraGroups.netdata.gid = 220008;
users.users.netdata.group = "netdata";
users.extraUsers.netdata = {
description = "Netdata server user";
isSystemUser = true;
name = "netdata";
uid = 200008;
};
systemd.services.netdata = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
preStart = ''
mkdir -p ${netdataDir}/config
mkdir -p ${netdataDir}/logs
cp -r ${netdata}/share/netdata/web ${netdataDir}/web
chmod -R 700 ${netdataDir}
chown -R netdata:netdata ${netdataDir}
'';
serviceConfig = {
Type = "forking";
ExecStart = "${netdata}/bin/netdata -c ${netdataConf} -u netdata";
Restart = "on-failure";
};
};
services.nginx.httpConfig = ''
server {
server_name netdata.thume.net;
location / {
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:19999;
}
}
'';
}

View File

@@ -0,0 +1,21 @@
[global]
run as user = netdata
config directory = /var/lib/netdata/config
web files directory = /var/lib/netdata/web
cache directory = /var/lib/netdata
log directory = /var/lib/netdata/logs
# the default database size - 1 hour
history = 3600
# some defaults to run netdata with least priority
process scheduling policy = idle
OOM score = 1000
[web]
# web files owner = root
web files group = netdata
# by default do not expose the netdata port
bind to = localhost

13
shell.nix Normal file
View File

@@ -0,0 +1,13 @@
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.11";
pkgs = import nixpkgs {
config = { };
overlays = [ ];
};
in
pkgs.mkShell {
shellHook = ''
${(import ./default.nix).pre-commit-check.shellHook}
'';
}

View File

@@ -2,10 +2,6 @@
set -euo pipefail
if ! git diff-index --quiet HEAD --; then
git stash push -m "Auto-stash via update-flash.sh on $(date)"
fi
git pull
update_msg=$(nix flake update 2>&1 | grep -v 'warning:')
just rebuild

9
upgrade-diff.nix Normal file
View File

@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
system.activationScripts.diff = {
supportsDryActivation = true;
text = ''
${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
'';
};
}