aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kassouni <alex@kassouni.net>2026-10-23 14:50:17 -0700
committerAlexander Kassouni <alex@kassouni.net>2026-10-23 14:50:17 -0700
commit15ec12896112df04665ff2b4b2a945c9f62d8188 (patch)
tree525963644d867b0d5cd1b90ef145db490e0da2a8
parentdb16d1d40b22c2502659fdb92014f41129896b61 (diff)
fmt
-rw-r--r--configuration.nix9
-rw-r--r--flake.nix15
-rw-r--r--git/default.nix19
-rw-r--r--justfile4
-rw-r--r--nix/hardware-configuration.nix44
-rw-r--r--nix/linkding.nix8
-rw-r--r--nix/minecraft.nix11
-rw-r--r--nix/options.nix12
-rw-r--r--nix/site.nix5
-rw-r--r--nix/ssh.nix7
-rw-r--r--nix/web.nix11
11 files changed, 100 insertions, 45 deletions
diff --git a/configuration.nix b/configuration.nix
index 2f6b4db..c02e389 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -1,4 +1,4 @@
-{config, ...}: {
+{ config, ... }: {
imports = [
./git
./nix/hardware-configuration.nix
@@ -8,7 +8,7 @@
./nix/ssh.nix
./nix/web.nix
];
-
+
boot.loader = {
systemd-boot = {
enable = true;
@@ -17,7 +17,10 @@
efi.canTouchEfiVariables = true;
};
- nix.settings.experimental-features = [ "nix-command" "flakes" ];
+ nix.settings.experimental-features = [
+ "nix-command"
+ "flakes"
+ ];
networking.hostName = "chariot";
networking.networkmanager.enable = true;
diff --git a/flake.nix b/flake.nix
index dd9358e..d5448cf 100644
--- a/flake.nix
+++ b/flake.nix
@@ -10,14 +10,15 @@
};
};
- outputs = inputs@{ flake-parts, nixpkgs, ... }:
+ outputs =
+ inputs@{ flake-parts, nixpkgs, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
-
- systems = [
- "x86_64-linux"
- "aarch64-linux"
- "x86_64-darwin"
- "aarch64-darwin"
+
+ systems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
];
perSystem = { pkgs, ... }: {
diff --git a/git/default.nix b/git/default.nix
index d383d05..671b708 100644
--- a/git/default.nix
+++ b/git/default.nix
@@ -1,14 +1,21 @@
-{config, inputs, pkgs, ...}: let
+{
+ config,
+ inputs,
+ pkgs,
+ ...
+}:
+let
domain = "git.kassouni.net";
repoRoot = "/srv/git";
theme = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.cgit-theme;
-in {
+in
+{
users.users.git = {
isSystemUser = true;
group = "git";
home = repoRoot;
createHome = true;
- homeMode = "750";
+ homeMode = "750";
shell = "${pkgs.git}/bin/git-shell";
openssh.authorizedKeys.keys = config.my.gitKeys;
};
@@ -36,7 +43,11 @@ in {
favicon = "/git.svg";
strict-export = "git-daemon-export-ok";
remove-suffix = true;
- readme = [ ":README.md" ":README" ":readme.md" ];
+ readme = [
+ ":README.md"
+ ":README"
+ ":readme.md"
+ ];
clone-url = "git@${domain}:$CGIT_REPO_URL https://${domain}/$CGIT_REPO_URL";
source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py";
about-filter = "${pkgs.cgit}/lib/cgit/filters/about-formatting.sh";
diff --git a/justfile b/justfile
index 8cd8365..276b3d8 100644
--- a/justfile
+++ b/justfile
@@ -1,7 +1,9 @@
host := "kassouni@5.78.230.100"
config := "kassouni-net"
rcon_port := "25575"
-rcon_password := "mooshroom"
+
+# RCON port is closed, password is unimportant
+rcon_password := "mooshroom"
deploy:
nixos-rebuild switch --flake .#{{config}} --target-host {{host}} --build-host {{host}} --use-substitutes --sudo --ask-sudo-password
diff --git a/nix/hardware-configuration.nix b/nix/hardware-configuration.nix
index 321c3d1..5ebec1c 100644
--- a/nix/hardware-configuration.nix
+++ b/nix/hardware-configuration.nix
@@ -1,28 +1,44 @@
# 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, ... }:
+{
+ config,
+ lib,
+ pkgs,
+ modulesPath,
+ ...
+}:
{
- imports =
- [ (modulesPath + "/profiles/qemu-guest.nix")
- ];
+ imports = [
+ (modulesPath + "/profiles/qemu-guest.nix")
+ ];
- boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
+ boot.initrd.availableKernelModules = [
+ "ahci"
+ "xhci_pci"
+ "virtio_pci"
+ "virtio_scsi"
+ "sd_mod"
+ "sr_mod"
+ ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
- fileSystems."/" =
- { device = "/dev/disk/by-uuid/39d32404-1fa3-42ef-9eb4-a2a41b532258";
- fsType = "ext4";
- };
+ fileSystems."/" = {
+ device = "/dev/disk/by-uuid/39d32404-1fa3-42ef-9eb4-a2a41b532258";
+ fsType = "ext4";
+ };
- fileSystems."/boot" =
- { device = "/dev/disk/by-uuid/1129-26CF";
- fsType = "vfat";
- options = [ "fmask=0022" "dmask=0022" ];
- };
+ fileSystems."/boot" = {
+ device = "/dev/disk/by-uuid/1129-26CF";
+ fsType = "vfat";
+ options = [
+ "fmask=0022"
+ "dmask=0022"
+ ];
+ };
swapDevices = [ ];
diff --git a/nix/linkding.nix b/nix/linkding.nix
index 744fe19..36a6521 100644
--- a/nix/linkding.nix
+++ b/nix/linkding.nix
@@ -1,6 +1,8 @@
-{ config, ... }: let
+{ config, ... }:
+let
domain = "links.kassouni.net";
-in {
+in
+{
services.linkding = {
enable = true;
environmentFile = "/var/lib/linkding/creds.env";
@@ -12,6 +14,6 @@ in {
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.linkding.port}";
- };
+ };
};
}
diff --git a/nix/minecraft.nix b/nix/minecraft.nix
index 6b2f70e..8117f6c 100644
--- a/nix/minecraft.nix
+++ b/nix/minecraft.nix
@@ -1,11 +1,18 @@
-{inputs, lib, pkgs, ...}: let
+{
+ inputs,
+ lib,
+ pkgs,
+ ...
+}:
+let
allowMinecraft = pkg: builtins.elem (lib.getName pkg) [ "minecraft-server" ];
unstable = import inputs.nixpkgs-unstable {
inherit (pkgs.stdenv.hostPlatform) system;
config.allowUnfreePredicate = allowMinecraft;
};
-in {
+in
+{
nixpkgs.config.allowUnfreePredicate = allowMinecraft;
environment.systemPackages = [ pkgs.mcrcon ];
diff --git a/nix/options.nix b/nix/options.nix
index faaf2c8..70d6669 100644
--- a/nix/options.nix
+++ b/nix/options.nix
@@ -1,7 +1,9 @@
-{config, lib, ...}: let
+{ config, lib, ... }:
+let
magician = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII42yGEm1u3FxKdgox6Kkp9IBgBERVKrcIjQkrVbEO3m alex@kassouni.net";
hierophant = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJqok+IgFuByRuoKM8HbiM919QmAVFvB2rI7ewgGsCiJ kassouni@hierophant";
-in {
+in
+{
options.my = {
adminKeys = lib.mkOption {
type = with lib.types; listOf singleLineStr;
@@ -22,9 +24,9 @@ in {
};
config.my = {
- adminKeys = [
- hierophant
- magician
+ adminKeys = [
+ hierophant
+ magician
];
# Admins push too; collaborator keys belong here and nowhere else.
diff --git a/nix/site.nix b/nix/site.nix
index 45209ff..9c8278b 100644
--- a/nix/site.nix
+++ b/nix/site.nix
@@ -7,7 +7,10 @@ pkgs.stdenvNoCC.mkDerivation {
# style/ sits outside the zola project because cgit shares its partials
src = pkgs.lib.fileset.toSource {
root = ../.;
- fileset = pkgs.lib.fileset.unions [ ../site ../style ];
+ fileset = pkgs.lib.fileset.unions [
+ ../site
+ ../style
+ ];
};
nativeBuildInputs = [ pkgs.zola ];
diff --git a/nix/ssh.nix b/nix/ssh.nix
index d58a2a1..abf662a 100644
--- a/nix/ssh.nix
+++ b/nix/ssh.nix
@@ -1,4 +1,4 @@
-{...}:{
+{ ... }: {
services.fail2ban.enable = true;
services.openssh = {
@@ -7,7 +7,10 @@
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
- AllowUsers = [ "kassouni" "git" ];
+ AllowUsers = [
+ "kassouni"
+ "git"
+ ];
KbdInteractiveAuthentication = false;
PubkeyAuthentication = true;
};
diff --git a/nix/web.nix b/nix/web.nix
index 82a0dfb..3f85d84 100644
--- a/nix/web.nix
+++ b/nix/web.nix
@@ -1,6 +1,8 @@
-{inputs, pkgs, ...}: let
+{ inputs, pkgs, ... }:
+let
domain = "kassouni.net";
-in {
+in
+{
services.nginx = {
enable = true;
recommendedGzipSettings = true;
@@ -29,5 +31,8 @@ in {
defaults.email = "alex@${domain}";
};
- networking.firewall.allowedTCPPorts = [ 80 443 ];
+ networking.firewall.allowedTCPPorts = [
+ 80
+ 443
+ ];
}