Compare commits

..

9 Commits

Author SHA1 Message Date
Audrey 79f6995431 bump 2026-03-06 14:08:25 -07:00
Audrey 32301ed3d6 augh 2026-03-06 00:13:14 -07:00
Audrey bc4205d3ee oh there we go 2026-03-06 05:47:42 +00:00
Audrey 9fb72416ca almost there 2026-03-05 22:29:29 -07:00
Audrey 7cf36bd2b5 rg good 2026-03-03 16:29:36 -07:00
Audrey 4a2f311176 more chrysanthemum 2026-03-01 21:12:54 -07:00
Audrey 32f224b494 oops 2026-02-25 05:12:58 -07:00
Audrey 52c8c73d9d what 2026-02-25 05:09:19 -07:00
Audrey ac0a851962 chrysanthemum attempt 2026-02-24 09:16:33 -07:00
94 changed files with 2252 additions and 7980 deletions

View File

@ -1,17 +1,11 @@
{ config, pkgs, lib, ... }:
{ {
lib, config = lib.mkMerge [(lib.mkIf (pkgs.stdenv.buildPlatform == pkgs.stdenv.hostPlatform) {
pkgs,
...
}:
{
config = lib.mkIf (pkgs.stdenv.buildPlatform == pkgs.stdenv.hostPlatform) {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
meld meld
nixfmt nixfmt-rfc-style
stdenv.cc stdenv.cc
stdenv.cc.bintools # bins but not manpages included in stdenv.cc stdenv.cc.bintools # bins but not manpages included in stdenv.cc
cached-nix-shell
zmx
]; ];
programs.git.config.merge.tool = "meld"; programs.git.config.merge.tool = "meld";
@ -19,16 +13,16 @@
programs.neovim = { programs.neovim = {
enable = true; enable = true;
# defaultEditor = true; defaultEditor = true;
vimAlias = true; vimAlias = true;
viAlias = true; viAlias = true;
configure = { configure = {
# lmao # lmao
customRC = '' customRC = ''
${builtins.readFile ../dotfiles/nvim-init.vim} ${builtins.readFile ./dotfiles/nvim-init.vim}
lua << EOF lua << EOF
${builtins.readFile ../dotfiles/nvim-init.lua} ${builtins.readFile ./dotfiles/nvim-init.lua}
EOF EOF
''; '';
packages.myVimPackage = with pkgs.vimPlugins; { packages.myVimPackage = with pkgs.vimPlugins; {
start = [ start = [
@ -55,31 +49,28 @@
vim-nix vim-nix
csharpls-extended-lsp-nvim csharpls-extended-lsp-nvim
]; ];
opt = [ ]; opt = [];
}; };
}; };
}; };
systemd.services.nvim-server = { }) (lib.mkIf (pkgs.stdenv.buildPlatform != pkgs.stdenv.hostPlatform) {
enable = false; programs.vim = {
wantedBy = [ "multi-user.target" ]; enable = true;
description = "Neovim Server"; defaultEditor = true;
script = '' package = pkgs.vim.customize {
export PATH="/run/current-system/sw/bin:/run/wrappers/bin:$PATH" vimrcConfig.customRC = ''
nvim --listen /tmp/nvim.sock --headless set mouse=
''; set hlsearch
serviceConfig = { nnoremap <CR> :noh<CR><CR>
User = "audrey"; '';
Type = "simple"; };
Restart = "always";
}; };
environment = { programs.git.config.core.editor = "vim";
LOG_CHANNEL_ID = "532689319350108160"; environment.systemPackages = with pkgs; [
CHANNEL_COUNT = "4"; clang
DELAY_SECONDS = "5"; bintools
DEBUG = "0"; ];
}; }) ];
};
};
} }

104
configuration-desktop.nix Normal file
View File

@ -0,0 +1,104 @@
{
lib,
pkgs,
...
}:
{
#networking.networkmanager.enable = true;
fonts.packages = builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts);
services = {
xserver.enable = true;
printing = {
enable = true;
drivers = with pkgs; [ cnijfilter2 ];
};
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
pipewire = {
enable = true;
pulse.enable = true;
};
libinput.enable = true;
#blueman.enable = true;
};
audrey-sway = {
enable = true;
};
programs.ydotool.enable = true;
users.users.audrey.extraGroups = [ "ydotool" ];
virtualisation.docker = {
enable = true;
storageDriver = "zfs";
logDriver = "journald";
daemon.settings = {
insecure-registries = [ "docker.shell.phish" "registry.finals.2025.nautilus.institute:5000" ];
};
};
programs = {
chromium.enable = true;
firefox.enable = true;
kdeconnect.enable = true;
partition-manager.enable = true;
wireshark.enable = true;
wireshark.package = pkgs.wireshark;
foot.enable = true;
obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-livesplit-one
];
};
};
environment.sessionVariables.TERMINAL = "footclient";
environment.systemPackages = with pkgs; [
dino
discord
element-desktop
signal-desktop
slack
zotero
via
libimobiledevice
dwarfdump
ffmpeg
gimp
kdePackages.plasma-thunderbolt
];
services.usbmuxd.enable = true;
systemd.tmpfiles.settings.usersetup."/home/audrey/Downloads"."e!" = {
user = "audrey";
group = "users";
mode = "0700";
age = "1d";
};
#systemd.services.sysfs-settings = {
# description = "Set desktop sysfs tunables";
# script = ''
# # https://bugzilla.kernel.org/show_bug.cgi?id=219112
# test "$(cat /sys/module/kvm/parameters/nx_huge_pages)" = "never" && exit 0 || true
# echo "never" | tee /sys/module/kvm/parameters/nx_huge_pages
# '';
# before = [ "boot-complete.target" ];
#};
hardware.keyboard.qmk.enable = true;
services.udev.packages = [ pkgs.via ];
}

20
configuration-nixbsd.nix Normal file
View File

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
let
nixKey = "/var/lib/nix/binary-cache-key" ;
in {
init.services.nix-key-setup = {
description = "Generate a nix build signing key";
startType = "oneshot";
startCommand = [ (pkgs.writeScript "nix-key-setup" ''
test -f ${nixKey} && test -f ${nixKey}.pub && exit 0 || true
mkdir -p "$(dirname "${nixKey}")"
${config.nix.package}/bin/nix-store --generate-binary-cache-key ${config.networking.hostName} ${nixKey} ${nixKey}.pub
'') ];
dependencies = [ "FILESYSTEMS" ];
before = [ "nix-daemon" ];
};
environment.systemPackages = with pkgs; [
freebsd.truss
];
}

View File

