aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-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
7 files changed, 68 insertions, 30 deletions
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
+ ];
}