27 Commits

Author SHA1 Message Date
05fdf726a3 WIP 2025-05-31 15:51:58 -07:00
5eab965637 Enable automatic nix garbage collection 2025-05-31 15:51:01 -07:00
a42a8ba871 Re-enable shelvacu's substituter 2025-05-31 15:49:50 -07:00
a9e74478c9 Configure apache to use php 8.0 2025-05-31 15:46:09 -07:00
dbfe474299 Use fish 2025-05-26 16:38:15 -07:00
455a36f0d1 Use apache and mod_php in www services 2025-05-26 15:23:29 -07:00
f21f543976 Configure www services 2025-05-25 21:52:10 -07:00
fc28b23995 Add electron tools 2025-05-25 21:11:31 -07:00
d9b0d8d4cb Make htop a globally common package 2025-04-22 15:34:08 -07:00
e40f929abe Add cachix substituter and disable shelvacu's 2025-04-22 14:21:01 -07:00
493d9962ef Setup php7.2 dev tools 2025-04-19 01:18:00 -07:00
3ee2d1dd84 Use cachix 2025-04-19 01:17:15 -07:00
1ac3895177 Install Arduino IDE on Marauder 2025-04-05 20:57:20 -07:00
3bc1357bb1 Uninstall orca-slicer from Marauder 2025-02-26 18:03:37 -08:00
46fbfbf8ca Install Signal desktop on Marauder 2025-02-26 17:59:38 -08:00
ebc1fce8f4 Update restic backup paths on marauder 2024-12-27 00:55:25 -08:00
a6acaf9b17 Setup vaultwarden on monolith 2024-12-27 00:55:25 -08:00
42a9998b54 Add Orca Slicer to marauder 2024-12-27 00:55:25 -08:00
36f3d3b66b Update hardware settings on marauder 2024-12-27 00:55:25 -08:00
fda44a9cc8 Add mp3val to monolith 2024-12-23 12:27:55 -08:00
8cdb64ed65 Add htop to monolith 2024-12-23 12:12:45 -08:00
5fd8e803b1 Update flake to NixOS 24.11 2024-12-18 22:15:49 -08:00
ac916d8305 Add reboot service to monolith 2024-12-18 22:04:49 -08:00
0de7e50ffa Add mullvad and qbittorrent to Marauder 2024-12-11 20:12:32 -08:00
227bf853ab Add extra SSH configurations to Marauder 2024-12-10 17:17:11 -08:00
e7100daf2f Install blender on marauder 2024-12-08 09:33:40 -08:00
04069f02ec Roughly setup todo-app web server 2024-12-06 17:02:11 -08:00
12 changed files with 745 additions and 289 deletions

808
flake.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,8 +2,9 @@
description = "Nettika's NixOS Configurations";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
shelvacu.url = "git+https://git.uninsane.org/shelvacu/nix-stuff";
phps.url = "github:fossar/nix-phps";
};
outputs = { self, nixpkgs, ... }@inputs:

View File

@@ -33,9 +33,12 @@
repository = "b2:marauder-backup";
passwordFile = "/etc/restic-password";
paths = [
"${config.users.users.nettika.home}/Documents"
"${config.users.users.nettika.home}/Artwork"
"${config.users.users.nettika.home}/Documents"
"${config.users.users.nettika.home}/Music"
"${config.users.users.nettika.home}/Pictures"
"${config.users.users.nettika.home}/Projects"
"${config.users.users.nettika.home}/Videos"
];
pruneOpts = [
"--keep-daily 7"

View File

@@ -6,6 +6,7 @@
self.nixosModules.zerotier
./backup.nix
./dev.nix
./www.nix
./printing.nix
];
@@ -48,18 +49,21 @@
hardware = {
enableRedistributableFirmware = true;
cpu.amd.updateMicrocode = true;
opengl = {
graphics = {
enable = true;
driSupport32Bit = true;
enable32Bit = true;
extraPackages = [ pkgs.vaapiVdpau ];
};
nvidia.prime = {
offload = {
enable = true;
enableOffloadCmd = true;
nvidia = {
open = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
amdgpuBusId = "PCI:05:00:0";
nvidiaBusId = "PCI:01:00:0";
};
amdgpuBusId = "PCI:05:00:0";
nvidiaBusId = "PCI:01:00:0";
};
};
@@ -72,12 +76,13 @@
slack
element-desktop
telegram-desktop
signal-desktop
# Browsers
firefox
filezilla
# Art and 3D
# Creative
inkscape
gimp
krita
@@ -93,6 +98,9 @@
obsidian
intiface-central
prismlauncher
blender
mullvad-vpn
qbittorrent
]);
};
@@ -102,6 +110,19 @@
dedicatedServer.openFirewall = true;
};
programs.ssh.extraConfig = ''
Host quasar
HostName consortium.chat
IdentityFile ~/.ssh/LightsailDefaultKey-us-west-2.pem
Host monolith
HostName 10.243.210.154
Host fennbox
HostName 10.243.109.199
User fenn
'';
programs.nix-ld = {
enable = true;
};

View File

@@ -5,16 +5,30 @@
};
environment.systemPackages = with pkgs; [
# Code Editors
vscode
kotlin
rustup
pyenv
gcc
arduino-ide
# Dev Tools
nixd
nixpkgs-fmt
pyenv
rustup
electron-fiddle
electron
# Languages
gcc
kotlin
nodejs
php
];
programs.direnv = {
enable = true;
};
nixpkgs.config.permittedInsecurePackages = [
"electron-24.8.6"
];
}