@ -1,15 +1,9 @@
{ { config, lib, pkgs, ... }:
config,
lib,
pkgs,
...
}:
let let
nixKey = "/var/lib/nix/binary-cache-key"; nixKey = "/var/lib/nix/binary-cache-key";
# just using the filepath interacts poorly with typechecking under diverted stores # just using the filepath interacts poorly with typechecking under diverted stores
toStore = path: pkgs.writeText (builtins.baseNameOf path) (builtins.readFile path); toStore = path: pkgs.writeText (builtins.baseNameOf path) (builtins.readFile path);
in in {
lib.optionalAttrs (!(lib ? nixbsdSystem)) {
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.systemd-boot.memtest86.enable = lib.mkIf (pkgs.stdenv.hostPlatform.isx86) true; boot.loader.systemd-boot.memtest86.enable = lib.mkIf (pkgs.stdenv.hostPlatform.isx86) true;
@ -28,20 +22,36 @@ lib.optionalAttrs (!(lib ? nixbsdSystem)) {
console = { console = {
font = "Lat2-Terminus16"; font = "Lat2-Terminus16";
#keyMap = "us"; keyMap = "us";
useXkbConfig = true; # use xkb.options in tty. useXkbConfig = true; # use xkb.options in tty.
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
strace strace
rr
qemu-user
# language servers
nil
#rust-analyzer # misbehaves unless it's in a dev shell with other environment variables... see shelld
lua-language-server
clang-tools
bash-language-server
pyright
csharp-ls
dotnet-sdk_9
gopls
typescript-language-server
#ocamllsp
pre-commit
]; ];
programs = { programs = {
zoxide.enable = true; firejail.enable = true;
firejail.enable = config.rhelmot.isWorkstation; virt-manager.enable = true;
virt-manager.enable = config.rhelmot.isWorkstation;
nix-ld = { nix-ld = {
enable = config.rhelmot.isWorkstation; enable = true;
libraries = with pkgs; [ libraries = with pkgs; [
glib glib
libGL libGL
@ -52,48 +62,43 @@ lib.optionalAttrs (!(lib ? nixbsdSystem)) {
zlib zlib
wayland wayland
krb5 krb5
fuse xorg.libX11
sdl3 xorg.libxcb
sdl2-compat xorg.xcbutilimage
libx11 xorg.xcbutilkeysyms
libxcb xorg.xcbutilrenderutil
libxcb-image xorg.xcbutilwm
libxcb-keysyms xorg.libXrandr
libxcb-render-util xorg.libXxf86vm
libxcb-wm xorg.libXi
libxrandr xorg.libXcursor
libxxf86vm xorg.libXinerama
libxi
libxcursor
libxinerama
]; ];
}; };
}; };
services.zfs.zed = { services.zfs.zed = {
settings = { settings = {
PATH = lib.mkForce ( PATH = lib.mkForce (lib.makeBinPath [
lib.makeBinPath [ config.boot.zfs.package
config.boot.zfs.package pkgs.coreutils
pkgs.coreutils pkgs.curl
pkgs.curl pkgs.gawk
pkgs.gawk pkgs.gnugrep
pkgs.gnugrep pkgs.gnused
pkgs.gnused pkgs.nettools
pkgs.nettools pkgs.util-linux
pkgs.util-linux
config.systemd.package config.systemd.package
] ]);
);
ZED_USE_DBUS = "1"; ZED_USE_DBUS = "1";
}; };
}; };
security.pam.u2f = { security.pam.u2f = {
enable = config.rhelmot.isWorkstation; enable = true;
settings.authfile = toStore ../keys/u2f; settings.authfile = toStore ./dotfiles/u2f-keys;
settings.cue = true; settings.cue = true;
}; };

174
configuration.nix Normal file
View File

@ -0,0 +1,174 @@
{ config, lib, pkgs, ... }:
let rhelmot = config.rhelmot;
in {
options.rhelmot = {
globalPythonPackages = lib.mkOption {
type = with lib.types; listOf (functionTo (listOf package));
default = [];
description = "python packages (p: with p; [ x ]) to include in the global python environment";
};
};
imports = [ ./overlays/packages.nix ./configuration-cross.nix ];
config = {
nixpkgs.config.allowUnfree = true;
nix.settings.extra-experimental-features = "nix-command flakes pipe-operators";
nix.settings.trusted-users = [ "audrey" ];
nix.settings.max-jobs = 1;
nix.settings.cores = 0;
nix.settings.secret-key-files = [ "/var/lib/nix/binary-cache-key" ];
nix.settings.trusted-public-keys = builtins.filter (f: f != "") <| lib.strings.splitString "\n" <| builtins.readFile ./keys/nix;
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Configure keymap in X11
services.xserver.xkb.layout = "us";
services.xserver.xkb.options = "caps:escape";
users.defaultUserShell = pkgs.zsh;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.audrey = {
uid = 1000;
description = "Audrey Dutcher";
isNormalUser = true;
extraGroups = [ "wheel" "docker" "video" "networkmanager" "libvirtd" ];
openssh.authorizedKeys.keyFiles = [ ./keys/ssh ];
};
environment.systemPackages = with pkgs; [
man-pages
man-pages-posix
gnumake
wget
#moor
ripgrep
fd
curl
#btop
file
nettools
psmisc
units
units-desktop
patchelf
gdb
#kubectl
p7zip
unzip
zip
#foremost
#binwalk
jq
socat
#nix-index
openssl
#wireguard-tools
#cached-nix-shell
tcpdump
sqlite
#cronie
editorconfig-core-c
(python3.withPackages (p: lib.concatMap (pl: pl p) rhelmot.globalPythonPackages))
];
rhelmot.globalPythonPackages = [ (p: with p; [
#virtualenvwrapper
pylint
pytest
ipdb
ipython
nclib
pyyaml
snakeviz
requests
pysocks
aiohttp
]) ];
documentation.dev.enable = true;
programs = {
kakoune = {
enable = true;
plugins = with pkgs.kakounePlugins; [
kak-fzf
smarttab-kak
];
configFiles = lib.filesystem.listFilesRecursive ./dotfiles/kakoune/config;
colorSchemes = [ ./dotfiles/kakoune/colors ];
extraPackages = with pkgs; [
kak-tree-sitter
kakoune-lsp
];
};
zsh = {
enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
vteIntegration = true;
histSize = 10000;
promptInit = builtins.readFile ./dotfiles/zsh-prompt.sh;
shellInit = builtins.readFile ./dotfiles/zsh-init.sh;
shellAliases = {
ls = null;
ll = null;
l = null;
grep = "grep --color=auto";
egrep = "egrep --color=auto";
objdump = "objdump -M intel";
gits = "git status";
pag = "ps aux | grep -v grep | grep -i";
hd = "hexdump -C";
hdc = "hexdump -ve '\"\\\x\" 1/1 \"%02x\"'";
nose = "pytest -v --capture=no --pdbcls=IPython.terminal.debugger:TerminalPdb";
mkvirtualenv = "mkvirtualenv -r /etc/venv-default.txt";
};
};
tmux = {
enable = true;
extraConfig = builtins.readFile ./dotfiles/tmux.conf;
};
direnv.enable = true;
htop.enable = true;
git = {
enable = true;
#lfs.enable = true;
config = {
user.email = "audrey@rhelmot.io";
user.name = "Audrey Dutcher";
init.defaultBranch = "main";
blame.markUnblamableLines = true;
credential.helper = "store";
url."ssh://git@".insteadOf = "git://";
};
};
#bat = {
# enable = true;
# extraPackages = with pkgs.bat-extras; [
# batdiff
# batman
# prettybat
# ];
# settings = {
# italic-text = "always";
# wrap = "never";
# style = "plain";
# };
#};
};
environment.etc."zshrc.local".source = ./dotfiles/zsh-final.sh;
#environment.variables.PAGER = "moor";
environment.etc.zinputrc.text = lib.mkForce (builtins.readFile ./dotfiles/zsh-input.sh);
environment.etc."gdb/gdbinit".source = ./dotfiles/gdb-init.gdb;
environment.etc."venv-default.txt".source = ./dotfiles/venv-default.txt;
# Enable the OpenSSH daemon.
services.openssh.enable = true;
};
}

View File

@ -1,93 +0,0 @@
{
inputs ? import ./nix/tamal { },
nixpkgs-stable ? inputs.nixpkgs,
nixpkgs-experimental ? inputs.nixpkgs-experimental,
home-manager ? inputs.home-manager,
nixbsd ? inputs.nixbsd,
bingosync ? inputs.bingosync,
cwdcontrol ? inputs.cwdcontrol,
blog-rhelmot-io ? inputs.blog-rhelmot-io,
nixtamal ? inputs.nixtamal,
}:
let
nixpkgsLib = import "${nixpkgs-stable}/lib";
nixbsdLib = import "${nixbsd}/lib";
mkSystem =
name:
let
basicConf = import ./sites/${name}/hardware-configuration.nix {
pkgs = null;
config = null;
options = null;
lib = {
mkDefault = x: x;
};
modulesPath = null;
};
platform = basicConf.nixpkgs.hostPlatform;
systemTypes = {
linux = import "${nixpkgs-stable}/nixos/lib/eval-config.nix";
freebsd = nixbsdLib.nixbsdSystem;
};
systemName = builtins.elemAt (nixpkgsLib.strings.splitString "-" platform) 1;
evaluated = systemTypes.${systemName} {
system = null;
modules = [
./sites/${name}/configuration.nix
(import "${bingosync}/module.nix")
(import "${home-manager}/nixos")
{
nixpkgs.buildPlatform = builtins.currentSystem;
_module.args.pkgs-experimental = import nixpkgs-experimental {
crossSystem = basicConf.nixpkgs.hostPlatform;
localSystem = builtins.currentSystem;
};
_module.args.inputs = inputs // {
inherit
nixpkgs-stable
nixpkgs-experimental
nixbsd
bingosync
cwdcontrol
blog-rhelmot-io
nixtamal
;
};
}
]
++ (builtins.attrValues modules);
};
result = evaluated // {
system = evaluated.config.system.build.toplevel;
deploy = evaluated.config.rhelmot.deployScript;
pkgs-experimental = evaluated._module.args.pkgs-experimental;
};
in
result;
sites =
let
sitesFiles = builtins.readDir ./sites;
sitesNames = builtins.filter (name: builtins.pathExists ./sites/${name}/configuration.nix) (
builtins.attrNames sitesFiles
);
toSitesList = name: {
inherit name;
value = mkSystem name;
};
sitesList = map toSitesList sitesNames;
in
builtins.listToAttrs sitesList;
modules =
let
modulesFiles = builtins.attrNames (builtins.readDir ./modules);
toModulesList = filename: {
name = nixpkgsLib.strings.removeSuffix ".nix" filename;
value = ./modules/${filename};
};
modulesList = map toModulesList modulesFiles;
in
builtins.listToAttrs modulesList;
in
{
inherit modules sites;
}

43
deploy.nix Normal file
View File

@ -0,0 +1,43 @@
{
flakeInputs,
platform,
site,
}:
let
pkgs = flakeInputs.nixpkgs.legacyPackages.${platform};
lib = pkgs.lib;
mkDeploy = { site, targetPkg, profileName, extraCommands ? "" }: pkgs.substituteAll {
name = "deploy-${profileName}";
dir = "bin";
src = builtins.toFile "deploy-template" ''
#!@runtimeShell@
set -ex
nix-copy-closure --to @site@ @targetPkg@
ssh @site@ sudo nix-env --set -p /nix/var/nix/profiles/@profileName@ @targetPkg@
@extraCommands@
'';
env = {
inherit site targetPkg profileName extraCommands;
inherit (pkgs) runtimeShell;
};
isExecutable = true;
passthru.site = site;
};
deployments = builtins.map mkDeploy [
{
profileName = "blog-rhelmot-io";
site = "sunflower";
targetPkg = flakeInputs."blog-rhelmot-io".packages.${platform}.blog;
}
];
filteredDeployments = builtins.filter (deployment: deployment.site == site) deployments;
filteredDeploymentsAttrs = builtins.listToAttrs (builtins.map (value: { name = value.profileName; inherit value; }) filteredDeployments);
targetSystem = flakeInputs.self.packages.${platform}.${site}.system;
deployAll = pkgs.writeShellScriptBin "deploy-all-${site}" (''
set -ex
# TODO take advantage of the nixos-rebuild infrastructure
nix-copy-closure --to ${site} ${targetSystem}
ssh ${site} 'sudo nix-env --set -p /nix/var/nix/profiles/system ${targetSystem} && sudo ${targetSystem}/bin/switch-to-configuration switch'
set +e
'' + lib.concatStringsSep "\n" filteredDeployments);
in deployAll // filteredDeploymentsAttrs

View File

@ -1,9 +0,0 @@
WORKDAY='Mon-Fri *-*-* 9..17:*:*'
cwdcontrol-disallow --systemd "$WORKDAY" --dir ~/proj/nix
cwdcontrol-disallow --systemd "$WORKDAY" --dir ~/proj/dragon
cwdcontrol-disallow --systemd "$WORKDAY" --dir ~/proj/celeste
cwdcontrol-disallow --systemd "$WORKDAY" --url types.pl
cwdcontrol-disallow --systemd "$WORKDAY" --url www.tumblr.com
cwdcontrol-disallow --systemd "$WORKDAY" --appid im.dino.Dino
cwdcontrol-disallow --systemd "$WORKDAY" --appid discord

View File

@ -6,15 +6,11 @@ selection=343a55ff
selection-match=2ac3deff selection-match=2ac3deff
selection-text=c0caf5ff selection-text=c0caf5ff
border=27a1b9ff border=27a1b9ff
[main] [main]
font=sans-serif:size=20,emoji:size=20 font=sans-serif:size=20,emoji:size=20
anchor=top anchor=top
letter-spacing=0.7 letter-spacing=0.7
y-margin=70 y-margin=70
keyboard-focus=exclusive
exit-on-keyboard-focus-loss=no
[key-bindings] [key-bindings]
next-with-wrap=Mod1+Down next-with-wrap=Mod1+Down
prev-with-wrap=Mod1+Up prev-with-wrap=Mod1+Up

View File

@ -4,7 +4,7 @@ hook global BufCreate .* %{
} }
set-option -add global ui_options terminal_assistant=cat set-option -add global ui_options terminal_assistant=cat
set-option -add global ui_options terminal_enable_mouse=false set-option -add global ui_options terminal_enable_mouse=false
set-option global modelinefmt "%opt{lsp_modeline} %%val{bufname} %%val{cursor_line}:%%val{cursor_char_column} {{context_info}} {{mode_info}}" set-option global modelinefmt '%val{bufname} %val{cursor_line}:%val{cursor_char_column} {{context_info}} {{mode_info}}'
add-highlighter global/ wrap -word add-highlighter global/ wrap -word
add-highlighter global/ number-lines -hlcursor -min-digits 3 add-highlighter global/ number-lines -hlcursor -min-digits 3
add-highlighter global/ show-matching -previous add-highlighter global/ show-matching -previous

View File

@ -8,10 +8,7 @@ map global normal <a-j> '<a-s-j>'
map global normal <a-s-j> '<a-j>' map global normal <a-s-j> '<a-j>'
map -docstring "Reset all selections" global normal '<ret>' '<a-:>:nohl<ret>;,' map -docstring "Reset all selections" global normal '<ret>' '<a-:>:nohl<ret>;,'
map global goto d <esc>:lsp-definition<ret> -docstring 'LSP definition' map -docstring "error listing" global goto e '<a-;> le'
map global goto r <esc>:lsp-references<ret> -docstring 'LSP references'
map global goto y <esc>:lsp-type-definition<ret> -docstring 'LSP type definition'
map global goto e <esc>:lsp-diagnostics<ret> -docstring 'LSP error listing'
map global normal '<a-v>' %{ map global normal '<a-v>' %{
:tree-sitter-nav '"parent"'<ret> :tree-sitter-nav '"parent"'<ret>

View File

@ -8,11 +8,6 @@ set-option global fzf_grep_command 'rg'
set-option global fzf_grep_preview_command 'bat' set-option global fzf_grep_preview_command 'bat'
set-option global fzf_window_map 'ctrl-n' set-option global fzf_window_map 'ctrl-n'
#require-module 'wayland'
require-module 'kitty'
#set-option global termcmd "kitty --single-instance sh -c"
set-option global kitty_window_type 'os-window'
map -docstring "filename search (current dir)" global goto n '<a-;>:filename-search<ret>' map -docstring "filename search (current dir)" global goto n '<a-;>:filename-search<ret>'
map -docstring "filename search (file dir)" global goto N '<a-;>:filename-search buffile-dir<ret>' map -docstring "filename search (file dir)" global goto N '<a-;>:filename-search buffile-dir<ret>'
map -docstring "full-text search (current dir)" global goto f '<a-;> fg' map -docstring "full-text search (current dir)" global goto f '<a-;> fg'
@ -29,10 +24,10 @@ define-command -docstring "terminal but floating" terminal-floating -params .. %
} }
set-option global fzf_terminal_command 'terminal-floating' set-option global fzf_terminal_command 'terminal-floating'
define-command sway-terminal-floating -params .. %{
define-command kitty-terminal-floating -params .. %{ nop %sh{ sway fullscreen disable }
set-option local kitty_window_type 'os-panel' set-option local termcmd "footclient --title=fzf.kak.picker sh -c"
kitty-terminal-window --os-panel edge=center --os-panel layer=overlay --os-panel focus-policy=exclusive --cwd current %arg{@} wayland-terminal-window %arg{@}
} }
define-command -override -hidden -docstring "wrapper command to create new terminal" \ define-command -override -hidden -docstring "wrapper command to create new terminal" \

View File

@ -19,8 +19,8 @@ map global object a '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
map global object <a-a> '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol' map global object <a-a> '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
map global object f '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method' map global object f '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method'
map global object t '<a-semicolon>lsp-object Class Interface Struct<ret>' -docstring 'LSP class interface or struct' map global object t '<a-semicolon>lsp-object Class Interface Struct<ret>' -docstring 'LSP class interface or struct'
map global object d '<a-semicolon>lsp-diagnostic-object error<ret>' -docstring 'LSP errors' map global object d '<a-semicolon>lsp-diagnostic-object --include-warnings<ret>' -docstring 'LSP errors and warnings'
map global object D '<a-semicolon>lsp-diagnostic-object error warning<ret>' -docstring 'LSP errors and warnings' map global object D '<a-semicolon>lsp-diagnostic-object<ret>' -docstring 'LSP errors'
hook -group lsp-diagnostic-autohover global NormalIdle .* %{ hook -group lsp-diagnostic-autohover global NormalIdle .* %{
lsp-check-auto-hover %{ try lsp-hover-if-error } lsp-check-auto-hover %{ try lsp-hover-if-error }

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
forward_remote_control yes

View File

@ -1,50 +0,0 @@
# vim:ft=kitty
## name: Tokyo Night (Tweaked)
## license: MIT
## author: Folke Lemaitre
## upstream: https://github.com/folke/tokyonight.nvim/raw/main/extras/kitty/tokyonight_night.conf
background #1a1b26
foreground #c0caf5
selection_background #283457
selection_foreground #c0caf5
url_color #73daca
cursor #c0caf5
cursor_text_color #1a1b26
# Tabs
active_tab_background #7aa2f7
active_tab_foreground #16161e
inactive_tab_background #292e42
inactive_tab_foreground #545c7e
#tab_bar_background #15161e
# Windows
active_border_color #7aa2f7
inactive_border_color #292e42
# normal
color0 #15161e
color1 #f7768e
color2 #9ece6a
color3 #e0af68
color4 #7aa2f7
color5 #bb9af7
color6 #7dcfff
color7 #a9b1d6
# bright
color8 #414868
color9 #ff899d
color10 #9fe044
color11 #b68405
color12 #8db0ff
color13 #c7a9ff
color14 #a4daff
color15 #c0caf5
# extended colors
color16 #b24200
color17 #db4b4b

View File

@ -10,6 +10,7 @@ end
--local rt = require("rust-tools") --local rt = require("rust-tools")
local lint = require('lint') local lint = require('lint')
local lspconfig = require('lspconfig')
tb = require("telescope.builtin") tb = require("telescope.builtin")
require('telescope').setup({ require('telescope').setup({
@ -85,15 +86,22 @@ require("telescope.pickers.layout_strategies").buffer_window = function(self)
return layout return layout
end end
require("nvim-treesitter").setup { require("nvim-treesitter.configs").setup {
auto_install = false,
highlight = {
enable = true,
disable = function(lang, buf)
local max_filesize = 100 * 1024 * 1024 -- 100 MB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
},
indent = {
enable = true
}
} }
vim.api.nvim_create_autocmd('FileType', {
pattern = { '<filetype>' },
callback = function()
vim.treesitter.start()
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end
})
-- completion -- completion
local cmp = require('cmp') local cmp = require('cmp')
@ -328,10 +336,9 @@ function show_preview_diagnostic(diag)
vim.api.nvim_echo({{message}}, false, {}) vim.api.nvim_echo({{message}}, false, {})
end end
lspconfig_util = require("lspconfig.util")
rust_root_dir = function(fname) rust_root_dir = function(fname)
local primary = lspconfig_util.root_pattern('rust-toolchain')(fname) local primary = lspconfig.util.root_pattern('rust-toolchain')(fname)
local fallback = lspconfig_util.root_pattern('Cargo.toml')(fname) local fallback = lspconfig.util.root_pattern('Cargo.toml')(fname)
return primary or fallback return primary or fallback
end end
@ -361,7 +368,7 @@ if rust_analyzer ~= nil then
-- cmd = {rust_analyzer}, -- cmd = {rust_analyzer},
-- }, -- },
--}) --})
vim.lsp.config("rust_analyzer", { lspconfig.rust_analyzer.setup{
on_attach = lsp_keybinds, on_attach = lsp_keybinds,
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
@ -371,11 +378,10 @@ if rust_analyzer ~= nil then
}, },
}, },
}, },
}) }
vim.lsp.enable("rust_analyzer")
end end
if pyright ~= nil then if pyright ~= nil then
vim.lsp.config("pyright", { lspconfig.pyright.setup{
on_attach = lsp_keybinds, on_attach = lsp_keybinds,
capabilities = capabilities, capabilities = capabilities,
cmd = {pyright, '--stdio'}, cmd = {pyright, '--stdio'},
@ -388,11 +394,10 @@ if pyright ~= nil then
}, },
}, },
}, },
}) }
vim.lsp.enable("pyright")
end end
if clangd ~= nil then if clangd ~= nil then
vim.lsp.config("clangd", { lspconfig.clangd.setup{
on_attach = lsp_keybinds, on_attach = lsp_keybinds,
capabilities = capabilities, capabilities = capabilities,
cmd = {clangd, "--limit-references=1000000" }, cmd = {clangd, "--limit-references=1000000" },
@ -401,38 +406,32 @@ if clangd ~= nil then
clangdFileStatus = true clangdFileStatus = true
}, },
single_file_support = false, single_file_support = false,
}) }
vim.lsp.enable("clangd")
end end
vim.lsp.config("nil_ls", { lspconfig.nil_ls.setup{
on_attach = lsp_keybinds, on_attach = lsp_keybinds,
capabilities = capabilities, capabilities = capabilities,
}) }
vim.lsp.enable("nil_ls") lspconfig.csharp_ls.setup{
vim.lsp.config("csharp_ls", {
on_attach = lsp_keybinds, on_attach = lsp_keybinds,
capabilities = capabilities, capabilities = capabilities,
}) }
vim.lsp.enable("csharp_ls")
if bashls ~= nil then if bashls ~= nil then
vim.lsp.config("bashls", { lspconfig.bashls.setup{
on_attach = lsp_keybinds, on_attach = lsp_keybinds,
capabilities = capabilities, capabilities = capabilities,
cmd = {bashls, "start" }, cmd = {bashls, "start" },
}) }
vim.lsp.enable("bashls")
end end
vim.lsp.config("gopls", { lspconfig.gopls.setup{
on_attach = lsp_keybinds, on_attach = lsp_keybinds,
capabilities = capabilities, capabilities = capabilities,
}) }
vim.lsp.enable("gopls") lspconfig.ts_ls.setup{
vim.lsp.config("ts_ls", {
on_attach = lsp_keybinds, on_attach = lsp_keybinds,
capabilities = capabilities, capabilities = capabilities,
}) }
vim.lsp.enable("ts_ls") lspconfig.lua_ls.setup{
vim.lsp.config("lua_ls", {
on_attach = lsp_keybinds, on_attach = lsp_keybinds,
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
@ -442,12 +441,11 @@ vim.lsp.config("lua_ls", {
}, },
}, },
}, },
}) }
vim.lsp.enable("lua_ts") --lspconfig.ocamllsp.setup{
--vim.lsp.config("ocamllsp", {
-- on_attach = lsp_keybinds, -- on_attach = lsp_keybinds,
-- capabilities = capabilities, -- capabilities = capabilities,
--}) --}
--vim.api.nvim_create_autocmd({ "BufWritePost", "BufReadPost" }, { --vim.api.nvim_create_autocmd({ "BufWritePost", "BufReadPost" }, {
-- callback = function() -- callback = function()
@ -459,7 +457,6 @@ vim.lsp.enable("lua_ts")
-- python = {'ruff'}, -- python = {'ruff'},
-- rust = {}, -- rust = {},
--} --}
--vim.lsp.enable("ocamllsp")
-- LSP Diagnostics Options Setup -- LSP Diagnostics Options Setup
local sign = function(opts) local sign = function(opts)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

View File

@ -1 +0,0 @@

View File

@ -5,11 +5,15 @@
## ##
# #
## Environment sync with uwsm and the palette ## Environment sync with uwsm and restart daemons
# #
exec_always 'uwsm finalize' #exec_always 'UWSM_FINALIZE_VARNAMES="${UWSM_FINALIZE_VARNAMES}${UWSM_FINALIZE_VARNAMES:+ }PAM_KWALLET5_LOGIN" uwsm finalize'
exec_always '/etc/sway/generate_palette >~/.cache/sway_palette.json' exec_always '/etc/sway/generate_palette >~/.cache/sway_palette.json'
exec waybar
exec swaync
exec foot --server
exec kanshi
# #
## Variables ## Variables
@ -21,10 +25,8 @@ set $left h
set $down j set $down j
set $up k set $up k
set $right l set $right l
set $term kitty --single-instance set $term footclient
set $browser firefox set $menu fuzzel
set $prelaunch swaylaunch
set $menu fuzzel "--launch-prefix=$prelaunch"
set $swaylock swaylock -c 1a1b26 set $swaylock swaylock -c 1a1b26
# #
@ -32,7 +34,7 @@ set $swaylock swaylock -c 1a1b26
# #
# Support legacy X11 apps # Support legacy X11 apps
xwayland enable #xwayland enable
# Move containers to scratchpad when they try to minimize # Move containers to scratchpad when they try to minimize
scratchpad_minimize enable scratchpad_minimize enable
# Move the mouse to a container when it focuses # Move the mouse to a container when it focuses
@ -80,9 +82,7 @@ bindsym $mod+Return exec $menu
### Command Palette ### Command Palette
bindsym $mod+Ctrl+Return exec /etc/sway/palette bindsym $mod+Ctrl+Return exec /etc/sway/palette
### Terminal ### Terminal
bindsym $mod+t exec $prelaunch $term bindsym $mod+t exec $term
### Browser
bindsym $mod+Shift+t exec $prelaunch $browser
# #
## Special keys ## Special keys
@ -102,16 +102,16 @@ bindsym --locked XF86AudioNext exec playerctl next
bindsym --locked XF86AudioStop exec playerctl stop bindsym --locked XF86AudioStop exec playerctl stop
# Brightness # Brightness
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 10%- bindsym --locked XF86MonBrightnessDown exec light -U 10
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 10%+ bindsym --locked XF86MonBrightnessUp exec light -A 10
# Screenshot # Screenshot
bindsym Print exec "FILEPATH=$(xdg-user-dir PICTURES)/Screenshots/$(date +'%Y-%m-%d-%H-%M-%S').png; slurp | grim -g - \"$FILEPATH\" && wl-copy <\"$FILEPATH\"" bindsym Print exec "FILEPATH=$(xdg-user-dir PICTURES)/Screenshots/$(date +'%Y-%m-%h-%H:%M:%S').png; slurp | grim -g - \"$FILEPATH\" && wl-copy <\"$FILEPATH\""
bindsym Alt+tab exec /etc/sway/sws next bindsym Alt+tab exec /etc/sway/sws next
bindsym Alt+Shift+tab exec /etc/sway/sws prev bindsym Alt+Shift+tab exec /etc/sway/sws prev
# bindsym $mod+tab exec "swayr next-window all-workspaces" bindsym $mod+tab exec "swayr next-window all-workspaces"
# bindsym $mod+Shift+tab exec "swayr prev-window all-workspaces" bindsym $mod+Shift+tab exec "swayr prev-window all-workspaces"
### Open notification tray ### Open notification tray
bindsym $mod+n exec swaync-client -t -sw bindsym $mod+n exec swaync-client -t -sw
@ -136,31 +136,17 @@ bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut.
# #
### Focus window left ### Focus window left
bindsym $mod+$left exec sway-overfocus split-lt float-lt output-ls bindsym $mod+$left focus left
# bindsym $mod+$left focus left
### Focus window down ### Focus window down
bindsym $mod+$down exec sway-overfocus split-dt float-dt output-ds bindsym $mod+$down focus down
# bindsym $mod+$down focus down
### Focus window up ### Focus window up
bindsym $mod+$up exec sway-overfocus split-ut float-ut output-us bindsym $mod+$up focus up
# bindsym $mod+$up focus up
### Focus window right ### Focus window right
bindsym $mod+$right exec sway-overfocus split-rt float-rt output-rs bindsym $mod+$right focus right
# bindsym $mod+$right focus right bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Left exec sway-overfocus split-lt float-lt output-ls bindsym $mod+Up focus up
# bindsym $mod+Left focus left bindsym $mod+Right focus right
bindsym $mod+Down exec sway-overfocus split-dt float-dt output-ds
# bindsym $mod+Down focus down
bindsym $mod+Up exec sway-overfocus split-ut float-ut output-us
# bindsym $mod+Up focus up
bindsym $mod+Right exec sway-overfocus split-rt float-rt output-rs
# bindsym $mod+Right focus right
### Focus next tab
bindsym $mod+Tab exec sway-overfocus group-rw group-dw
### Focus previous tab
bindsym $mod+Shift+Tab exec sway-overfocus group-lw group-uw
# Move the focused window with the same, but add Shift # Move the focused window with the same, but add Shift
### Move focused window left ### Move focused window left
@ -176,6 +162,20 @@ bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right bindsym $mod+Shift+Right move right
# Move the focused window across entire workspaces
### Move focused window to workspace left
bindsym $mod+Ctrl+$left move to workspace left
### Move focused window to workspace down
bindsym $mod+Ctrl+$down move to workspace down
### Move focused window to workspace up
bindsym $mod+Ctrl+$up move to workspace up
### Move focused window to workspace right
bindsym $mod+Ctrl+$right move to workspace right
bindsym $mod+Ctrl+Left move to workspace left
bindsym $mod+Ctrl+Down move to workspace down
bindsym $mod+Ctrl+Up move to workspace up
bindsym $mod+Ctrl+Right move to workspace right
# Move entire workspace to different output # Move entire workspace to different output
### Move focused workspace to monitor left ### Move focused workspace to monitor left
bindsym $mod+Shift+Ctrl+$left move workspace to output left bindsym $mod+Shift+Ctrl+$left move workspace to output left
@ -233,11 +233,11 @@ bindsym $mod+Shift+9 move container to workspace number 9; workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10; workspace number 10 bindsym $mod+Shift+0 move container to workspace number 10; workspace number 10
### Rename current workspace ### Rename current workspace
bindsym $mod+Shift+r exec "NUM=$(swaymsg -t get_workspaces | jq '.[] | select(.focused) | .num'); read -r NEWNAME rest < <(fuzzel --dmenu --prompt-only 'Rename: '); REGEX='^[0-9]+:?'; [[ $NEWNAME =~ $REGEX ]] || NEWNAME=$NUM:$NEWNAME; sway rename workspace to $NEWNAME" bindsym $mod+Shift+r exec "sway rename workspace to $(swaymsg -t get_workspaces | jq '.[] | select(.focused) | .num'):$(fuzzel --dmenu --prompt-only 'Rename: ')"
### Focus new workspace ### Focus new workspace
bindsym $mod+grave exec "NUM=$(swaymsg -t get_workspaces | jq '[range(1; 100)] - map(.num) | min'); sway workspace number $NUM" bindsym $mod+grave exec "NUM=$(swaymsg -t get_workspaces | jq 'map(.num) | max + 1'); sway workspace number $NUM"
### Move focused window to new workspace ### Move focused window to new workspace
bindsym $mod+Shift+grave exec "NUM=$(swaymsg -t get_workspaces | jq '[range(1; 100)] - map(.num) | min'); sway move container to workspace number $NUM; sway workspace number $NUM" bindsym $mod+Shift+grave exec "NUM=$(swaymsg -t get_workspaces | jq 'map(.num) | max + 1'); sway move container to workspace number $NUM; sway workspace number $NUM"
# #
## Tiling & Layout ## Tiling & Layout
@ -303,33 +303,27 @@ mode "resize" {
# #
# TokyoNight theme # TokyoNight theme
font "pango:sans 10"
# Property Name Border BG Text Indicator Child-border # Property Name Border BG Text Indicator Child-border
client.focused #0a0b16 #2f343f #4477ff #4477ff #4477ff client.focused #0a0b16 #2f343f #4477ff #4477ff #4477ff
client.focused_inactive #102020 #2f343f #d8dee8 #2f343f #2f343f client.focused_inactive #2f343f #2f343f #d8dee8 #2f343f #2f343f
client.focused_tab_title #102020 #2f343f #4477ff client.unfocused #2f343f #2f343f #d8dee8 #2f343f #2f343f
client.unfocused #04050c #2f343f #d8dee8 #2f343f #2f343f
client.urgent #ff80c0 #2f343f #d8dee8 #2f343f #2f343f client.urgent #ff80c0 #2f343f #d8dee8 #2f343f #2f343f
client.placeholder #2f343f #2f343f #d8dee8 #2f343f #2f343f
default_border pixel 1 default_border pixel 1
gaps inner 5 gaps inner 5
smart_borders on
smart_gaps on
for_window [title="."] title_format "%title <i>(%app_id)</i>"
# fx # fx
blur enable blur enable
corner_radius 8 corner_radius 8
shadows enable shadows enable
shadow_blur_radius 8 shadow_blur_radius 8
animation_duration_ms 150
# #
# Automation # Automation
# #
for_window [app_id="^fzf.kak.picker$"] { for_window [title="^fzf.kak.picker$"] {
floating enable floating enable
resize set width 90ppt height 90ppt resize set width 90ppt height 90ppt
move position center move position center

View File

@ -1,91 +0,0 @@
{
"$schema": "/etc/xdg/swaync/configSchema.json",
"ignore-gtk-theme": true,
"control-center-layer": "overlay",
"timeout-critical": 20,
"widgets": [
"buttons-grid#top",
"volume",
"backlight",
"mpris",
"dnd",
"inhibitors",
"title",
"notifications"
],
"widget-config": {
"buttons-grid#top": {
"buttons-per-row": 6,
"actions": [
{
"label": "",
"type": "normal",
"command": "wlogout",
"active": true
},
{
"label": "󰂯",
"type": "toggle",
"command": "[[ $SWAYNC_TOGGLE_STATE == true ]] && bluetoothctl power on || bluetoothctl power off",
"update-command": "bluetoothctl show | grep -q 'Powered: on' && echo true || echo false"
},
{
"label": "󰕾",
"type": "toggle",
"command": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
"update-command": "pactl get-sink-mute @DEFAULT_SINK@ | grep -q 'Mute: yes' && echo true || echo false"
},
{
"label": "󰍬",
"type": "toggle",
"command": "pactl set-source-mute @DEFAULT_SOURCE@ toggle",
"update-command": "pactl get-source-mute @DEFAULT_SOURCE@ | grep -q 'Mute: yes' && echo true || echo false"
},
{
"label": "",
"type": "toggle",
"command": "[[ $SWAYNC_TOGGLE_STATE == true ]] && nmcli radio wifi on || nmcli radio wifi off",
"update-command": "nmcli radio wifi | grep -q enabled && echo true || echo false"
}
]
},
"title": {
"text": "Notifications",
"clear-all-button": true,
"button-text": "Clear All"
},
"backlight": {
"label": "Backlight",
"min": 1
},
"volume": {
"label": "Volume",
"show-per-app": true,
"show-per-app-icon": true,
"show-per-app-label": true,
"expand-per-app": false,
"empty-list-label": "No active sink input",
"expand-button-label": "⇧",
"collapse-button-label": "⇩",
"animation-type": "slide_down",
"animation-duration": 150
},
"notifications": {
},
"dnd": {
"text": "Do Not Disturb"
},
"inhibitors": {
"text": "Inhibitors",
"clear-all-button": true,
"button-text": "Clear All"
},
"mpris": {
"blacklist": [],
"autohide": false,
"show-album-art": "always",
"loop-carousel": false
}
}
}

View File

@ -10,7 +10,7 @@
"custom/launcher": { "custom/launcher": {
"format": "", "format": "",
"tooltip-format": "", "tooltip-format": "",
"on-click": "fuzzel --launch-prefix=\"uwsm app --\"", "on-click": "fuzzel --no-exit-on-keyboard-focus-loss",
}, },
"systemd-failed-units": { "systemd-failed-units": {
"format": "󱗗", "format": "󱗗",
@ -21,17 +21,14 @@
"window-format": "", "window-format": "",
"window-rewrite-default": "", "window-rewrite-default": "",
"window-rewrite": { "window-rewrite": {
"class<firefox>": "<span letter_spacing='10040'>󰈹</span>", "class<firefox>": "<span letter_spacing='10040'>󰈹</span>",
"class<discord>": "<span letter_spacing='10240' size='9pt'></span>", "class<discord>": "<span letter_spacing='10240' size='9pt'></span>",
"class<kitty>": "<span letter_spacing='10240'></span>", "class<footclient>": "<span letter_spacing='10240'></span>",
"class<Zotero>": "<span letter_spacing='10240'>󱉟</span>", "class<Zotero>": "<span letter_spacing='10240'>󱉟</span>",
"class<Element>": "<span letter_spacing='10480'>󰭹</span>", "class<Element>": "<span letter_spacing='10480'>󰭹</span>",
"class<im.dino.Dino>": "<span letter_spacing='10480'>󰭹</span>", "class<im.dino.Dino>": "<span letter_spacing='10480'>󰭹</span>",
"class<signal>": "<span letter_spacing='10480'>󰭹</span>", "class<signal>": "<span letter_spacing='10480'>󰭹</span>",
"class<slack>": "<span letter_spacing='10480'>󰭹</span>",
"class<thunderbird>": "<span letter_spacing='10480'>󰛮</span>",
"class<com.hex-rays.>": "<span letter_spacing='10480'></span>", "class<com.hex-rays.>": "<span letter_spacing='10480'></span>",
"title<Dot Viewer>": "<span letter_spacing='10480'></span>",
}, },
"format-window-separator": "", "format-window-separator": "",
}, },

View File

@ -2,12 +2,13 @@
setopt appendhistory notify setopt appendhistory notify
unsetopt beep nomatch unsetopt beep nomatch
setopt completealiases
# #
# Aliases # Aliases
# #
#eval "$(batman --export-env)"
# standard functions # standard functions
function nixos-edit() { function nixos-edit() {
@ -15,31 +16,7 @@ function nixos-edit() {
} }
function nixos-apply() { function nixos-apply() {
flags=("--sudo" "--use-substitutes") sudo nixos-rebuild switch --flake ~/nixos-config#$HOST "$@"
host="$HOST"
action="switch"
while [[ "$#" != 0 ]]; do
case "$1" in
--host)
host="$2"
shift
shift
;;
--boot)
action="boot"
shift
;;
*)
flags+=("$1")
shift
;;
esac
done
flags+=("--file" "$HOME/nixos-config" "--attr" "sites.$host")
if [[ "$host" != "$HOST" ]]; then
flags+=("--target-host" "$host")
fi
nixos-rebuild "$action" "${flags[@]}"
} }
lsflags=() lsflags=()
@ -47,10 +24,6 @@ if ls --group-directories-first &>/dev/null; then
lsflags+=("--group-directories-first") lsflags+=("--group-directories-first")
fi fi
if [[ "$TERM" == "xterm-kitty" ]]; then
alias ssh="kitten ssh"
fi
alias ls="ls ${lsflags[@]} --color=auto"; alias ls="ls ${lsflags[@]} --color=auto";
alias ll="ls -lh"; alias ll="ls -lh";
alias lh="ll -ab"; alias lh="ll -ab";
@ -72,7 +45,7 @@ function rmida () {
rm -f *.idb *.i64 *.id0 *.id1 *.id2 *.id3 *.nam *.til rm -f *.idb *.i64 *.id0 *.id1 *.id2 *.id3 *.nam *.til
} }
function rustc() { $(/bin/which rustc) "$@" && echo "Good girl."; } function rustc() { $(/bin/which rustc) "$@" && echo "Good girl." }
function scale () { function scale () {
INP=$1 INP=$1
@ -131,7 +104,7 @@ function preexec-osc-title() {
} }
autoload -Uz add-zsh-hook autoload -Uz add-zsh-hook
add-zsh-hook -Uz precmd chpwd-osc7-pwd add-zsh-hook -Uz chpwd chpwd-osc7-pwd
add-zsh-hook -Uz precmd precmd-osc133-marker add-zsh-hook -Uz precmd precmd-osc133-marker
add-zsh-hook -Uz precmd precmd-osc-title add-zsh-hook -Uz precmd precmd-osc-title
add-zsh-hook -Uz preexec preexec-osc133-marker add-zsh-hook -Uz preexec preexec-osc133-marker
@ -164,13 +137,6 @@ export SHELL=$(which zsh)
export npm_config_prefix=~/.local export npm_config_prefix=~/.local
export HISTSIZE=100000 export HISTSIZE=100000
export SAVEHIST=100000 export SAVEHIST=100000
export CARGO_TARGET_DIR=~/.cache/cargo/obj
export TEMP=/tmp
export TMP=/tmp
export TEMPDIR=/tmp
export TMPDIR=/tmp
CWDCONTROL="$(which cwdcontrol 2>/dev/null)" && . "$CWDCONTROL" hook
# site vars, functions, and aliases # site vars, functions, and aliases
if [ -e ~/.site_aliases.sh ]; then if [ -e ~/.site_aliases.sh ]; then

View File

@ -2,7 +2,6 @@
NOCOLOR="" NOCOLOR=""
PURPLE="" PURPLE=""
RED=""
YELLOW="" YELLOW=""
GREEN="" GREEN=""
BOLDYELLOW="" BOLDYELLOW=""
@ -29,12 +28,11 @@ function update-prompt-color {
[ "$MODE" = "main" ] && INDICATOR='+' || INDICATOR=' ' [ "$MODE" = "main" ] && INDICATOR='+' || INDICATOR=' '
PS1="%{$COLOR%}[$INDICATOR] %~%# %{$NOCOLOR%}" PS1="%{$COLOR%}[$INDICATOR] %~%# %{$NOCOLOR%}"
[[ -n "$VIRTUAL_ENV" && ! "${VIRTUAL_ENV##*/}" = "default" ]] && VENV_STRING="%{$GREEN%}(${VIRTUAL_ENV##*/})" || VENV_STRING= [ -n "$VIRTUAL_ENV" -a ! "${VIRTUAL_ENV##*/}" = "default" ] && VENV_STRING="%{$GREEN%}(${VIRTUAL_ENV##*/})" || VENV_STRING=
[[ -n "$ZMX_SESSION" ]] && ZMX_STRING="%{$RED%}($ZMX_SESSION)" || ZMX_STRING=
USER_STRING="%{$PURPLE%}%n@%m" USER_STRING="%{$PURPLE%}%n@%m"
TIME_STRING="%{$PURPLE%}[%{$YELLOW%}%D{%r}%{$PURPLE%}]" TIME_STRING="%{$PURPLE%}[%{$YELLOW%}%D{%r}%{$PURPLE%}]"
RPS1="$VENV_STRING$ZMX_STRING $USER_STRING $TIME_STRING%{$NOCOLOR%}" RPS1="$VENV_STRING $USER_STRING $TIME_STRING%{$NOCOLOR%}"
zle && zle reset-prompt zle && zle reset-prompt
} }

312
flake.lock Normal file
View File

@ -0,0 +1,312 @@
{
"nodes": {
"bingosync": {
"locked": {
"lastModified": 1769710902,
"narHash": "sha256-cNkfwDSPOew7CPnkEBfVxZl8tMZDAhD7MQP5AKSCEKE=",
"owner": "rhelmot",
"repo": "bingosync",
"rev": "7fd458dfb54ff88bc1744223bd6b6f3576bd85da",
"type": "github"
},
"original": {
"owner": "rhelmot",
"repo": "bingosync",
"type": "github"
}
},
"blog-rhelmot-io": {
"inputs": {
"coricamu": "coricamu",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1759863336,
"narHash": "sha256-H8NRd03xQVKVunTYsd95pMzZS5nfYTDUw6R78dJESrs=",
"ref": "refs/heads/main",
"rev": "bc6337d8f649f5afdc281b64fad2891bb2067a51",
"revCount": 11,
"type": "git",
"url": "https://git.lain.faith/rhelmot/blog.rhelmot.io"
},
"original": {
"type": "git",
"url": "https://git.lain.faith/rhelmot/blog.rhelmot.io"
}
},
"coricamu": {
"inputs": {
"nixpkgs": [
"blog-rhelmot-io",
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1759863318,
"narHash": "sha256-6yXyEllmvAFgSg4KzFqJ3bx6K1+ZBsqOOdX08F29k08=",
"owner": "rhelmot",
"repo": "coricamu",
"rev": "f109bad2add146f3001805a8600b198473b3c9c2",
"type": "github"
},
"original": {
"owner": "rhelmot",
"repo": "coricamu",
"type": "github"
}
},
"cppnix": {
"inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"git-hooks-nix": "git-hooks-nix",
"nixpkgs": [
"nixbsd",
"nixpkgs"
],
"nixpkgs-23-11": "nixpkgs-23-11",
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1772745693,
"narHash": "sha256-4d0xSh/Vy2xI5jqCKmw/Yuo18uAUtnqvBrllNcmXvqU=",
"owner": "rhelmot",
"repo": "nix",
"rev": "38517c6967041d60e469383bc4ce3c0b4adf00ae",
"type": "github"
},
"original": {
"owner": "rhelmot",
"ref": "freebsd-safe",
"repo": "nix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"revCount": 69,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz?rev=ff81ac966bb2cae68946d5ed5fc4994f96d0ffec&revCount=69"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixbsd",
"cppnix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"git-hooks-nix": {
"inputs": {
"flake-compat": [
"nixbsd",
"cppnix"
],
"gitignore": [
"nixbsd",
"cppnix"
],
"nixpkgs": [
"nixbsd",
"cppnix",
"nixpkgs"
],
"nixpkgs-stable": [
"nixbsd",
"cppnix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1734279981,
"narHash": "sha256-NdaCraHPp8iYMWzdXAt5Nv6sA3MUzlCiGiR586TCwo0=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "aa9f40c906904ebd83da78e7f328cd8aeaeae785",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"mini-tmpfiles": {
"inputs": {
"nixpkgs": [
"nixbsd",
"nixpkgs"
]
},
"locked": {
"lastModified": 1742754557,
"narHash": "sha256-nGxgiNhA94eSl8jcQwCboJ5Ed132z8yrFdOoT+rf8bE=",
"owner": "nixos-bsd",
"repo": "mini-tmpfiles",
"rev": "534ee577692c7092fdcd035f89bc29b663c6f9ca",
"type": "github"
},
"original": {
"owner": "nixos-bsd",
"repo": "mini-tmpfiles",
"type": "github"
}
},
"nixbsd": {
"inputs": {
"cppnix": "cppnix",
"flake-compat": "flake-compat_2",
"mini-tmpfiles": "mini-tmpfiles",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1772769953,
"narHash": "sha256-3NRnNY5L8dm3bc12nr3wk4sMOWbvO1m5s7/wWXXwx2Q=",
"owner": "nixos-bsd",
"repo": "nixbsd",
"rev": "87787927615d57969df3faf3cdeeb1bf1f3e1576",
"type": "github"
},
"original": {
"owner": "nixos-bsd",
"ref": "nixbsd-demo",
"repo": "nixbsd",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1772828289,
"narHash": "sha256-rNKF1bFtrV+1Lable7vVxw53W0EM0qCOXW+TfL6wwQs=",
"owner": "rhelmot",
"repo": "nixpkgs",
"rev": "c6b65605b4caf622440e7287e0394a789def6729",
"type": "github"
},
"original": {
"owner": "rhelmot",
"ref": "freebsd-graphical-wip",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-23-11": {
"locked": {
"lastModified": 1717159533,
"narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
"type": "github"
}
},
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"root": {
"inputs": {
"bingosync": "bingosync",
"blog-rhelmot-io": "blog-rhelmot-io",
"nixbsd": "nixbsd",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

67
flake.nix Normal file
View File

@ -0,0 +1,67 @@
{
inputs = {
nixpkgs.url = "github:rhelmot/nixpkgs/freebsd-graphical-wip";
#nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixbsd.url = "github:nixos-bsd/nixbsd/nixbsd-demo";
nixbsd.inputs.nixpkgs.follows = "nixpkgs";
bingosync.url = "github:rhelmot/bingosync";
blog-rhelmot-io.url = "git+https://git.lain.faith/rhelmot/blog.rhelmot.io";
blog-rhelmot-io.inputs.nixpkgs.follows = "nixpkgs";
#nixos-defcon.url = "path:/home/audrey/nixos-defcon";
#nixos-defcon.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, nixbsd, bingosync, ... }@flakeInputs: let
sitesFiles = builtins.readDir ./sites;
sitesNames = builtins.filter (name: builtins.pathExists ./sites/${name}/configuration.nix) (builtins.attrNames sitesFiles);
systemTypes = {
nixos = nixpkgs.lib.nixosSystem;
nixbsd = nixbsd.lib.nixbsdSystem;
};
systemName = name: builtins.replaceStrings ["\n"] [""] (builtins.readFile ./sites/${name}/system);
nixosConfigurations = platform: builtins.listToAttrs (builtins.map (name: {
inherit name;
value = let evaluated = systemTypes.${systemName name} {
modules = [
./configuration.nix
./configuration-${systemName name}.nix
./sites/${name}/configuration.nix
{ nixpkgs.buildPlatform = platform; }
self.modules.audrey-sway
#self.modules.mobile-timezone
self.modules.kakoune
self.modules.zfs-module
#self.modules.syncthing-cluster
#{
# services.syncthing-cluster.deviceIds = ./keys/syncthing;
# services.syncthing-cluster.coordinator = "hydrangea";
#}
#bingosync.nixosModules.default
#nixos-defcon.nixosModules.pkgsOverlay
#nixos-defcon.nixosModules.tulip
#nixos-defcon.nixosModules.noscope
];
specialArgs = {
inherit nixpkgs;
#pkgs-unstable = nixpkgs-unstable.legacyPackages.${platform};
};
}; in {
inherit (evaluated) config options;
system = evaluated.config.system.build.toplevel;
deploy = import ./deploy.nix { inherit flakeInputs platform; site = name; };
};
}) sitesNames);
in {
packages = let
buildPlatforms = [ "x86_64-linux" "aarch64-linux" "x86_64-freebsd" "aarch64-freebsd" ];
toPackagesList = platform: { name = platform; value = let base = nixosConfigurations platform; in base // { nixosConfigurations = base; }; };
packagesList = builtins.map toPackagesList buildPlatforms;
in builtins.listToAttrs packagesList;
modules = let
modulesFiles = builtins.attrNames (builtins.readDir ./modules);
toModulesList = filename: { name = nixpkgs.lib.strings.removeSuffix ".nix" filename; value = ./modules/${filename}; };
modulesList = builtins.map toModulesList modulesFiles;
in builtins.listToAttrs modulesList;
};
}

View File

@ -1,4 +1,2 @@
clove:WbMoKN9/WvTS/tCNa2+75MImjZuqX8X094i5vT0dKTU= clove:WbMoKN9/WvTS/tCNa2+75MImjZuqX8X094i5vT0dKTU=
daisy:HU3mg1KY/sGYVZk243dgJRDLKHASRmu8/IXeGI/sdE8= daisy:HU3mg1KY/sGYVZk243dgJRDLKHASRmu8/IXeGI/sdE8=
tulip:Q08HY4C1H1YB4d6ObReFS7Ohqb5xWW3Ei6lGkldkojU=
hydrangea:D6wG8lviPwODmq1ZdQzPL4AGt1ZsboUQKwSNyGPKOhk=

View File

@ -1,2 +1,3 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDeeSDW2s8awLKVsdqalGrSWJ0zHdLXP8PE6MyFglGITyrjm5SKnyCEYL1wS6W/egJT2trNPwWl22D3UKYgWyzi6HLZAvJwT+eoyo1Ya3V+k2Do3AU0/LeJ0xjx9kO6E0IL++ozqpFPoT+OAmw6cZ3Eyir3VjTOdbsUz7QTPFHhuwJ37GAshpc6C5I/cralFs5NwRFpI2j9j6pu0RJFm2QBqG1zY6qIjFt5l9LuY5aOQBYSaFfmMa8BVJo6ZFQxySv+Xo51zEch2Nv/efXmiuJoCyUcrb9fTYRmtFchl/XAd+8SyvuxTIOYAhWpBgK8pK7i7wTxDcz4Lbi7iJKHYTX4hqw0qKPjF+K+XGVYqw2Cz38W861dx5bUqBwQP+4OsE/+/ThTZDe1dfwJumJgaUWU6Mnr1EYwEefGQZlU4lxvy6DyCYd6Y5s9KmPNSlxXQsArrhWymmfKELN+aRGMys/KnWwFAHnhGC6J1uBQjT/jsTXFXtsqHuICBTsCo5JhiIk= audrey@dandelion ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDeeSDW2s8awLKVsdqalGrSWJ0zHdLXP8PE6MyFglGITyrjm5SKnyCEYL1wS6W/egJT2trNPwWl22D3UKYgWyzi6HLZAvJwT+eoyo1Ya3V+k2Do3AU0/LeJ0xjx9kO6E0IL++ozqpFPoT+OAmw6cZ3Eyir3VjTOdbsUz7QTPFHhuwJ37GAshpc6C5I/cralFs5NwRFpI2j9j6pu0RJFm2QBqG1zY6qIjFt5l9LuY5aOQBYSaFfmMa8BVJo6ZFQxySv+Xo51zEch2Nv/efXmiuJoCyUcrb9fTYRmtFchl/XAd+8SyvuxTIOYAhWpBgK8pK7i7wTxDcz4Lbi7iJKHYTX4hqw0qKPjF+K+XGVYqw2Cz38W861dx5bUqBwQP+4OsE/+/ThTZDe1dfwJumJgaUWU6Mnr1EYwEefGQZlU4lxvy6DyCYd6Y5s9KmPNSlxXQsArrhWymmfKELN+aRGMys/KnWwFAHnhGC6J1uBQjT/jsTXFXtsqHuICBTsCo5JhiIk= audrey@dandelion
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA0UbgxW37GCUcU9mkV9tGbFk+4v5+F4Raa0ZIMKmJuCg4I05v6YdKu+gkRyl25TgNto1se4kxUalma46/olw6IRglP0iNb4kiXMqFw3WhpMwZJiZ6+1FiebD3HNEEZisaA+Gef3Ae2n9jtOr/x17Vp2P5iUtFhyZHJUzbTOuRcNWHH2OME45d2AvlUAO13uDXhTXEbW4J9ubpXr87YHc4w0ealbW8Itkzl0prWcFHlkzTrGFX3b7UW5dhlvGxYgwbpSifu4LUkiSxgADbtP2LkRiUQYq3VMaZTc1arg6kygznqNS6SoybUHyVADS2z5GKY3l8fJhFUhQk2IVoKBCD audrey@violet ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA0UbgxW37GCUcU9mkV9tGbFk+4v5+F4Raa0ZIMKmJuCg4I05v6YdKu+gkRyl25TgNto1se4kxUalma46/olw6IRglP0iNb4kiXMqFw3WhpMwZJiZ6+1FiebD3HNEEZisaA+Gef3Ae2n9jtOr/x17Vp2P5iUtFhyZHJUzbTOuRcNWHH2OME45d2AvlUAO13uDXhTXEbW4J9ubpXr87YHc4w0ealbW8Itkzl0prWcFHlkzTrGFX3b7UW5dhlvGxYgwbpSifu4LUkiSxgADbtP2LkRiUQYq3VMaZTc1arg6kygznqNS6SoybUHyVADS2z5GKY3l8fJhFUhQk2IVoKBCD audrey@violet
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA0UbgxW37GCUcU9mkV9tGbFk+4v5+F4Raa0ZIMKmJuCg4I05v6YdKu+gkRyl25TgNto1se4kxUalma46/olw6IRglP0iNb4kiXMqFw3WhpMwZJiZ6+1FiebD3HNEEZisaA+Gef3Ae2n9jtOr/x17Vp2P5iUtFhyZHJUzbTOuRcNWHH2OME45d2AvlUAO13uDXhTXEbW4J9ubpXr87YHc4w0ealbW8Itkzl0prWcFHlkzTrGFX3b7UW5dhlvGxYgwbpSifu4LUkiSxgADbtP2LkRiUQYq3VMaZTc1arg6kygznqNS6SoybUHyVADS2z5GKY3l8fJhFUhQk2IVoKBCD audrey@rhododendron

View File

@ -1 +0,0 @@
WB3OPFM-5S7CLM4-PN7JIWE-H66YCFD-7UKW7PE-7KM4CMT-WPQ5BK5-ZFPMQAM

View File

@ -1,360 +1,248 @@
{ {
lib, lib,
config, config,
pkgs, pkgs,
... ...
}: }:
let let
cfg = config.audrey-sway; cfg = config.audrey-sway;
swaylockCmd = "swaylock -c 1a1b26"; swaylockCmd = "swaylock -c 1a1b26";
pasystray-custom = pkgs.runCommand pkgs.pasystray.name {
outputs = pkgs.pasystray.outputs;
} ''
${lib.concatMapStrings (output: ''
mkdir -p ${placeholder output}
ln -s ${pkgs.pasystray.${output}}/* ${placeholder output}
'') pkgs.pasystray.outputs}
rm $out/etc
mkdir $out/etc
ln -s ${pkgs.pasystray.out}/etc/* $out/etc
rm $out/etc/xdg
mkdir $out/etc/xdg
ln -s ${pkgs.pasystray.out}/etc/xdg/* $out/etc/xdg
rm $out/etc/xdg/autostart
mkdir $out/etc/xdg/autostart
ln -s ${pkgs.pasystray.out}/etc/xdg/autostart/* $out/etc/xdg/autostart
rm $out/etc/xdg/autostart/pasystray.desktop
sed -E -e '/Exec=/a Exec=pasystray ${cfg.pasystrayArgs}' ${pkgs.pasystray.out}/etc/xdg/autostart/pasystray.desktop >$out/etc/xdg/autostart/pasystray.desktop
'';
swaylaunch = pkgs.writeShellScriptBin "swaylaunch" ''
case "''${1##*/}" in
${lib.concatMapStrings (app: ''
${app}) export DISPLAY=:1 ;;
'') cfg.satelliteApps}
*) ;;
esac
exec uwsm app -- "$@"
'';
in in
{ {
options.audrey-sway = { options.audrey-sway = {
enable = lib.mkEnableOption "Audrey's sway desktop for girls"; enable = lib.mkEnableOption "Audrey's sway desktop for girls";
background = lib.mkOption { background = lib.mkOption {
type = lib.types.path; type = lib.types.pathInStore;
default = ../dotfiles/smotsgamed.jpg; default = ../dotfiles/smotsgamed.jpg;
description = "Background image file"; description = "Background image file";
};
extraPaletteEntries = lib.mkOption {
type = lib.types.listOf (lib.types.module {
name = lib.mkOption {
type = lib.types.str;
description = "The name or description to show";
};
icon = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "The icon to show";
default = null;
};
command = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = ''
The shell command to run on invocation. If null, will inherit the command from your sway configuration based on the name.
The name must be present in the config on the same line as the bindsym command after "###".
'';
};
});
default = [];
description = "Extra entries to add to the command palette";
};
}; };
extraPaletteEntries = lib.mkOption {
type = lib.types.listOf (
lib.types.module {
name = lib.mkOption {
type = lib.types.str;
description = "The name or description to show";
};
icon = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "The icon to show";
default = null;
};
command = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = ''
The shell command to run on invocation. If null, will inherit the command from your sway configuration based on the name.
The name must be present in the config on the same line as the bindsym command after "###".
'';
};
}
);
default = [ ];
description = "Extra entries to add to the command palette";
};
extraSwayArgs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
description = "Extra command line arguments with which to launch sway";
};
blankTimeout = lib.mkOption {
type = lib.types.nullOr lib.types.int;
default = 300;
description = "After how long in seconds idle should the system blank its screens";
};
lockTimeout = lib.mkOption {
type = lib.types.nullOr lib.types.int;
default = 360;
description = "After how long in seconds idle should the system lock the desktop";
};
suspendTimeout = lib.mkOption {
type = lib.types.nullOr lib.types.int;
default = 600;
description = "After how long in seconds idle should the system suspend";
};
pasystrayArgs = lib.mkOption {
type = lib.types.str;
default = "--notify=sink --notify=source -m 100";
description = "Arguments with which to launch pasystray";
};
satelliteApps = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "steam" ];
description = "Applications names (as per executable names, globs ok) which should be forced to launch with xwayland-satellite as opposed to normal xwayland";
};
};
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.greetd.settings = { #programs.regreet.enable = true;
default_session.command = "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe config.programs.sway.package} -c /etc/sway/greeter-config ${toString cfg.extraSwayArgs}"; #services.greetd.settings = {
}; # default_session.command = "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe config.programs.sway.package} -c /etc/sway/greeter-config";
services.displayManager.regreet.enable = true; #};
services.displayManager.regreet.settings = { #programs.regreet.settings = {
background.fit = "Fill"; # background.fit = "Fill";
GTK.application_prefer_dark_theme = true; # GTK.application_prefer_dark_theme = true;
}; #};
environment.etc."sway/config".source = lib.mkForce ../dotfiles/sway/config; environment.etc."sway/config".source = lib.mkForce ../dotfiles/sway/config;
environment.etc."sway/sws".source = ../dotfiles/sway/sws.sh; environment.etc."sway/sws".source = ../dotfiles/sway/sws.sh;
environment.etc."sway/generate_palette".source = ../dotfiles/sway/generate_palette.sh; environment.etc."sway/generate_palette".source = ../dotfiles/sway/generate_palette.sh;
environment.etc."sway/palette".source = ../dotfiles/sway/palette.sh; environment.etc."sway/palette".source = ../dotfiles/sway/palette.sh;
environment.etc."sway/bg".source = cfg.background; environment.etc."sway/bg".source = cfg.background;
environment.etc."sway/greeter-config".source = lib.mkForce ( #environment.etc."sway/greeter-config".source = lib.mkForce (pkgs.writeText "sway-greeter-config" ''
pkgs.writeText "sway-greeter-config" '' # exec "${lib.getExe config.programs.regreet.package}; swaymsg exit"
exec "${lib.getExe config.services.displayManager.regreet.package}; swaymsg exit" # output * scale 2
output * scale 2 # input type:keyboard {
input type:keyboard { # xkb_options "caps:escape"
xkb_options "caps:escape" # }
} # input type:touchpad {
input type:touchpad { # dwt enabled
dwt enabled # dwtp enabled
dwtp enabled # tap enabled
tap enabled # tap_button_map lrm
tap_button_map lrm # natural_scroll enabled
natural_scroll enabled # }
}
# Brightness # # Brightness
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 10%- # bindsym --locked XF86MonBrightnessDown exec light -U 10
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 10%+ # bindsym --locked XF86MonBrightnessUp exec light -A 10
blur enable # blur enable
corner_radius 8 # corner_radius 8
shadows enable # shadows enable
shadow_blur_radius 8 # shadow_blur_radius 8
'' #'');
); environment.etc."xdg/waybar".source = ../dotfiles/waybar;
environment.etc."xdg/waybar".source = ../dotfiles/waybar; environment.etc."xdg/swayr".source = ../dotfiles/swayr;
environment.etc."xdg/swayr".source = ../dotfiles/swayr; environment.etc."xdg/fuzzel".source = ../dotfiles/fuzzel;
environment.etc."xdg/fuzzel".source = ../dotfiles/fuzzel; environment.etc."xdg/foot".source = ../dotfiles/foot;
environment.etc."xdg/kitty".source = ../dotfiles/kitty; environment.etc."xdg/xdg-desktop-portal-wlr/config".source = ../dotfiles/xdg-desktop-portal-wlr;
environment.etc."xdg/swaync/config.json".source = ../dotfiles/swaync/config.json;
environment.etc."xdg/swaync/configSchema.json".source = "${pkgs.swaynotificationcenter}/etc/xdg/swaync/configSchema.json";
environment.etc."xdg/xdg-desktop-portal-wlr/config".source = ../dotfiles/xdg-desktop-portal-wlr;
services.tumbler.enable = true; #programs.uwsm = {
programs.thunar = { # enable = true;
enable = true; # waylandCompositors.sway = {
plugins = with pkgs; [ thunar-volman thunar-archive-plugin ]; # prettyName = "Sway";
}; # binPath = "/run/current-system/sw/bin/sway";
programs.fuse.enable = true; # };
programs.uwsm = { #};
enable = true; programs.sway = {
waylandCompositors.sway = { enable = true;
prettyName = "Sway"; package = pkgs.swayfx;
binPath = "/run/current-system/sw/bin/sway"; wrapperFeatures.gtk = true;
extraArgs = cfg.extraSwayArgs; #xwayland.enable = true;
}; extraPackages = with pkgs; [
}; swaylock
programs.sway = { swaynotificationcenter
enable = true; #swayr
package = pkgs.swayfx; #pavucontrol
wrapperFeatures.gtk = true; #pulseaudio
xwayland.enable = true; libnotify
extraPackages = with pkgs; [ wdisplays
pasystray-custom #playerctl
swaylaunch grim
kdePackages.kdeconnect-kde slurp
swaylock swayidle
networkmanagerapplet waybar
swaynotificationcenter wl-clipboard
swayr wl-mirror
sway-overfocus wlogout
polkit_gnome fuzzel
brightnessctl gsettings-desktop-schemas
pavucontrol glib
pulseaudio kanshi
libnotify #kdePackages.kwallet
wdisplays #networkmanagerapplet
playerctl adwaita-icon-theme
grim #reversal-icon-theme
slurp whitesur-icon-theme
swayidle xdg-user-dirs
waybar ];
wl-clipboard extraSessionCommands = ''
wl-mirror export ELECTRON_OZONE_PLATFORM_HINT=wayland
wlogout export SDL_VIDEODRIVER=wayland
fuzzel export QT_QPA_PLATFORM=wayland-egl
gsettings-desktop-schemas export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
glib
networkmanagerapplet
adwaita-icon-theme
reversal-icon-theme
whitesur-icon-theme
xdg-user-dirs
xwayland-satellite
];
extraSessionCommands = ''
export ELECTRON_OZONE_PLATFORM_HINT=wayland
export SDL_VIDEODRIVER=wayland,x11
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
'';
};
environment.pathsToLink = [ "/share/gsettings-schemas" ];
#environment.sessionVariables.XDG_DATA_DIRS = [ "/run/current-system/sw/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}" ];
security.pam.services.swaylock = { };
security.pam.loginLimits = [
{
domain = "@users";
item = "rtprio";
type = "-";
value = 1;
}
];
security.polkit.enable = true;
programs.dconf.enable = true;
services.power-profiles-daemon.enable = true;
systemd.user.services.kanshi = {
description = "Monitor hotswap daemon";
serviceConfig = {
Type = "simple";
ExecStart = lib.getExe pkgs.kanshi;
};
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
requisite = [ "graphical-session.target" ];
};
systemd.user.services.swayidle = {
description = "Idle lock + sleep manager";
serviceConfig = {
Type = "simple";
ExecStart = ''
${lib.getExe pkgs.swayidle} -w \
${
lib.optionalString (cfg.blankTimeout != null) ''
timeout ${toString cfg.blankTimeout} 'swaymsg "output * power off"' \
resume 'swaymsg "output * power on"' \
''
} ${
lib.optionalString (cfg.lockTimeout != null) ''
timeout ${toString cfg.lockTimeout} '${swaylockCmd} -f' \
before-sleep '${swaylockCmd} -f' \
''
} ${
lib.optionalString (cfg.suspendTimeout != null) ''
timeout ${toString cfg.suspendTimeout} 'systemctl suspend' \
''
}
''; '';
}; };
path = [ "/run/current-system/sw" ]; environment.pathsToLink = [ "/share/gsettings-schemas" ];
wantedBy = [ "graphical-session.target" ]; #environment.sessionVariables.XDG_DATA_DIRS = [ "/run/current-system/sw/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}" ];
partOf = [ "graphical-session.target" ]; #programs.light.enable = true;
after = [ "graphical-session.target" ]; security.pam.services.swaylock = {};
requisite = [ "graphical-session.target" ]; security.pam.loginLimits = [
}; { domain = "@users"; item = "rtprio"; type = "-"; value = 1; }
systemd.user.services.waybar.path = [ "/run/current-system/sw" ]; ];
# systemd.user.services.waybar = { security.pam.services = {
# description = "Desktop status bar"; #greetd.kwallet = {
# serviceConfig = { # enable = true;
# Type = "simple"; # package = pkgs.kdePackages.kwallet-pam;
# ExecStart = lib.getExe pkgs.waybar; # forceRun = true;
# }; #};
# path = [ "/run/current-system/sw" ]; #greetd.rules.session.kwallet.settings.auto_start = true;
# partOf = [ "graphical-session.target" ];
# wantedBy = [ "graphical-session.target" ];
# };
# systemd.user.services.networkmanagerapplet = {
# description = "Networkmanager applet";
# serviceConfig = {
# Type = "simple";
# ExecStart = lib.getExe pkgs.networkmanagerapplet;
# };
# path = [ "/run/current-system/sw" ];
# partOf = [ "graphical-session.target" ];
# wantedBy = [ "graphical-session.target" ];
# };
# systemd.user.services.pasystray = {
# description = "Pulseaudio system tray icon";
# serviceConfig = {
# Type = "simple";
# ExecStart = "${lib.getExe pkgs.pasystray} --notify source --notify sink -m 100";
# };
# path = [ "/run/current-system/sw" ];
# partOf = [ "graphical-session.target" ];
# wantedBy = [ "graphical-session.target" ];
# };
# systemd.user.services.kdeconnect-indicator = {
# description = "KDE connect indicator";
# serviceConfig = {
# Type = "simple";
# ExecStart = "${lib.getBin pkgs.kdePackages.kdeconnect-kde}/bin/kdeconnect-indicator";
# };
# path = [ "/run/current-system/sw" ];
# partOf = [ "graphical-session.target" ];
# wantedBy = [ "graphical-session.target" ];
# };
systemd.user.services.swayr = {
description = "Sway MRU window switcher";
serviceConfig = {
Type = "simple";
ExecStart = "${lib.getBin pkgs.swayr}/bin/swayrd";
}; };
path = [ "/run/current-system/sw" ]; security.polkit.enable = lib.mkForce false;
wantedBy = [ "graphical-session.target" ]; programs.xwayland.enable = false;
partOf = [ "graphical-session.target" ]; programs.dconf.enable = true;
after = [ "graphical-session.target" ]; #services.power-profiles-daemon.enable = true;
requisite = [ "graphical-session.target" ]; #systemd.user.targets.graphical-environment = { };
}; #systemd.user.services.kanshi = {
systemd.user.services.wayland-pipewire-idle-inhibit = { # description = "Monitor hotswap daemon";
description = "Inhibit Wayland idling when media is played through pipewire"; # serviceConfig = {
documentation = [ "https://github.com/rafaelrc7/wayland-pipewire-idle-inhibit" ]; # Type = "simple";
serviceConfig = { # ExecStart = lib.getExe pkgs.kanshi;
Type = "simple"; # };
ExecStart = lib.getExe pkgs.wayland-pipewire-idle-inhibit; # partOf = [ "graphical-environment.target" ];
Restart = "always"; # wantedBy = [ "graphical-environment.target" ];
RestartSec = 10; #};
}; #systemd.user.services.swayidle = {
wantedBy = [ "graphical-session.target" ]; # description = "Idle lock + sleep manager";
partOf = [ "graphical-session.target" ]; # serviceConfig = {
after = [ "graphical-session.target" "pipewire.service" ]; # Type = "simple";
wants = [ "pipewire.service" ]; # ExecStart = ''
}; # ${lib.getExe pkgs.swayidle} -w \
# systemd.user.services.fumon.wantedBy = [ "graphical-session.target" ]; # timeout 300 'swaymsg "output * power off"' \
# systemd.user.services.fumon.path = with pkgs; [ libnotify uwsm ]; # resume 'swaymsg "output * power on"' \
systemd.user.services.waybar.wantedBy = [ "graphical-session.target" ]; # timeout 360 '${swaylockCmd} -f' \
systemd.user.services.waybar.overrideStrategy = "asDropin"; # timeout 600 'systemctl suspend' \
systemd.user.services.xwayland-satellite.wantedBy = [ "graphical-session.target" ]; # before-sleep '${swaylockCmd} -f'
systemd.user.services.xwayland-satellite.overrideStrategy = "asDropin"; # '';
systemd.user.services.thunar.wantedBy = [ "graphical-session.target" ]; # };
systemd.user.services.thunar.after = [ "graphical-session.target" ]; # path = [ "/run/current-system/sw" ];
systemd.user.services.thunar.overrideStrategy = "asDropin"; # partOf = [ "graphical-environment.target" ];
# systemd.user.services.polkit-gnome-authentication-agent-1 = { # wantedBy = [ "graphical-environment.target" ];
# description = "polkit-gnome-authentication-agent-1"; #};
# partOf = [ "graphical-session.target" ]; #systemd.user.services.waybar = {
# wantedBy = [ "graphical-session.target" ]; # description = "Desktop status bar";
# serviceConfig = { # serviceConfig = {
# Type = "simple"; # Type = "simple";
# ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; # ExecStart = lib.getExe pkgs.waybar;
# Restart = "on-failure"; # };
# RestartSec = 1; # path = [ "/run/current-system/sw" ];
# TimeoutStopSec = 10; # partOf = [ "graphical-environment.target" ];
# }; # wantedBy = [ "graphical-environment.target" ];
# }; #};
#systemd.user.services.networkmanagerapplet = {
# description = "Networkmanager applet";
# serviceConfig = {
# Type = "simple";
# ExecStart = lib.getExe pkgs.networkmanagerapplet;
# };
# path = [ "/run/current-system/sw" ];
# partOf = [ "graphical-environment.target" ];
# wantedBy = [ "graphical-environment.target" ];
#};
#systemd.user.services.pasystray = {
# description = "Pulseaudio system tray icon";
# serviceConfig = {
# Type = "simple";
# ExecStart = "${lib.getExe pkgs.pasystray} --notify source --notify sink -m 100";
# };
# path = [ "/run/current-system/sw" ];
# partOf = [ "graphical-environment.target" ];
# wantedBy = [ "graphical-environment.target" ];
#};
#systemd.user.services.kdeconnect-indicator = {
# description = "KDE connect indicator";
# serviceConfig = {
# Type = "simple";
# ExecStart = "${lib.getBin pkgs.kdePackages.kdeconnect-kde}/bin/kdeconnect-indicator";
# };
# path = [ "/run/current-system/sw" ];
# partOf = [ "graphical-environment.target" ];
# wantedBy = [ "graphical-environment.target" ];
#};
#systemd.user.services.swayr = {
# description = "Sway MRU window switcher";
# serviceConfig = {
# Type = "simple";
# ExecStart = "${lib.getBin pkgs.swayr}/bin/swayrd";
# };
# path = [ "/run/current-system/sw" ];
# partOf = [ "graphical-environment.target" ];
# wantedBy = [ "graphical-environment.target" ];
#};
#systemd.user.services.polkit-gnome-authentication-agent-1 = {
# description = "polkit-gnome-authentication-agent-1";
# partOf = [ "graphical-environment.target" ];
# wantedBy = [ "graphical-environment.target" ];
# serviceConfig = {
# Type = "simple";
# ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
# Restart = "on-failure";
# RestartSec = 1;
# TimeoutStopSec = 10;
# };
#};
#systemd.packages = [ pkgs.foot ];
#systemd.user.sockets.foot-server.wantedBy = [ "graphical-environment.target" ];
audrey-sway.extraPaletteEntries = [
audrey-sway.extraPaletteEntries = [ { name = "Command Palette"; }
{ name = "Command Palette"; } ];
]; };
};
} }

View File

@ -1,22 +0,0 @@
{
lib,
pkgs,
pkgs-experimental,
...
}:
{
config = lib.mkIf (pkgs.stdenv.buildPlatform != pkgs.stdenv.hostPlatform) {
programs.vim = {
enable = true;
# defaultEditor = true;
package = pkgs.vim.customize {
vimrcConfig.customRC = ''
set mouse=
set hlsearch
nnoremap <CR> :noh<CR><CR>
'';
};
};
programs.git.config.core.editor = "vim";
};
}

View File

@ -1,215 +0,0 @@
{
lib,
pkgs,
config,
...
}:
{
config = lib.mkIf config.rhelmot.isDesktop {
rhelmot.isWorkstation = true;
networking.networkmanager = {
enable = true;
plugins = with pkgs; [
networkmanager-openvpn
networkmanager-iodine
networkmanager-ssh
];
};
fonts.packages = with pkgs; [
nerd-fonts.fira-code
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
liberation_ttf
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
dina-font
proggyfonts
];
services = {
xserver.enable = true;
printing = {
enable = true;
drivers = with pkgs; [ cnijfilter2 ];
};
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
pipewire = {
enable = true;
pulse.enable = true;
};
libinput.enable = true;
blueman.enable = true;
};
audrey-sway = {
enable = true;
};
programs.ydotool.enable = true;
users.users.audrey.extraGroups = [ "ydotool" ];
virtualisation.docker = {
enable = true;
storageDriver = "zfs";
logDriver = "journald";
daemon.settings = {
insecure-registries = [
"docker.shell.phish"
"registry.finals.2025.nautilus.institute:5000"
];
};
};
programs.firefox = {
enable = true;
package = pkgs.firefox-esr;
nativeMessagingHosts.packages = [
pkgs.fx-cast-bridge
pkgs.cwdcontrol
];
preferences = {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"xpinstall.signatures.required" = false;
};
policies = {
ExtensionSettings = {
"cwdcontrol@rhelmot.io" = {
install_url = "file://${pkgs.cwdcontrol}/cwdcontrol.xpi";
installation_mode = "force_installed";
};
"onetab@nonexistenturl.net" = {
install_url = "file://${pkgs.onetab}/onetab.xpi";
installation_mode = "force_installed";
};
};
};
};
systemd.user.services.cwdcontrol-apps = {
description = "cwdcontrol sway integration";
path = [ "/run/current-system/sw" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.cwdcontrol}/bin/cwdcontrol-app-watch";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
requisite = [ "graphical-session.target" ];
};
programs = {
chromium.enable = true;
thunderbird.enable = true;
kdeconnect.enable = true;
partition-manager.enable = true;
wireshark.enable = true;
wireshark.package = pkgs.wireshark;
obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-livesplit-one
];
};
};
environment.sessionVariables.TERMINAL = "kitty --single-instance";
nixpkgs.config.permittedInsecurePackages = [
"firefox-esr-140-bin-unwrapped-140.17.0esr"
];
environment.systemPackages = with pkgs; [
(pkgs.runCommand pkgs.firefox-esr.name {} ''
mkdir -p $out/bin
ln -s /run/current-system/sw/bin/firefox-esr $out/bin/firefox
'')
dino
discord
# legcord
element-desktop
signal-desktop
slack
zotero
via
libimobiledevice
gnome-disk-utility
kitty
gimp
feh
swayimg
vlc
mpv
alsa-utils
zathura
losslesscut-bin
file-roller
kdePackages.plasma-thunderbolt
(pkgs.idapro9.override {
pythonWithPackages = config.rhelmot.globalPython;
})
cwdcontrol
];
xdg.mime.defaultApplications = {
"image/*" = "swayimg.desktop";
"inode/directory" = "thunar.desktop";
};
environment.etc."xdg/cwdcontrol/config.sh".source = ../dotfiles/cwdcontrol.sh;
environment.wordlist.enable = true;
# rhelmot.globalPythonPackages = [ (p: [(p.binsync)]) ];
services.usbmuxd.enable = true;
systemd.tmpfiles.settings.usersetup."/home/audrey/Downloads"."e!" = {
user = "audrey";
group = "users";
mode = "0700";
age = "1d";
};
systemd.services.sysfs-settings = {
description = "Set desktop sysfs tunables";
script = ''
# https://bugzilla.kernel.org/show_bug.cgi?id=219112
test "$(cat /sys/module/kvm/parameters/nx_huge_pages)" = "never" && exit 0 || true
echo "never" | tee /sys/module/kvm/parameters/nx_huge_pages
'';
before = [ "boot-complete.target" ];
};
hardware.sane.enable = true; # scanners
hardware.keyboard.qmk.enable = true;
hardware.acpilight.enable = true;
services.udev.packages = [ pkgs.via ];
services.udev.extraRules = ''
# Disable DS4 touchpad acting as mouse
# USB
ATTRS{name}=="Sony Interactive Entertainment Wireless Controller Touchpad", ENV{LIBINPUT_IGNORE_DEVICE}="1"
# Bluetooth
ATTRS{name}=="Wireless Controller Touchpad", ENV{LIBINPUT_IGNORE_DEVICE}="1"
'';
# https://codeberg.org/wvhulle/bootvine/src/branch/main/nixos-module.nix ?
};
options.rhelmot.isDesktop = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Install a graphical desktop";
};
}

