Reformat with alejandra

This commit is contained in:
Invariantspace 2024-08-14 11:14:20 -07:00
parent 7b2b5b3b80
commit 52a81ddb21
No known key found for this signature in database
GPG key ID: EBC4A20067373921
53 changed files with 764 additions and 746 deletions

View file

@ -1,5 +1,8 @@
{ config, lib, ... }: {
config,
lib,
...
}:
with lib; { with lib; {
options.constants = { options.constants = {
domain = mkOption { domain = mkOption {
@ -50,7 +53,10 @@ with lib; {
}; };
privateKeyFiles = mkOption { privateKeyFiles = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = if config.services.openssh.enable then builtins.map (key: key.path) config.services.openssh.hostKeys else [ "/root/.ssh/${config.networking.hostName}" ]; default =
if config.services.openssh.enable
then builtins.map (key: key.path) config.services.openssh.hostKeys
else ["/root/.ssh/${config.networking.hostName}"];
description = '' description = ''
The private key files for sops. The private key files for sops.
''; '';

View file

@ -1,6 +1,4 @@
{ inputs, ... }: {inputs, ...}: {
{
imports = with inputs; [ imports = with inputs; [
home-manager.nixosModules.default home-manager.nixosModules.default
sops-nix.nixosModules.default sops-nix.nixosModules.default

View file

@ -1,6 +1,4 @@
{ config, ... }: {config, ...}: {
{
sops = with config.constants; { sops = with config.constants; {
age.sshKeyPaths = privateKeyFiles; age.sshKeyPaths = privateKeyFiles;
defaultSopsFile = sopsFile; defaultSopsFile = sopsFile;

View file

@ -1,11 +1,12 @@
{ config, pkgs, ... }: {
config,
let pkgs,
...
}: let
home = config.constants.homeDir; home = config.constants.homeDir;
usr = config.constants.userName; usr = config.constants.userName;
usrPwdFile = "users/${usr}/password"; usrPwdFile = "users/${usr}/password";
in in {
{
console.enable = false; console.enable = false;
fonts = { fonts = {
@ -24,8 +25,12 @@ in
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
users.${usr} = { config, osConfig, pkgs, ... }: users.${usr} = {
{ config,
osConfig,
pkgs,
...
}: {
home = { home = {
file.kvantum = { file.kvantum = {
enable = config.programs.plasma.enable; enable = config.programs.plasma.enable;
@ -35,24 +40,32 @@ in
theme=Sweet-Ambar-Blue theme=Sweet-Ambar-Blue
''; '';
}; };
packages = with pkgs; [ packages = with pkgs;
[
alejandra
dua dua
fd fd
nil nil
nixpkgs-fmt
rclone rclone
sops sops
] ++ (if config.programs.plasma.enable then [ ]
++ (
if config.programs.plasma.enable
then
[
sweet-ambar-blue sweet-ambar-blue
wallpaper-engine-plasma6-plugin wallpaper-engine-plasma6-plugin
yorha-sound-theme yorha-sound-theme
] ++ (with kdePackages; [ ]
++ (with kdePackages; [
qtmultimedia qtmultimedia
qtstyleplugin-kvantum qtstyleplugin-kvantum
qtwebchannel qtwebchannel
qtwebengine qtwebengine
qtwebsockets qtwebsockets
]) else [ ]); ])
else []
);
stateVersion = osConfig.system.stateVersion; stateVersion = osConfig.system.stateVersion;
}; };
programs = { programs = {
@ -63,6 +76,7 @@ in
nix-direnv.enable = true; nix-direnv.enable = true;
}; };
eza.enable = true; eza.enable = true;
firefox.enable = config.programs.plasma.enable;
fish.enable = true; fish.enable = true;
fzf.enable = true; fzf.enable = true;
git = { git = {
@ -91,7 +105,22 @@ in
theme = "base16_transparent"; theme = "base16_transparent";
}; };
}; };
kitty = {
enable = config.programs.plasma.enable;
settings = {
background_opacity = "0.96";
remember_window_size = "no";
};
theme = "Tokyo Night Moon";
};
plasma = { plasma = {
configFile = {
kded5rc.Module-browserintegrationreminder.autoload = false;
kdeglobals.General = {
TerminalApplication = "kitty";
TerminalService = "kitty.desktop";
};
};
input.touchpads = [ input.touchpads = [
{ {
enable = false; enable = false;
@ -193,7 +222,6 @@ in
options = ["--cmd cd"]; options = ["--cmd cd"];
}; };
}; };
xdg.enable = true;
}; };
}; };
@ -209,12 +237,14 @@ in
services = { services = {
openssh = { openssh = {
hostKeys = [{ hostKeys = [
{
comment = "host@${config.networking.hostName}"; comment = "host@${config.networking.hostName}";
path = "/etc/ssh/host"; path = "/etc/ssh/host";
rounds = 100; rounds = 100;
type = "ed25519"; type = "ed25519";
}]; }
];
settings = { settings = {
PasswordAuthentication = false; PasswordAuthentication = false;
KbdInteractiveAuthentication = false; KbdInteractiveAuthentication = false;

View file

@ -13,15 +13,19 @@
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
}; };
outputs = inputs@{ self, nixpkgs, nix-custom, ... }: outputs = inputs @ {
let self,
nixpkgs,
nix-custom,
...
}: let
linuxCfgDir = ./linux; linuxCfgDir = ./linux;
templateDir = ./template; templateDir = ./template;
in in {
{ nixosConfigurations =
nixosConfigurations = builtins.mapAttrs builtins.mapAttrs
(instance: _: (instance: _:
nixpkgs.lib.nixosSystem ({ nixpkgs.lib.nixosSystem {
modules = [ modules = [
# Import config from folder # Import config from folder
(linuxCfgDir + "/${instance}") (linuxCfgDir + "/${instance}")
@ -46,14 +50,14 @@
}) })
]; ];
specialArgs = {inherit inputs;}; specialArgs = {inherit inputs;};
})) })
(builtins.readDir linuxCfgDir); (builtins.readDir linuxCfgDir);
templates = builtins.mapAttrs templates =
builtins.mapAttrs
(template: _: { (template: _: {
path = templateDir + "/${template}"; path = templateDir + "/${template}";
description = "Template flake setup: ${template}"; description = "Template flake setup: ${template}";
}) })
(builtins.readDir templateDir); (builtins.readDir templateDir);
}; };
} }

View file

@ -1,16 +1,15 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{pkgs, ...}: {
{ pkgs, ... }:
{
# Configure boot # Configure boot
boot = { boot = {
initrd.systemd.enable = true; initrd.systemd.enable = true;
loader = { loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
grub = let yorha = pkgs.yorha-grub-theme; in { grub = let
yorha = pkgs.yorha-grub-theme;
in {
enable = true; enable = true;
device = "nodev"; device = "nodev";
efiSupport = true; efiSupport = true;
@ -46,4 +45,3 @@
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment? system.stateVersion = "24.05"; # Did you read the comment?
} }

View file

@ -1,6 +1,4 @@
{ inputs, ... }: {inputs, ...}: {
{
imports = with inputs; [ imports = with inputs; [
disko.nixosModules.default disko.nixosModules.default
hardware.nixosModules.asus-zephyrus-ga402 hardware.nixosModules.asus-zephyrus-ga402

View file

@ -1,9 +1,10 @@
{ config, pkgs, ... }:
let
usr = config.constants.userName;
in
{ {
config,
pkgs,
...
}: let
usr = config.constants.userName;
in {
hardware = { hardware = {
bluetooth.enable = true; bluetooth.enable = true;
graphics.enable = true; graphics.enable = true;

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
disko.devices = { disko.devices = {
# Partition the physical disk # Partition the physical disk
disk.storage = { disk.storage = {

View file

@ -1,9 +1,19 @@
{ config, pkgs, ... }: {
config,
let usr = config.constants.userName; in { pkgs,
home-manager.users.${usr} = { config, pkgs, ... }: ...
let xdgCfg = config.xdg; in { }: let
home.packages = with pkgs; [ usr = config.constants.userName;
in {
home-manager.users.${usr} = {
config,
pkgs,
...
}: let
xdgCfg = config.xdg;
in {
home.packages = with pkgs;
[
feishin feishin
hunspell hunspell
hunspellDicts.en-us-large hunspellDicts.en-us-large
@ -20,13 +30,13 @@ let usr = config.constants.userName; in {
thunderbird thunderbird
winetricks winetricks
wineWowPackages.stagingFull wineWowPackages.stagingFull
] ++ (with kdePackages; [ ]
++ (with kdePackages; [
k3b k3b
kdepim-addons kdepim-addons
merkuro merkuro
]); ]);
programs = { programs = {
firefox.enable = true;
git.signing = { git.signing = {
key = "0x6A815D4CB1637AAC"; key = "0x6A815D4CB1637AAC";
signByDefault = true; signByDefault = true;
@ -35,14 +45,6 @@ let usr = config.constants.userName; in {
enable = true; enable = true;
homedir = "${xdgCfg.dataHome}/gnupg"; homedir = "${xdgCfg.dataHome}/gnupg";
}; };
kitty = {
enable = true;
settings = {
background_opacity = "0.96";
remember_window_size = "no";
};
theme = "Tokyo Night Moon";
};
mpv = { mpv = {
enable = true; enable = true;
config = { config = {

View file

@ -1,11 +1,14 @@
# 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, ... }:
{ {
imports = config,
[ lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
networking = { networking = {
hostId = "30f8f777"; hostId = "30f8f777";
networkmanager = { networkmanager = {

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
services.syncthing = { services.syncthing = {
enable = true; enable = true;
settings.folders = { settings.folders = {
@ -21,4 +19,3 @@
}; };
}; };
} }

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
services.tailscale = { services.tailscale = {
enable = true; enable = true;
port = 22276; port = 22276;

View file

@ -1,6 +1,8 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
boot = { boot = {
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
loader.grub.zfsSupport = true; loader.grub.zfsSupport = true;
@ -15,11 +17,13 @@
enable = true; enable = true;
settings = { settings = {
global = { global = {
logging = [{ logging = [
{
type = "syslog"; type = "syslog";
level = "info"; level = "info";
format = "human"; format = "human";
}]; }
];
}; };
jobs = [ jobs = [
{ {
@ -32,11 +36,13 @@
interval = "1h"; interval = "1h";
}; };
pruning = { pruning = {
keep = [{ keep = [
{
type = "grid"; type = "grid";
regex = "^zrepl-.*"; regex = "^zrepl-.*";
grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "24x1h" "7x1d" "4x1w"]; grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "24x1h" "7x1d" "4x1w"];
}]; }
];
}; };
} }
{ {
@ -57,12 +63,19 @@
}; };
snapshotting = {type = "manual";}; snapshotting = {type = "manual";};
pruning = { pruning = {
keep_sender = [{ type = "regex"; regex = ".*"; }]; keep_sender = [
keep_receiver = [{ {
type = "regex";
regex = ".*";
}
];
keep_receiver = [
{
type = "grid"; type = "grid";
regex = "^zrepl-.*"; regex = "^zrepl-.*";
grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "365x1d" "52x1w"]; grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "365x1d" "52x1w"];
}]; }
];
}; };
} }
{ {
@ -79,4 +92,3 @@
}; };
}; };
} }

View file

@ -1,10 +1,7 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{...}: {
{ ... }:
{
# Configure boot loader # Configure boot loader
boot.loader = { boot.loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;

View file

@ -1,6 +1,4 @@
{ inputs, ... }: {inputs, ...}: {
{
imports = with inputs; [ imports = with inputs; [
hardware.nixosModules.common-cpu-intel hardware.nixosModules.common-cpu-intel
../../common ../../common

View file

@ -1,11 +1,14 @@
# 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, ... }:
{ {
imports = config,
[ lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
@ -14,14 +17,12 @@
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = []; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{
device = "/dev/disk/by-uuid/9f65c4b3-1c87-42a0-8c1d-f3c1ff2e71b1"; device = "/dev/disk/by-uuid/9f65c4b3-1c87-42a0-8c1d-f3c1ff2e71b1";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{
device = "/dev/disk/by-uuid/1C5A-E5B5"; device = "/dev/disk/by-uuid/1C5A-E5B5";
fsType = "vfat"; fsType = "vfat";
}; };

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
networking = { networking = {
hostId = "3ddd2ad2"; hostId = "3ddd2ad2";
nftables.enable = true; nftables.enable = true;

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
services.tailscale = { services.tailscale = {
enable = true; enable = true;
port = 12765; port = 12765;

View file

@ -1,6 +1,4 @@
{ config, ... }: {config, ...}: {
{
services.matrix-conduit = { services.matrix-conduit = {
enable = true; enable = true;
settings.global = with config.constants; { settings.global = with config.constants; {

View file

@ -1,10 +1,7 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`). # and in the NixOS manual (accessible by running `nixos-help`).
{...}: {
{ ... }:
{
# Configure boot loader # Configure boot loader
boot.loader = { boot.loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
@ -22,4 +19,3 @@
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment? system.stateVersion = "24.05"; # Did you read the comment?
} }

View file

@ -1,6 +1,4 @@
{ inputs, ... }: {inputs, ...}: {
{
imports = with inputs; [ imports = with inputs; [
disko.nixosModules.default disko.nixosModules.default
hardware.nixosModules.common-cpu-amd hardware.nixosModules.common-cpu-amd

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
disko.devices = { disko.devices = {
# Partition the physical disk # Partition the physical disk
disk.storage = { disk.storage = {
@ -77,5 +75,4 @@
}; };
}; };
}; };
} }

View file

@ -1,6 +1,4 @@
{ config, ... }: {config, ...}: {
{
services.forgejo = { services.forgejo = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,11 +1,14 @@
# 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, ... }:
{ {
imports = config,
[ lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];

View file

@ -1,11 +1,12 @@
{ config, pkgs, ... }: {
config,
let pkgs,
...
}: let
const = config.constants; const = config.constants;
ports = const.port; ports = const.port;
usr = const.userName; usr = const.userName;
in in {
{
hardware.graphics.enable = true; hardware.graphics.enable = true;
services = { services = {

View file

@ -1,6 +1,4 @@
{ config, ... }: {config, ...}: {
{
networking = { networking = {
firewall.trustedInterfaces = [config.services.tailscale.interfaceName]; firewall.trustedInterfaces = [config.services.tailscale.interfaceName];
hostId = "e6449321"; hostId = "e6449321";

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
services.syncthing = { services.syncthing = {
enable = true; enable = true;
settings.folders.music = { settings.folders.music = {

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
services.tailscale = { services.tailscale = {
enable = true; enable = true;
port = 25555; port = 25555;

View file

@ -1,6 +1,4 @@
{ config, ... }: {config, ...}: {
{
services.writefreely = with config.constants; { services.writefreely = with config.constants; {
enable = true; enable = true;
host = "writefreely.${domain}"; host = "writefreely.${domain}";

View file

@ -1,7 +1,4 @@
{ config, ... }: {config, ...}: {
{
boot = { boot = {
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
loader.grub.zfsSupport = true; loader.grub.zfsSupport = true;
@ -11,6 +8,4 @@
autoScrub.enable = true; autoScrub.enable = true;
trim.enable = true; trim.enable = true;
}; };
} }

View file

@ -1,10 +1,7 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`). # and in the NixOS manual (accessible by running `nixos-help`).
{...}: {
{ ... }:
{
# Configuration boot # Configuration boot
boot.loader = { boot.loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
@ -27,6 +24,4 @@
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment? system.stateVersion = "24.05"; # Did you read the comment?
} }

View file

@ -1,6 +1,4 @@
{ inputs, ... }: {inputs, ...}: {
{
imports = with inputs; [ imports = with inputs; [
disko.nixosModules.default disko.nixosModules.default
jovian.nixosModules.default jovian.nixosModules.default

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
disko.devices = { disko.devices = {
# Partition the physical disk # Partition the physical disk
disk.storage = { disk.storage = {
@ -69,5 +67,4 @@
}; };
}; };
}; };
} }

View file

@ -1,10 +1,12 @@
{ config, inputs, pkgs, ... }: {
config,
let inputs,
pkgs,
...
}: let
usr = config.constants.userName; usr = config.constants.userName;
jovianPkgs = pkgs.extend inputs.jovian.overlays.default; jovianPkgs = pkgs.extend inputs.jovian.overlays.default;
in in {
{
home-manager.users.${usr} = { home-manager.users.${usr} = {
home.packages = with jovianPkgs; [ home.packages = with jovianPkgs; [
feishin feishin
@ -20,10 +22,7 @@ in
winetricks winetricks
wineWowPackages.stagingFull wineWowPackages.stagingFull
]; ];
programs = { programs.plasma.enable = true;
firefox.enable = true;
plasma.enable = true;
};
}; };
jovian = { jovian = {
devices.steamdeck = { devices.steamdeck = {

View file

@ -1,11 +1,14 @@
# 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, ... }:
{ {
imports = config,
[ lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];

View file

@ -1,6 +1,4 @@
{ config, ... }: {config, ...}: {
{
networking = { networking = {
firewall.trustedInterfaces = [config.services.tailscale.interfaceName]; firewall.trustedInterfaces = [config.services.tailscale.interfaceName];
hostId = "74247225"; hostId = "74247225";

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
services.syncthing = { services.syncthing = {
enable = true; enable = true;
settings.folders = { settings.folders = {

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
services.tailscale = { services.tailscale = {
enable = true; enable = true;
port = 25172; port = 25172;

View file

@ -1,9 +1,6 @@
{ ... }: {...}: {
{
services.zfs = { services.zfs = {
autoScrub.enable = true; autoScrub.enable = true;
trim.enable = true; trim.enable = true;
}; };
} }

View file

@ -1,11 +1,12 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
services.caddy = { services.caddy = {
enable = true; enable = true;
email = config.constants.postMaster; email = config.constants.postMaster;
virtualHosts = virtualHosts = let
let
dn = config.constants.domain; dn = config.constants.domain;
homeSrv = s: "nebula:${portStr.${s}}"; homeSrv = s: "nebula:${portStr.${s}}";
localSrv = s: "${config.constants.localhost}:${portStr.${s}}"; localSrv = s: "${config.constants.localhost}:${portStr.${s}}";
@ -13,9 +14,10 @@
mtfqdn = "matrix.${dn}"; mtfqdn = "matrix.${dn}";
portStr = builtins.mapAttrs (n: v: toString v) config.constants.port; portStr = builtins.mapAttrs (n: v: toString v) config.constants.port;
wn = s: "/.well-known/${s}"; wn = s: "/.well-known/${s}";
in in {
{ "${dn}".extraConfig = let
"${dn}".extraConfig = let wnm = wn "matrix"; in '' wnm = wn "matrix";
in ''
header ${wnm}/* Content-Type application/json header ${wnm}/* Content-Type application/json
header ${wnm}/* Access-Control-Allow-Origin * header ${wnm}/* Access-Control-Allow-Origin *
respond ${wnm}/server `{ "m.server": "${mtfqdn}:${portStr.https}" }` respond ${wnm}/server `{ "m.server": "${mtfqdn}:${portStr.https}" }`
@ -74,5 +76,4 @@
webroot = "/var/lib/acme/acme-challenge"; webroot = "/var/lib/acme/acme-challenge";
}; };
}; };
} }

View file

@ -1,7 +1,4 @@
{ ... }: {...}: {
{
boot = { boot = {
tmp.cleanOnBoot = true; tmp.cleanOnBoot = true;
loader.grub.device = "/dev/sda"; loader.grub.device = "/dev/sda";

View file

@ -1,6 +1,4 @@
{ inputs, ... }: {inputs, ...}: {
{
imports = with inputs; [ imports = with inputs; [
mailserver.nixosModules.default mailserver.nixosModules.default
../../common ../../common

View file

@ -1,9 +1,13 @@
# 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 = [(modulesPath + "/profiles/qemu-guest.nix")]; imports = [(modulesPath + "/profiles/qemu-guest.nix")];
# boot.initrd.availableKernelModules = # boot.initrd.availableKernelModules =
@ -19,8 +23,10 @@
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi"]; boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi"];
boot.initrd.kernelModules = ["nvme"]; boot.initrd.kernelModules = ["nvme"];
fileSystems."/" = { device = "/dev/sda3"; fsType = "ext4"; }; fileSystems."/" = {
device = "/dev/sda3";
fsType = "ext4";
};
swapDevices = []; swapDevices = [];

View file

@ -1,6 +1,4 @@
{ config, ... }: {config, ...}: {
{
services = { services = {
headscale = with config.constants; { headscale = with config.constants; {
enable = true; enable = true;

View file

@ -1,11 +1,8 @@
{ config, ... }: {config, ...}: let
let
dn = config.constants.domain; dn = config.constants.domain;
usr = config.constants.userName; usr = config.constants.userName;
mailSecret = "mail/${usr}/password"; mailSecret = "mail/${usr}/password";
in in {
{
mailserver = { mailserver = {
enable = true; enable = true;
fqdn = "mail.${dn}"; fqdn = "mail.${dn}";

View file

@ -1,6 +1,6 @@
{ config, ... }: {config, ...}: let
hn = config.networking.hostName;
let hn = config.networking.hostName; in { in {
networking = { networking = {
firewall.allowedTCPPorts = with config.constants.port; [http https]; firewall.allowedTCPPorts = with config.constants.port; [http https];
hostId = "2cadb253"; hostId = "2cadb253";

View file

@ -1,9 +1,9 @@
{ config, ... }: {config, ...}: {
{
services.vaultwarden = { services.vaultwarden = {
enable = true; enable = true;
config = let const = config.constants; in { config = let
const = config.constants;
in {
# Disable signup # Disable signup
SIGNUPS_ALLOWED = false; SIGNUPS_ALLOWED = false;
# Specify service port # Specify service port

View file

@ -4,9 +4,13 @@
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs = {
flake-utils.lib.eachDefaultSystem (system: self,
let pkgs = nixpkgs.legacyPackages.${system}; flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in { in {
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
packages = with pkgs; [texlive.combined.scheme-full]; packages = with pkgs; [texlive.combined.scheme-full];

View file

@ -4,9 +4,13 @@
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs = {
flake-utils.lib.eachDefaultSystem (system: self,
let pkgs = nixpkgs.legacyPackages.${system}; flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in { in {
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [

View file

@ -10,9 +10,15 @@
}; };
}; };
outputs = { self, crane, fenix, flake-utils, nixpkgs, advisory-db }: outputs = {
flake-utils.lib.eachDefaultSystem (system: self,
let crane,
fenix,
flake-utils,
nixpkgs,
advisory-db,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
fenixPkgs = fenix.packages.${system}; fenixPkgs = fenix.packages.${system};
craneLib = crane.mkLib pkgs; craneLib = crane.mkLib pkgs;
@ -22,9 +28,11 @@
commonArgs = with pkgs; { commonArgs = with pkgs; {
inherit src; inherit src;
strictDeps = true; strictDeps = true;
buildInputs = [ buildInputs =
[
# Add additional build inputs here # Add additional build inputs here
] ++ lib.optionals stdenv.isDarwin [ ]
++ lib.optionals stdenv.isDarwin [
# Additional darwin specific inputs can be set here # Additional darwin specific inputs can be set here
libiconv libiconv
]; ];
@ -33,7 +41,8 @@
# MY_CUSTOM_VAR = "some value"; # MY_CUSTOM_VAR = "some value";
}; };
craneLibLLvmTools = craneLib.overrideToolchain craneLibLLvmTools =
craneLib.overrideToolchain
(fenixPkgs.complete.withComponents [ (fenixPkgs.complete.withComponents [
"cargo" "cargo"
"llvm-tools" "llvm-tools"
@ -46,11 +55,11 @@
# Build the actual crate itself, reusing the dependency # Build the actual crate itself, reusing the dependency
# artifacts from above. # artifacts from above.
crate = craneLib.buildPackage (commonArgs // { crate = craneLib.buildPackage (commonArgs
// {
inherit cargoArtifacts; inherit cargoArtifacts;
}); });
in in {
{
checks = { checks = {
# Build the crate as part of `nix flake check` for convenience # Build the crate as part of `nix flake check` for convenience
inherit crate; inherit crate;
@ -61,12 +70,14 @@
# Note that this is done as a separate derivation so that # Note that this is done as a separate derivation so that
# we can block the CI if there are issues here, but not # we can block the CI if there are issues here, but not
# prevent downstream consumers from building our crate by itself. # prevent downstream consumers from building our crate by itself.
clippy = craneLib.cargoClippy (commonArgs // { clippy = craneLib.cargoClippy (commonArgs
// {
inherit cargoArtifacts; inherit cargoArtifacts;
cargoClippyExtraArgs = "--all-targets -- --deny warnings"; cargoClippyExtraArgs = "--all-targets -- --deny warnings";
}); });
doc = craneLib.cargoDoc (commonArgs // { doc = craneLib.cargoDoc (commonArgs
// {
inherit cargoArtifacts; inherit cargoArtifacts;
}); });
@ -88,17 +99,21 @@
# Run tests with cargo-nextest # Run tests with cargo-nextest
# Consider setting `doCheck = false` on `my-crate` if you do not want # Consider setting `doCheck = false` on `my-crate` if you do not want
# the tests to run twice # the tests to run twice
nextest = craneLib.cargoNextest (commonArgs // { nextest = craneLib.cargoNextest (commonArgs
// {
inherit cargoArtifacts; inherit cargoArtifacts;
partitions = 1; partitions = 1;
partitionType = "count"; partitionType = "count";
}); });
}; };
packages = { packages =
{
default = crate; default = crate;
} // pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) { }
my-crate-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs // { // pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
my-crate-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs
// {
inherit cargoArtifacts; inherit cargoArtifacts;
}); });
}; };

View file

@ -4,9 +4,13 @@
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs = {
flake-utils.lib.eachDefaultSystem (system: self,
let pkgs = nixpkgs.legacyPackages.${system}; flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in { in {
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
packages = with pkgs; [typst]; packages = with pkgs; [typst];