26
hosts/marauder/www.nix Executable file
View File

@@ -0,0 +1,26 @@
{ pkgs, inputs, ... }:
let
fortune = pkgs.writeShellScript "cgi" ''
echo "Content-type: text/html"
echo ""
${pkgs.fortune}/bin/fortune
'';
in {
services.mysql = {
enable = true;
package = pkgs.mariadb;
};
services.httpd = {
enable = true;
enablePHP = true;
phpPackage = inputs.phps.packages.x86_64-linux.php80;
extraConfig = ''
ScriptAlias /fortune ${fortune}/bin/fortune
'';
virtualHosts."localhost" = {
documentRoot = "/var/www";
locations."/".index = "index.html index.php";
};
};
}

View File

@@ -6,11 +6,14 @@
self.nixosModules.server
self.nixosModules.zerotier
./dns.nix
./memos.nix
./vault.nix
];
networking = {
hostName = "monolith";
hostId = "44551c32";
firewall.allowedTCPPorts = [ 8000 ];
};
fileSystems = {
@@ -44,7 +47,10 @@
beets
flac
screen
rustup
gcc
(callPackage ../marauder/ffcheck.nix { })
mp3val
];
services.jellyfin = {
@@ -63,6 +69,24 @@
};
};
systemd = {
services.reboot = {
description = "Reboot the system";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.systemd}/bin/systemctl reboot";
};
};
timers.reboot = {
description = "Reboot the system every two hours";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "6h";
Persistent = true;
};
};
};
promptEmoji = "🏰";
time.timeZone = "America/Los_Angeles";

45
hosts/monolith/memos.nix Executable file
View File

@@ -0,0 +1,45 @@
{ pkgs, ... }:
{
users.users = {
memos = {
isSystemUser = true;
group = "memos";
};
};
users.groups = {
memos = { };
};
environment.systemPackages = [ pkgs.memos ];
systemd.tmpfiles.settings = {
memosDirs = {
"/var/opt/memos".d = {
mode = "700";
user = "memos";
group = "memos";
};
};
};
# systemd.services = {
# memos = {
# description = "Memos Note-taking Server";
# wantedBy = [ "multi-user.target" ];
# after = [ "network.target" ];
# serviceConfig = {
# Type = "simple";
# User = "memos";
# WorkingDirectory = "/var/opt/memos";
# ExecStart = "${pkgs.memos}/bin/memos --data /var/opt/memos --port 5230";
# Restart = "on-failure";
# TimeoutSec = 15;
# };
# };
# };
networking.firewall = {
allowedTCPPorts = [ 5230 ];
};
}

20
hosts/monolith/vault.nix Normal file
View File

@@ -0,0 +1,20 @@
{ secrets, ... }:
{
services.vaultwarden = {
enable = true;
config = {
domain = "https://vault.leaf.ninja";
signupsAllowed = false;
rocketAddress = "0.0.0.0";
rocketPort = 8222;
smtpHost = "smtp.migadu.com";
smtpFrom = "vaultwarden@leaf.ninja";
smtpPort = 587;
smtpSecurity = "starttls";
smtpUsername = "vaultwarden@leaf.ninja";
smtpPassword = secrets.vaultwarden.smtpPassword;
};
};
networking.firewall.allowedTCPPorts = [ 8222 ];
}

View File

@@ -4,14 +4,27 @@
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
substituters = [ "https://nixcache.shelvacu.com" ];
trusted-public-keys = [ "nixcache.shelvacu.com:73u5ZGBpPRoVZfgNJQKYYBt9K9Io/jPwgUfuOLsJbsM=" ];
substituters = [
"https://nixcache.shelvacu.com"
"https://fossar.cachix.org"
];
trusted-public-keys = [
"fossar.cachix.org-1:Zv6FuqIboeHPWQS7ysLCJ7UT7xExb4OE8c4LyGb5AsE="
"nixcache.shelvacu.com:73u5ZGBpPRoVZfgNJQKYYBt9K9Io/jPwgUfuOLsJbsM="
];
trusted-users = [ "@wheel" ];
};
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
users.users.nettika = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
shell = pkgs.fish;
};
security.sudo.wheelNeedsPassword = false;
@@ -41,8 +54,13 @@
'';
};
programs.fish = {
enable = true;
};
environment.systemPackages = with pkgs; [
git-crypt
htop
jq
];
}

View File

@@ -7,4 +7,24 @@
config.programs.bash.promptInit = ''
PS1="\[\e]0;\u@\h: \w\a\]\n${config.promptEmoji} \[\033[1;$((UID ? 32 : 31))m\]\w \\$\[\033[0m\] "
'';
config.programs.fish = {
promptInit = ''
function fish_prompt
echo -n '${config.promptEmoji} '
set_color brgreen
echo -n (prompt_pwd)
set_color normal
echo -n ' > '
end
function fish_right_prompt
set_color bryellow
echo -n (git branch --show-current 2>/dev/null)
end
'';
shellInit = ''
set -g fish_greeting
set -g fish_prompt_pwd_full_dirs 999
'';
};
}

Binary file not shown.