View File

@ -1,30 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
nixKey = "/var/lib/nix/binary-cache-key";
in
lib.optionalAttrs (lib ? nixbsdSystem) {
# it's already default
lix.enable = false;
init.services.nix-key-setup = {
description = "Generate a nix build signing key";
startType = "oneshot";
startCommand = [
(pkgs.writeScript "nix-key-setup" ''
test -f ${nixKey} && test -f ${nixKey}.pub && exit 0 || true
mkdir -p "$(dirname "${nixKey}")"
${config.nix.package}/bin/nix-store --generate-binary-cache-key ${config.networking.hostName} ${nixKey} ${nixKey}.pub
'')
];
dependencies = [ "FILESYSTEMS" ];
before = [ "nix-daemon" ];
};
environment.systemPackages = with pkgs; [
freebsd.truss
];
}

View File

@ -1,291 +0,0 @@
{
config,
lib,
pkgs,
pkgs-experimental,
inputs,
...
}:
let
rhelmot = config.rhelmot;
in
{
options.rhelmot = {
globalPythonPackages = lib.mkOption {
type = with lib.types; listOf (functionTo (listOf package));
default = [ ];
description = "python packages (p: with p; [ x ]) to include in the global python environment";
};
globalPython = lib.mkOption {
type = lib.types.package;
description = "The python that will be used globally";
};
};
config = {
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
(import ../overlays/packages.nix)
(import "${inputs.nixtamal}/nix/overlay")
(final: prev: {
cwdcontrol = final.callPackage "${inputs.cwdcontrol}/package.nix" {};
inherit (pkgs-experimental) php php83 php84 php85 php86 phpPackages php83Packages php84Packages php85Packages php86Packages;
inherit (pkgs-experimental) mariadb;
inherit (pkgs-experimental) lixPackageSets;
inherit (pkgs-experimental) nix-direnv;
inherit (pkgs-experimental) openjdk jre_headless keycloak;
buildPackages = prev.buildPackages // {
# inherit (pkgs-experimental.buildPackages) openjdk jre_headless;
inherit (pkgs-experimental.buildPackages) php php83 php84 php85 php86 phpPackages php83Packages php84Packages php85Packages php86Packages;
};
})
# lix overlay
(final: prev: {
inherit (prev.lixPackageSets.lix_2_96)
nixpkgs-review
nix-eval-jobs
nix-fast-build
colmena
;
})
];
nix.registry.nixpkgs.to = lib.mkForce {
type = "path";
path = inputs.nixpkgs;
lastModified = 1;
narHash =
inputs.nixpkgs.hash or (builtins.readFile (
pkgs.runCommand "hash.nix" {
nativeBuildInputs = [ pkgs.nix ];
} "nix --extra-experimental-features nix-command hash path ${inputs.nixpkgs} >$out"
));
};
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
nix.package = pkgs.lixPackageSets.lix_2_96.lix;
nix.settings.extra-experimental-features = [ "nix-command" "flakes" "pipe-operator" ];
nix.settings.max-jobs = 1;
nix.settings.cores = 0;
nix.settings.secret-key-files = [ "/var/lib/nix/binary-cache-key" ];
nix.settings.trusted-public-keys =
builtins.filter (f: f != "") <| lib.strings.splitString "\n" <| builtins.readFile ../keys/nix;
nix.settings.trusted-substituters = [ "ssh-ng://clove" "ssh-ng://clove.local" ];
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Configure keymap in X11
services.xserver.xkb.layout = "us";
services.xserver.xkb.options = "caps:escape";
users.defaultUserShell = pkgs.zsh;
users.users.audrey = {
uid = 1000;
description = "Audrey Dutcher";
isNormalUser = true;
extraGroups = [
"wheel"
"docker"
"video"
"networkmanager"
"libvirtd"
"scanner"
"lp"
];
openssh.authorizedKeys.keyFiles = [ ../keys/ssh ];
};
environment.systemPackages = with pkgs; [
man-pages
man-pages-posix
wget
moor
ripgrep
fd
curl
btop
file
nettools
lsof
psmisc
p7zip
unzip
zip
jq
yq
socat
nix-run
openssl
expect
wireguard-tools
tcpdump
sqlite
smartmontools
pciutils
usbutils
nethogs
rhelmot.globalPython
];
rhelmot.globalPythonPackages = [
(
p: with p; [
pylint
pytest
ipdb
ipython
nclib
pyyaml
requests
]
)
];
programs = {
zsh = {
enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
vteIntegration = true;
histSize = 10000;
promptInit = builtins.readFile ../dotfiles/zsh-prompt.sh;
shellInit = builtins.readFile ../dotfiles/zsh-init.sh;
shellAliases = {
ls = null;
ll = null;
l = null;
grep = "grep --color=auto";
egrep = "egrep --color=auto";
objdump = "objdump -M intel";
gits = "git status";
pag = "ps aux | grep -v grep | grep -i";
hd = "hexdump -C";
hdc = "hexdump -ve '\"\\\\x\" 1/1 \"%02x\"'";
nose = "pytest -v --capture=no --pdbcls=IPython.terminal.debugger:TerminalPdb";
mkvirtualenv = "mkvirtualenv -r /etc/venv-default.txt";
woman = "man";
};
};
tmux = {
enable = true;
extraConfig = builtins.readFile ../dotfiles/tmux.conf;
};
ssh.extraConfig = builtins.readFile ../dotfiles/ssh-config;
direnv.enable = true;
direnv.nix-direnv.package = pkgs-experimental.nix-direnv;
htop.enable = true;
git = {
enable = true;
config = {
user.email = "audrey@rhelmot.io";
user.name = "Audrey Dutcher";
init.defaultBranch = "main";
blame.markUnblamableLines = true;
credential.helper = "store";
url."ssh://git@".insteadOf = "git://";
core.excludesFile = pkgs.writeText "gitignore" ''
.stignore
.stignore-sync
.direnv
.envrc
'';
};
};
bat = {
enable = true;
extraPackages = with pkgs.bat-extras; [
batdiff
batman
];
settings = {
italic-text = "always";
wrap = "never";
style = "plain";
};
};
mosh.enable = true;
};
environment.etc."zshrc.local".source = ../dotfiles/zsh-final.sh;
environment.etc."zinputrc".text = lib.mkForce (builtins.readFile ../dotfiles/zsh-input.sh);
environment.etc."gdb/gdbinit".source = ../dotfiles/gdb-init.gdb;
environment.etc."venv-default.txt".source = ../dotfiles/venv-default.txt;
services.openssh.enable = true;
boot.zfs.forceImportRoot = false;
services.sanoid = lib.mkIf config.boot.zfs.enabled {
enable = true;
datasets."system/home" = {
autosnap = true;
autoprune = true;
recursive = true;
processChildrenOnly = false;
yearly = 0;
monthly = 2;
daily = 7;
hourly = 24;
};
datasets."system/local/var" = {
autosnap = true;
autoprune = true;
recursive = true;
processChildrenOnly = false;
yearly = 0;
monthly = 2;
daily = 7;
hourly = 24;
};
datasets."system/local/root" = {
autosnap = true;
autoprune = true;
recursive = true;
processChildrenOnly = false;
yearly = 0;
monthly = 2;
daily = 7;
hourly = 24;
};
datasets."system/local/var/lib_docker" = {
autosnap = false;
recursive = true;
};
};
services.syncoid =
let
rootName = builtins.elemAt (lib.strings.splitString "/" config.fileSystems."/".device) 0;
in
lib.mkIf config.boot.zfs.enabled {
enable = true;
# offset 30min from sanoid to reduce I/O spikes and give sanoid a chance to snapshot before we
# back up
interval = "00/1:30";
service = {
serviceConfig = {
ExecCondition = "+${lib.getExe pkgs.condition-unmetered-network}";
};
};
sshKey = "/var/lib/syncoid/.ssh/id_ed25519";
commands."system" = {
source = rootName;
target = "buser@home.rhelmot.io:main/backup/${config.networking.hostName}/${rootName}";
# xeni note - option w is weeeeeeeird but the only consequnce is a lack of encryption
#sendOptions = "w";
recursive = true;
extraArgs = [
"--skip-parent"
"--sshport"
"2252"
];
};
};
services.syncthing-cluster = {
deviceIds = ../keys/syncthing;
coordinator = "hydrangea";
};
rhelmot.globalPython = (
pkgs.python3.withPackages (p: lib.concatMap (pl: pl p) rhelmot.globalPythonPackages)
);
};
}

