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; {
options.constants = {
domain = mkOption {
@ -50,7 +53,10 @@ with lib; {
};
privateKeyFiles = mkOption {
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 = ''
The private key files for sops.
'';

View file

@ -1,6 +1,4 @@
{ inputs, ... }:
{
{inputs, ...}: {
imports = with inputs; [
home-manager.nixosModules.default
sops-nix.nixosModules.default
@ -9,5 +7,5 @@
./users.nix
];
home-manager.sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ];
home-manager.sharedModules = [inputs.plasma-manager.homeManagerModules.plasma-manager];
}

View file

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

View file

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

View file

@ -13,20 +13,24 @@
sops-nix.url = "github:Mic92/sops-nix";
};
outputs = inputs@{ self, nixpkgs, nix-custom, ... }:
let
outputs = inputs @ {
self,
nixpkgs,
nix-custom,
...
}: let
linuxCfgDir = ./linux;
templateDir = ./template;
in
{
nixosConfigurations = builtins.mapAttrs
in {
nixosConfigurations =
builtins.mapAttrs
(instance: _:
nixpkgs.lib.nixosSystem ({
nixpkgs.lib.nixosSystem {
modules = [
# Import config from folder
(linuxCfgDir + "/${instance}")
# Setup Nix
({ pkgs, ... }: {
({pkgs, ...}: {
networking.hostName = instance;
nix = {
gc = {
@ -35,25 +39,25 @@
};
settings = {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
trusted-substituters = [ "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" ];
experimental-features = ["nix-command" "flakes"];
trusted-substituters = ["https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"];
};
};
nixpkgs = {
config.allowUnfree = true;
overlays = [ nix-custom.overlays.default ];
overlays = [nix-custom.overlays.default];
};
})
];
specialArgs = { inherit inputs; };
}))
specialArgs = {inherit inputs;};
})
(builtins.readDir linuxCfgDir);
templates = builtins.mapAttrs
templates =
builtins.mapAttrs
(template: _: {
path = templateDir + "/${template}";
description = "Template flake setup: ${template}";
})
(builtins.readDir templateDir);
};
}

View file

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

View file

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

View file

@ -1,15 +1,16 @@
{ config, pkgs, ... }:
let
usr = config.constants.userName;
in
{
config,
pkgs,
...
}: let
usr = config.constants.userName;
in {
hardware = {
bluetooth.enable = true;
graphics.enable = true;
openrazer = {
enable = true;
users = [ usr ];
users = [usr];
};
};
@ -32,7 +33,7 @@ in
kanata = {
enable = true;
keyboards.core = {
devices = [ "/dev/input/by-id/usb-ASUSTeK_Computer_Inc._N-KEY_Device-if02-event-kbd" ];
devices = ["/dev/input/by-id/usb-ASUSTeK_Computer_Inc._N-KEY_Device-if02-event-kbd"];
config = ''
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del
@ -86,7 +87,7 @@ in
printing.enable = true;
};
users.users.${usr}.extraGroups = [ "adbusers" "cdrom" ];
users.users.${usr}.extraGroups = ["adbusers" "cdrom"];
virtualisation = {
containers.enable = true;

View file

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

View file

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

View file

@ -1,18 +1,21 @@
# 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 =
[
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usbhid" "sdhci_pci"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
# 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

View file

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

View file

@ -1,24 +1,21 @@
{ ... }:
{
{...}: {
services.syncthing = {
enable = true;
settings.folders = {
game-data = {
devices = [ "protostar" ];
devices = ["protostar"];
path = "~/Game/data";
type = "sendonly";
};
game-save = {
devices = [ "protostar" ];
devices = ["protostar"];
path = "~/Game/save";
};
music = {
devices = [ "nebula" ];
devices = ["nebula"];
path = "~/Music";
type = "sendonly";
};
};
};
}

View file

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

View file

@ -1,6 +1,8 @@
{ config, lib, ... }:
{
config,
lib,
...
}: {
boot = {
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
loader.grub.zfsSupport = true;
@ -15,60 +17,71 @@
enable = true;
settings = {
global = {
logging = [{
logging = [
{
type = "syslog";
level = "info";
format = "human";
}];
}
];
};
jobs = [
{
name = "snapshot";
type = "snap";
filesystems = { "zroot/main/home" = true; };
filesystems = {"zroot/main/home" = true;};
snapshotting = {
type = "periodic";
prefix = "zrepl-";
interval = "1h";
};
pruning = {
keep = [{
keep = [
{
type = "grid";
regex = "^zrepl-.*";
grid = lib.concatStringsSep " | " [ "1x1h(keep=all)" "24x1h" "7x1d" "4x1w" ];
}];
grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "24x1h" "7x1d" "4x1w"];
}
];
};
}
{
name = "push-to-local-drive";
type = "push";
send = { encrypted = true; };
send = {encrypted = true;};
connect = {
type = "local";
listener_name = "sink-to-local-drive";
client_identity = config.networking.hostName;
};
filesystems = { "zroot/main/home" = true; };
filesystems = {"zroot/main/home" = true;};
replication = {
protection = {
initial = "guarantee_resumability";
incremental = "guarantee_incremental";
};
};
snapshotting = { type = "manual"; };
snapshotting = {type = "manual";};
pruning = {
keep_sender = [{ type = "regex"; regex = ".*"; }];
keep_receiver = [{
keep_sender = [
{
type = "regex";
regex = ".*";
}
];
keep_receiver = [
{
type = "grid";
regex = "^zrepl-.*";
grid = lib.concatStringsSep " | " [ "1x1h(keep=all)" "365x1d" "52x1w" ];
}];
grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "365x1d" "52x1w"];
}
];
};
}
{
name = "sink-to-local-drive";
type = "sink";
recv = { placeholder = { encryption = "off"; }; };
recv = {placeholder = {encryption = "off";};};
root_fs = "zbackup";
serve = {
type = "local";
@ -79,4 +92,3 @@
};
};
}

View file

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

View file

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

View file

@ -1,32 +1,33 @@
# 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 =
[
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usbhid" "uas" "sd_mod" "sdhci_acpi" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "usbhid" "uas" "sd_mod" "sdhci_acpi"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{
fileSystems."/" = {
device = "/dev/disk/by-uuid/9f65c4b3-1c87-42a0-8c1d-f3c1ff2e71b1";
fsType = "ext4";
};
fileSystems."/boot" =
{
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/1C5A-E5B5";
fsType = "vfat";
};
swapDevices = [ ];
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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,18 +1,21 @@
# 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 =
[
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "uas" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usbhid" "uas" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
# 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

View file

@ -1,11 +1,12 @@
{ config, pkgs, ... }:
let
{
config,
pkgs,
...
}: let
const = config.constants;
ports = const.port;
usr = const.userName;
in
{
in {
hardware.graphics.enable = true;
services = {
@ -38,7 +39,7 @@ in
};
};
sops.secrets.aria2 = { };
sops.secrets.aria2 = {};
users.users.${usr}.extraGroups = [ config.systemd.services.aria2.serviceConfig.Group ];
users.users.${usr}.extraGroups = [config.systemd.services.aria2.serviceConfig.Group];
}

View file

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

View file

@ -1,10 +1,8 @@
{ ... }:
{
{...}: {
services.syncthing = {
enable = true;
settings.folders.music = {
devices = [ "blitzar" ];
devices = ["blitzar"];
path = "~/Music";
type = "receiveonly";
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,18 +1,21 @@
# 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 =
[
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usbhid" "sdhci_pci"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
# 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

View file

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

View file

@ -1,16 +1,14 @@
{ ... }:
{
{...}: {
services.syncthing = {
enable = true;
settings.folders = {
game-data = {
devices = [ "blitzar" ];
devices = ["blitzar"];
path = "~/Game/data";
type = "receiveonly";
};
game-save = {
devices = [ "blitzar" ];
devices = ["blitzar"];
path = "~/Game/save";
};
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,28 +1,34 @@
# 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") ];
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
# boot.initrd.availableKernelModules =
# [ "ata_piix" "virtio_pci" "virtio_scsi" "sd_mod" ];
# boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
boot.kernelModules = [];
boot.extraModulePackages = [];
# fileSystems."/" = {
# device = "/dev/disk/by-uuid/6d3bf8cd-1996-45fb-";
# fsType = "ext4";
# };
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = { device = "/dev/sda3"; fsType = "ext4"; };
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi"];
boot.initrd.kernelModules = ["nvme"];
fileSystems."/" = {
device = "/dev/sda3";
fsType = "ext4";
};
swapDevices = [ ];
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

View file

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

View file

@ -1,24 +1,21 @@
{ config, ... }:
let
{config, ...}: let
dn = config.constants.domain;
usr = config.constants.userName;
mailSecret = "mail/${usr}/password";
in
{
in {
mailserver = {
enable = true;
fqdn = "mail.${dn}";
domains = [ dn ];
domains = [dn];
loginAccounts = {
"${usr}@${dn}" = {
aliases = [ config.constants.postMaster ];
aliases = [config.constants.postMaster];
hashedPasswordFile = config.sops.secrets.${mailSecret}.path;
};
};
certificateScheme = "acme";
};
sops.secrets.${mailSecret} = { };
sops.secrets.${mailSecret} = {};
}

View file

@ -1,8 +1,8 @@
{ config, ... }:
let hn = config.networking.hostName; in {
{config, ...}: let
hn = config.networking.hostName;
in {
networking = {
firewall.allowedTCPPorts = with config.constants.port; [ http https ];
firewall.allowedTCPPorts = with config.constants.port; [http https];
hostId = "2cadb253";
nftables.enable = true;
};
@ -16,5 +16,5 @@ let hn = config.networking.hostName; in {
openssh.enable = true;
};
sops.secrets."cloudflare/${hn}" = { };
sops.secrets."cloudflare/${hn}" = {};
}

View file

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

View file

@ -4,12 +4,16 @@
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
outputs = {
self,
flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [ texlive.combined.scheme-full ];
packages = with pkgs; [texlive.combined.scheme-full];
TEXMFHOME = "$XDG_DATA_HOME/texmf";
TEXMFVAR = "$XDG_CACHE_HOME/texlive/texmf-var";
EXMFCONFIG = "$XDG_CONFIG_HOME/texlive/texmf-config";

View file

@ -4,14 +4,18 @@
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
outputs = {
self,
flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
(rWrapper.override {
packages = with rPackages; [ tidyverse ];
packages = with rPackages; [tidyverse];
})
];
};

View file

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

View file

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