View File

@ -1,73 +0,0 @@
{
pkgs,
config,
lib,
...
}:
let
hostname = config.networking.hostName;
in
{
options.rhelmot.deployments = lib.mkOption {
default = { };
description = "Any deployments to establish as profiles on this system";
type = lib.types.attrsOf (
lib.types.submodule (
{
name,
config,
...
}:
{
options = {
profileName = lib.mkOption {
type = lib.types.str;
default = name;
description = "The profile name at which to find the resulting package";
};
target = lib.mkOption {
type = lib.types.pathInStore;
description = "The derivation to link into the specified profile.";
};
extraCommands = lib.mkOption {
type = lib.types.str;
default = "";
description = "Any extra commands to run when deploying this deployment";
};
deployScript = lib.mkOption {
internal = true;
};
};
config.deployScript = pkgs.replaceVarsWith rec {
name = "deploy-${config.profileName}";
dir = "bin";
src = builtins.toFile "deploy-template" ''
#!@runtimeShell@
set -ex
nix-copy-closure --to @site@ @target@
ssh @site@ sudo nix-env --set -p /nix/var/nix/profiles/@profileName@ @target@
@extraCommands@
'';
replacements = {
site = hostname;
inherit (config) target profileName extraCommands;
inherit (pkgs.buildPackages) runtimeShell;
};
isExecutable = true;
meta.mainProgram = name;
};
}
)
);
};
options.rhelmot.deployScript = lib.mkOption {
internal = true;
};
config.rhelmot.deployScript =
(pkgs.buildPackages.writeShellScriptBin "deploy" (
lib.concatMapStrings (x: "${lib.getExe x.deployScript}\n") (
builtins.attrValues config.rhelmot.deployments
)
))
// builtins.mapAttrs (k: v: v.deployScript) config.rhelmot.deployments;
}

View File

@ -1,89 +1,79 @@
{ {
lib, lib,
pkgs, pkgs,
config, config,
... ...
}: }:
let let cfg = config.programs.kakoune;
cfg = config.programs.kakoune; in {
in options.programs.kakoune = {
{ enable = lib.mkEnableOption "kakoune";
options.programs.kakoune = { plugins = lib.mkOption {
enable = lib.mkEnableOption "kakoune"; type = lib.types.listOf lib.types.package;
plugins = lib.mkOption { default = [];
type = lib.types.listOf lib.types.package; description = "kakoune packages to include in the global editor";
default = [ ]; };
description = "kakoune packages to include in the global editor"; package = lib.mkPackageOption pkgs "kakoune" {};
}; finalPackage = lib.mkOption {
package = lib.mkPackageOption pkgs "kakoune" { }; type = lib.types.package;
finalPackage = lib.mkOption { description = "The package that will be linked into the global environment if enabled";
type = lib.types.package; default = cfg.package.override { plugins = cfg.plugins; };
description = "The package that will be linked into the global environment if enabled"; };
default = cfg.package.override { plugins = cfg.plugins; }; extraPackages = lib.mkOption {
internal = true; type = lib.types.listOf lib.types.package;
}; default = [];
defaultEditor = lib.mkOption { description = "Extra packages that should be linked into the system if Kakoune is enabled";
type = lib.types.bool; example = ''
default = false; with pkgs; [ kak-tree-sitter kakoune-lsp ]
description = "Whether to set EDITOR=kak globally"; '';
}; };
extraPackages = lib.mkOption { configFiles = lib.mkOption {
type = lib.types.listOf lib.types.package; type = lib.types.listOf lib.types.path;
default = [ ]; default = [];
description = "Extra packages that should be linked into the system if Kakoune is enabled"; description = "Files to link into the auto-loaded configuration";
example = '' example = ''
with pkgs; [ kak-tree-sitter kakoune-lsp ] lib.filesystem.listFilesRecursive ./dotfiles/kakoune/config
''; '';
}; };
configFiles = lib.mkOption { extraConfig = lib.mkOption {
type = lib.types.listOf lib.types.path; type = lib.types.lines;
default = [ ]; default = "";
description = "Files to link into the auto-loaded configuration"; description = "Extra configuration to load after the configFiles";
example = '' example = ''
lib.filesystem.listFilesRecursive ./dotfiles/kakoune/config "colorscheme silly-color-scheme"
''; '';
}; };
extraConfig = lib.mkOption { colorSchemes = lib.mkOption {
type = lib.types.lines; type = lib.types.listOf lib.types.path;
default = ""; default = [];
description = "Extra configuration to load after the configFiles"; description = ''
example = '' Files to link into the auto-loaded color schemes.
"colorscheme silly-color-scheme"
'';
};
colorSchemes = lib.mkOption {
type = lib.types.listOf lib.types.path;
default = [ ];
description = ''
Files to link into the auto-loaded color schemes.
NOTE: You probably want to populate this with a directory path NOTE: You probably want to populate this with a directory path
rather than a file path, since if a file is copied to the nix rather than a file path, since if a file is copied to the nix
store its name will be mangled, and you must refer to color store its name will be mangled, and you must refer to color
schemes by their filename. schemes by their filename.
''; '';
example = "[ ./dotfiles/kakoune/colors ]"; example = "[ ./dotfiles/kakoune/colors ]";
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
cfg.finalPackage
] ++ cfg.extraPackages;
programs.kakoune.configFiles = lib.mkAfter [
(pkgs.writeText "kakoune-extra-config.kak" cfg.extraConfig)
];
programs.kakoune.plugins = lib.mkAfter [
(pkgs.runCommand "kakoune-colorschemes" {} ''
mkdir -p $out/share/kak/colors
${lib.strings.concatMapStringsSep "\n" (p: "ln -s ${p} $out/share/kak/colors/") cfg.colorSchemes}
'')
(pkgs.writeTextFile {
name = "kakrc.local";
text = lib.strings.concatMapStrings (f: "source ${f}\n") cfg.configFiles;
destination = "/share/kak/kakrc.local";
})
];
}; };
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
cfg.finalPackage
]
++ cfg.extraPackages;
programs.kakoune.configFiles = lib.mkAfter [
(pkgs.writeText "kakoune-extra-config.kak" cfg.extraConfig)
];
programs.kakoune.plugins = lib.mkAfter [
(pkgs.runCommand "kakoune-colorschemes" { } ''
mkdir -p $out/share/kak/colors
${lib.strings.concatMapStringsSep "\n" (p: "ln -s ${p} $out/share/kak/colors/") cfg.colorSchemes}
'')
(pkgs.writeTextFile {
name = "kakrc.local";
text = lib.strings.concatMapStrings (f: "source ${f}\n") cfg.configFiles;
destination = "/share/kak/kakrc.local";
})
];
environment.variables.EDITOR = lib.mkIf cfg.defaultEditor "kak";
};
} }

View File

@ -1,60 +1,37 @@
{ {
config, config,
pkgs, pkgs,
lib, lib,
... ...
}: }:
let let cfg = config.services.mobileTimezone;
cfg = config.services.mobileTimezone; in {
in options.services.mobileTimezone = {
{ enable = lib.mkEnableOption "automatic mobile timezone configuration";
options.services.mobileTimezone = { interface = lib.mkOption {
enable = lib.mkEnableOption "automatic mobile timezone configuration"; description = "Interface to use to fetch a public IP";
interface = lib.mkOption { type = lib.types.str;
description = "Interface to use to fetch a public IP"; };
type = lib.types.str;
}; };
}; config = lib.mkIf cfg.enable {
config = lib.mkIf cfg.enable { assertions = [
assertions = [ { assertion = config.time.timeZone == null;
{ message = "mobileTimezone requires mutable time zone configuration";
assertion = config.time.timeZone == null; }
message = "mobileTimezone requires mutable time zone configuration"; {
} assertion = config.networking.networkmanager.enable;
{ message = "mobileTimezone requires use of NetworkManager";
assertion = config.networking.networkmanager.enable; }
message = "mobileTimezone requires use of NetworkManager"; ];
}
];
networking.networkmanager.dispatcherScripts = [ networking.networkmanager.dispatcherScripts = [{
{ source = pkgs.writeShellScript "mobile-timezone" ''
source = pkgs.writeShellScript "mobile-timezone" '' export WIRELESS_INTERFACE="${cfg.interface}"
export WIRELESS_INTERFACE="${cfg.interface}" export PATH="${lib.strings.makeBinPath (with pkgs; [ config.systemd.package bash geoipWithDatabase sudo curl gnugrep gnused coreutils libnotify procps gawk libc ])}"
export PATH="${ if [[ "$2" == "connectivity-change" && "$CONNECTIVITY_STATE" == "FULL" ]]; then
lib.strings.makeBinPath ( ${./mobile-timezone.sh}
with pkgs; fi
[ '';
config.systemd.package }];
bash };
geoipWithDatabase
sudo
curl
gnugrep
gnused
coreutils
libnotify
procps
gawk
libc
]
)
}"
if [[ "$2" == "connectivity-change" && "$CONNECTIVITY_STATE" == "FULL" ]]; then
${./mobile-timezone.sh}
fi
'';
}
];
};
} }

View File

@ -7,15 +7,11 @@ let
cfg = config.services.syncthing-cluster; cfg = config.services.syncthing-cluster;
hostname = config.networking.hostName; hostname = config.networking.hostName;
deviceFiles = builtins.attrNames (builtins.readDir cfg.deviceIds); deviceFiles = builtins.attrNames (builtins.readDir cfg.deviceIds);
toDeviceInfo = filename: { toDeviceInfo = filename: { name = filename; value = lib.strings.trim (builtins.readFile "${cfg.deviceIds}/${filename}"); };
name = filename;
value = lib.strings.trim (builtins.readFile "${cfg.deviceIds}/${filename}");
};
allDevices = builtins.listToAttrs (builtins.map toDeviceInfo deviceFiles); allDevices = builtins.listToAttrs (builtins.map toDeviceInfo deviceFiles);
otherDevices = lib.attrsets.removeAttrs allDevices [ hostname ]; otherDevices = lib.attrsets.removeAttrs allDevices [ hostname ];
myDeviceIdAgain = allDevices.${hostname} or ""; myDeviceIdAgain = allDevices.${hostname} or "";
in in {
{
options.services.syncthing-cluster = { options.services.syncthing-cluster = {
enable = lib.mkEnableOption "syncthing cluster"; enable = lib.mkEnableOption "syncthing cluster";
device = lib.mkOption { device = lib.mkOption {
@ -43,33 +39,22 @@ in
description = "The hostname of the device which should be the coordinator for the cluster and should auto-accept all folders"; description = "The hostname of the device which should be the coordinator for the cluster and should auto-accept all folders";
}; };
}; };
config = lib.mkIf cfg.enable ( config = lib.mkIf cfg.enable (lib.mkMerge [{
lib.mkMerge [ assertions = [{
{ assertion = cfg.device == myDeviceIdAgain;
assertions = [ message = "Your device ID (${cfg.device}) is not listed in the device ID directory under your hostname (${hostname})";
{ }];
assertion = cfg.device == myDeviceIdAgain; services.syncthing = {
message = "Your device ID (${cfg.device}) is not listed in the device ID directory under your hostname (${hostname})"; enable = true;
} inherit (cfg) configDir dataDir user;
]; openDefaultPorts = true;
services.syncthing = { overrideDevices = true;
enable = true; settings.devices = builtins.mapAttrs (_: value: { id = value; autoAcceptFolders = hostname == cfg.coordinator; }) otherDevices;
inherit (cfg) configDir dataDir user; };
openDefaultPorts = true; } (lib.mkIf (cfg.user != "syncthing") {
overrideDevices = true; services.syncthing = {
overrideFolders = false; inherit (cfg) user;
settings.devices = builtins.mapAttrs (_: value: { group = config.users.users.${cfg.user}.group;
id = value; };
autoAcceptFolders = hostname == cfg.coordinator; })]);
}) otherDevices;
};
}
(lib.mkIf (cfg.user != "syncthing") {
services.syncthing = {
inherit (cfg) user;
group = config.users.users.${cfg.user}.group;
};
})
]
);
} }

View File

@ -1,92 +0,0 @@
{
lib,
config,
pkgs,
pkgs-experimental,
...
}:
{
options.rhelmot.isWorkstation = lib.mkOption {
default = false;
type = lib.types.bool;
description = "Whether to install workstation tools on this machine";
};
config = lib.mkIf config.rhelmot.isWorkstation {
environment.systemPackages = with pkgs; [
gnumake
units
units-desktop
patchelf
dwarfdump
gdb
kubectl
kubernetes-helm
foremost
binwalk
nix-index
nix-diff
nixtamal.nixtamal
cronie
# radicle-node
editorconfig-core-c
clang
gcc
bintools
ffmpeg
unar
] ++ lib.optionals stdenv.hostPlatform.isLinux [
rr
qemu-user
nixd
lua-language-server
clang-tools
bash-language-server
pyright
csharp-ls
dotnet-sdk_9
gopls
typescript-language-server
ocamlPackages.ocaml-lsp
vscode-json-languageserver
pre-commit
];
rhelmot.globalPythonPackages = [
(
p: with p; [
aiohttp
snakeviz
pysocks
pudb
]
)
];
documentation.dev.enable = true;
documentation.man.enable = true;
documentation.doc.enable = true;
programs = {
kakoune = {
enable = pkgs.stdenv.hostPlatform.system == pkgs.stdenv.buildPlatform.system;
defaultEditor = true;
plugins = with pkgs.kakounePlugins; [
kak-fzf
smarttab-kak
];
configFiles = lib.filesystem.listFilesRecursive ../dotfiles/kakoune/config;
colorSchemes = [ ../dotfiles/kakoune/colors ];
extraPackages = with pkgs; [
pkgs-experimental.kak-tree-sitter-complete
kakoune-lsp
];
};
git.lfs.enable = true;
bat.extraPackages = with pkgs.bat-extras; [
prettybat
];
};
};
}

View File

@ -1,13 +1,5 @@
{ { config, pkgs, lib, ... }: let
config, withDefaultPool = defaultPool: dataset: if lib.strings.hasPrefix "/" dataset then "${defaultPool}${dataset}" else dataset;
pkgs,
lib,
...
}:
let
withDefaultPool =
defaultPool: dataset:
if lib.strings.hasPrefix "/" dataset then "${defaultPool}${dataset}" else dataset;
cfg = config.zfs; cfg = config.zfs;
zfsPermsOptions = { zfsPermsOptions = {
@ -19,7 +11,7 @@ let
Corresponds to `zfs allow -l`. Corresponds to `zfs allow -l`.
''; '';
type = with lib.types; listOf str; type = with lib.types; listOf str;
default = [ ]; default = [];
example = lib.literalExpression "[\"@mypermset\" \"create\" \"destroy\"]"; example = lib.literalExpression "[\"@mypermset\" \"create\" \"destroy\"]";
}; };
@ -30,7 +22,7 @@ let
Corresponds to `zfs allow -d`. Corresponds to `zfs allow -d`.
''; '';
type = with lib.types; listOf str; type = with lib.types; listOf str;
default = [ ]; default = [];
example = lib.literalExpression "[\"@mypermset\" \"create\" \"destroy\"]"; example = lib.literalExpression "[\"@mypermset\" \"create\" \"destroy\"]";
}; };
}; };
@ -38,9 +30,7 @@ let
zfsDatasetOptions = { zfsDatasetOptions = {
options = { options = {
enable = (lib.mkEnableOption "ZFS dataset") // { enable = (lib.mkEnableOption "ZFS dataset") // { default = true; };
default = true;
};
name = lib.mkOption { name = lib.mkOption {
description = '' description = ''
@ -68,14 +58,8 @@ let
Corresponds to `zfs create -o property=value`. Corresponds to `zfs create -o property=value`.
''; '';
type = type = with lib.types; attrsOf (oneOf [str int bool]);
with lib.types; default = {};
attrsOf (oneOf [
str
int
bool
]);
default = { };
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
"mycustom:prop" = "test"; "mycustom:prop" = "test";
@ -99,7 +83,7 @@ let
This corresponds to the `zfs allow -u` command. This corresponds to the `zfs allow -u` command.
''; '';
type = with lib.types; attrsOf (submodule zfsPermsOptions); type = with lib.types; attrsOf (submodule zfsPermsOptions);
default = { }; default = {};
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
"myuser" = { "myuser" = {
@ -117,7 +101,7 @@ let
This corresponds to the `zfs allow -g` command. This corresponds to the `zfs allow -g` command.
''; '';
type = with lib.types; attrsOf (submodule zfsPermsOptions); type = with lib.types; attrsOf (submodule zfsPermsOptions);
default = { }; default = {};
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
"mygroup" = { "mygroup" = {
@ -135,7 +119,7 @@ let
This corresponds to the `zfs allow -e` command. This corresponds to the `zfs allow -e` command.
''; '';
type = with lib.types; submodule zfsPermsOptions; type = with lib.types; submodule zfsPermsOptions;
default = { }; default = {};
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
local = ["create"]; local = ["create"];
@ -146,8 +130,7 @@ let
}; };
}; };
makeFileSystem = makeFileSystem = parent: name: value:
parent: name: value:
lib.nameValuePair value.mountPoint { lib.nameValuePair value.mountPoint {
device = withDefaultPool parent name; device = withDefaultPool parent name;
fsType = "zfs"; fsType = "zfs";
@ -155,24 +138,21 @@ let
neededForBoot = true; neededForBoot = true;
}; };
makeTmpfiles = makeTmpfiles = _: value:
_: value:
lib.nameValuePair value.mountPoint { lib.nameValuePair value.mountPoint {
z = { z = {
inherit (value) user group mode; inherit (value) user group mode;
}; };
}; };
normalizeProp = normalizeProp = prop:
prop:
if lib.isInt prop then if lib.isInt prop then
builtins.toString prop builtins.toString prop
else if lib.isBool prop then else if lib.isBool prop then
if prop then "on" else "off" if prop then "on" else "off"
else else
prop; prop;
in in {
{
options.zfs = { options.zfs = {
systemPool = { systemPool = {
name = lib.mkOption { name = lib.mkOption {
@ -191,14 +171,8 @@ in
Corresponds to `zpool create -o property=value`. Corresponds to `zpool create -o property=value`.
''; '';
type = type = with lib.types; attrsOf (oneOf [str int bool]);
with lib.types; default = {};
attrsOf (oneOf [
str
int
bool
]);
default = { };
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
compression = "lz4"; compression = "lz4";
@ -213,14 +187,8 @@ in
Corresponds to `zpool create -O property=value`. Corresponds to `zpool create -O property=value`.
''; '';
type = type = with lib.types; attrsOf (oneOf [str int bool]);
with lib.types; default = {};
attrsOf (oneOf [
str
int
bool
]);
default = { };
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
"mycustom:prop" = "test"; "mycustom:prop" = "test";
@ -230,20 +198,13 @@ in
}; };
reserved = { reserved = {
enable = (lib.mkEnableOption "ZFS reservation") // { enable = (lib.mkEnableOption "ZFS reservation") // { default = true; };
default = true;
};
size = lib.mkOption { size = lib.mkOption {
description = '' description = ''
Size of the ZFS reservation. Size of the ZFS reservation.
''; '';
type = type = with lib.types; oneOf [ str int ];
with lib.types;
oneOf [
str
int
];
default = "5G"; default = "5G";
example = lib.literalExpression "\"10G\""; example = lib.literalExpression "\"10G\"";
}; };
@ -252,7 +213,7 @@ in
datasets = lib.mkOption { datasets = lib.mkOption {
description = "ZFS datasets"; description = "ZFS datasets";
type = with lib.types; attrsOf (submodule zfsDatasetOptions); type = with lib.types; attrsOf (submodule zfsDatasetOptions);
default = { }; default = {};
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
"mydataset" = { "mydataset" = {
@ -268,7 +229,7 @@ in
users = lib.mkOption { users = lib.mkOption {
description = "List of users to process zfs.perUser for."; description = "List of users to process zfs.perUser for.";
type = with lib.types; listOf str; type = with lib.types; listOf str;
default = [ ]; default = [];
example = lib.literalExpression "[ \"someuser\" ]"; example = lib.literalExpression "[ \"someuser\" ]";
}; };
@ -280,7 +241,7 @@ in
being created in the format `{name, ...}`. being created in the format `{name, ...}`.
''; '';
type = with lib.types; functionTo (attrsOf (submodule zfsDatasetOptions)); type = with lib.types; functionTo (attrsOf (submodule zfsDatasetOptions));
default = { }; default = {};
example = lib.literalExpression '' example = lib.literalExpression ''
{name, ...}: { {name, ...}: {
"mydataset" = { "mydataset" = {
@ -301,116 +262,108 @@ in
}; };
}; };
config = config = let
let datasetsToSort =
datasetsToSort = lib.mapAttrsToList (name: value: { lib.mapAttrsToList (name: value: {
inherit name; inherit name;
inherit (value) mountPoint; inherit (value) mountPoint;
}) cfg._allDatasets; }) cfg._allDatasets;
sortFunc = a: b: (lib.hasPrefix a.name b.name) || (lib.hasPrefix a.mountPoint b.mountPoint); sortFunc = a: b:
sortedDatasets = lib.toposort sortFunc datasetsToSort; (lib.hasPrefix a.name b.name) || (lib.hasPrefix a.mountPoint b.mountPoint);
in sortedDatasets = lib.toposort sortFunc datasetsToSort;
{ in {
assertions = [ assertions = [
{ {
assertion = !(lib.hasAttr "cycle" sortedDatasets); assertion = !(lib.hasAttr "cycle" sortedDatasets);
message = message = let
let cycleItems =
cycleItems = lib.map (x: "\n - " + x.name + " (" + x.mountPoint + ")") sortedDatasets.cycle; lib.map (x:
in "\n - " + x.name + " (" + x.mountPoint + ")"
"ZFS datasets have a cycle!" + (lib.concatStrings cycleItems); ) sortedDatasets.cycle;
} in "ZFS datasets have a cycle!" + (lib.concatStrings cycleItems);
]; }
];
zfs._allDatasets = zfs._allDatasets = let
let fixupDatasets = user: group: datasets:
fixupDatasets = (lib.mapAttrs'
user: group: datasets: (name: value:
(lib.mapAttrs' ( lib.nameValuePair
name: value: (if value.name == null then name else value.name)
lib.nameValuePair (if value.name == null then name else value.name) ( ((lib.removeAttrs value ["name"]) // {
(lib.removeAttrs value [ "name" ]) inherit user group;
// { }))
inherit user group; datasets)
} |> (lib.filterAttrs (_: value: value.enable))
) |> (lib.mapAttrs (_: value: lib.removeAttrs value ["enable"]));
) datasets) in
|> (lib.filterAttrs (_: value: value.enable)) (fixupDatasets "root" "root" cfg.datasets) //
|> (lib.mapAttrs (_: value: lib.removeAttrs value [ "enable" ])); (lib.mergeAttrsList
in (lib.map
(fixupDatasets "root" "root" cfg.datasets) (name:
// (lib.mergeAttrsList (
lib.map (
name:
# XXX: passing in "users" verbatim here is kind of a hack # XXX: passing in "users" verbatim here is kind of a hack
# unfortunately due to infinite recursion we can't actually query for the user's # unfortunately due to infinite recursion we can't actually query for the user's
# main group, and it seems clunky to expect it to be passed from the outside # main group, and it seems clunky to expect it to be passed from the outside
fixupDatasets name "users" (cfg.perUser { inherit name; }) fixupDatasets name "users" (cfg.perUser { inherit name; }))
) cfg.users cfg.users));
));
fileSystems = lib.mapAttrs' (makeFileSystem "${cfg.systemPool.name}") cfg._allDatasets; fileSystems =
lib.mapAttrs'
(makeFileSystem "${cfg.systemPool.name}")
cfg._allDatasets;
systemd.tmpfiles.settings."zfs-datasets" = lib.mapAttrs' makeTmpfiles cfg._allDatasets; systemd.tmpfiles.settings."zfs-datasets" =
lib.mapAttrs' makeTmpfiles cfg._allDatasets;
# provide some recommended config # provide some recommended config
zfs = { zfs = {
systemPool = { systemPool = {
properties = { properties = {
# user must set ashift # user must set ashift
autotrim = lib.mkDefault true; autotrim = lib.mkDefault true;
}; };
fsProperties = { fsProperties = {
acltype = lib.mkDefault "posix"; acltype = lib.mkDefault "posix";
compression = lib.mkDefault "lz4"; compression = lib.mkDefault "lz4";
mountpoint = lib.mkDefault "none"; mountpoint = lib.mkDefault "none";
canmount = lib.mkDefault false; canmount = lib.mkDefault false;
atime = lib.mkDefault false; atime = lib.mkDefault false;
relatime = lib.mkDefault true; relatime = lib.mkDefault true;
recordsize = lib.mkDefault "16k"; recordsize = lib.mkDefault "16k";
dnodesize = lib.mkDefault "auto"; dnodesize = lib.mkDefault "auto";
xattr = lib.mkDefault "sa"; xattr = lib.mkDefault "sa";
normalization = lib.mkDefault "formD"; normalization = lib.mkDefault "formD";
};
}; };
}; };
# TODO: apply ZFS properties and permissions
system.build.zfsConfig = (pkgs.formats.json { }).generate "zfs.json" rec {
inherit (cfg) reserved;
systemPool = {
properties = lib.mapAttrs (_: v: normalizeProp v) cfg.systemPool.properties;
fsProperties = lib.mapAttrs (_: v: normalizeProp v) cfg.systemPool.fsProperties;
}
// lib.removeAttrs cfg.systemPool [
"properties"
"fsProperties"
];
datasets =
cfg._allDatasets
|> (lib.mapAttrs' (
name: value:
lib.nameValuePair (withDefaultPool cfg.systemPool.name name) (
{
properties = lib.mapAttrs (_: v: normalizeProp v) value.properties;
}
// (lib.removeAttrs value [ "properties" ])
)
));
installOrder = lib.map (x: withDefaultPool cfg.systemPool.name x.name) sortedDatasets.result;
};
system.build.zfsProvisionScript = pkgs.writeShellScriptBin "zfs-provision" ''
bash ${./zfs-provision.sh} ${config.system.build.zfsConfig}
'';
system.systemBuilderCommands = ''
cp "${config.system.build.zfsConfig}" $out/zfs.json
'';
}; };
# TODO: apply ZFS properties and permissions
system.build.zfsConfig = (pkgs.formats.json {}).generate "zfs.json" rec {
inherit (cfg) reserved;
systemPool = {
properties = lib.mapAttrs (_: v: normalizeProp v) cfg.systemPool.properties;
fsProperties = lib.mapAttrs (_: v: normalizeProp v) cfg.systemPool.fsProperties;
} // lib.removeAttrs cfg.systemPool ["properties" "fsProperties"];
datasets = cfg._allDatasets
|> (lib.mapAttrs'
(name: value: lib.nameValuePair (withDefaultPool cfg.systemPool.name name)
({
properties = lib.mapAttrs (_: v: normalizeProp v) value.properties;
} // (lib.removeAttrs value ["properties"]))));
installOrder = lib.map (x: withDefaultPool cfg.systemPool.name x.name) sortedDatasets.result;
};
system.build.zfsProvisionScript = pkgs.writeShellScriptBin "zfs-provision" ''
bash ${./zfs-provision.sh} ${config.system.build.zfsConfig}
'';
system.systemBuilderCommands = ''
cp "${config.system.build.zfsConfig}" $out/zfs.json
'';
};
} }

View File

@ -1,38 +0,0 @@
git-base: staging
diff --git a/pkgs/build-support/rust/hooks/default.nix b/pkgs/build-support/rust/hooks/default.nix
index d17c6c0b4a12..5f6a1f6de729 100644
--- a/pkgs/build-support/rust/hooks/default.nix
+++ b/pkgs/build-support/rust/hooks/default.nix
@@ -130,8 +130,8 @@
bindgenHook = makeSetupHook {
name = "rust-bindgen-hook";
substitutions = {
- libclang = (lib.getLib clang.cc);
- inherit clang;
+ libclang = (lib.getLib pkgsHostTarget.rustc.llvmPackages.clang.cc);
+ inherit (pkgsHostTarget.rustc.llvmPackages) clang;
targetFlag = lib.optionalString (
!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform
) "--target=${stdenv.targetPlatform.config}";
diff --git a/pkgs/by-name/ru/rust-bindgen-unwrapped/package.nix b/pkgs/by-name/ru/rust-bindgen-unwrapped/package.nix
index 50e4576027d3..6d4ac7a9fd89 100644
--- a/pkgs/by-name/ru/rust-bindgen-unwrapped/package.nix
+++ b/pkgs/by-name/ru/rust-bindgen-unwrapped/package.nix
@@ -1,13 +1,14 @@
{
lib,
fetchCrate,
- rustPlatform,
+ rustc,
rustfmt,
+ rustPlatform,
}:
let
# bindgen hardcodes rustfmt outputs that use nightly features
rustfmt-nightly = rustfmt.override { asNightly = true; };
- clang = rustPlatform.rust.rustc.llvmPackages.clang;
+ clang = rustc.llvmPackages.clang;
in
rustPlatform.buildRustPackage rec {
pname = "rust-bindgen-unwrapped";

View File

@ -1,15 +0,0 @@
diff --git a/pkgs/by-name/ni/nix-direnv/package.nix b/pkgs/by-name/ni/nix-direnv/package.nix
index a52ca907e8f4..32bf83d5fbc3 100644
--- a/pkgs/by-name/ni/nix-direnv/package.nix
+++ b/pkgs/by-name/ni/nix-direnv/package.nix
@@ -14,8 +14,8 @@ resholve.mkDerivation (finalAttrs: {
src = fetchFromGitHub {
owner = "nix-community";
repo = "nix-direnv";
- tag = finalAttrs.version;
- hash = "sha256-dNJeSRuuqA2avtLpTse7mTTmnYdVnC5BxRsofuLXiqE=";
+ tag = "babed5598d2594b71677ca18674d027bc4549eb0";
+ hash = "sha256-cf6klSXJ0WmICyHpFiFT5A+em5kuD8vVhBxgYktC0m8=";
};
installPhase = ''

View File

@ -1,15 +0,0 @@
git-base: staging
diff --git a/pkgs/by-name/gd/gdb/package.nix b/pkgs/by-name/gd/gdb/package.nix
index 592afe0fe227..84d4ccb42b5e 100644
--- a/pkgs/by-name/gd/gdb/package.nix
+++ b/pkgs/by-name/gd/gdb/package.nix
@@ -197,6 +197,8 @@ stdenv.mkDerivation (finalAttrs: {
# Remove Info files already provided by Binutils and other packages.
rm -v $out/share/info/bfd.info
+ ''
+ + lib.optionalString pythonSupport ''
# Make sure pyc files are generated before fixup
python3 -m compileall $out/share/gdb/python/gdb
'';

View File

@ -1,23 +0,0 @@
git-base: master
diff --git a/pkgs/tools/package-management/lix/common-lix.nix b/pkgs/tools/package-management/lix/common-lix.nix
index 084a511858a9..1e557b56ae62 100644
--- a/pkgs/tools/package-management/lix/common-lix.nix
+++ b/pkgs/tools/package-management/lix/common-lix.nix
@@ -41,6 +41,7 @@ assert lib.assertMsg (
callPackage,
capnproto,
cargo,
+ clang,
curl,
cmake,
darwin,
@@ -230,6 +231,8 @@ stdenv.mkDerivation (finalAttrs: {
# We only include CMake so that Meson can locate toml11, which only ships CMake dependency metadata.
dontUseCmakeConfigure = true;
+ depsBuildBuild = [ clang ];
+
nativeBuildInputs = [
# python3.withPackages does not splice properly, see https://github.com/NixOS/nixpkgs/issues/305858
(buildPackages.python3.withPackages (

View File

@ -1,39 +0,0 @@
git-base: master
diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix
index 48fe659737a3..b733dfbfba4f 100644
--- a/pkgs/servers/sql/mariadb/default.nix
+++ b/pkgs/servers/sql/mariadb/default.nix
@@ -179,6 +179,7 @@ let
# revisit this if nixpkgs supports any architecture whose stack grows upwards
"-DSTACK_DIRECTION=-1"
"-DCMAKE_CROSSCOMPILING_EMULATOR=${stdenv.hostPlatform.emulator buildPackages}"
+ (with stdenv.hostPlatform.parsed; "-DDUCKDB_EXPLICIT_PLATFORM=${cpu.name}_${kernel.name}")
];
postInstall = lib.optionalString (!withEmbedded) ''
@@ -279,6 +280,7 @@ let
bison
boost.dev
flex
+ git
];
buildInputs =
@@ -294,7 +296,6 @@ let
judy
libevent
libxml2
- git
]
++ lib.optional withNuma numactl
++ lib.optionals stdenv.hostPlatform.isLinux [ linux-pam ]
@@ -312,6 +313,8 @@ let
postPatch = ''
substituteInPlace scripts/galera_new_cluster.sh \
--replace ":-mariadb" ":-mysql"
+
+ sed -E -i -e '/CMAKE_ARGS/a -DDUCKDB_EXPLICIT_PLATFORM=''${DUCKDB_EXPLICIT_PLATFORM}' ./storage/duckdb/cmake/duckdb.cmake
'';
cmakeFlags =

View File

@ -1,32 +0,0 @@
git-base: staging
diff --git a/pkgs/development/compilers/openjdk/generic.nix b/pkgs/development/compilers/openjdk/generic.nix
index 78980adcf797..1d5d1b256917 100644
--- a/pkgs/development/compilers/openjdk/generic.nix
+++ b/pkgs/development/compilers/openjdk/generic.nix
@@ -47,7 +47,6 @@
liberation_ttf,
cacert,
- jre-generate-cacerts,
nixpkgs-openjdk-updater,
@@ -407,7 +406,7 @@ stdenv.mkDerivation (finalAttrs: {
mkdir "$NIX_BUILD_TOP/cacerts-gen"
pushd "$NIX_BUILD_TOP/cacerts-gen"
JAVA_TOOL_OPTIONS="-Dkeystore.pkcs12.certProtectionAlgorithm=NONE -Dkeystore.pkcs12.macAlgorithm=NONE" \
- ${jre-generate-cacerts} ${jdk-bootstrap'.home}/bin/keytool ${cacert}/etc/ssl/certs/ca-bundle.crt
+ ${buildPackages.jre-generate-cacerts} ${jdk-bootstrap'.home}/bin/keytool ${cacert}/etc/ssl/certs/ca-bundle.crt
popd
configureFlags+=("--with-cacerts-file=$NIX_BUILD_TOP/cacerts-gen/cacerts")
'';
@@ -567,7 +566,7 @@ stdenv.mkDerivation (finalAttrs: {
+ ''
cd $jre/lib/openjdk/jre/lib/security
rm cacerts
- ${jre-generate-cacerts} ${
+ ${buildPackages.jre-generate-cacerts} ${
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
"$jre/lib/openjdk/jre/bin/keytool"
else

View File

@ -1,13 +0,0 @@
diff --git a/nixos/modules/services/web-apps/wordpress.nix b/nixos/modules/services/web-apps/wordpress.nix
index 43119592e972..39c3402494c8 100644
--- a/nixos/modules/services/web-apps/wordpress.nix
+++ b/nixos/modules/services/web-apps/wordpress.nix
@@ -96,7 +96,7 @@ let
require_once(ABSPATH . 'wp-settings.php');
?>
'';
- checkPhase = "${pkgs.php}/bin/php --syntax-check $target";
+ checkPhase = "${pkgs.buildPackages.php}/bin/php --syntax-check $target";
};
mkPhpValue =

View File

@ -1,83 +0,0 @@
diff --git a/pkgs/development/interpreters/php/generic.nix b/pkgs/development/interpreters/php/generic.nix
index 6f00169e38f4..9055730d0504 100644
--- a/pkgs/development/interpreters/php/generic.nix
+++ b/pkgs/development/interpreters/php/generic.nix
@@ -7,6 +7,7 @@ let
callPackage,
lib,
stdenv,
+ buildPackages,
nixosTests,
tests,
fetchurl,
@@ -298,6 +299,10 @@ let
++ lib.optionals (!zendSignalsSupport) [ "--disable-zend-signals" ]
++ lib.optional zendMaxExecutionTimersSupport "--enable-zend-max-execution-timers"
+ # Cross
+ ++ lib.optional (!stdenv.buildPlatform.canExecute stdenv.hostPlatform)
+ "ac_cv_prog_BUILD_CC=${lib.getBin buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"
+
# Sendmail
++ [ "PROG_SENDMAIL=${system-sendmail}/bin/sendmail" ];
@@ -369,6 +374,10 @@ let
]
++ extraPatches;
+ postPatch = lib.optionalString (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) ''
+ substituteInPlace pear/Makefile.frag --replace-fail '$(top_builddir)/sapi/cli/php' "${lib.getExe buildPackages.php}"
+ '';
+
separateDebugInfo = true;
outputs = [
diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix
index 24a07f88d3ce..f989d4c3d65d 100644
--- a/pkgs/top-level/php-packages.nix
+++ b/pkgs/top-level/php-packages.nix
@@ -1,5 +1,6 @@
{
stdenv,
+ buildPackages,
config,
callPackages,
lib,
@@ -35,7 +36,6 @@
bison,
re2c,
readline,
- rsync,
sqlite,
unixodbc,
uwimap,
@@ -192,7 +192,7 @@ lib.makeScope pkgs.newScope (
mkdir -p $out/lib/php/extensions
cp modules/${extName}.so $out/lib/php/extensions/${extName}.so
mkdir -p $dev/include
- ${rsync}/bin/rsync -r --filter="+ */" \
+ ${buildPackages.rsync}/bin/rsync -r --filter="+ */" \
--filter="+ *.h" \
--filter="- *" \
--prune-empty-dirs \
@@ -469,6 +469,7 @@ lib.makeScope pkgs.newScope (
{
name = "fileinfo";
buildInputs = [ pcre2 ];
+ doCheck = false;
}
{
name = "filter";
@@ -833,7 +834,11 @@ lib.makeScope pkgs.newScope (
++ lib.optional (
!stdenv.hostPlatform.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind
) valgrind.dev;
- configureFlags = lib.optional php.ztsSupport "--disable-opcache-jit";
+ configureFlags =
+ lib.optional php.ztsSupport "--disable-opcache-jit"
+ ++
+ lib.optional (!stdenv.buildPlatform.canExecute stdenv.hostPlatform)
+ "ac_cv_prog_BUILD_CC=${lib.getBin buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc";
zendExtension = true;
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
# Tests are flaky on darwin

View File

@ -1,8 +0,0 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

View File

@ -1,2 +0,0 @@
darcs_context
.silo

View File

@ -1 +0,0 @@
root = true

File diff suppressed because it is too large Load Diff

View File

@ -1,259 +0,0 @@
/*
SPDX-FileCopyrightText: 2025–2026 toastal
SPDX-FileCopyrightText: 2026 Nixtamal contributors
SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
& this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED “AS IS” & ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY & FITNESS. IN
NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
────────────────────────────────────────────────────────────────────────────────
┏┓╻+╻ ╱┏┳┓┏┓┏┳┓┏┓╻
┃┃┃┃┗━┓╹┃╹┣┫┃┃┃┣┫┃ This file was generated by Nixtamal.
╹┗┛╹╱ ╹ ╹ ╹╹╹ ╹╹╹┗┛ Do not edit as it will be overwritten.
────────────────────────────────────────────────────────────────────────────────
*/
{
system ? null,
bootstrap-nixpkgs ? null,
bootstrap-nixpkgs-lock-name ? null,
bootstrap-pkgs ? null,
}:
let lock = builtins.fromJSON (builtins.readFile ./lock.json); in
assert (lock.v == "1.5.0");
let
isNonemptyString = x: builtins.isString x && x != "";
isNonemptyList = xs: builtins.isList xs && xs != [ ];
hash-token = {
"0" = "sha256";
"1" = "sha512";
"2" = "blake3";
};
local-patches = {
"bindgen-bullshit" = ../bindgen-bullshit.patch;"direnv-prerelease" = ../direnv-prerelease.patch;"gdb-cross" = ../gdb-cross.patch;"lix-cross" = ../lix-cross.patch;"mariadb-cross" = ../mariadb-cross.patch;"openjdk-cross" = ../openjdk-cross.patch;"php-cross" = ../php-cross.patch;"php-cross-module" = ../php-cross-module.patch;
};
try-fetch = input-name: fetcher:
let
try-fetch' = failed-urls: url: urls:
let result = builtins.tryEval (fetcher url); in
if result.success then
result.value
else
let failed-urls' = [ url ] ++ failed-urls; in
if urls == [ ] then
let fus = builtins.concatStringsSep " " failed-urls'; in
throw "Input 「${input-name}」fetchable @ [ ${fus} ]"
else
try-fetch' failed-urls' (builtins.head urls) (builtins.tail urls);
in
try-fetch' [ ];
builtin-fetch-tarball = { input-name, name, kind, hash }:
try-fetch input-name (url:
builtins.fetchTarball ({
inherit url;
${hash-token.${builtins.toString hash.al}} = hash.vl;
}
// (if isNonemptyString name then { inherit name; } else { }))
) kind.ur kind.ms;
builtin-fetch-git = { input-name, name, kind }:
let
ref =
let
type = builtins.elemAt kind.rf 0;
valu = builtins.elemAt kind.rf 1;
in
if type == 0 then # ref
valu
else if type == 1 then # branch
"refs/heads/${valu}"
else if type == 2 then # tag
"refs/tags/${valu}"
else
throw "Unsupported reference type “${builtins.toString type}”.";
in
try-fetch input-name (url:
let
args = {
inherit url ref;
rev = kind.lr;
submodules = kind.sm;
shallow = true;
}
// (if builtins.compareVersions builtins.nixVersion "2.26" < 0 then { } else { lfs = kind.lf; })
// (if isNonemptyString name then { inherit name; } else { });
in
builtins.fetchGit args
) kind.rp kind.ms;
builtin-to-input = input-name: input:
let
name = input.sn;
hash = input.ha;
kind = builtins.elemAt input.kd 1;
k = builtins.head input.kd;
in
if k == 1 then
builtin-fetch-tarball { inherit input-name name hash kind; }
else if k == 2 then
builtin-fetch-git { inherit input-name name kind; }
else
throw "Unsupported builtin fetcher “${builtins.toString k}”";
local-bootstrap-nixpkgs =
if builtins.isAttrs bootstrap-nixpkgs then
bootstrap-nixpkgs
else
builtin-to-input "bootstrap-nixpkgs-for-nixtamal" (
if builtins.isString bootstrap-nixpkgs-lock-name then
lock.i.${bootstrap-nixpkgs-lock-name}
else
lock.i.nixpkgs-nixtamal or lock.i.nixpkgs
);
pkgs =
if builtins.isAttrs bootstrap-pkgs then
bootstrap-pkgs
else
import local-bootstrap-nixpkgs {
system = if builtins.isString system then system else builtins.currentSystem;
};
inherit (pkgs) lib;
fetch-zip = { input-name, name, kind, hash }:
pkgs.fetchzip (
{
# base gnutar doesn’t support Zstandard
nativeBuildInputs = [ pkgs.zstd ];
hash = hash.vl;
}
// (if isNonemptyList kind.ms then
{ urls = [ kind.ur ] ++ kind.ms; }
else
{ url = kind.ur; }
)
// lib.optionalAttrs (isNonemptyString name) { inherit name; }
// lib.optionalAttrs (isNonemptyString kind.ex) { extension = kind.ex; }
);
fetch-git = { input-name, name, kind, hash }:
let
has-mirrors = isNonemptyList kind.ms;
has-mirror-support = pkgs.fetchgit.__functionArgs ? "mirrors";
in
lib.warnIf (has-mirrors && !has-mirror-support)
"Upstream pkgs.fetchgit doesn’t yet support mirrors for 「${input-name}」"
pkgs.fetchgit ({
url = kind.rp;
rev = kind.lr;
fetchSubmodules = kind.sm;
fetchLFS = kind.lf;
deepClone = false;
hash = hash.vl;
}
// lib.optionalAttrs (isNonemptyString name) { inherit name; }
// lib.optionalAttrs (has-mirrors && has-mirror-support) { mirrors = kind.ms; }
);
fetch-darcs = { input-name, name, kind, hash }:
let
has-mirrors = isNonemptyList kind.ms;
has-mirror-support = pkgs.fetchdarcs.__functionArgs ? "mirrors";
reference =
let
type = builtins.elemAt kind.rf 0;
value = builtins.elemAt kind.rf 1;
in
if type == 0 then
let ctx-path = builtins.elemAt value 1; in
assert (lib.hasSuffix ".txt" ctx-path);
let
txt-files = lib.sourceFilesBySuffices ./. [ ".txt" ];
dir = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.fromSource txt-files;
};
in
{ context = "${dir}/${ctx-path}"; }
else if type == 1 then
{ rev = value; }
else
throw "Invalid Darcs reference";
in
lib.warnIf (has-mirrors && !has-mirror-support)
"Upstream pkgs.fetchdarcs doesn’t yet support mirrors for 「${input-name}」"
pkgs.fetchdarcs (
{
url = kind.rp;
hash = hash.vl;
}
// reference
// lib.optionalAttrs (isNonemptyString name) { inherit name; }
// lib.optionalAttrs (has-mirrors && has-mirror-support) { mirrors = kind.ms; }
);
fetch-patch = patch-name: { ur, ha, sn ? null, ... }:
pkgs.fetchpatch2 {
url = ur;
hash = ha.vl;
name = if isNonemptyString sn then sn else "${patch-name}-patch";
};
to-input = input-name: input:
let
name = input.sn;
hash = input.ha;
kind = builtins.elemAt input.kd 1;
k = builtins.head input.kd;
raw-input =
if k == 3 then
fetch-darcs { inherit input-name name kind hash; }
else if k == 1 then
let fetch-time = kind.ft; in
if fetch-time == 0 then
fetch-zip { inherit input-name name kind hash; }
else if fetch-time == 1 then
builtin-fetch-tarball { inherit input-name name kind hash; }
else
throw "Unsupported fetch time ${fetch-time}."
else if k == 2 then
let fetch-time = kind.ft; in
if fetch-time == 0 then
fetch-git { inherit input-name name kind hash; }
else if fetch-time == 1 then
builtin-fetch-git { inherit input-name name kind; }
else
throw "Unsupported fetch time ${fetch-time}."
else
throw "Unsupported input kind “${builtins.toString k}”";
in
if input.ps == [ ] then
raw-input
else
pkgs.applyPatches {
src = raw-input;
name = "${if isNonemptyString name then name else "src"}-patched";
patches = map (p:
if local-patches ? "${p}" then
local-patches."${p}"
else
fetch-patch p lock.p."${p}"
) input.ps;
};
in
builtins.mapAttrs to-input lock.i

View File

@ -1,14 +0,0 @@
{"v":"1.5.0"
,"i":{
"nixpkgs":{"sn":"nixpkgs-src","kd":[1,{"ft":0,"ur":"https://github.com/NixOS/nixpkgs/archive/04906337b6d53e8bb0eaf0470ae9f070a4d4eb55.tar.gz","ms":[],"ex":null}],"ha":{"al":0,"vl":"sha256-lME2lHoDHAaSHP3/okgiVoJ0icVEvsQH8LeU3We7tcc="},"fv":"04906337b6d53e8bb0eaf0470ae9f070a4d4eb55","ps":["php-cross-module"]}
,"nixpkgs-experimental":{"sn":"nixpkgs-experimental-src","kd":[2,{"ft":0,"rp":"https://github.com/nixos/nixpkgs","ms":[],"rf":[0,"refs/heads/master"],"dt":"2026-11-08T08:29:57Z","sm":false,"lf":false,"lr":"5e7788fd2ced82eb31da7f5329b55e49dc1587c8"}],"ha":{"al":0,"vl":"sha256-gyzx4ADMhQ4Q9jgVMVgLO21W8zusME7WZRcofrEiQ0U="},"fv":"5e7788fd2ced82eb31da7f5329b55e49dc1587c8","ps":["declarative-kts","bindgen-bullshit","lix-cross","openjdk-cross","php-cross","php-cross-module","mariadb-cross","gdb-cross","direnv-prerelease"]}
,"bingosync":{"sn":"bingosync-src","kd":[2,{"ft":0,"rp":"https://github.com/rhelmot/bingosync","ms":[],"rf":[0,"refs/heads/main"],"dt":"2026-09-28T19:46:15-07:00","sm":false,"lf":false,"lr":"aee0d0927a26c0b2b0df595b81f51ef16a22d32d"}],"ha":{"al":0,"vl":"sha256-2lwEM7HMYi7PnQ2esWIMnw7GShglLJ6YSQg5bhyzt5w="},"fv":"aee0d0927a26c0b2b0df595b81f51ef16a22d32d","ps":[]}
,"blog-rhelmot-io":{"sn":"blog-rhelmot-io-src","kd":[2,{"ft":0,"rp":"https://git.lain.faith/rhelmot/blog.rhelmot.io","ms":[],"rf":[0,"refs/heads/main"],"dt":"2026-09-13T12:36:06-07:00","sm":false,"lf":false,"lr":"59f5e8ddbcd054f45223c0be9dfdd401208de1af"}],"ha":{"al":0,"vl":"sha256-Tte2UlB1UMCcE7YVnpxKic8n8vtigivWJIV3ctTwWB0="},"fv":"59f5e8ddbcd054f45223c0be9dfdd401208de1af","ps":[]}
,"cwdcontrol":{"sn":"cwdcontrol-src","kd":[2,{"ft":0,"rp":"https://git.lain.faith/rhelmot/cwdcontrol","ms":[],"rf":[0,"refs/heads/main"],"dt":"2026-11-10T13:55:49-07:00","sm":false,"lf":false,"lr":"a83837d7db3383b8a0d90dcc72dbc704267070a6"}],"ha":{"al":0,"vl":"sha256-coOvZuPLi/4BRRJ4xhXrfGJT4utOoRz7k6pCvcm5PuY="},"fv":"a83837d7db3383b8a0d90dcc72dbc704267070a6","ps":[]}
,"home-manager":{"sn":"home-manager-src","kd":[2,{"ft":0,"rp":"https://github.com/nix-community/home-manager","ms":[],"rf":[0,"refs/heads/master"],"dt":"2026-11-06T09:36:06-06:00","sm":false,"lf":false,"lr":"2c0c1f01521469cf0271180c453c79782d53c2f6"}],"ha":{"al":0,"vl":"sha256-7OoWDsYO9teiPxl0QdlS5lYE20Pue8/5mpscSL32FUA="},"fv":"2c0c1f01521469cf0271180c453c79782d53c2f6","ps":[]}
,"nixtamal":{"sn":"nixtamal-src","kd":[3,{"rp":"https://darcs.toastal.in.th/nixtamal/stable","ms":["https://smeder.ee/~toastal/nixtamal.darcs"],"dt":"2026-10-30T09:16:37Z","rf":[0,[0,"./darcs_context/nixtamal.txt"]],"lw":"16ad90d6681f1567680ec7ecd005b971f2aa2606"}],"ha":{"al":0,"vl":"sha256-XHIs3CW94++3p2tQlDGYYG9eCmqIyV5ofNuPWEAsElI="},"fv":"16ad90d6681f1567680ec7ecd005b971f2aa2606","ps":[]}
}
,"p":{
"declarative-kts":{"ur":"https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/518336.patch","ha":{"al":0,"vl":"sha256-DmY05efj6QtlBhLfN2Pc/nPWf5E23dyHYIhwSqagUwA="},"fv":null,"sn":"declarative-kts-patch"}
}
}

View File

@ -1,68 +0,0 @@
// ┏┓╻+╻ ╱┏┳┓┏┓┏┳┓┏┓╻
// ┃┃┃┃┗━┓╹┃╹┣┫┃┃┃┣┫┃ Read the manpage:
// ╹┗┛╹╱ ╹ ╹ ╹╹╹ ╹╹╹┗┛ $ man nixtamal-manifest
version "1.5.0"
patches {
declarative-kts "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/518336.patch"
bindgen-bullshit "../bindgen-bullshit.patch";
direnv-prerelease "../direnv-prerelease.patch";
lix-cross "../lix-cross.patch"
openjdk-cross "../openjdk-cross.patch"
php-cross "../php-cross.patch"
php-cross-module "../php-cross-module.patch"
mariadb-cross "../mariadb-cross.patch";
gdb-cross "../gdb-cross.patch";
}
inputs {
nixpkgs {
archive {
url "https://github.com/NixOS/nixpkgs/archive/{{fresh_value}}.tar.gz"
}
hash algorithm=SHA-256
fresh-cmd {
$ git ls-remote "https://github.com/NixOS/nixpkgs.git" --refs "refs/heads/nixos-unstable"
| cut -f1
}
patches php-cross-module
}
nixpkgs-experimental {
git {
repository "https://github.com/nixos/nixpkgs"
ref "refs/heads/master"
}
patches declarative-kts bindgen-bullshit lix-cross openjdk-cross php-cross php-cross-module mariadb-cross gdb-cross direnv-prerelease
}
home-manager {
git {
repository "https://github.com/nix-community/home-manager"
ref "refs/heads/master"
}
}
blog-rhelmot-io {
git {
repository "https://git.lain.faith/rhelmot/blog.rhelmot.io";
ref "refs/heads/main";
}
}
bingosync {
git {
repository "https://github.com/rhelmot/bingosync";
ref "refs/heads/main";
}
}
cwdcontrol {
git {
repository "https://git.lain.faith/rhelmot/cwdcontrol";
ref "refs/heads/main";
}
}
nixtamal {
darcs {
repository "https://darcs.toastal.in.th/nixtamal/stable"
mirrors "https://smeder.ee/~toastal/nixtamal.darcs"
}
fresh-cmd {
$ curl -sL "https://darcs.toastal.in.th/nixtamal/stable/_darcs/weak_hash"
}
}
}

15
overlays/lix.nix Normal file
View File

@ -0,0 +1,15 @@
{
pkgs,
...
}:
{
nixpkgs.overlays = [ (final: prev: {
inherit (prev.lixPackageSets.latest)
nixpkgs-review
nix-eval-jobs
nix-fast-build
colmena;
}) ];
nix.package = pkgs.lixPackageSets.latest.lix;
}

View File

@ -1,73 +1,20 @@
final: prev: { { config, lib, pkgs, ... }:
vimPlugins = prev.vimPlugins.extend (
final': prev': {
sweetie-nvim = final.callPackage ../pkgs/sweetie.nix { };
}
);
zfs_2_2 = prev.zfs_2_2.overrideAttrs (
final': prev': {
patches = prev'.patches ++ [
(final.fetchpatch {
url = "https://git.lain.faith/haskal/dragnpkgs/raw/commit/f4348768df564166762793aed43803675e251926/pkgs/zfs/0001-ZED-add-support-for-desktop-notifications-D-Bus.patch";
hash = "sha256-vwGHiLKSjJor4A+r599DlvSHXkDuuLSSQ4/tWFALMKU=";
})
];
}
);
sftpgo = prev.sftpgo.overrideAttrs (prev: {
# killing and tearing and ripping and maiming
postPatch = (prev.postPatch or "") + ''
sed -E -i -e '/func preserveUserProfile/a newUser.Groups = user.Groups;' internal/common/eventmanager.go
'';
});
fx-cast-bridge = prev.fx-cast-bridge.overrideAttrs (prev: {
postConfigure = (prev.postConfigure or "") + ''
substituteInPlace node_modules/mdns/lib/resolver_sequence_tasks.js --replace-fail \
'cares.getaddrinfo(req, host, family, 0, false)' \
'cares.getaddrinfo(req, host, family, 0, 0)'
'';
});
idapro9 = final.callPackage ../pkgs/idapro9.nix { };
condition-unmetered-network = final.callPackage ../pkgs/condition-unmetered-network { };
units-desktop = final.callPackage ../pkgs/units-desktop.nix { };
aria2 = prev.aria2.overrideAttrs ( let overlay = final: prev: {
final': prev': { vimPlugins = prev.vimPlugins.extend (final': prev': {
patches = (prev'.patches or [ ]) ++ [ ./patches/aria2-retry-codes.patch ]; sweetie-nvim = final.callPackage ../pkgs/sweetie.nix {};
} });
); zfs_2_2 = prev.zfs_2_2.overrideAttrs (final': prev': {
nixos-render-docs = prev.nixos-render-docs.overrideAttrs ( patches = prev'.patches ++ [(final.fetchpatch {
final': prev': { url = "https://git.lain.faith/haskal/dragnpkgs/raw/commit/f4348768df564166762793aed43803675e251926/pkgs/zfs/0001-ZED-add-support-for-desktop-notifications-D-Bus.patch";
patches = (prev'.patches or [ ]) ++ [ hash = "sha256-vwGHiLKSjJor4A+r599DlvSHXkDuuLSSQ4/tWFALMKU=";
./patches/nixos-render-docs-flush.patch })];
]; });
} idapro9 = pkgs.callPackage ../pkgs/idapro9.nix {};
); condition-unmetered-network = pkgs.callPackage ../pkgs/condition-unmetered-network {};
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ units-desktop = pkgs.callPackage ../pkgs/units-desktop.nix {};
(final': prev': { };
binsync = final'.callPackage ../pkgs/binsync.nix { };
libbs = final'.callPackage ../pkgs/libbs.nix { }; in {
}) nixpkgs.overlays = [ overlay ];
];
onetab = final.callPackage ../pkgs/onetab.nix {};
scenefx = prev.scenefx.overrideAttrs {
src = final.fetchFromGitHub {
owner = "wlrfx";
repo = "scenefx";
rev = "b96cb6c923b8bf721ad11fa2136fe070d9adc2dd";
hash = "sha256-dmBb+d2YEFWAb0j28YHfBdioY1q2nB4WoaaLu3FhXjE=";
};
};
swayfx-unwrapped = prev.swayfx-unwrapped.overrideAttrs {
version = "${prev.swayfx-unwrapped.version}-devel-patched";
src = final.fetchFromGitHub {
owner = "wlrfx";
repo = "swayfx";
rev = "972e98614168a3a79ae1a84f59baa5001639e15f";
hash = "sha256-Y+WC+RaThl8+LZ46Aq4Xz+KtShC9lus5ViKhIoMA1+U=";
};
patches = (prev.swayfx-unwrapped.patches or []) ++ [
./patches/swayfx-anim.patch
];
};
} }

View File

@ -1,17 +0,0 @@
diff --git a/src/HttpSkipResponseCommand.cc b/src/HttpSkipResponseCommand.cc
index a722d774..d6f76c85 100644
--- a/src/HttpSkipResponseCommand.cc
+++ b/src/HttpSkipResponseCommand.cc
@@ -220,8 +220,12 @@ bool HttpSkipResponseCommand::processResponse()
}
throw DL_RETRY_EX2(MSG_RESOURCE_NOT_FOUND,
error_code::RESOURCE_NOT_FOUND);
+ case 429:
+ case 500:
case 502:
case 503:
+ case 520:
+ case 521:
// Only retry if pretry-wait > 0. Hammering 'busy' server is not
// a good idea.
if (getOption()->getAsInt(PREF_RETRY_WAIT) > 0) {

View File

@ -1,16 +0,0 @@
diff --git a/nixos_render_docs/options.py b/nixos_render_docs/options.py
index 9e337e6b1082..64808e5a4ba5 100644
--- a/nixos_render_docs/options.py
+++ b/nixos_render_docs/options.py
@@ -268,6 +268,11 @@ class ManpageConverter(BaseConverter[OptionsManpageRenderer]):
r'''.ad l''',
r'''.\" enable line breaks after slashes''',
r'''.cflags 4 /''',
+ r'''.\" if rendering in continuous mode (default for man-db), flush pages periodically''',
+ r'''.if \\\\n[cR] \\{\\''',
+ r'''.wh 10000v an*real-bp''',
+ r'''.pl 10000v''',
+ r'''.\\}''',
r'''.SH "NAME"''',
self._render('{file}`configuration.nix` - NixOS system configuration specification'),
r'''.SH "DESCRIPTION"''',

View File

@ -1,48 +0,0 @@
diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c
index f7852888..97bce5da 100644
--- a/sway/desktop/transaction.c
+++ b/sway/desktop/transaction.c
@@ -900,18 +900,21 @@ static void arrange_output(struct sway_output *output, int width, int height) {
add_animation(&new_active->animation_state.animation,
workspace_fade_update_callback, NULL);
} else {
- new_active->animation_state.to_alpha = 0.0f;
- float current_alpha = get_animated_value(old_active->animation_state.from_alpha,
- old_active->animation_state.to_alpha, &old_active->animation_state.animation);
- old_active->animation_state.from_alpha = current_alpha;
- old_active->animation_state.to_alpha = 0.0f;
+ if (old_active->current.output == output) {
+ // old_active is our responsibility. animate it
+ float current_alpha = get_animated_value(old_active->animation_state.from_alpha,
+ old_active->animation_state.to_alpha, &old_active->animation_state.animation);
+ old_active->animation_state.from_alpha = current_alpha;
+ old_active->animation_state.to_alpha = 0.0f;
+ add_animation(&old_active->animation_state.animation,
+ workspace_fade_update_callback, workspace_fade_complete_callback);
+ }
+ new_active->animation_state.to_alpha = 0.0f;
finish_animation(&new_active->animation_state.animation);
new_active->animation_state.from_alpha = 0.0f;
new_active->animation_state.to_alpha = 1.0f;
- add_animation(&old_active->animation_state.animation,
- workspace_fade_update_callback, workspace_fade_complete_callback);
add_animation(&new_active->animation_state.animation,
workspace_fade_update_callback, workspace_fade_complete_callback);
}
@@ -923,9 +926,11 @@ static void arrange_output(struct sway_output *output, int width, int height) {
new_active->animation_state.from_alpha = 1.0f;
new_active->animation_state.to_alpha = 1.0f;
- finish_animation(&old_active->animation_state.animation);
- old_active->animation_state.from_alpha = 1.0f;
- old_active->animation_state.to_alpha = 0.0f;
+ if (old_active->current.output == output) {
+ finish_animation(&old_active->animation_state.animation);
+ old_active->animation_state.from_alpha = 1.0f;
+ old_active->animation_state.to_alpha = 0.0f;
+ }
}
for (int i = 0; i < output->current.workspaces->length; i++) {

View File

@ -1,82 +1,131 @@
{ {
lib, lib,
callPackage, fetchPypi,
buildPythonPackage,
fetchFromGitHub, fetchFromGitHub,
buildPythonPackage,
buildPythonApplication,
hatchling,
flask,
setuptools, httpx,
pydantic,
python-dotenv,
poetry-core,
libbs, filelock,
gitpython,
prompt-toolkit,
pycparser,
sortedcontainers, sortedcontainers,
toml, toml,
gitpython,
filelock,
ply,
prompt-toolkit,
tqdm, tqdm,
wordfreq, setuptools,
pyside6, pyside6,
flask,
requests,
pytest-qt,
pytestCheckHook, pytestCheckHook,
pytest-qt,
ply,
wordfreq,
ghidra-bridge,
jfx-bridge,
networkx,
platformdirs,
psutil,
pyhidra,
writableTmpDirAsHomeHook,
}: let
libbs_latest = buildPythonPackage {
pname = "libbs";
version = "2.15.5+dev";
pyproject = true;
withGhidra ? false, src = fetchFromGitHub {
}: owner = "binsync";
repo = "libbs";
rev = "c7f3b7e16a44affd446b392a89ed343d356885af";
hash = "sha256-AzsOok38JG2pjNzeWQVHhi9Iw266TAOxavQEDu+JcyQ=";
};
buildPythonPackage rec { build-system = [ setuptools ];
pname = "binsync";
version = "5.15.0+dev"; dependencies = [
pyproject = true; filelock
ghidra-bridge
jfx-bridge
networkx
platformdirs
prompt-toolkit
psutil
pycparser
pyhidra
toml
tqdm
ply
];
nativeCheckInputs = [
pytestCheckHook
writableTmpDirAsHomeHook
];
pythonImportsCheck = [ "libbs" ];
disabledTests = [
"test_change_watcher_plugin_cli"
"test_ghidra_artifact_watchers"
"TestHeadlessInterfaces"
];
disabledTestPaths = [
"tests/test_decompilers.py"
"tests/test_remote_ghidra.py"
];
src = fetchFromGitHub {
owner = "binsync";
repo = "binsync";
rev = "667ba599b79766339820f57dab8f8ce01b05808b";
hash = "sha256-v8hxcoMFe8DJovJD1FAC8NIov7EGVn4L8isWg4sxxik=";
}; };
build-system = [ setuptools ]; binsync_latest = buildPythonPackage {
pname = "binsync";
version = "5.5.1+dev";
pyproject = true;
dependencies = [ src = fetchFromGitHub {
libbs owner = "binsync";
# (libbs.override { inherit withGhidra; }) repo = "binsync";
sortedcontainers rev = "f46c576338a0cd74b8aeb46b09467ca3862d4e52";
toml hash = "sha256-C3i969oA+jHjFz9fWYuzJZ0pz1O4Wvi9QU8PjHnL1Kk=";
gitpython };
filelock
ply
prompt-toolkit
tqdm
wordfreq
flask
requests
]
++ lib.optionals withGhidra [ pyside6 ];
nativeCheckInputs = [ build-system = [ setuptools ];
pytestCheckHook
]
++ lib.optionals withGhidra [
pytest-qt
pyside6
];
disabledTestPaths = [ dependencies = [
# Test tries to import angr-management libbs_latest
"tests/test_angr_gui.py"
# uses GUI stuff
"tests/test_auxiliary_server.py"
];
pythonImportsCheck = [ "binsync" ]; filelock
gitpython
prompt-toolkit
pycparser
sortedcontainers
toml
tqdm
ply
wordfreq
];
meta = { optional-dependencies = {
description = "Reversing plugin for cross-decompiler collaboration, built on git"; ghidra = [ pyside6 ];
homepage = "https://github.com/binsync/binsync"; };
changelog = "https://github.com/binsync/binsync/releases/tag/${src.tag}";
license = lib.licenses.bsd2; nativeCheckInputs = [
maintainers = with lib.maintainers; [ scoder12 ]; pytestCheckHook
pytest-qt
pyside6
];
disabledTestPaths = [
# Test tries to import angrmanagement
"tests/test_angr_gui.py"
];
pythonImportsCheck = [ "binsync" ];
}; };
} in binsync_latest

View File

@ -1,8 +1,7 @@
{ {
rustPlatform, rustPlatform,
lib, lib,
}: }: rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage rec {
pname = "condition-unmetered-network"; pname = "condition-unmetered-network";
version = "0.1.0"; version = "0.1.0";
src = ./.; src = ./.;

View File

@ -2,6 +2,7 @@
lib, lib,
stdenv, stdenv,
requireFile, requireFile,
fetchurl,
autoPatchelfHook, autoPatchelfHook,
copyDesktopItems, copyDesktopItems,
python3, python3,
@ -12,7 +13,6 @@
freetype, freetype,
glib, glib,
gtk3, gtk3,
libxcrypt-legacy,
libdrm, libdrm,
libGL, libGL,
libkrb5, libkrb5,
@ -22,38 +22,31 @@
openssl, openssl,
gcc, gcc,
clang, clang,
xorg,
zlib, zlib,
curl, curl,
gnutar, gnutar,
makeDesktopItem, makeDesktopItem,
makeWrapper, makeWrapper,
runCommand, runCommand,
libice,
libsm,
libx11,
libXau,
libxcb,
libxext,
libxi,
libXrender,
xcbutilimage,
xcbutilkeysyms,
xcbutilrenderutil,
xcbutilwm,
pythonWithPackages ? python3,
}: }:
let
pythonForIDA = python3.withPackages (ps: with ps; [
rpyc
(ps.callPackage ./binsync.nix {})
]);
in
# https://github.com/msanft/ida-pro-overlay/blob/main/packages/ida-pro.nix # https://github.com/msanft/ida-pro-overlay/blob/main/packages/ida-pro.nix
stdenv.mkDerivation (self: { stdenv.mkDerivation (self: {
pname = "idapro"; pname = "idapro";
version = "9.3.260421"; version = "9.2.250908";
src = requireFile { src = requireFile {
name = "idapro-x64linux-9.3.260421.tar.xz"; name = "idapro-linux-9.2.250908.tar.xz";
hash = "sha256-8fxZ4fOgOFdSd/H/Jd4MX9fCX7TwWACmH9I4rnIMKdQ="; hash = "sha256-daQtHbJxCuKzfGiBzkmy7FOTCMEJX3WL7IwuuvwIi+Y=";
message = '' message = ''
Please run nix store add-file idapro-x64linux-9.3.260421.tar.xz Please run nix store add-file idapro-linux-9.2.250908.tar.xz
Its sha256sum should be f1fc59e1f3a038575277f1ff25de0c5fd7c25fb4f05800a61fd238ae720c29d4 Its sha256sum should be 75a42d1db2710ae2b37c6881ce49b2ec539308c1095f758bec8c2ebafc088be6
''; '';
}; };
@ -71,7 +64,6 @@ stdenv.mkDerivation (self: {
freetype freetype
glib glib
gtk3 gtk3
libxcrypt-legacy
libdrm libdrm
libGL libGL
libkrb5 libkrb5
@ -80,21 +72,21 @@ stdenv.mkDerivation (self: {
libxkbcommon libxkbcommon
openssl.out openssl.out
(if stdenv.cc.isGNU then gcc else clang).cc (if stdenv.cc.isGNU then gcc else clang).cc
libice xorg.libICE
libsm xorg.libSM
libx11 xorg.libX11
libXau xorg.libXau
libxcb xorg.libxcb
libxext xorg.libXext
libxi xorg.libXi
libXrender xorg.libXrender
xcbutilimage xorg.xcbutilimage
xcbutilkeysyms xorg.xcbutilkeysyms
xcbutilrenderutil xorg.xcbutilrenderutil
xcbutilwm xorg.xcbutilwm
zlib zlib
curl.out curl.out
pythonWithPackages pythonForIDA
qt6.qtwayland qt6.qtwayland
]; ];
buildInputs = self.runtimeDependencies; buildInputs = self.runtimeDependencies;
@ -116,6 +108,8 @@ stdenv.mkDerivation (self: {
ln -s $out/opt/ida $out/bin/ida64 ln -s $out/opt/ida $out/bin/ida64
ln -s $out/opt/ida $out/bin/ida ln -s $out/opt/ida $out/bin/ida
ln -s ${pythonForIDA}/bin/binsync $out/bin/binsync
runHook postInstall runHook postInstall
''; '';
@ -124,30 +118,23 @@ stdenv.mkDerivation (self: {
addAutoPatchelfSearchPath $out/opt addAutoPatchelfSearchPath $out/opt
# Manually patch libraries that dlopen stuff. # Manually patch libraries that dlopen stuff.
patchelf --add-needed libpython${pythonWithPackages.pythonVersion}.so $out/lib/libida.so patchelf --add-needed libpython${pythonForIDA.pythonVersion}.so $out/lib/libida.so
patchelf --add-needed libpython${pythonWithPackages.pythonVersion}.so $out/opt/plugins/idapython3.so patchelf --add-needed libpython${pythonForIDA.pythonVersion}.so $out/opt/plugins/idapython3.so
patchelf --add-needed libcrypto.so $out/lib/libida.so patchelf --add-needed libcrypto.so $out/lib/libida.so
patchelf --add-needed libcrypto.so $out/opt/plugins/idapython3.so patchelf --add-needed libcrypto.so $out/opt/plugins/idapython3.so
wrapProgram "$out/opt/ida" \ wrapProgram "$out/opt/ida" \
--prefix PYTHONPATH : $out/opt/idalib/python \ --prefix PYTHONPATH : $out/opt/idalib/python \
--prefix PATH : ${pythonWithPackages}/bin \ --prefix PATH : ${pythonForIDA}/bin
--prefix LD_LIBRARY_PATH : ${lib.getLib libsecret}/lib
''; '';
dontWrapQtApps = true; dontWrapQtApps = true;
desktopItem = makeDesktopItem { desktopItem = makeDesktopItem {
name = "ida-pro"; name = "ida-pro";
exec = "ida"; exec = "ida";
icon = icon = runCommand "appico.png" {nativeBuildInputs = [gnutar]; strictDeps = true;} ''
runCommand "appico.png" tar --to-command cat -xf ${self.src} 'idapro-linux-9.2.250908/appico.png' > "$out"
{ '';
nativeBuildInputs = [ gnutar ];
strictDeps = true;
}
''
tar --to-command cat -xf ${self.src} 'ida/appico.png' > "$out"
'';
comment = self.meta.description; comment = self.meta.description;
desktopName = "IDA Pro"; desktopName = "IDA Pro";
genericName = "Interactive Disassembler"; genericName = "Interactive Disassembler";
@ -157,10 +144,10 @@ stdenv.mkDerivation (self: {
desktopItems = [ self.desktopItem ]; desktopItems = [ self.desktopItem ];
passthru = { passthru = {
python = pythonWithPackages; inherit pythonForIDA;
}; };
meta = with lib; { meta = with lib; {
description = "The world's smartest and most feature-full disassembler"; description = "The world's smartest and most feature-full disassembler";
homepage = "https://hex-rays.com/ida-pro/"; homepage = "https://hex-rays.com/ida-pro/";
mainProgram = "ida"; mainProgram = "ida";

View File

@ -1,103 +0,0 @@
{
lib,
callPackage,
buildPythonPackage,
fetchFromGitHub,
setuptools,
toml,
ply,
pycparser,
prompt-toolkit,
tqdm,
psutil,
pyghidra,
platformdirs,
filelock,
networkx,
pytestCheckHook,
writableTmpDirAsHomeHook,
# ghidra_headless,
withGhidra ? false,
}:
let
# Binary files from https://github.com/binsync/bs-artifacts (only used for testing and only here)
binaries = fetchFromGitHub {
owner = "binsync";
repo = "bs-artifacts";
rev = "0d300eb679b9a07bbdcf8b77a9f4917d48133c6c";
hash = "sha256-P7+BTJgdC9W8cC/7xQduFYllF+0ds1dSlm59/BFvZ2g=";
};
in
buildPythonPackage rec {
pname = "libbs";
version = "3.7.0+dev";
pyproject = true;
src = fetchFromGitHub {
owner = "binsync";
repo = "libbs";
rev = "55f9b2fc441a4e8aaf3ff4bdc2ee51eddef46ef4";
hash = "sha256-Z1OAgJjNA7WJDjy4KEuVFyWgq3WjwhpFzf8dAYe8c1E=";
};
build-system = [ setuptools ];
dependencies = [
toml
ply
pycparser
# (callPackage ./pycparser_3.nix {})
setuptools
prompt-toolkit
tqdm
psutil
platformdirs
filelock
networkx
]
++ lib.optionals withGhidra [ pyghidra ];
pythonRemoveDeps = lib.optionals (!withGhidra) [ "pyghidra" ];
nativeCheckInputs = [
pytestCheckHook
writableTmpDirAsHomeHook
];
# ] ++ (lib.optionals withGhidra [ ghidra_headless ]);
# Place test binaries in place
preCheck = ''
export HOME=$TMPDIR
mkdir -p $HOME/bs-artifacts/binaries
cp -r ${binaries}/binaries/. $HOME/bs-artifacts/binaries/.
export TEST_BINARIES_DIR=$HOME/bs-artifacts/binaries
'';
# '' + lib.optionalString withGhidra ''
# export PATH="${lib.makeBinPath [ ghidra_headless.jdkPackage ]}:$PATH"
# export NIX_GHIDRAHOME="${ghidra_headless}/lib/ghidra/Ghidra"
# export GHIDRA_INSTALL_DIR="${ghidra_headless}/lib/ghidra"
# '';
pythonImportsCheck = [ "libbs" ];
disabledTests = [
"test_change_watcher_plugin_cli"
"TestHeadlessInterfaces"
"TestNewLibbsFeatures"
]
++ lib.optionals (!withGhidra) [ "TestClientServer" ];
meta = {
description = "Library for writing plugins in any decompiler: includes API lifting, common data formatting, and GUI abstraction";
homepage = "https://github.com/binsync/libbs";
changelog = "https://github.com/binsync/libbs/releases/tag/${src.tag}";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ scoder12 ];
};
}

View File

@ -1,28 +0,0 @@
{
stdenv,
fetchFromSourcehut,
zip,
}:
stdenv.mkDerivation {
pname = "onetab";
version = "0.1.0";
src = fetchFromSourcehut {
owner = "~rhelmot";
repo = "onetab";
rev = "bf7c09d98a590c8fac62266ecf82962c3c793b5e";
hash = "sha256-AmzUPVcPH11oHRm0RDOiimEY3C54JivADEPbkFVW+nE=";
};
nativeBuildInputs = [
zip
];
postBuild = ''
./build
'';
postInstall = ''
mkdir -p $out
mv ../onetab.zip $out/onetab.xpi
'';
}

View File

@ -1,18 +1,18 @@
{ {
lib, lib,
writeTextFile, writeTextFile,
units, units,
}: }:
writeTextFile { writeTextFile {
name = "units-desktop"; name = "units-desktop";
destination = "/share/applications/units.desktop"; destination = "/share/applications/units.desktop";
text = '' text = ''
[Desktop Entry] [Desktop Entry]
Encoding=UTF-8 Encoding=UTF-8
Version=${units.version} Version=${units.version}
Type=Application Type=Application
Terminal=true Terminal=true
Exec=${lib.getExe units} Exec=${lib.getExe units}
Name=Units Name=Units
''; '';
} }

View File

@ -1,7 +0,0 @@
{ }@args: let
everything = import ./default.nix args;
mkSite = site: { inherit (site) system deploy; };
sites = builtins.mapAttrs (k: mkSite) everything.sites;
in {
inherit sites;
}

View File

@ -1,30 +1,53 @@
{ { pkgs, lib, config, ... }:
pkgs,
lib,
config,
...
}:
{ {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
networking.hostName = "chrysanthemum"; networking.hostName = "chrysanthemum";
networking.hostId = "6bb591ac"; networking.hostId = "6bb591ac";
networking.dhcpcd.wait = "background";
networking.interfaces.wlan0.wlandev = "iwlwifi0";
services.wpa_supplicant.configFile = "/home/audrey/wpa_supplicant.conf";
system.stateVersion = "25.04"; system.stateVersion = "25.11";
environment.etc.machine-id.text = "d3d521900f0e11f0af2b9d9b219a1c36\n"; environment.etc.machine-id.text = "d3d521900f0e11f0af2b9d9b219a1c36\n";
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
hardware.opengl.enable = true; hardware.opengl.enable = true;
services.dbus.enable = true; services.dbus.enable = true;
services.accounts-daemon.enable = true; services.seatd.enable = true;
services.consolekit2.enable = true; boot.extraModulePackages = [ pkgs.freebsd.wifi-firmware-kmod ];
services.xserver = { users.users.audrey.extraGroups = [
enable = true; "u2f"
displayManager.lightdm.enable = true; "seat"
displayManager.defaultSession = "xfce"; "_video"
desktopManager.xfce = { ];
enable = true; # boot.kernelEnvironment."hw.psm.synaptics_support" = "1";
}; boot.kernelEnvironment."compat.linuxkpi.iwlwifi_disable_11ac" = "0";
exportConfiguration = true; boot.kernelEnvironment."compat.linuxkpi.iwlwifi_11n_disable" = "0";
}; freebsd.rc.conf.kld_list = "i915kms";
audrey-sway.enable = true;
environment.systemPackages = with pkgs; [
firefox
foot
dino
fzf
(libinput.override { eventGUISupport = true; })
util-linuxMinimal
];
fonts.packages = builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts);
services.powerd.enable = true;
hardware.bsdfan.enable = true;
#services.accounts-daemon.enable = true;
#services.consolekit2.enable = true;
#services.xserver = {
# enable = true;
# displayManager.lightdm.enable = true;
# displayManager.defaultSession = "xfce";
# desktopManager.xfce = {
# enable = true;
# };
# exportConfiguration = true;
#};
} }

View File

@ -1,38 +1,37 @@
{ { config, lib, pkgs, modulesPath, ... }:
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
fileSystems."/" = { fileSystems."/" =
device = "system/local/root"; { device = "system/tier1/root";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/nix" = { fileSystems."/var" =
device = "system/local/nix"; { device = "system/tier1/var";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/var" = { fileSystems."/home" =
device = "system/local/var"; { device = "system/tier1/home";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/home" = { fileSystems."/nix" =
device = "system/home"; { device = "system/scratch/nix";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/boot" = { fileSystems."/tmp" =
device = "/dev/gpt/ESP"; { device = "system/scratch/tmp";
fsType = "msdos"; fsType = "zfs";
}; };
swapDevices = [ { device = "/dev/gpt/swap"; } ]; fileSystems."/boot" =
{ device = "/dev/nda0p1";
fsType = "msdos";
};
#swapDevices = [ { device = "/dev/gpt/swap"; } ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-freebsd"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-freebsd";
} }

View File

@ -0,0 +1 @@
nixbsd

View File

@ -1,90 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ./hardware-configuration.nix ];
rhelmot.isDesktop = true;
boot.initrd.supportedFilesystems = [ "zfs" ];
services.zfs.autoScrub.enable = true;
services.zfs.trim.enable = true;
# fstrim is also enabled by nixos-hardware, but only runs for /boot
networking.hostName = "clove";
networking.hostId = "e2a6d757";
time.timeZone = "America/Phoenix";
# Open ports in the firewall.
networking.firewall.enable = false;
# networking.firewall.allowedTCPPorts = [ 22 80 443 1337 1338 8081 2222 ];
# networking.firewall.allowedUDPPorts = [ 1337 ];
systemd.coredump.enable = false;
system.stateVersion = "25.11";
environment.systemPackages = [
pkgs.racket
pkgs.qemu_kvm
(pkgs.runCommand "OVMF-fd" { } ''
mkdir -p $out/share/FV
ln -s ${pkgs.OVMF.fd}/FV/OVMF_CODE.fd $out/share/FV/OVMF_CODE.fd
'')
pkgs.OVMF.fd
];
services.tailscale = {
enable = true;
openFirewall = true;
};
#programs.celestegame = {
# enable = true;
# withEverest = true;
# withOlympus = true;
# writableDir = "/var/lib/celeste";
#};
# boot.binfmt.emulatedSystems = [
# "aarch64-linux"
# "mips-linux"
# "mipsel-linux"
# "armv7l-linux"
# ];
# boot.binfmt.preferStaticEmulators = true;
programs.steam.enable = true;
# programs.steam.gamescopeSession.enable = true;
programs.gamescope.enable = true;
programs.gamescope.capSysNice = true;
# services.pulseaudio.support32Bit = lib.mkForce false;
# hardware.graphics.enable32Bit = lib.mkForce false;
# services.pipewire.alsa.support32Bit = lib.mkForce false;
virtualisation.libvirtd = {
enable = true;
qemu.package = pkgs.qemu_kvm;
};
security.sudo.wheelNeedsPassword = false;
audrey-sway.background = ../../dotfiles/rtfs.jpg;
services.syncthing-cluster = {
enable = true;
device = "WB3OPFM-5S7CLM4-PN7JIWE-H66YCFD-7UKW7PE-7KM4CMT-WPQ5BK5-ZFPMQAM";
user = "audrey";
configDir = "/home/audrey/.config/syncthing";
dataDir = "/home/audrey";
};
#services.xserver.videoDrivers = [ "nvidia" ];
#hardware.nvidia.open = true;
audrey-sway.extraSwayArgs = [ "--unsupported-gpu" ];
audrey-sway.suspendTimeout = null;
programs.zoom-us.enable = true;
}

View File

@ -1,95 +0,0 @@
# 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,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "clove/tier1/root";
fsType = "zfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/66C8-15C6";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
fileSystems."/var" = {
device = "clove/tier1/var";
fsType = "zfs";
};
fileSystems."/home" = {
device = "clove/tier1/home";
fsType = "zfs";
};
fileSystems."/var/lib/containers" = {
device = "clove/tier2/containers";
fsType = "zfs";
};
fileSystems."/var/lib/docker" = {
device = "clove/tier2/docker";
fsType = "zfs";
};
fileSystems."/var/log" = {
device = "clove/tier2/log";
fsType = "zfs";
};
fileSystems."/var/spool" = {
device = "clove/tier2/spool";
fsType = "zfs";
};
fileSystems."/var/tmp" = {
device = "clove/scratch/tmp";
fsType = "zfs";
};
fileSystems."/nix" = {
device = "clove/scratch/nix";
fsType = "zfs";
};
fileSystems."/var/cache" = {
device = "clove/scratch/cache";
fsType = "zfs";
};
swapDevices = [
{
device = "/dev/disk/by-uuid/31ae9d96-d3dc-45e4-9b36-707df8b4f6c2";
}
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

34
sites/daisy/cert.pem Normal file
View File

@ -0,0 +1,34 @@
-----BEGIN CERTIFICATE-----
MIIF1zCCA7+gAwIBAgIUKYdQD74Iefk1CyzHvROGC83Hw6IwDQYJKoZIhvcNAQEL
BQAwezELMAkGA1UEBhMCVVMxDzANBgNVBAgMBk5ldmFkYTESMBAGA1UEBwwJTGFz
IFZlZ2FzMRMwEQYDVQQKDApTaGVsbHBoaXNoMRUwEwYDVQQLDAxhd29vLnN5c3Rl
bXMxGzAZBgNVBAMMEmRvY2tlci5zaGVsbC5waGlzaDAeFw0yNTA4MDQxNjI5NDda
Fw0zNTA4MDIxNjI5NDdaMHsxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIDAZOZXZhZGEx
EjAQBgNVBAcMCUxhcyBWZWdhczETMBEGA1UECgwKU2hlbGxwaGlzaDEVMBMGA1UE
CwwMYXdvby5zeXN0ZW1zMRswGQYDVQQDDBJkb2NrZXIuc2hlbGwucGhpc2gwggIi
MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDyVMA3TRVo52CNfmo4KCEF1UXR
km3z2fezjsbjEOCeMTsirkFp71g4Cvj4RPCrIASq1DVXkOI6ZaU2OEfm15TcY0Q1
DG8/zvjVFTOGGNqfCyz+DUSr3qweeAijyLMygjTvK1LrCUJ1daYTdr9es1Qd29dV
Z2QxWy9+BOpz9oCs8ph+SUCVSfqn11mJ7btgSN9EU8K8f7vhm4PHpruaIJzXh6l0
tl3wLvXbG8QW1Ms95oBCxiGFKxhAOhGQYlWkODJuh9nF+K/erXv/gmC9Xth/mbL9
fRJpW+gPK79bhdSTPf9qLmanesRh7ZYxqDW/b7a1moR1u/MNqn4evm0muiz+cb/4
e6PaRQfwD21dS4FNiJRWtUgSSa0qV7UdvFXvRIev/1f6jbeP0NB6txRxfRwf7cHQ
ceWIMZgfLeGXjS1VUFnyvEL2iRgFE86YVgaYd6TIafN2tcKBb5CBJCZkkP2BBk17
NJ/S4h1H0w9u9yyfSz8kvrFf8KMGreRsZGdq776ajI1RNye+kdOQdu8UVN/W2ewu
E7vBw6NdDRuYGZ/pCULaXgdabiEYnzuwD5k9AKAeArWVDltSk8pS0gv8cI1MXt8J
TBcSEal5SPwjQNVjahghc3ASydkGN31U0roXuV8+5CjTxfzE6vVsQ2PdF9cSEVHT
kO6uIlMF7UKlytz2TwIDAQABo1MwUTAdBgNVHQ4EFgQUfMaBc83sxwCnJEeS893N
hpFQF5gwHwYDVR0jBBgwFoAUfMaBc83sxwCnJEeS893NhpFQF5gwDwYDVR0TAQH/
BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEATt+MoCjOJ7MlgfX/vvgrnjp9RCwY
ltjg1n2sFzObJN0FpukFYLUdLXNj7YI34qL30FRjVDbEw3Q7ciXDPafqkzu/fMDd
/QkOnkIPa7oQ1qHGTODN/a3/sDkGcf7Mf1KV2B3QovybhRjB+N35C2zDA6V4TWik
AKXfqdJJEcSaG9yv1Kp4wmHvEOI0jruK2dks+46Ulw1eGk5xOHtRElfVfvO0LwGz
8vvv+6WNoBNMw9inzwmEQALvVooWdh4cJnkUIWlSPI2n091dtU57rzvsAnPtV/sW
Xvn9ZpRxw9vyKUBkWLLQAUbdn+XDM8XXi7zRGaY8b9LKWoNA2PGltpteCYck9za0
a/F5Jt3f78d/vug/6Q0U2SiWNbqL9pzMX8gLIOuTqw6Rx6W32VY6WT418WqWjfsG
iySaMbJ+P+EpIFn57UvKV5CgdDFroBLnS1YpYNpZAJJubpJLVyMxQMhb47K5vU6s
YpsRm96kC0cZvP4J7+xpVilbzIqIHoV1foz0eRhCcS9bY+p22oLQY0EQ2joMnMnq
VvffPBaIWMkx6hoSaoQl7nhksu1UQrzomGJfOEK+jGkRbo1QI/qz38EuvlUfSayu
ONbCx7j+x++DyxvIQ9JEuu+cC76CNWjiDU0xFUhURrlS3t5AGe0+2ZBjcxWeX7jF
iwbYVRB2xqWwxek=
-----END CERTIFICATE-----

View File

@ -1,23 +1,20 @@
{ { config, lib, pkgs, ... }:
config,
lib,
pkgs,
...
}:
{ {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ../../configuration-desktop.nix ];
rhelmot.isDesktop = true;
boot.initrd.supportedFilesystems = [ "zfs" ]; boot.initrd.supportedFilesystems = [ "zfs" ];
boot.initrd.systemd.enable = true;
services.zfs.autoScrub.enable = true; services.zfs.autoScrub.enable = true;
services.zfs.trim.enable = true; services.zfs.trim.enable = true;
# fstrim is also enabled by nixos-hardware, but only runs for /boot # fstrim is also enabled by nixos-hardware, but only runs for /boot
boot.kernelPackages = pkgs.linuxPackages_7_2; #services.fprintd.enable = true;
# fix hang on initial login
#security.pam.services.login.fprintAuth = false;
networking.hostName = "lotus"; networking.hostName = "daisy";
networking.hostId = "fbe03944"; networking.hostId = "293a1290";
services.mobileTimezone.enable = true; services.mobileTimezone.enable = true;
services.mobileTimezone.interface = "wlp0s20f3"; services.mobileTimezone.interface = "wlp0s20f3";
@ -26,29 +23,55 @@
hardware.bluetooth.powerOnBoot = true; hardware.bluetooth.powerOnBoot = true;
# Open ports in the firewall. # Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [ 22 80 443 1337 1338 8081 2222 ];
22
80
443
1337
1338
8081
2222
];
networking.firewall.allowedUDPPorts = [ 1337 ]; networking.firewall.allowedUDPPorts = [ 1337 ];
systemd.coredump.enable = false;
system.stateVersion = "26.05"; system.stateVersion = "24.11";
#services.immich.enable = true;
hardware.ipu7 = { hardware.ipu6 = {
enable = true; enable = true;
platform = "ipu75xa"; platform = "ipu6ep";
}; };
# not sure when this commit will reach upstream
#boot.kernelPackages = pkgs.linuxPackages_6_16.extend ( self: super: {
# ipu6-drivers = super.ipu6-drivers.overrideAttrs (
# final: previous: rec {
# src = builtins.fetchGit {
# url = "https://github.com/intel/ipu6-drivers.git";
# ref = "master";
# rev = "b4ba63df5922150ec14ef7f202b3589896e0301a";
# };
# patches = [
# "${src}/patches/0001-v6.10-IPU6-headers-used-by-PSYS.patch"
# ] ;
# }
# );
#} );
#boot.kernelPackages = pkgs.linuxPackages_latest;
# https://discourse.nixos.org/t/how-to-hide-this-dummy-video-device/40985/3
services.udev.extraRules = ''
# If the system is not a video device, we skip these rules by jumping to the end
SUBSYSTEM!="video4linux", GOTO="hide_cam_end"
#ATTR{name}=="Intel MIPI Camera", GOTO="hide_cam_end" # This line cannot be used as it would move too much stuff and then the camera would not work. Instead, we just move the dummy camera,
# I found its name with udevadm info -q all -a /dev/video0
# If this is not the dummy video, we also skip these rules.
ATTR{name}!="Dummy video device (0x0000)", GOTO="hide_cam_end"
ACTION=="add", RUN+="${pkgs.coreutils}/bin/mkdir -p /dev/not-for-user"
ACTION=="add", RUN+="${pkgs.coreutils}/bin/mv -f $env{DEVNAME} /dev/not-for-user/"
ACTION=="remove", RUN+="${pkgs.coreutils}/bin/rm -f /dev/not-for-user/$name"
ACTION=="remove", RUN+="${pkgs.coreutils}/bin/rm -f /dev/not-for-user/$env{ID_SERIAL}"
LABEL="hide_cam_end"
'';
environment.systemPackages = [ environment.systemPackages = [
pkgs.racket pkgs.racket
pkgs.idapro9
pkgs.qemu_kvm pkgs.qemu_kvm
(pkgs.runCommand "OVMF-fd" { } '' (pkgs.runCommand "OVMF-fd" {} ''
mkdir -p $out/share/FV mkdir -p $out/share/FV
ln -s ${pkgs.OVMF.fd}/FV/OVMF_CODE.fd $out/share/FV/OVMF_CODE.fd ln -s ${pkgs.OVMF.fd}/FV/OVMF_CODE.fd $out/share/FV/OVMF_CODE.fd
'') '')
@ -60,6 +83,14 @@
openFirewall = true; openFirewall = true;
}; };
#services.coolify = {
# enable = true;
# hostname = "coolify";
#};
# networking.extraHosts = ''
# 135.181.103.93 anons.ee
# '';
#programs.celestegame = { #programs.celestegame = {
# enable = true; # enable = true;
# withEverest = true; # withEverest = true;
@ -104,7 +135,7 @@
programs.steam.gamescopeSession.enable = true; programs.steam.gamescopeSession.enable = true;
programs.gamescope.enable = true; programs.gamescope.enable = true;
programs.gamescope.capSysNice = true; programs.gamescope.capSysNice = true;
# services.pulseaudio.support32Bit = true; services.pulseaudio.support32Bit = true;
hardware.graphics.enable32Bit = true; hardware.graphics.enable32Bit = true;
virtualisation.libvirtd = { virtualisation.libvirtd = {
@ -125,9 +156,4 @@
configDir = "/home/audrey/.syncthing"; configDir = "/home/audrey/.syncthing";
dataDir = "/home/audrey"; dataDir = "/home/audrey";
}; };
services.thinkfan = {
enable = true;
smartSupport = true;
};
} }

View File

@ -0,0 +1,56 @@
# 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, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "system/local/root";
fsType = "zfs";
options = [ "zfsutil" ];
};
fileSystems."/nix" =
{ device = "system/local/nix";
fsType = "zfs";
#options = [ "zfsutil" ];
};
fileSystems."/var" =
{ device = "system/local/var";
fsType = "zfs";
#options = [ "zfsutil" ];
};
fileSystems."/home" =
{ device = "system/home";
fsType = "zfs";
#options = [ "zfsutil" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/8261-4807";
fsType = "vfat";
};
swapDevices = [ ];
# 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.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

52
sites/daisy/key.pem Normal file
View File

@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDyVMA3TRVo52CN
fmo4KCEF1UXRkm3z2fezjsbjEOCeMTsirkFp71g4Cvj4RPCrIASq1DVXkOI6ZaU2
OEfm15TcY0Q1DG8/zvjVFTOGGNqfCyz+DUSr3qweeAijyLMygjTvK1LrCUJ1daYT
dr9es1Qd29dVZ2QxWy9+BOpz9oCs8ph+SUCVSfqn11mJ7btgSN9EU8K8f7vhm4PH
pruaIJzXh6l0tl3wLvXbG8QW1Ms95oBCxiGFKxhAOhGQYlWkODJuh9nF+K/erXv/
gmC9Xth/mbL9fRJpW+gPK79bhdSTPf9qLmanesRh7ZYxqDW/b7a1moR1u/MNqn4e
vm0muiz+cb/4e6PaRQfwD21dS4FNiJRWtUgSSa0qV7UdvFXvRIev/1f6jbeP0NB6
txRxfRwf7cHQceWIMZgfLeGXjS1VUFnyvEL2iRgFE86YVgaYd6TIafN2tcKBb5CB
JCZkkP2BBk17NJ/S4h1H0w9u9yyfSz8kvrFf8KMGreRsZGdq776ajI1RNye+kdOQ
du8UVN/W2ewuE7vBw6NdDRuYGZ/pCULaXgdabiEYnzuwD5k9AKAeArWVDltSk8pS
0gv8cI1MXt8JTBcSEal5SPwjQNVjahghc3ASydkGN31U0roXuV8+5CjTxfzE6vVs
Q2PdF9cSEVHTkO6uIlMF7UKlytz2TwIDAQABAoICACrgMug188lNUuiGCu4nr3wU
OZe0dE7WbHyxEOCBDnT+2esvcLR5HB9CVb27mOd2MU02Yb++C0Dw1hPrTlF6KET8
LUfDjPV5vc4Zw7WAtUG5nPrQRyuvqL11WHX+HzKbFhmRDUk3qLIWoE1GT+LGEOZ9
jLJ4KiKPcy41WXQuE6NGAxQpCsu/PKGwuQ9t6B7HlfVFaqmmYgwvU1giWIQTLBz4
TFOxpppF/MsJNR8jBFjN7TijTK/+qXpHq+7jbyqwpL+ouq/L6fYYtN1G6K3o155w
B9rQ486Pa9YvU9qyKaPprsTPM+uDDbcT7eSYUfYuomGsVq5sFDuBRHJVGAPnoekE
+ybrHST0MBwMqt3IUzNTfoNkO+/JKlEdAIMvmTkZERgw1yLokNUHlvoWSdiKkbpp
ZsFpsS6nLucaUg2YxKRBkUFNXIwmO9RcCrax0putRkLeW+iYDd/1HyD8xyCpBLyG
v/e0uUepx2i/T096YBNLrIj95Lqh1rdGOXmN2b98vEJhgZN0FCmmlIiMbYXYlrpQ
8+6yNjpc36fFa0Af2xtv0RwULj1pEVI2QjTJCecKk9rjYBVOM8gp6xVpjy538+Zy
yvkhKchILT4fZq8wXD8LBnFuFRjpgFQnHbN46J++y4+o0t8Kfjq+v8ttuCXLLkks
LVCUu7GAWjejxWdQ0t/xAoIBAQD8MNQ2U6BzlVmTKjLhl9HrJd1zFEDVFDRseJjs
YIfknIAtZMP12F810QQD0MMFisge8iDy+pm5K1GrauL5yKQUPExszFHLx9SyL4Ui
TtsfWwHXFRged4+HS0RAqTCYpdfsKbnAYfpJCw99H1x0E6mcz2DBKS7vlO6gqhCL
SkKwBtoXzh8IX8JpFI6blHGIZNdKF00a7iavG8ct7awHxZ5fhENnxz0QF/RCSXrG
DIWJFC/Sa+iOq5YKQ9BjrVEsm2BwSfdD7DO1mrBYFutRz99aaACXnDnRscYPQw1G
Et71wWE3qtkObMzIJhoEoS8gghRTpwW2/g8mueMpiFe61W6/AoIBAQD1/cvmSlGQ
9S6mDpbSOo8r3kbcdj/Apv7rY18Ais8kynOADqlCbS3svWSL8h6tkD1SsA1ypsrq
4n3ko5c/7IjqqRgeFE9ZNAFFTiqrbSw7W2EdH3/OtUJQUehu335Yl3mDqMu86874
iGaHMQSfCRI2Cl7xbbseoZo7r0OiBhb8ERjTl8cJfVud9nO+oS267VyremmvDgmT
c/SPiMJaFdQKy9l8c+VC89eTXnmzPeBERhmWhLdX9L4k+pjNtaSP2bc9W05pMzy4
ST1XcyRT7ab1uaI7gs0RQApPrvUQuts2XnAr+mZ4K/xlvKxBQ7vEtNrkb4UunLt2
ORZyD+AiMexxAoIBAByMfomD4AcVoiVJwqbNJANlrvMHGOvGNMUOxekEaH3VxaDd
5l0fWG/kMHsqF9m5wzvVlytKeTqAD+fC2t0B/KkZxmEOpDfYcFiXjo+6s42SJNwv
VCKm0EW1nI1hWdH9/DqM4q1Hqii4qtE0SqgNTcclpsNXISwYBQeFGQhbqL76l5fY
SqUNChoRLK+qF0wkdka56o2g5houn9awMChVE7+mXmcSI/R9cbZLUS24XymMcnl0
o8f63qpc0OtnxGezUzCC/w3eYGAvmcTvG0aQrK00VtTS56y4Xj5+DbOgEUNq19GQ
cq/yWyBRR+K8SHR6pUhvAPOdQSPWKUQbXisVXEsCggEBAPP6woZphdb5Z0gqRirD
DAedkbjNy9Ofjk0XJT3bbzJ1XfNQF06cDSW2fwhSn1zUKA5gMSZbCf3HoMfp/XTY
fMAJ8LK8wCqgavY7XhTi1jEVJBAHkvMJUnlpk9iL8LubmVkdTN3XIFPerZo+4u99
xsM0rBBXHnV2IQw7fCAyXA+sQWx0KGRgIkNdElWrdTjmfbhSVIncqWDHbHQEV4eU
CNigcNh/9o7eXR18YcaGg24T/QMOJO6m/wScTHwTQeGvNZA0hGPQ/tNlSOL4f7qC
hstHUAIobI5EbzWzOLtcKVoWdrkXxRRBxDd/13Vv4cdq/YP+nCCsMT5DxuBgoJQp
4fECggEAc0joAOCppQsqi0+MYtnz+sLnN0LkedI4Pc+BrFgZe+pa0gOuz816Xf6R
nJEuRo1DcbyOZ0/DldQdoMFd9c6kmFO2WIHJ4JsZXDRCZWFGIeakVQyepbB2J0n9
dqSL7+o3nTtYtIbVbhIwQi0FGSLNIzyKycms0rxG4Rz3B9dzk+NEdrBYdCV/eiVo
DHAnokgLTRKyINMiUreB/QUxg+4TOarXBJJPhqEQjHgVXXRhQzk4EH3EsU6wjFSo
/q0J2vQ1CJJDM0YKV4izWSCjvpd6MuMPyHBCOVqWpMy3cOwzRGTO0asaG43GK1H3
VkJw2xvYBO477ta66id4RDUBBXXzQQ==
-----END PRIVATE KEY-----

1
sites/daisy/system Normal file
View File

@ -0,0 +1 @@
nixos

View File

@ -1,17 +1,12 @@
{ { config, lib, pkgs, ... }:
config,
lib,
pkgs,
...
}:
{ {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
boot.initrd.supportedFilesystems = [ "zfs" ]; boot.initrd.supportedFilesystems = [ "zfs" ];
boot.initrd.systemd.enable = true;
services.zfs.autoScrub.enable = true; services.zfs.autoScrub.enable = true;
services.zfs.trim.enable = true; services.zfs.trim.enable = true;
services.syncoid.enable = lib.mkForce false;
networking.hostName = "hydrangea"; networking.hostName = "hydrangea";
networking.hostId = "5dfd64c1"; networking.hostId = "5dfd64c1";
@ -40,61 +35,18 @@
shell = pkgs.bashInteractive; shell = pkgs.bashInteractive;
}; };
fileSystems."/run/nginx/tmp" = {
fsType = "tmpfs";
};
systemd.tmpfiles.settings.nginx = {
"/run/nginx/tmp/dash".d = {
user = "nginx";
group = "nginx";
mode = "0700";
};
"/run/nginx/tmp/hls".d = {
user = "nginx";
group = "nginx";
mode = "0700";
};
};
services.nginx = { services.nginx = {
enable = true; enable = true;
additionalModules = [
pkgs.nginxModules.rtmp
];
recommendedGzipSettings = true; recommendedGzipSettings = true;
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedProxySettings = true; recommendedProxySettings = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
clientMaxBodySize = "10g";
virtualHosts = { virtualHosts = {
"home.rhelmot.io" = { "home.rhelmot.io" = {
default = true;
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/".root = "/var/www/home.rhelmot.io/"; locations."/".root = "/var/www/home.rhelmot.io/";
locations."/stream/".extraConfig = ''
alias /run/nginx/tmp/;
types {
application/dash+xml mpd;
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
image/jpeg jpg;
}
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Expose-Headers' 'Content-Length';
add_header 'Access-Control-Allow-Origin' '*';
add_header Cache-Control no-cache;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header Cache-Control no-cache;
add_header 'Content-Length' 0;
return 204;
}
'';
}; };
"vaultwarden.home.rhelmot.io" = { "vaultwarden.home.rhelmot.io" = {
enableACME = true; enableACME = true;
@ -133,73 +85,7 @@
proxyWebsockets = true; proxyWebsockets = true;
}; };
}; };
"sftpgo.home.rhelmot.io" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:3006";
proxyWebsockets = true;
};
};
"jellyfin.home.rhelmot.io" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8096";
proxyWebsockets = true;
};
};
"aria2.home.rhelmot.io" = {
enableACME = true;
forceSSL = true;
locations."/".root = "${pkgs.ariang}/share/ariang";
locations."/jsonrpc" = {
proxyPass = "http://127.0.0.1:${toString config.services.aria2.settings.rpc-listen-port}";
};
};
# "owncast.home.rhelmot.io" = {
# enableACME = true;
# forceSSL = true;
# locations."/" = {
# proxyPass = "http://127.0.0.1:3007";
# proxyWebsockets = true;
# };
# };
"127.0.0.1:1934" = {
listen = [
{
addr = "127.0.0.1";
port = 1934;
ssl = false;
}
];
locations."/" = {
root = "/var/www/stream/";
tryFiles = "/$arg_name =404";
};
};
}; };
appendConfig = ''
rtmp {
server {
listen 1935;
chunk_size 4000;
application live {
live on;
dash on;
dash_path /run/nginx/tmp/dash;
hls on;
hls_path /run/nginx/tmp/hls;
hls_fragment 2s;
allow publish all;
allow play all;
notify_method get;
on_publish http://127.0.0.1:1934/;
}
}
}
'';
}; };
services.vaultwarden = { services.vaultwarden = {
@ -242,14 +128,6 @@
settings = { settings = {
newVersionCheck.enabled = false; newVersionCheck.enabled = false;
server.externalDomain = "https://immich.home.rhelmot.io"; server.externalDomain = "https://immich.home.rhelmot.io";
oauth = {
enabled = true;
autoLaunch = true;
buttonText = "Single Sign-On";
clientId = "immich";
clientSecret._secret = "/var/lib/immich/oidc-client-secret";
issuerUrl = "https://auth.rhelmot.io/realms/rhelmot";
};
}; };
}; };
@ -267,7 +145,7 @@
}; };
systemd.timers.pepper-glucose = { systemd.timers.pepper-glucose = {
wantedBy = [ "timers.target" ]; wantedBy = ["timers.target"];
timerConfig = { timerConfig = {
OnBootSec = "60"; OnBootSec = "60";
OnUnitActiveSec = "60"; OnUnitActiveSec = "60";
@ -275,7 +153,7 @@
}; };
systemd.services.pepper-glucose = { systemd.services.pepper-glucose = {
path = [ (pkgs.python3.withPackages (p: [ p.pydexcom ])) ]; path = [(pkgs.python3.withPackages (p: [p.pydexcom]))];
script = '' script = ''
~/glucose/dexcom.py /var/www/home.rhelmot.io/pepper/glucose.json ~/glucose/dexcom.py /var/www/home.rhelmot.io/pepper/glucose.json
''; '';
@ -316,168 +194,12 @@
settings.gui.user = "audrey"; settings.gui.user = "audrey";
}; };
services.sftpgo = {
enable = true;
dataDir = "/var/lib/sftpgo";
extraReadWriteDirs = [
"/var/lib/jellyfin/library"
"/var/lib/aria2/Downloads"
];
settings = {
tz = "local";
httpd.cookie_lifetime = "720";
httpd.bindings = [
{
port = 3006;
# 1 means OIDC for the WebAdmin UI.
# 2 means OIDC for the WebClient UI.
# 4 means login form for the WebAdmin UI.
# 8 means login form for the WebClient UI.
# 16 means the admin token endpoint for REST API.
# 32 means the user token endpoint for REST API.
# 64 means admin API key login.
# 128 means user API key login.
disabled_login_methods = 1 + 8;
oidc = {
config_url = "https://auth.rhelmot.io/realms/rhelmot";
client_id = "sftpgo";
client_secret_file = "/var/lib/sftpgo/oidc-client-secret";
redirect_base_url = "https://sftpgo.home.rhelmot.io";
username_field = "preferred_username";
scopes = [
"openid"
"profile"
"email"
"sftpgo"
];
};
}
];
sftpd.bindings = [
{
port = 28022;
address = "0.0.0.0";
}
];
sftpd.password_authentication = false;
};
};
systemd.services.sftpgo.serviceConfig.UMask = lib.mkForce "0007";
services.jellyfin = {
enable = true;
};
services.aria2 = {
enable = true;
rpcSecretFile = "/var/lib/aria2/secret";
settings = {
rpc-listen-port = 3008;
retry-wait = 15;
interface = "10.100.0.2";
};
};
systemd.services.aria2 = {
wants = [ "openvpn-nordvpn.service" ];
after = [ "openvpn-nordvpn.service" ];
serviceConfig.UMask = lib.mkForce "0002";
};
users.users.audrey.extraGroups = [ "sftpgo" "aria2" ];
users.users.jellyfin.extraGroups = [ "sftpgo" "aria2" ];
users.users.aria2.extraGroups = [ "sftpgo" ];
users.users.sftpgo.extraGroups = [ "aria2" ];
services.openvpn = {
servers.nordvpn = {
config = "config /var/lib/openvpn/nordvpn.ovpn";
autoStart = true;
authUserPass = "/var/lib/openvpn/nordvpn.passwd";
};
};
systemd.network.networks.nordvpn = {
name = "tun0";
address = [ "10.100.0.2" ];
routes = [
{
Gateway = "0.0.0.0";
Table = "10";
}
];
routingPolicyRules = [
{
From = "10.100.0.2";
Table = "10";
}
];
};
services.radicle = {
enable = false;
privateKey = "/var/lib/radicle/keys/radicle";
publicKey = "/var/lib/radicle/keys/radicle.pub";
httpd = {
enable = true;
listenPort = 3009;
nginx = {
serverName = "rad.rhelmot.io";
};
};
settings = {
node = {
alias = "rad.rhelmot.io";
listen = [ "0.0.0.0:8776" ];
externalAddresses = [ "rad.rhelmot.io:8776" ];
seedingPolicy = {
default = "block";
scope = "all";
};
};
};
};
services.ddns-updater = {
enable = true;
};
systemd.timers.offsite-backups = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "15min";
OnUnitActiveSec = "1w";
};
};
systemd.services.offsite-backups = {
path = with pkgs; [
zfs
backblaze-b2
];
environment = {
paths = "/var/lib/immich /var/lib/syncthing /var/lib/vaultwarden /var/lib/sftpgo";
HOME = "/root";
};
script = /* bash */ ''
set +e
result=0
for f in $paths; do
backblaze-b2 sync --replace-newer --keep-days 30 "$f" "b2://hydrangea-datasets/$(basename $f)" || result=1
done
exit $result
'';
serviceConfig = {
Type = "oneshot";
User = "root";
Group = "root";
};
};
# TODO # TODO
# - sftpgo
# - transfer old nextcloud files # - transfer old nextcloud files
# - move old data files to sftpgo/audrey? # - jellyfin
# - alerting
# ON HOLD # ON HOLD
# - hedgedoc keycloak # - dyndns
# - waiting for hedgedoc2 release to get oidc # - https://github.com/qdm12/ddns-updater/pull/1046
# - https://github.com/ddclient/ddclient/pull/852
} }

View File

@ -21,33 +21,11 @@
"main/hedgedoc".mountPoint = "/var/lib/hedgedoc"; "main/hedgedoc".mountPoint = "/var/lib/hedgedoc";
"main/immich".mountPoint = "/var/lib/immich"; "main/immich".mountPoint = "/var/lib/immich";
"main/syncthing".mountPoint = "/var/lib/syncthing"; "main/syncthing".mountPoint = "/var/lib/syncthing";
"main/jellyfin".mountPoint = "/var/lib/jellyfin";
"main/jellyfin/cache".mountPoint = "/var/cache/jellyfin";
"main/jellyfin/library".mountPoint = "/var/lib/jellyfin/library";
"main/radicle".mountPoint = "/var/lib/radicle";
"main/aria2".mountPoint = "/var/lib/aria2/Downloads";
}; };
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/910E-0D0F"; device = "/dev/disk/by-uuid/910E-0D0F";
fsType = "vfat"; fsType = "vfat";
options = [ options = [ "fmask=0022" "dmask=0022" ];
"fmask=0022"
"dmask=0022"
];
}; };
swapDevices = [
# /dev/nvme0n1p3
{ device = "/dev/disk/by-partuuid/1d1f5875-7879-11ee-8f2a-7cc255275618"; priority = 4096; }
# /dev/sd?1
{ device = "/dev/disk/by-partuuid/f24dd684-8201-11ee-b4f3-7cc255275618"; priority = 2048; }
{ device = "/dev/disk/by-partuuid/f230749d-8201-11ee-b4f3-7cc255275618"; priority = 2048; }
{ device = "/dev/disk/by-partuuid/f2282ec5-8201-11ee-b4f3-7cc255275618"; priority = 2048; }
{ device = "/dev/disk/by-partuuid/f23453fa-8201-11ee-b4f3-7cc255275618"; priority = 2048; }
{ device = "/dev/disk/by-partuuid/9caa659b-04fb-11ef-b641-7cc255275618"; priority = 2048; }
{ device = "/dev/disk/by-partuuid/9c825eb4-04fb-11ef-b641-7cc255275618"; priority = 2048; }
{ device = "/dev/disk/by-partuuid/9c889103-04fb-11ef-b641-7cc255275618"; priority = 2048; }
{ device = "/dev/disk/by-partuuid/9c978ead-04fb-11ef-b641-7cc255275618"; priority = 2048; }
];
} }

1
sites/hydrangea/system Normal file
View File

@ -0,0 +1 @@
nixos

View File

@ -1,48 +0,0 @@
# 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, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "system/local/root";
fsType = "zfs";
options = [ "zfsutil" ];
};
fileSystems."/nix" = {
device = "system/local/nix";
fsType = "zfs";
#options = [ "zfsutil" ];
};
fileSystems."/var" = {
device = "system/local/var";
fsType = "zfs";
#options = [ "zfsutil" ];
};
fileSystems."/home" = {
device = "system/home";
fsType = "zfs";
#options = [ "zfsutil" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-partuuid/12ae38d6-1d1c-4032-b800-f18d9e9bb1cb";
fsType = "vfat";
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.npu.enable = true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,14 +1,8 @@
{ { config, lib, pkgs, nixpkgs, ... }:
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = [ imports = [
"${modulesPath}/installer/cd-dvd/installation-cd-graphical-gnome.nix" "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix"
]; ];
networking.hostName = "redshank"; networking.hostName = "redshank";

View File

@ -1,9 +0,0 @@
# dummy file to make import infra work
{
lib,
...
}:
{
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

1
sites/redshank/system Normal file
View File

@ -0,0 +1 @@
nixos

View File

@ -6,55 +6,55 @@
let let
wp-hestia = pkgs.stdenv.mkDerivation rec { wp-hestia = pkgs.stdenv.mkDerivation rec {
name = "hestia"; name = "hestia";
version = "3.3.6"; version = "3.3.3";
src = pkgs.fetchzip { src = pkgs.fetchzip {
url = "https://downloads.wordpress.org/theme/${name}.${version}.zip"; url = "https://downloads.wordpress.org/theme/${name}.${version}.zip";
hash = "sha256-ouFycwkK0Gy/65jD4qwm0iHG1PXSEDUnJQztNUMWu3o="; hash = "sha256-hDHG6UdIriF07Uk5hlUuWUriBVtY3XBoma8tl733yrw=";
}; };
installPhase = "mkdir -p $out; cp -R * $out/"; installPhase = "mkdir -p $out; cp -R * $out/";
}; };
wp-lightning = pkgs.stdenv.mkDerivation rec { wp-lightning = pkgs.stdenv.mkDerivation rec {
name = "lightning"; name = "lightning";
version = "15.42.0"; version = "15.32.1";
src = pkgs.fetchzip { src = pkgs.fetchzip {
url = "https://downloads.wordpress.org/theme/${name}.${version}.zip"; url = "https://downloads.wordpress.org/theme/${name}.${version}.zip";
hash = "sha256-VaRLeJTgsTSlRBIqTS1aGMjIjA8AMY2eLHETI1ihoaI="; hash = "sha256-yiA3PDxIoyYyZ2CI73Wa4GgRrJ3IlaJa45je8H95oY8=";
}; };
installPhase = "mkdir -p $out; cp -R * $out/"; installPhase = "mkdir -p $out; cp -R * $out/";
}; };
wp-fresh-bakers-shop = pkgs.stdenv.mkDerivation rec { wp-fresh-bakers-shop = pkgs.stdenv.mkDerivation rec {
name = "fresh-bakers-shop"; name = "fresh-bakers-shop";
version = "2.0.5"; version = "1.0";
src = pkgs.fetchzip { src = pkgs.fetchzip {
url = "https://downloads.wordpress.org/theme/${name}.${version}.zip"; url = "https://downloads.wordpress.org/theme/${name}.${version}.zip";
hash = "sha256-s7MajZ44iQ0+NgH0487I6MCO7dJiyl5bUtppcONU9Q0="; hash = "sha256-MJI6uwRfSFAiYMVhJ3nG4MG6Xw1wZVT47AbLRSJel9M=";
}; };
installPhase = "mkdir -p $out; cp -R * $out/"; installPhase = "mkdir -p $out; cp -R * $out/";
}; };
wp-blocksy = pkgs.stdenv.mkDerivation rec { wp-blocksy = pkgs.stdenv.mkDerivation rec {
name = "blocksy"; name = "blocksy";
version = "2.1.57"; version = "2.1.20";
src = pkgs.fetchzip { src = pkgs.fetchzip {
url = "https://downloads.wordpress.org/theme/${name}.${version}.zip"; url = "https://downloads.wordpress.org/theme/${name}.${version}.zip";
hash = "sha256-odTfwnsnIJVG6jffwoAbmEyqWVt+5fa48UGgefJC18c="; hash = "sha256-KVAkPBa3G8D55ltmybW8rdVd0mRmdcG/ZthpOd1aLGM=";
}; };
installPhase = "mkdir -p $out; cp -R * $out/"; installPhase = "mkdir -p $out; cp -R * $out/";
}; };
wp-blocksy-companion = pkgs.stdenv.mkDerivation rec { wp-blocksy-companion = pkgs.stdenv.mkDerivation rec {
name = "blocksy-companion"; name = "blocksy-companion";
version = "2.1.57"; version = "2.1.20";
src = pkgs.fetchzip { src = pkgs.fetchzip {
url = "https://downloads.wordpress.org/plugin/${name}.${version}.zip"; url = "https://downloads.wordpress.org/plugin/${name}.${version}.zip";
hash = "sha256-MvPHnBDwnhAC41j12PvDfLBRindLBGUm/B8DH17rcJs="; hash = "sha256-QctNCyxARX/SDjJVf9q96lanXnC9vKAC0a6UAGhM//Q=";
}; };
installPhase = "mkdir -p $out; cp -R * $out/"; installPhase = "mkdir -p $out; cp -R * $out/";
}; };
wp-wordpress-importer = pkgs.stdenv.mkDerivation rec { wp-wordpress-importer = pkgs.stdenv.mkDerivation rec {
name = "wordpress-importer"; name = "wordpress-importer";
version = "0.9.6"; version = "0.9.5";
src = pkgs.fetchzip { src = pkgs.fetchzip {
url = "https://downloads.wordpress.org/plugin/${name}.${version}.zip"; url = "https://downloads.wordpress.org/plugin/${name}.${version}.zip";
hash = "sha256-rc/Ut0HYmqTsP2Yc3tcqVRXU3zq7H9wf80SmGqQSYF4="; hash = "sha256-X/jB6DdUZH0CVrfv0NhrvisOTDK5mF9qJA96oOWSRhY=";
}; };
installPhase = "mkdir -p $out; cp -R * $out/"; installPhase = "mkdir -p $out; cp -R * $out/";
}; };
@ -71,18 +71,13 @@ in
inherit wp-wordpress-importer wp-blocksy-companion; inherit wp-wordpress-importer wp-blocksy-companion;
}; };
settings = { settings = {
FORCE_SSL_ADMIN = true; FORCE_SSL_ADMIN = true;
}; };
extraConfig = '' extraConfig = ''
$_SERVER['HTTPS']='on'; $_SERVER['HTTPS']='on';
''; '';
}; };
services.nginx.virtualHosts."anonsee.rhelmot.io".listen = [ services.nginx.virtualHosts."anonsee.rhelmot.io".listen = [ { addr = "0.0.0.0"; port = 3000; } ];
{
addr = "0.0.0.0";
port = 3000;
}
];
networking.firewall.allowedTCPPorts = [ 3000 ]; networking.firewall.allowedTCPPorts = [ 3000 ];
services.wordpress.webserver = "nginx"; services.wordpress.webserver = "nginx";
system.stateVersion = "25.05"; system.stateVersion = "25.05";

View File

@ -0,0 +1,295 @@
{ config, lib, pkgs, ... }:
{
imports = [ ./hardware-configuration.nix ];
boot.initrd.supportedFilesystems = [ "zfs" ];
boot.initrd.systemd.enable = true;
services.zfs.autoScrub.enable = true;
services.zfs.trim.enable = true;
networking.hostName = "sunflower";
networking.hostId = "77d68c52";
networking.useNetworkd = true;
systemd.network.enable = true;
systemd.network.networks."30-wan" = {
matchConfig.Name = "enp1s0";
networkConfig.DHCP = "ipv4";
address = [
"2a01:4f9:c013:ce62::1/64"
];
routes = [
{ Gateway = "fe80::1"; }
];
};
time.timeZone = "America/Phoenix";
system.stateVersion = "24.11";
security.sudo.wheelNeedsPassword = false;
networking.firewall.allowedTCPPorts = [ 22 80 443 1337 1338 ];
networking.firewall.allowedUDPPorts = [ 1337 1338 ];
security.acme = {
acceptTerms = true;
defaults.email = "audrey@rhelmot.io";
};
services.bingosync = {
enable = true;
domain = "celestebingo.rhelmot.io";
socketsDomain = "sockets-celestebingo.rhelmot.io";
databaseUrl = "postgres://%2Frun%2Fpostgresql/bingosync";
extraPythonPackages = p: [ p.psycopg2 ];
};
users.users.wiki-js = {
isSystemUser = true;
group = "wiki-js";
};
users.groups.wiki-js = {};
users.groups.${config.services.forgejo.group}.members = [config.services.nginx.user];
services.wiki-js = {
enable = true;
settings = {
db.type = "postgres";
db.db = "wiki-js";
db.user = "wiki-js";
db.host = "/run/postgresql";
bindIP = "127.0.0.1";
port = 5517;
};
};
services.forgejo = {
enable = true;
lfs.enable = true;
database = {
createDatabase = true;
type = "postgres";
socket = "/run/postgresql";
};
settings = {
DEFAULT = {
APP_NAME = "Shellphish Git";
};
server = {
DOMAIN = "git.rhelmot.io";
PROTOCOL = "http+unix";
ROOT_URL = "https://git.rhelmot.io/";
UNIX_SOCKET_PERMISSION = "770";
LANDING_PAGE = "explore";
};
"ssh.minimum_key_sizes".RSA = "2047";
repository = {
ENABLE_PUSH_CREATE_USER = "true";
ENABLE_PUSH_CREATE_ORG = "true";
};
};
};
services.postgresql = {
enable = true;
ensureDatabases = [
"bingosync"
"mspa"
"wiki-js"
"forgejo"
];
ensureUsers = [
{ name = "bingosync"; ensureDBOwnership = true; }
{ name = "mspa"; ensureDBOwnership = true; }
{ name = "wiki-js"; ensureDBOwnership = true; }
{ name = "forgejo"; ensureDBOwnership = true; }
];
authentication = pkgs.lib.mkOverride 10 ''
#type database DBuser auth-method optional_ident_map
local all all peer map=defaultmap
'';
identMap = ''
# ArbitraryMapName systemUser DBUser
defaultmap root postgres
defaultmap postgres postgres
defaultmap php-nginx mspa
defaultmap bingosync bingosync
defaultmap wiki-js wiki-js
defaultmap forgejo forgejo
'';
};
users.users.php-nginx = {
isSystemUser = true;
group = "php-nginx";
};
users.groups.php-nginx = {};
services.phpfpm.pools.nginx = {
user = "php-nginx";
settings = {
"pm" = "dynamic";
"listen.owner" = config.services.nginx.user;
"pm.max_children" = 5;
"pm.start_servers" = 2;
"pm.min_spare_servers" = 1;
"pm.max_spare_servers" = 3;
"pm.max_requests" = 500;
};
};
services.nginx = {
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
"rhelmot.io" = {
default = true;
forceSSL = true;
enableACME = true;
root = "/var/www/rhelmot.io/";
locations."/secret/" = {
basicAuthFile = "/var/lib/rhelmot.io/secret";
};
locations."~ ^/MSPA/(.*\\.php|)$" = {
extraConfig = ''
fastcgi_pass unix:${config.services.phpfpm.pools.nginx.socket};
fastcgi_index index.php;
'';
index = "index.php index.html";
};
};
"www.rhelmot.io" = {
globalRedirect = "rhelmot.io";
enableACME = true;
};
"blog.rhelmot.io" = {
forceSSL = true;
enableACME = true;
locations."/" = {
root = "/nix/var/nix/profiles/blog-rhelmot-io";
};
};
"www.blog.rhelmot.io" = {
globalRedirect = "blog.rhelmot.io";
enableACME = true;
};
"bingosync.rhelmot.io" = {
locations."/" = {
proxyPass = "https://bingosync.com/";
proxyWebsockets = true;
};
};
# proxy conf generated by services.bingosync
"celestebingo.rhelmot.io" = {
enableACME = true;
addSSL = true;
};
"sockets-celestebingo.rhelmot.io" = {
enableACME = true;
addSSL = true;
};
"www.celestebingo.rhelmot.io" = {
globalRedirect = "celestebingo.rhelmot.io";
enableACME = true;
};
"minal.rhelmot.io" = {
forceSSL = true;
enableACME = true;
locations."/".root = "/var/www/minal.rhelmot.io/";
};
"www.minal.rhelmot.io" = {
globalRedirect = "minal.rhelmot.io";
enableACME = true;
};
"mimispastrypost.com" = {
forceSSL = true;
enableACME = true;
locations."/".root = "/var/www/mimispastrypost.com/";
};
"www.mimispastrypost.com" = {
globalRedirect = "mimispastrypost.com";
enableACME = true;
};
"wiki.rhelmot.io" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:5517/";
proxyWebsockets = true;
};
};
"git.rhelmot.io" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
client_max_body_size 4G;
'';
locations."/" = {
proxyPass = "http://unix:/run/forgejo/forgejo.sock";
proxyWebsockets = true;
};
};
"anonsee.rhelmot.io" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://192.168.100.11:3000";
proxyWebsockets = true;
recommendedProxySettings = true;
extraConfig = ''
'';
};
};
"anons.ee" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://192.168.100.11:3000";
proxyWebsockets = true;
recommendedProxySettings = true;
extraConfig = ''
'';
};
};
};
};
users.users.reminder-bot = {
isSystemUser = true;
group = "nogroup";
};
systemd.services.reminder-bot = {
path = [ (pkgs.python3.withPackages (p: with p; [ discordpy aiocron aiosqlite cronsim ])) ];
script = ''
exec python ${./reminder_bot.py}
'';
serviceConfig = {
Type = "simple";
Restart = "always";
User = "reminder-bot";
};
wantedBy = [ "multi-user.target" ];
};
containers.anonsee = {
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.11";
config.imports = [ ./anonsee.nix ];
};
services.nginx.logError = "stderr info";
}

View File

@ -0,0 +1,53 @@
# 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, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "system/local/root";
fsType = "zfs";
options = [ "zfsutil" ];
};
fileSystems."/nix" =
{ device = "system/local/nix";
fsType = "zfs";
};
fileSystems."/var" =
{ device = "system/local/var";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "system/home";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/564D-E28E";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# 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.enp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

1
sites/sunflower/system Normal file
View File

@ -0,0 +1 @@
nixos

View File

@ -1,16 +1,10 @@
{ { config, lib, pkgs, ... }:
config,
lib,
pkgs,
pkgs-experimental,
inputs,
...
}:
{ {
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
boot.initrd.supportedFilesystems = [ "zfs" ]; boot.initrd.supportedFilesystems = [ "zfs" ];
boot.initrd.systemd.enable = true;
services.zfs.autoScrub.enable = true; services.zfs.autoScrub.enable = true;
services.zfs.trim.enable = true; services.zfs.trim.enable = true;
@ -23,278 +17,6 @@
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [ 22 80 443 1337 1338 ];
22 networking.firewall.allowedUDPPorts = [ 1337 1338 ];
80
443
1337
1338
];
networking.firewall.allowedUDPPorts = [
1337
1338
];
users.users.vamp = {
isNormalUser = true;
};
security.acme = {
acceptTerms = true;
defaults.email = "audrey@rhelmot.io";
};
services.bingosync = {
enable = true;
domain = "celestebingo.rhelmot.io";
socketsDomain = "sockets-celestebingo.rhelmot.io";
databaseUrl = "postgres://%2Frun%2Fpostgresql/bingosync";
extraPythonPackages = p: [ p.psycopg2 ];
};
services.postgresql = {
enable = true;
ensureDatabases = [
"bingosync"
"mspa"
"keycloak"
];
ensureUsers = [
{
name = "bingosync";
ensureDBOwnership = true;
}
{
name = "mspa";
ensureDBOwnership = true;
}
{
name = "keycloak";
ensureDBOwnership = true;
}
];
authentication = pkgs.lib.mkOverride 10 ''
#type database DBuser auth-method optional_ident_map
local all all peer map=defaultmap
'';
identMap = ''
# ArbitraryMapName systemUser DBUser
defaultmap root postgres
defaultmap postgres postgres
defaultmap php-nginx mspa
defaultmap bingosync bingosync
defaultmap keycloak keycloak
'';
};
users.users.php-nginx = {
isSystemUser = true;
group = "php-nginx";
};
users.groups.php-nginx = { };
services.phpfpm.pools.nginx = {
user = "php-nginx";
settings = {
"pm" = "dynamic";
"listen.owner" = config.services.nginx.user;
"pm.max_children" = 5;
"pm.start_servers" = 2;
"pm.min_spare_servers" = 1;
"pm.max_spare_servers" = 3;
"pm.max_requests" = 500;
};
};
security.acme.certs = {
"rhelmot.io".extraDomainNames = [
"www.rhelmot.io"
"blog.rhelmot.io"
"www.blog.rhelmot.io"
"celestebingo.rhelmot.io"
"sockets-celestebingo.rhelmot.io"
"www.celestebingo.rhelmot.io"
"minal.rhelmot.io"
"www.minal.rhelmot.io"
"auth.rhelmot.io"
];
"mimispastrypost.com".extraDomainNames = [
"www.mimispastrypost.com"
];
};
services.nginx = {
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
"rhelmot.io" = {
default = true;
forceSSL = true;
enableACME = true;
root = "/var/www/rhelmot.io/";
locations."/secret/" = {
basicAuthFile = "/var/lib/rhelmot.io/secret";
};
locations."~ ^/MSPA/(.*\\.php|)$" = {
extraConfig = ''
fastcgi_pass unix:${config.services.phpfpm.pools.nginx.socket};
fastcgi_index index.php;
'';
index = "index.php index.html";
};
};
"www.rhelmot.io" = {
globalRedirect = "rhelmot.io";
useACMEHost = "rhelmot.io";
};
"blog.rhelmot.io" = {
forceSSL = true;
useACMEHost = "rhelmot.io";
locations."/" = {
root = "/nix/var/nix/profiles/blog-rhelmot-io";
};
};
"www.blog.rhelmot.io" = {
globalRedirect = "blog.rhelmot.io";
useACMEHost = "rhelmot.io";
};
"bingosync.rhelmot.io" = {
locations."/" = {
proxyPass = "https://bingosync.com/";
proxyWebsockets = true;
};
};
# proxy conf generated by services.bingosync
"celestebingo.rhelmot.io" = {
addSSL = true;
useACMEHost = "rhelmot.io";
};
"sockets-celestebingo.rhelmot.io" = {
addSSL = true;
useACMEHost = "rhelmot.io";
};
"www.celestebingo.rhelmot.io" = {
globalRedirect = "celestebingo.rhelmot.io";
useACMEHost = "rhelmot.io";
};
"minal.rhelmot.io" = {
forceSSL = true;
useACMEHost = "rhelmot.io";
locations."/".root = "/var/www/minal.rhelmot.io/";
};
"www.minal.rhelmot.io" = {
globalRedirect = "minal.rhelmot.io";
useACMEHost = "rhelmot.io";
};
"mimispastrypost.com" = {
forceSSL = true;
enableACME = true;
locations."/".root = "/var/www/mimispastrypost.com/";
};
"www.mimispastrypost.com" = {
globalRedirect = "mimispastrypost.com";
useACMEHost = "mimispastrypost.com";
};
"anons.ee" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://192.168.100.11:3000";
proxyWebsockets = true;
recommendedProxySettings = true;
};
};
"auth.rhelmot.io" = {
forceSSL = true;
useACMEHost = "rhelmot.io";
locations."/" = {
proxyPass = "http://127.0.0.1:3030";
proxyWebsockets = true;
};
};
};
};
users.users.reminder-bot = {
isSystemUser = true;
group = "nogroup";
};
systemd.services.reminder-bot = {
path = [
(pkgs.python3.withPackages (
p: with p; [
(discordpy.override { withVoice = false; })
aiocron
aiosqlite
cronsim
]
))
];
script = ''
exec python ${./reminder_bot.py}
'';
serviceConfig = {
Type = "simple";
Restart = "always";
User = "reminder-bot";
};
wantedBy = [ "multi-user.target" ];
};
containers.anonsee = {
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.11";
config.imports = [
./anonsee.nix
{
_module.args = {
inherit pkgs-experimental;
};
nixpkgs = {
inherit (config.nixpkgs) buildPlatform overlays;
};
}
];
};
services.nginx.logError = "stderr info";
services.keycloak = {
enable = true;
database.host = "/run/postgresql";
database.type = "postgresql";
initialAdminPassword = "bitesyouchangeme";
plugins = with pkgs.keycloak.plugins; [
junixsocket-common
junixsocket-native-common
];
settings = {
hostname = "auth.rhelmot.io";
http-host = "127.0.0.1";
http-port = 3030;
proxy-headers = "xforwarded";
http-enabled = true;
};
};
rhelmot.deployments = {
"blog-rhelmot-io" = {
target = (import inputs."blog-rhelmot-io" { }).site;
};
};
networking.extraHosts = ''
129.146.203.142 rhelmot.io
129.146.203.142 auth.rhelmot.io
129.146.203.142 celestebingo.rhelmot.io
129.146.203.142 anons.ee
'';
services.fwupd.enable = lib.mkForce false;
} }

View File

@ -1,52 +1,43 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’ # Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ { config, lib, pkgs, modulesPath, ... }:
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = [ imports =
(modulesPath + "/profiles/qemu-guest.nix") [ (modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ "virtio_scsi" ]; boot.initrd.availableKernelModules = [ "virtio_scsi" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" =
device = "system/root"; { device = "system/root";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/var" = { fileSystems."/var" =
device = "system/var"; { device = "system/var";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/nix" = { fileSystems."/nix" =
device = "system/nix"; { device = "system/nix";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/home" = { fileSystems."/home" =
device = "system/home"; { device = "system/home";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/boot" = { fileSystems."/boot" =
device = "/dev/disk/by-uuid/7798-9D4F"; { device = "/dev/disk/by-uuid/7798-9D4F";
fsType = "vfat"; fsType = "vfat";
options = [ options = [ "fmask=0022" "dmask=0022" ];
"fmask=0022" };
"dmask=0022"
];
};
swapDevices = [ ]; swapDevices = [ ];

1
sites/tulip/system Normal file
View File

@ -0,0 +1 @@
nixos