fixed linting

pull/208/head
Vivian 2023-09-25 11:56:02 +02:00
parent 290ce7f72d
commit ea83c79fb3
59 changed files with 2843 additions and 2638 deletions

View File

@ -46,8 +46,17 @@
attic.url = "github:zhaofengli/attic";
};
outputs = { self, nixpkgs, nixpkgs_stable, vault-secrets, colmena
, nixos-generators, nur, attic, ... }@inputs:
outputs =
{ self
, nixpkgs
, nixpkgs_stable
, vault-secrets
, colmena
, nixos-generators
, nur
, attic
, ...
}@inputs:
let
inherit (nixpkgs) lib;
@ -81,7 +90,8 @@
source /etc/set-environment
nix repl --file "${./.}/repl.nix" $@
'';
in {
in
{
# Make the nixosConfigurations for compat reasons (e.g. vault)
nixosConfigurations =
(import (inputs.colmena + "/src/nix/hive/eval.nix") {
@ -93,12 +103,14 @@
}).nodes;
# Make the colmena configuration
colmena = lib.foldr (el: acc: acc // util.mkColmenaHost el) {
colmena = lib.foldr (el: acc: acc // util.mkColmenaHost el)
{
meta = {
inherit specialArgs;
nixpkgs = pkgs;
};
} nixHosts;
}
nixHosts;
packages.${system} = {
inherit apply-local;
@ -137,6 +149,7 @@
statix
terraform
nixfmt
nixpkgs-fmt
nixUnstable
nil
vault

View File

@ -2,10 +2,12 @@
imports =
[ ./users ./modules inputs.vault-secrets.nixosModules.vault-secrets ];
vault-secrets = let
vault-secrets =
let
inherit (config.networking) domain hostName;
server = if domain == "olympus" then "vault" else "vault-0";
in lib.mkIf (domain == "olympus" || domain == "hades") {
in
lib.mkIf (domain == "olympus" || domain == "hades") {
vaultPrefix = "${domain}_secrets/nixos";
vaultAddress = "http://${server}.${domain}:8200/";
approlePrefix = "${domain}-${hostName}";

View File

@ -21,9 +21,26 @@
users.victor = import ./home.nix;
extraSpecialArgs = { inherit inputs; };
};
services = {
# Enable my config for the gnome desktop environment
services.v.gnome.enable = true;
v.gnome.enable = true;
# Enable CUPS to print documents.
printing.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
};
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
@ -42,9 +59,6 @@
LC_TIME = "nl_NL.UTF-8";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Global Packages
environment = { systemPackages = with pkgs; [ wireguard-tools sbctl ]; };
@ -52,18 +66,6 @@
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
virtualisation = {
podman.enable = true;
@ -84,8 +86,10 @@
[ "DejaVuSansMono" "Ubuntu" "DroidSansMono" "NerdFontsSymbolsOnly" ];
})
];
programs = {
steam = {
programs.steam = {
enable = true;
# Open ports in the firewall for Steam Remote Play
remotePlay.openFirewall = true;
@ -94,11 +98,15 @@
};
};
programs.gamemode.enable = true;
programs.adb.enable = true;
gamemode.enable = true;
adb.enable = true;
};
networking = {
# Networking
networking.networkmanager.enable = true;
networking.firewall.checkReversePath = false;
networking.firewall.enable = false;
networkmanager.enable = true;
firewall.checkReversePath = false;
firewall.enable = false;
};
}

View File

@ -5,7 +5,8 @@ let
dnd-5e-latex-template = { pkgs = [ pkgs.v.dnd-5e-latex-template ]; };
};
my-python-packages = ps: with ps; [ pandas requests numpy ];
in {
in
{
home.packages = with pkgs; [
(python3.withPackages my-python-packages)
btop
@ -37,40 +38,43 @@ in {
# Enable my own hm modules
themes.v.catppuccin.enable = true;
programs.v.vscode.enable = true;
programs = {
v.vscode.enable = true;
programs.riff = {
riff = {
enable = true;
direnv = true;
};
programs.firefox.enable = true;
firefox.enable = true;
programs.chromium = {
chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
};
programs.direnv = {
direnv = {
enable = true;
nix-direnv.enable = true;
};
programs.zsh = {
zsh = {
enable = true;
sessionVariables = { DIRENV_LOG_FORMAT = ""; };
};
programs.thunderbird = {
thunderbird = {
enable = true;
profiles.default = {
isDefault = true;
};
};
};
# Syncthing
services.syncthing.enable = true;
xdg.userDirs = let home = config.home.homeDirectory;
xdg.userDirs =
let home = config.home.homeDirectory;
in {
enable = true;
createDirectories = true;

View File

@ -3,10 +3,12 @@ with lib;
let cfg = config.themes.v.catppuccin;
in {
options.themes.v.catppuccin = { enable = mkEnableOption "catppuccin"; };
config = let
config =
let
theme = "Catppuccin-Pink-Dark";
cursorTheme = config.home.pointerCursor.name;
in mkIf cfg.enable {
in
mkIf cfg.enable {
home.pointerCursor = {
name = "Bibata_Ghost";
size = 24;

View File

@ -65,12 +65,14 @@ in {
comment-nvim = { enable = true; };
lsp = {
enable = true;
servers.nil_ls.enable = true;
servers.rust-analyzer.enable = true;
servers.pyright.enable = true;
servers.elixirls.enable = true;
servers.clangd.enable = true;
servers.yamlls.enable = true;
servers = {
nil_ls.enable = true;
rust-analyzer.enable = true;
pyright.enable = true;
elixirls.enable = true;
clangd.enable = true;
yamlls.enable = true;
};
};
trouble.enable = true;
lspkind.enable = true;

View File

@ -15,7 +15,8 @@ let
ptr6Data = { hostname, realm, ip6, ... }: ''"${ip6} ${hostname}.${realm}"'';
cfg = config.services.v.dns;
in {
in
{
options.services.v.dns = {
enable = mkEnableOption "v.dns";
@ -47,7 +48,7 @@ in {
config = mkIf cfg.enable {
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ 53 ] ;
allowedTCPPorts = [ 53 ];
allowedUDPPorts = [ 53 ];
};
services.prometheus.exporters.unbound = mkIf cfg.enableMetrics {

View File

@ -14,22 +14,28 @@ in {
};
config = mkIf cfg.enable {
services.xserver.enable = true;
services.xserver.excludePackages = [ pkgs.xterm ];
services = {
xserver = {
enable = true;
excludePackages = [ pkgs.xterm ];
# Configure keymap in X11
layout = "us";
xkbVariant = "altgr-intl";
# Enable the GNOME Desktop Environment.
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
dbus.enable = true;
udisks2.enable = true;
};
# Add Home-manager dconf stuff
home-manager.sharedModules = mkIf cfg.hm [ ./hm.nix ];
# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "altgr-intl";
};
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
environment.gnome.excludePackages =
(with pkgs; [ gnome-photos gnome-tour gnome-connections ])
++ (with pkgs.gnome; [
@ -54,8 +60,6 @@ in {
# Services required for gnome
programs.dconf.enable = true;
services.dbus.enable = true;
services.udisks2.enable = true;
# Extra gnome packages
environment.systemPackages = with pkgs; [

View File

@ -7,15 +7,18 @@ let
generate_custom_keybindings = binds:
{
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = map (name:
custom-keybindings = map
(name:
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/${name}/")
(attrNames binds);
};
} // mapAttrs' (name:
} // mapAttrs'
(name:
nameValuePair
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/${name}")
binds;
in {
in
{
xdg.mimeApps.enable = true;
xdg.mimeApps.defaultApplications = {
"text/plain" = "org.gnome.TextEditor.desktop";

View File

@ -20,7 +20,8 @@ let
};
};
};
in {
in
{
options.meta = {
exposes = mkOption {
@ -38,6 +39,5 @@ in {
};
};
config = {
};
config = { };
}

View File

@ -5,7 +5,8 @@ in {
options.services.v.nginx.autoExpose =
mkEnableOption "generate vhosts";
config = let
config =
let
proxy = url: {
enableACME = true;
@ -19,12 +20,13 @@ in {
hosts' =
filter (hasAttr "exposes") (attrValues hosts.${config.networking.domain});
exposes = { ip, exposes, ... }:
map ({ domain, port ? 80}: { inherit ip domain port; }) (attrValues exposes);
mkVhost = { ip, domain, port}: {
map ({ domain, port ? 80 }: { inherit ip domain port; }) (attrValues exposes);
mkVhost = { ip, domain, port }: {
"${domain}" = proxy "http://${ip}:${toString port}";
};
vhosts = foldr (el: acc: acc // mkVhost el) { } (concatMap exposes hosts');
in mkIf cfg.autoExpose {
in
mkIf cfg.autoExpose {
services.nginx.virtualHosts = vhosts;
};
}

View File

@ -57,7 +57,8 @@ let
'';
};
};
in {
in
{
options.services.unpackerr = {
enable = mkEnableOption "unpackerr";
@ -257,7 +258,8 @@ in {
after = [ "network.target" ];
description = "unpackerr system service";
# Filter out all unset variables else unpackerr complains
environment = filterAttrs (_n: v: stringLength v > 0) {
environment = filterAttrs (_n: v: stringLength v > 0)
{
# General options
UN_DEBUG = "${toString cfg.debug}";
UN_INTERVAL = "${cfg.interval}";

View File

@ -8,12 +8,15 @@ let
vault_hosts =
filter ({ tags ? [ ], ip ? "", ... }: (elem "vault" tags) && (ip != hostIP))
flat_hosts;
cluster_config = concatStrings (map ({ ip, ... }: ''
cluster_config = concatStrings (map
({ ip, ... }: ''
retry_join {
leader_api_addr = "http://${ip}:${toString cfg.port}"
}
'') vault_hosts);
in {
'')
vault_hosts);
in
{
options.services.v.vault = {
enable = mkEnableOption "v's vault";

View File

@ -23,23 +23,27 @@
};
home-manager.users.victor = {
programs.home-manager.enable = true;
programs = {
home-manager.enable = true;
home.username = "victor";
home.homeDirectory = "/home/victor";
home.stateVersion = "23.05";
v.nvim.enable = true;
v.git.enable = true;
programs.v.nvim.enable = true;
programs.v.git.enable = true;
programs.tmux = {
tmux = {
enable = true;
shortcut = "b";
terminal = "screen-256color";
clock24 = true;
};
programs.bat.enable = true;
bat.enable = true;
};
home = {
username = "victor";
homeDirectory = "/home/victor";
stateVersion = "23.05";
};
};
}

View File

@ -7,7 +7,8 @@ let
# https://github.com/immich-app/immich/releases
# version = "1.55.1";
dataDir = "/var/lib/immich";
in {
in
{
imports = [ ];
# This value determines the NixOS release from which the default

View File

@ -24,7 +24,8 @@ let
doCheck = false;
};
in {
in
{
imports = [ ./hardware-configuration.nix ];
# This value determines the NixOS release from which the default
@ -46,10 +47,12 @@ in {
trivy
wapiti
];
boot.loader = {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot";
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = "/boot";
};
virtualisation.docker.enable = true;

View File

@ -5,8 +5,9 @@
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot = {
boot.initrd.availableKernelModules = [
initrd.availableKernelModules = [
"uhci_hcd"
"ehci_pci"
"ahci"
@ -15,9 +16,10 @@
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
initrd.kernelModules = [ ];
kernelModules = [ ];
extraModulePackages = [ ];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/749c02fd-209d-4974-917e-38b749d10ec2";

View File

@ -2,7 +2,8 @@
let
vs = config.vault-secrets.secrets;
cfg = config.services.mastodon;
in {
in
{
system.stateVersion = "21.05";
# Use DHCP with static leases
networking.interfaces.eth0.useDHCP = true;
@ -100,6 +101,7 @@ in {
};
};
networking.firewall = let cfg = config.services.mastodon;
networking.firewall =
let cfg = config.services.mastodon;
in { allowedTCPPorts = [ cfg.streamingPort cfg.webPort ]; };
}

View File

@ -12,7 +12,8 @@ let
proxyWebsockets = true;
};
};
in {
in
{
imports = [ ];
nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1t" ];
@ -25,10 +26,12 @@ in {
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
networking.firewall.allowedTCPPorts = [ 80 443 ];
security.acme = {
security.acme.defaults.email = "victorheld12@gmail.com";
security.acme.acceptTerms = true;
security.acme.preliminarySelfsigned = true;
defaults.email = "victorheld12@gmail.com";
acceptTerms = true;
preliminarySelfsigned = true;
};
services.nginx = {
enable = true;
@ -39,12 +42,13 @@ in {
clientMaxBodySize = "1024m";
package = pkgs.nginxMainline;
virtualHosts = {
virtualHosts."cshub.nl" = proxy "http://192.168.0.113";
virtualHosts."api.cshub.nl" = proxy "http://192.168.0.113";
"cshub.nl" = proxy "http://192.168.0.113";
"api.cshub.nl" = proxy "http://192.168.0.113";
virtualHosts."ha.xirion.net" = proxy "http://192.168.0.129:8123";
virtualHosts."xirion.net" = {
"ha.xirion.net" = proxy "http://192.168.0.129:8123";
"xirion.net" = {
enableACME = true;
forceSSL = true;
locations."/".extraConfig = ''
@ -56,20 +60,20 @@ in {
'';
};
# virtualHosts."blog.xirion.net" = proxy "http://10.10.10.12";
virtualHosts."git.xirion.net" = proxy "http://10.10.10.12";
"git.xirion.net" = proxy "http://10.10.10.12";
# virtualHosts."mail.xirion.net" = proxy "http://192.168.0.118";
virtualHosts."o.xirion.net" = proxy "http://192.168.0.112:9000";
virtualHosts."g.xirion.net" = proxy "http://garage.hades:3900";
virtualHosts."requests.xirion.net" = proxy "http://overseerr.hades:5055";
virtualHosts."pass.xirion.net" = proxy "http://bitwarden_rs";
virtualHosts."repo.xirion.net" = proxy "http://archlinux";
virtualHosts."thelounge.xirion.net" = proxy "http://thelounge:9000";
virtualHosts."attic.xirion.net" = proxy "http://attic.hades:8080";
"o.xirion.net" = proxy "http://192.168.0.112:9000";
"g.xirion.net" = proxy "http://garage.hades:3900";
"requests.xirion.net" = proxy "http://overseerr.hades:5055";
"pass.xirion.net" = proxy "http://bitwarden_rs";
"repo.xirion.net" = proxy "http://archlinux";
"thelounge.xirion.net" = proxy "http://thelounge:9000";
"attic.xirion.net" = proxy "http://attic.hades:8080";
virtualHosts."tautulli.xirion.net" = proxy "http://tautulli.hades:8080";
virtualHosts."peepeepoopoo.xirion.net" = proxy "http://tautulli.hades:8080"; # Deprecated but Ricardo has it bookmarked already!
"tautulli.xirion.net" = proxy "http://tautulli.hades:8080";
"peepeepoopoo.xirion.net" = proxy "http://tautulli.hades:8080"; # Deprecated but Ricardo has it bookmarked already!
virtualHosts."registry.xirion.net" = proxy "http://docker-registry:5000"
"registry.xirion.net" = proxy "http://docker-registry:5000"
// {
locations."/".extraConfig = ''
allow 127.0.0.1;
@ -83,7 +87,7 @@ in {
'';
};
virtualHosts."plex.xirion.net" = {
"plex.xirion.net" = {
# Since we want a secure connection, we force SSL
forceSSL = true;
enableACME = true;
@ -138,12 +142,13 @@ in {
};
};
virtualHosts."fedi.xirion.net" = {
"fedi.xirion.net" = {
enableACME = true;
forceSSL = true;
root = "${pkgs.v.glitch-soc}/public/";
locations."/".tryFiles = "$uri @proxy";
locations = {
"/".tryFiles = "$uri @proxy";
# location ~ ^/(emoji|packs|system/accounts/avatars|system/media_attachments/files) {
# add_header Cache-Control "public, max-age=31536000, immutable";
@ -157,17 +162,19 @@ in {
# try_files $uri @proxy;
# }
locations."@proxy" = {
"@proxy" = {
proxyPass = "http://192.168.0.138:55001";
proxyWebsockets = true;
};
locations."/api/v1/streaming" = {
"/api/v1/streaming" = {
proxyPass = "http://192.168.0.138:55000";
proxyWebsockets = true;
};
};
};
virtualHosts."fedi-media.xirion.net" = proxy "http://garage.hades:3902";
"fedi-media.xirion.net" = proxy "http://garage.hades:3902";
};
};
}

View File

@ -14,7 +14,8 @@ let
-v "/etc/pmm/TVShows.yml:/config/TVShows.yml:ro" \
${container} --run
'';
in {
in
{
imports = [ ];
# This value determines the NixOS release from which the default

View File

@ -21,13 +21,15 @@ in {
vault-secrets.secrets.rtorrent = { services = [ "wg-quick-wg0" ]; };
# Mullvad VPN
networking.wg-quick.interfaces = let
networking.wg-quick.interfaces =
let
postUpScript = pkgs.writeScriptBin "post_up" ''
#!${pkgs.stdenv.shell}
${pkgs.iproute2}/bin/ip route add 10.42.42.0/23 via 192.168.0.1
${pkgs.iproute2}/bin/ip route add 10.100.0.0/24 via 192.168.0.1
'';
in {
in
{
wg0 = {
address = [ "10.66.153.191/32" "fc00:bbbb:bbbb:bb01::3:99be/128" ];
dns = [ "10.64.0.1" ];
@ -37,7 +39,7 @@ in {
peers = [
{
publicKey = "HQHCrq4J6bSpdW1fI5hR/bvcrYa6HgGgwaa5ZY749ik=";
allowedIPs = [ "0.0.0.0/0" "::/0"];
allowedIPs = [ "0.0.0.0/0" "::/0" ];
endpoint = "185.213.155.73:51820";
# persistentKeepalive = 25;
}

View File

@ -4,7 +4,8 @@
port = 54945; # Port Forwarded in mullvad
downloadDir = "/mnt/storage/torrents/r";
package = pkgs.jesec-rtorrent;
configText = let cfg = config.services.rtorrent;
configText =
let cfg = config.services.rtorrent;
in pkgs.lib.mkForce ''
# rTorrent runtime directory (cfg.basedir) [default: "$HOME/.local/share/rtorrent"]
method.insert = cfg.basedir, private|const|string, (cat,"${cfg.dataDir}/")

View File

@ -1,4 +1,4 @@
{ pkgs, lib, pkgs_stable,... }: {
{ pkgs, lib, pkgs_stable, ... }: {
system.stateVersion = "21.05";
networking.interfaces.eth0.useDHCP = true;

View File

@ -17,7 +17,8 @@ let
done
fi
'';
in {
in
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix

View File

@ -5,12 +5,14 @@
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot = {
boot.initrd.availableKernelModules =
initrd.availableKernelModules =
[ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
initrd.kernelModules = [ ];
kernelModules = [ ];
extraModulePackages = [ ];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/e8427097-8545-4924-b033-2659fcf9adca";

View File

@ -9,7 +9,8 @@ let
db_name = "dex";
inherit (config.meta.exposes.dex) port;
metricsPort = 5558;
in {
in
{
imports = [ ];
# This value determines the NixOS release from which the default

View File

@ -10,7 +10,8 @@ let
hosts =
filter (h: hasAttr "ip" h && hasAttr "mac" h && h.realm == localDomain)
flat_hosts;
in {
in
{
networking = {
defaultGateway = "10.42.42.1";
nameservers = [ "10.42.42.15" "10.42.42.16" ];

View File

@ -5,12 +5,14 @@
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
boot.initrd.availableKernelModules =
initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
initrd.kernelModules = [ ];
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/947a98af-9a4e-4811-a2ca-9aa00b319e9c";

View File

@ -1,10 +1,7 @@
{ pkgs, config, ... }: {
hardware.enableAllFirmware = true;
services.hardware.bolt.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
hardware = {
enableAllFirmware = true;
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.stable;
# Open drivers cause gdm to crash
@ -15,28 +12,35 @@
};
# Hardware acceleration
hardware.opengl = {
opengl = {
enable = true;
# Vulkan
driSupport = true;
};
hardware.logitech.wireless = {
logitech.wireless = {
enable = true;
enableGraphical = true;
};
};
services = {
hardware.bolt.enable = true;
xserver.videoDrivers = [ "nvidia" ];
# udev
services.udev.packages = with pkgs; [
udev.packages = with pkgs; [
android-udev-rules
logitech-udev-rules
wooting-udev-rules
];
# SSD Trim
fstrim.enable = true;
};
# FS
fileSystems."/".options = [ "compress=zstd" ];
# SSD Trim
services.fstrim.enable = true;
}

View File

@ -6,7 +6,8 @@
let
vs = config.vault-secrets.secrets;
inherit (config.meta.exposes.git) port;
in {
in
{
imports = [ ];
# This value determines the NixOS release from which the default
@ -23,27 +24,16 @@ in {
environment.noXlibs = lib.mkForce false;
networking.firewall.allowedTCPPorts = [ port ];
services = {
services.openssh.startWhenNeeded = false;
openssh.startWhenNeeded = false;
services.fail2ban = {
fail2ban = {
enable = true;
maxretry = 3;
};
vault-secrets.secrets.gitea = {
user = "gitea";
group = "gitea";
};
system.activationScripts.gitea-theme =
let target_dir = "${config.services.gitea.stateDir}/custom/public/css/";
in lib.stringAfter [ "var" ] ''
mkdir -p ${target_dir}
ln -sf ${pkgs.v.gitea-agatheme} "${target_dir}/theme-agatheme.css"
'';
services.gitea = {
gitea = {
enable = true;
package = pkgs.forgejo;
lfs.enable = true;
@ -99,4 +89,17 @@ in {
};
};
};
};
vault-secrets.secrets.gitea = {
user = "gitea";
group = "gitea";
};
system.activationScripts.gitea-theme =
let target_dir = "${config.services.gitea.stateDir}/custom/public/css/";
in lib.stringAfter [ "var" ] ''
mkdir -p ${target_dir}
ln -sf ${pkgs.v.gitea-agatheme} "${target_dir}/theme-agatheme.css"
'';
}

View File

@ -8,7 +8,8 @@ let
db_user = "hedgedoc";
inherit (config.meta.exposes.md) port;
vs = config.vault-secrets.secrets;
in {
in
{
imports = [ ];
# This value determines the NixOS release from which the default
@ -67,7 +68,8 @@ in {
secretKey = "$MINIO_SECRET_KEY";
};
email = false;
oauth2 = let url = "https://dex.0x76.dev";
oauth2 =
let url = "https://dex.0x76.dev";
in {
providerName = "Dex";
clientID = "hedgedoc";

View File

@ -97,11 +97,12 @@ in {
autoIndexExclude = [ "\\Junk" ];
};
};
services = {
services.postfix.relayHost = "smtp.ziggozakelijk.nl";
services.postfix.relayPort = 587;
postfix.relayHost = "smtp.ziggozakelijk.nl";
postfix.relayPort = 587;
services.roundcube = {
roundcube = {
enable = true;
package = pkgs.roundcube.withPlugins
(plugins: [ plugins.persistent_login pkgs.v.roundcube-swipe ]);
@ -138,7 +139,8 @@ in {
'';
};
services.nginx = { enable = true; };
nginx = { enable = true; };
};
security.acme.acceptTerms = true;
security.acme.defaults.email = "v@0x76.dev";

View File

@ -7,7 +7,8 @@ let
vs = config.vault-secrets.secrets;
listenPort = config.meta.exposes.minio.port;
consolePort = listenPort + 1;
in {
in
{
imports = [ ];
# This value determines the NixOS release from which the default

View File

@ -13,7 +13,8 @@ let
add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON data}';
'';
in {
in
{
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
@ -23,11 +24,12 @@ in {
system.stateVersion = "21.05"; # Did you read the comment?
networking.firewall.allowedTCPPorts = [ 80 443 ];
services = {
# Generates vhosts for all hosts that have an `exposes` section
services.v.nginx.autoExpose = true;
v.nginx.autoExpose = true;
services.nginx = {
nginx = {
enable = true;
statusPage = true;
recommendedProxySettings = true;
@ -43,42 +45,47 @@ in {
"pass.0x76.dev" = {
enableACME = true;
forceSSL = true;
locations."/" = {
locations = {
"/".proxyPass = "http://vaultwarden.olympus:8222";
"/".proxyWebsockets = true;
"/notifications/hub/negotiate" = {
proxyPass = "http://vaultwarden.olympus:8222";
proxyWebsockets = true;
};
locations."/notifications/hub/negotiate" = {
proxyPass = "http://vaultwarden.olympus:8222";
proxyWebsockets = true;
};
locations."/notifications/hub" = {
"/notifications/hub" = {
proxyPass = "http://vaultwarden.olympus:3012";
proxyWebsockets = true;
};
};
};
# Meow
"meowy.tech" = {
enableACME = true;
forceSSL = true;
locations."/".extraConfig = ''
locations = {
"/".extraConfig = ''
add_header Content-Type 'text/html; charset=UTF-8';
return 200 '<h1>meow</h1>';
'';
locations."= /.well-known/matrix/client".extraConfig =
"= /.well-known/matrix/client".extraConfig =
mkWellKnown clientConfig;
locations."= /.well-known/matrix/server".extraConfig =
"= /.well-known/matrix/server".extraConfig =
mkWellKnown serverConfig;
};
};
"chat.meowy.tech" = {
enableACME = true;
forceSSL = true;
locations."/".extraConfig = ''
locations = {
"/".extraConfig = ''
return 307 https://element.chat.meowy.tech;
'';
locations."/_matrix".proxyPass = "http://synapse.olympus:8008";
locations."/_synapse/client".proxyPass = "http://synapse.olympus:8008";
locations."/_synapse/admin" = {
"/_matrix".proxyPass = "http://synapse.olympus:8008";
"/_synapse/client".proxyPass = "http://synapse.olympus:8008";
"/_synapse/admin" = {
# Allow only local and my own IPs
extraConfig = ''
allow 127.0.0.1;
@ -92,6 +99,7 @@ in {
proxyPass = "http://synapse.olympus:8008";
};
};
};
"element.chat.meowy.tech" = {
enableACME = true;
forceSSL = true;
@ -124,14 +132,19 @@ in {
};
};
security.acme.defaults.email = "victorheld12@gmail.com";
security.acme.acceptTerms = true;
security.acme.preliminarySelfsigned = true;
services.prometheus.exporters = {
prometheus.exporters = {
nginx = {
enable = true;
openFirewall = true;
};
};
};
security = {
acme = {
defaults.email = "victorheld12@gmail.com";
acceptTerms = true;
preliminarySelfsigned = true;
};
};
}

View File

@ -20,7 +20,8 @@
networking.firewall.allowedTCPPorts = [ 80 9090 ];
services.ntfy-sh = let datadir = "/var/lib/ntfy-sh";
services.ntfy-sh =
let datadir = "/var/lib/ntfy-sh";
in {
enable = true;
settings = {

View File

@ -6,7 +6,8 @@
let
vs = config.vault-secrets.secrets;
inherit (config.meta.exposes.outline) port;
in {
in
{
imports = [ ];
# This value determines the NixOS release from which the default

View File

@ -7,7 +7,8 @@ let
vs = config.vault-secrets.secrets;
port = 8008;
metricsPort = 9000;
in {
in
{
imports = [ ];
# This value determines the NixOS release from which the default
@ -49,7 +50,8 @@ in {
"${vs.synapse}/email_password" # Also contains the rest of the email config
];
settings = let
settings =
let
log_file = pkgs.writeText "log.yml" ''
version: 1
@ -71,7 +73,8 @@ in {
level: INFO
handlers: [file]
'';
in {
in
{
server_name = "meowy.tech";
enable_registration = true;
public_baseurl = "https://chat.meowy.tech";

View File

@ -6,7 +6,8 @@
let
vs = config.vault-secrets.secrets;
cfg = config.services.vaultwarden.config;
in {
in
{
imports = [ ];
# This value determines the NixOS release from which the default

View File

@ -8,7 +8,8 @@ let
grafanaDomain = config.meta.exposes.grafana.domain;
grafanaPort = config.meta.exposes.grafana.port;
vs = config.vault-secrets.secrets;
in {
in
{
imports = [ ];
# This value determines the NixOS release from which the default
@ -20,15 +21,16 @@ in {
system.stateVersion = "21.11"; # Did you read the comment?
networking.firewall.allowedTCPPorts = [ vmPort grafanaPort ];
networking.firewall.allowedUDPPorts = [ vmPort ];
services = {
services.victoriametrics = {
victoriametrics = {
enable = true;
listenAddress = ":${toString vmPort}";
# Data Retention period in months
retentionPeriod = 36;
};
services.vmagent = {
vmagent = {
enable = true;
openFirewall = true;
prometheusConfig = {
@ -68,7 +70,7 @@ in {
{
job_name = "ntfy";
static_configs = [{
targets = [ "ntfy.olympus:9090"];
targets = [ "ntfy.olympus:9090" ];
labels.app = "ntfy";
}];
}
@ -90,12 +92,7 @@ in {
};
};
vault-secrets.secrets.grafana = {
user = "grafana";
group = "grafana";
};
services.grafana = {
grafana = {
enable = true;
settings = {
server = {
@ -123,4 +120,10 @@ in {
};
};
};
vault-secrets.secrets.grafana = {
user = "grafana";
group = "grafana";
};
}

View File

@ -19,33 +19,19 @@ in {
environment.systemPackages = with pkgs; [ wireguard-tools ];
environment.noXlibs = lib.mkForce false;
networking = {
networking.firewall.allowedUDPPorts =
firewall.allowedUDPPorts =
[ config.networking.wireguard.interfaces.wg0.listenPort ];
networking.firewall.checkReversePath = false;
firewall.checkReversePath = false;
vault-secrets.secrets.wireguard = {
services = [ "wireguard-wg0" ];
loginRetries = 25;
};
networking.nat = {
nat = {
enable = true;
internalInterfaces = [ "wg0" "eth0" ];
externalInterface = "eth0";
};
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1;
"net.ipv6.conf.all.forwarding" = 1;
};
services.prometheus.exporters.wireguard = {
enable = true;
openFirewall = true;
};
networking.wireguard.interfaces.wg0 = {
wireguard.interfaces.wg0 = {
ips = [ "10.100.0.1/24" ];
listenPort = 51821;
privateKeyFile = "${vs.wireguard}/privateKey";
@ -82,4 +68,20 @@ in {
}
];
};
};
vault-secrets.secrets.wireguard = {
services = [ "wireguard-wg0" ];
loginRetries = 25;
};
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1;
"net.ipv6.conf.all.forwarding" = 1;
};
services.prometheus.exporters.wireguard = {
enable = true;
openFirewall = true;
};
}

View File

@ -5,12 +5,14 @@
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
boot.initrd.availableKernelModules =
initrd.availableKernelModules =
[ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
initrd.kernelModules = [ ];
kernelModules = [ "kvm-amd" ];
extraModulePackages = [ ];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/c184866a-9a53-4a9f-9a1f-493792af7ea9";

View File

@ -1,50 +1,58 @@
{ pkgs, ... }: {
hardware.enableAllFirmware = true;
hardware = {
enableAllFirmware = true;
hardware.bluetooth.enable = true;
bluetooth.enable = true;
services.hardware.bolt.enable = true;
# Vulkan
opengl.driSupport = true;
opengl.extraPackages = with pkgs; [
amdvlk
rocm-opencl-icd
rocm-opencl-runtime
];
};
services = {
services.fprintd.enable = true;
hardware.bolt.enable = true;
fprintd.enable = true;
# Video Driver
xserver.videoDrivers = [ "amdgpu" ];
xserver = {
dpi = 280;
xkbOptions = "caps:swapescape";
};
# SSD Trim
fstrim.enable = true;
# Power Management
upower.enable = true;
thermald.enable = true;
};
# hardware.trackpoint.enable = true;
# FS
fileSystems."/".options = [ "compress=zstd" ];
# Video Driver
services.xserver.videoDrivers = [ "amdgpu" ];
services.xserver = {
dpi = 280;
xkbOptions = "caps:swapescape";
};
# Vulkan
hardware.opengl.driSupport = true;
hardware.opengl.extraPackages = with pkgs; [
amdvlk
rocm-opencl-icd
rocm-opencl-runtime
];
systemd.tmpfiles.rules =
[ "L+ /opt/rocm/hip - - - - ${pkgs.hip}" ];
# SSD Trim
services.fstrim.enable = true;
# Power Management
services.upower.enable = true;
services.thermald.enable = true;
powerManagement = {
enable = true;
powertop.enable = true;
};
security = {
tpm2 = {
# tpm
security.tpm2.enable = true;
security.tpm2.pkcs11.enable = true; # expose /run/current-system/sw/lib/libtpm2_pkcs11.so
security.tpm2.tctiEnvironment.enable = true; # TPM2TOOLS_TCTI and TPM2_PKCS11_TCTI env variables
enable = true;
pkcs11.enable = true; # expose /run/current-system/sw/lib/libtpm2_pkcs11.so
tctiEnvironment.enable = true;
};
}; # TPM2TOOLS_TCTI and TPM2_PKCS11_TCTI env variables
users.users.victor.extraGroups = [ "tss" ]; # tss group has access to TPM devices
}

View File

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
# Custom dconf settings
dconf.settings."org/gnome/desktop/input-sources" = {
xkb-options = [ "caps:swapescape" ];

View File

@ -30,23 +30,39 @@ let
exec Hyprland
'';
in {
in
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
./rescue-boot.nix
./networking.nix
];
home-manager = {
# home-manager
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.victor = import ./home;
home-manager.extraSpecialArgs = { inherit inputs; };
useGlobalPkgs = true;
useUserPackages = true;
users.victor = import ./home;
extraSpecialArgs = { inherit inputs; };
};
security = {
security.pam.services.swaylock = { };
pam.services.swaylock = { };
security.sudo.wheelNeedsPassword = true;
sudo.wheelNeedsPassword = true;
rtkit.enable = true;
# Enables logging in with my Solokey
pam.u2f = {
enable = true;
debug = false;
cue = true;
control = "sufficient";
authFile =
"/etc/u2f-mappings"; # use `pamu2fcfg` from `pkgs.pam_u2f` to generate this config
};
};
fonts = {
fonts = with pkgs; [
@ -79,108 +95,35 @@ in {
# boot.initrd.systemd.enable = true; # Experimental
boot = {
kernelPackages = pkgs.linuxPackages_latest;
loader.systemd-boot.editor = false;
loader.systemd-boot.enable = true;
loader = {
systemd-boot.editor = false;
systemd-boot.enable = true;
# loader.systemd-boot.configurationLimit = 6;
loader.efi.canTouchEfiVariables = true;
loader.efi.efiSysMountPoint = "/boot/efi";
efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = "/boot/efi";
};
kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
};
services = {
services.gnome.gnome-keyring.enable = true;
gnome.gnome-keyring.enable = true;
fileSystems."/".options = [ "compress=zstd" ];
fileSystems."/home".options = [ "compress=zstd" ];
fileSystems."/nix".options = [ "compress=zstd" "noatime" ];
udisks2.enable = true;
dbus.enable = true;
# Filesystem dedup
# services.beesd.filesystems = {
# root = {
# spec = "LABEL=nixos";
# hashTableSizeMB = 256;
# verbosity = "crit";
# extraOptions = [ "--loadavg-target" "2.0" ];
# };
# };
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.utf8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "nl_NL.UTF-8";
LC_IDENTIFICATION = "nl_NL.UTF-8";
LC_MEASUREMENT = "nl_NL.UTF-8";
LC_MONETARY = "nl_NL.UTF-8";
LC_NAME = "nl_NL.UTF-8";
LC_NUMERIC = "nl_NL.UTF-8";
LC_PAPER = "nl_NL.UTF-8";
LC_TELEPHONE = "nl_NL.UTF-8";
LC_TIME = "en_DK.UTF-8";
};
i18n.supportedLocales =
[ "en_GB.UTF-8/UTF-8" "nl_NL.UTF-8/UTF-8" "en_DK.UTF-8/UTF-8" ];
xdg.portal = {
enable = true;
wlr.enable = true;
};
services.udisks2.enable = true;
services.dbus.enable = true;
# Hyprland
programs.hyprland = {
enable = true;
package = null; # Managed by home manager
};
environment.loginShellInit = ''
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
${run-hyprland}/bin/run-hyprland
fi
'';
services.xserver = {
xserver = {
enable = false;
layout = "us";
xkbVariant = "altgr-intl";
xkbOptions = "caps:swapescape";
videoDrivers = [ "nvidia" ];
};
hardware.nvidia.prime = {
offload.enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
vaapiVdpau
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
];
};
hardware.bluetooth.enable = true;
services.blueman.enable = true;
virtualisation.podman.enable = true;
hardware.saleae-logic.enable = true;
blueman.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
printing.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
@ -193,6 +136,111 @@ in {
#media-session.enable = true;
};
fstrim.enable = true;
# don't shutdown when power button is short-pressed
logind.extraConfig = ''
HandlePowerKey=suspend
'';
udev.packages = with pkgs; [
android-udev-rules
logitech-udev-rules
wooting-udev-rules
];
};
fileSystems = {
"/".options = [ "compress=zstd" ];
"/home".options = [ "compress=zstd" ];
"/nix".options = [ "compress=zstd" "noatime" ];
};
i18n = {
# Filesystem dedup
# services.beesd.filesystems = {
# root = {
# spec = "LABEL=nixos";
# hashTableSizeMB = 256;
# verbosity = "crit";
# extraOptions = [ "--loadavg-target" "2.0" ];
# };
# };
# Select internationalisation properties.
defaultLocale = "en_GB.utf8";
extraLocaleSettings = {
LC_ADDRESS = "nl_NL.UTF-8";
LC_IDENTIFICATION = "nl_NL.UTF-8";
LC_MEASUREMENT = "nl_NL.UTF-8";
LC_MONETARY = "nl_NL.UTF-8";
LC_NAME = "nl_NL.UTF-8";
LC_NUMERIC = "nl_NL.UTF-8";
LC_PAPER = "nl_NL.UTF-8";
LC_TELEPHONE = "nl_NL.UTF-8";
LC_TIME = "en_DK.UTF-8";
};
supportedLocales =
[ "en_GB.UTF-8/UTF-8" "nl_NL.UTF-8/UTF-8" "en_DK.UTF-8/UTF-8" ];
};
xdg.portal = {
enable = true;
wlr.enable = true;
};
programs = {
# Hyprland
hyprland = {
enable = true;
package = null; # Managed by home manager
};
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
ssh.startAgent = true;
};
environment.loginShellInit = ''
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
${run-hyprland}/bin/run-hyprland
fi
'';
hardware = {
nvidia.prime = {
offload.enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
opengl = {
enable = true;
extraPackages = with pkgs; [
vaapiVdpau
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
];
};
bluetooth.enable = true;
saleae-logic.enable = true;
pulseaudio.enable = false;
};
virtualisation.podman.enable = true;
# Enable sound with pipewire.
sound.enable = true;
environment.systemPackages = with pkgs; [
pciutils
nvidia-offload
@ -204,42 +252,11 @@ in {
swaylock-effects # Has to be installed globally so that pam module works
];
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
services.fstrim.enable = true;
nix.extraOptions = ''
keep-outputs = true
keep-derivations = true
'';
# Enables logging in with my Solokey
security.pam.u2f = {
enable = true;
debug = false;
cue = true;
control = "sufficient";
authFile =
"/etc/u2f-mappings"; # use `pamu2fcfg` from `pkgs.pam_u2f` to generate this config
};
programs.ssh.startAgent = true;
# don't shutdown when power button is short-pressed
services.logind.extraConfig = ''
HandlePowerKey=suspend
'';
services.udev.packages = with pkgs; [
android-udev-rules
logitech-udev-rules
wooting-udev-rules
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave

View File

@ -5,35 +5,39 @@
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
boot.initrd.availableKernelModules =
initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
initrd.kernelModules = [ ];
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
fileSystems = {
fileSystems."/" = {
"/" = {
device = "/dev/disk/by-uuid/d4f56e5b-2509-4e63-8324-65a35c71e90c";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/nix" = {
"/nix" = {
device = "/dev/disk/by-uuid/d4f56e5b-2509-4e63-8324-65a35c71e90c";
fsType = "btrfs";
options = [ "subvol=@/nix" ];
};
fileSystems."/home" = {
"/home" = {
device = "/dev/disk/by-uuid/d4f56e5b-2509-4e63-8324-65a35c71e90c";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
fileSystems."/boot/efi" = {
"/boot/efi" = {
device = "/dev/disk/by-uuid/D478-6F66";
fsType = "vfat";
};
};
swapDevices = [ ];

View File

@ -4,15 +4,115 @@ let
inherit (pkgs.texlive) scheme-full;
dnd-5e-latex-template = { pkgs = [ pkgs.v.dnd-5e-latex-template ]; };
};
in {
programs.home-manager.enable = true;
home.username = "victor";
home.homeDirectory = "/home/victor";
home.stateVersion = "22.05";
in
{
programs = {
home-manager.enable = true;
imports = [ ./hyprland.nix ./neovim.nix ./eww ./theme.nix ];
foot = { enable = true; };
home.packages = with pkgs; [
nix-index.enable = true;
exa = {
enable = true;
enableAliases = true;
};
bat.enable = true;
git = {
enable = true;
package = pkgs.gitAndTools.gitFull;
userName = "Victor";
userEmail = "victor@xirion.net";
lfs.enable = true;
# delta.enable = true;
extraConfig = {
push.autoSetupRemote = true;
init.defaultBranch = "main";
};
};
mako = {
enable = true;
extraConfig = ''
[mode=do-not-disturb]
invisible=1
'';
};
tmux = {
enable = true;
shortcut = "b";
terminal = "screen-256color";
clock24 = true;
};
firefox = {
enable = true;
package = pkgs.firefox-devedition-bin;
};
vscode = {
enable = true;
package = pkgs.vscode;
userSettings = {
"ltex.language" = "en-GB";
"latex-workshop" = {
"linting.chktex.enabled" = true;
"latex.clean.subfolder.enabled" = true;
"latex.outDir" = "%TMPDIR%/%RELATIVE_DOC%";
};
"workbench.colorTheme" = "Catppuccin Frappé";
"editor.fontFamily" =
"'DejaVuSansMono Nerd Font', 'monospace', monospace";
"keyboard.dispatch" = "keyCode";
"rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer";
"terminal.integrated.defaultProfile.linux" = "zsh";
"nix.enableLanguageServer" = true; # Enable LSP.
"nix.serverPath" =
"${pkgs.nil}/bin/nil"; # The path to the LSP server executable.
"[nix]" = { "editor.defaultFormatter" = "brettm12345.nixfmt-vscode"; };
};
extensions = with pkgs.vscode-extensions;
with pkgs.v.vscode-extensions; [
# astro-build.astro-vscode
brettm12345.nixfmt-vscode
catppuccin.catppuccin-vsc
codezombiech.gitignore
editorconfig.editorconfig
foxundermoon.shell-format
james-yu.latex-workshop
jnoortheen.nix-ide
matklad.rust-analyzer
mkhl.direnv
ms-vscode-remote.remote-ssh
ms-vscode.cpptools
platformio.platformio-ide
redhat.vscode-yaml
tamasfe.even-better-toml
valentjn.vscode-ltex
vscodevim.vim
xaver.clang-format
];
};
direnv = {
enable = true;
nix-direnv = { enable = true; };
};
zsh = {
enable = true;
sessionVariables = { DIRENV_LOG_FORMAT = ""; };
};
};
home = {
username = "victor";
homeDirectory = "/home/victor";
stateVersion = "22.05";
packages = with pkgs; [
appimage-run
brightnessctl
btop
@ -58,10 +158,14 @@ in {
wofi # Wayland rofi
wpa_supplicant_gui
];
};
imports = [ ./hyprland.nix ./neovim.nix ./eww ./theme.nix ];
xdg.mimeApps = {
enable = true;
defaultApplications = let browser = [ "firefox.desktop" ];
defaultApplications =
let browser = [ "firefox.desktop" ];
in {
"image/*" = "org.gnome.eog.desktop";
"text/html" = browser;
@ -85,105 +189,8 @@ in {
};
};
programs.foot = { enable = true; };
programs.nix-index.enable = true;
programs.exa = {
enable = true;
enableAliases = true;
};
programs.bat.enable = true;
programs.git = {
enable = true;
package = pkgs.gitAndTools.gitFull;
userName = "Victor";
userEmail = "victor@xirion.net";
lfs.enable = true;
# delta.enable = true;
extraConfig = {
push.autoSetupRemote = true;
init.defaultBranch = "main";
};
};
programs.mako = {
enable = true;
extraConfig = ''
[mode=do-not-disturb]
invisible=1
'';
};
programs.tmux = {
enable = true;
shortcut = "b";
terminal = "screen-256color";
clock24 = true;
};
programs.firefox = {
enable = true;
package = pkgs.firefox-devedition-bin;
};
programs.vscode = {
enable = true;
package = pkgs.vscode;
userSettings = {
"ltex.language" = "en-GB";
"latex-workshop" = {
"linting.chktex.enabled" = true;
"latex.clean.subfolder.enabled" = true;
"latex.outDir" = "%TMPDIR%/%RELATIVE_DOC%";
};
"workbench.colorTheme" = "Catppuccin Frappé";
"editor.fontFamily" =
"'DejaVuSansMono Nerd Font', 'monospace', monospace";
"keyboard.dispatch" = "keyCode";
"rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer";
"terminal.integrated.defaultProfile.linux" = "zsh";
"nix.enableLanguageServer" = true; # Enable LSP.
"nix.serverPath" =
"${pkgs.nil}/bin/nil"; # The path to the LSP server executable.
"[nix]" = { "editor.defaultFormatter" = "brettm12345.nixfmt-vscode"; };
};
extensions = with pkgs.vscode-extensions;
with pkgs.v.vscode-extensions; [
# astro-build.astro-vscode
brettm12345.nixfmt-vscode
catppuccin.catppuccin-vsc
codezombiech.gitignore
editorconfig.editorconfig
foxundermoon.shell-format
james-yu.latex-workshop
jnoortheen.nix-ide
matklad.rust-analyzer
mkhl.direnv
ms-vscode-remote.remote-ssh
ms-vscode.cpptools
platformio.platformio-ide
redhat.vscode-yaml
tamasfe.even-better-toml
valentjn.vscode-ltex
vscodevim.vim
xaver.clang-format
];
};
programs.direnv = {
enable = true;
nix-direnv = { enable = true; };
};
programs.zsh = {
enable = true;
sessionVariables = { DIRENV_LOG_FORMAT = ""; };
};
xdg.userDirs = let home = config.home.homeDirectory;
xdg.userDirs =
let home = config.home.homeDirectory;
in {
enable = true;
createDirectories = true;

View File

@ -1,38 +1,42 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
home = {
packages = with pkgs; [
eww-wayland
pamixer
lua
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
];
file = {
home.file.".config/eww/eww.yuck".source = ./eww.yuck;
home.file.".config/eww/eww.scss".text = builtins.readFile ./eww.scss;
".config/eww/eww.yuck".source = ./eww.yuck;
".config/eww/eww.scss".text = builtins.readFile ./eww.scss;
# scripts
# TODO: just link all scripts in ./scripts to .config/eww/scripts
home.file.".config/eww/scripts/volume.sh" = {
".config/eww/scripts/volume.sh" = {
source = ./scripts/volume.sh;
executable = true;
};
home.file.".config/eww/scripts/wifi.sh" = {
".config/eww/scripts/wifi.sh" = {
source = ./scripts/wifi.sh;
executable = true;
};
home.file.".config/eww/scripts/workspaces.sh" = {
".config/eww/scripts/workspaces.sh" = {
source = ./scripts/workspaces.sh;
executable = true;
};
home.file.".config/eww/scripts/workspaces.lua" = {
".config/eww/scripts/workspaces.lua" = {
source = ./scripts/workspaces.lua;
executable = true;
};
home.file.".config/eww/scripts/do-not-disturb.sh" = {
".config/eww/scripts/do-not-disturb.sh" = {
source = ./scripts/do-not-disturb.sh;
executable = true;
};
};
};
}

View File

@ -5,7 +5,8 @@
wallpaper = eDP-1,~/cloud/Pictures/Wallpapers-Laptop/wallpaper-nix-pink.png
'';
wayland.windowManager.hyprland = let
wayland.windowManager.hyprland =
let
startup-script = pkgs.writeScriptBin "startup" ''
#!${pkgs.stdenv.shell}
hyprctl setcursor Catppuccin-Frappe-Pink-Cursors ${
@ -19,7 +20,8 @@
webcord &
element-desktop &
'';
in {
in
{
enable = true;
recommendedEnvironment = true;
extraConfig = ''

View File

@ -27,9 +27,11 @@
};
lsp = {
enable = true;
servers.rust-analyzer.enable = true;
servers.rnix-lsp.enable = true;
servers.pyright.enable = true;
servers = {
rust-analyzer.enable = true;
rnix-lsp.enable = true;
pyright.enable = true;
};
};
nvim-cmp = { enable = true; };
};

View File

@ -34,18 +34,50 @@ let
hex = mapAttrs (_name: value: "#${value}") colour;
};
in {
home.file.".xsettingsd".text = ''
in
{
home = {
file.".xsettingsd".text = ''
Net/ThemeName "${theme}"
Gtk/CursorThemeName "${cursorTheme}"
'';
home.pointerCursor = {
pointerCursor = {
name = "Catppuccin-Frappe-Pink-Cursors";
size = 32;
package = pkgs.catppuccin-cursors.frappePink;
};
file.".config/eww/eww.scss".text = lib.mkBefore ''
$rosewater: ${colour.hex.rosewater};
$flamingo: ${colour.hex.flamingo};
$pink: ${colour.hex.pink};
$mauve: ${colour.hex.mauve};
$red: ${colour.hex.red};
$maroon: ${colour.hex.maroon};
$peach: ${colour.hex.peach};
$yellow: ${colour.hex.yellow};
$green: ${colour.hex.green};
$teal: ${colour.hex.teal};
$sky: ${colour.hex.sky};
$sapphire: ${colour.hex.sapphire};
$blue: ${colour.hex.blue};
$lavender: ${colour.hex.lavender};
$text: ${colour.hex.text};
$subtext0: ${colour.hex.subtext0};
$subtext1: ${colour.hex.subtext1};
$overlay0: ${colour.hex.overlay0};
$overlay1: ${colour.hex.overlay1};
$overlay2: ${colour.hex.overlay2};
$surface0: ${colour.hex.surface0};
$surface1: ${colour.hex.surface1};
$surface2: ${colour.hex.surface2};
$base: ${colour.hex.base};
$mantle: ${colour.hex.mantle};
$crust: ${colour.hex.crust};
'';
};
gtk = {
enable = true;
theme = {
@ -92,33 +124,4 @@ in {
textColor = colour.hex.text;
borderRadius = 5;
};
home.file.".config/eww/eww.scss".text = lib.mkBefore ''
$rosewater: ${colour.hex.rosewater};
$flamingo: ${colour.hex.flamingo};
$pink: ${colour.hex.pink};
$mauve: ${colour.hex.mauve};
$red: ${colour.hex.red};
$maroon: ${colour.hex.maroon};
$peach: ${colour.hex.peach};
$yellow: ${colour.hex.yellow};
$green: ${colour.hex.green};
$teal: ${colour.hex.teal};
$sky: ${colour.hex.sky};
$sapphire: ${colour.hex.sapphire};
$blue: ${colour.hex.blue};
$lavender: ${colour.hex.lavender};
$text: ${colour.hex.text};
$subtext0: ${colour.hex.subtext0};
$subtext1: ${colour.hex.subtext1};
$overlay0: ${colour.hex.overlay0};
$overlay1: ${colour.hex.overlay1};
$overlay2: ${colour.hex.overlay2};
$surface0: ${colour.hex.surface0};
$surface1: ${colour.hex.surface1};
$surface2: ${colour.hex.surface2};
$base: ${colour.hex.base};
$mantle: ${colour.hex.mantle};
$crust: ${colour.hex.crust};
'';
}

View File

@ -13,7 +13,8 @@ let
boot.supportedFilesystems = [ "btrfs" "ext4" ];
environment.systemPackages = with pkgs; [ git ];
};
in {
in
{
boot.loader.systemd-boot = {
extraEntries = {
"rescue.conf" = ''

View File

@ -1,9 +1,22 @@
{ lib, stdenv, nodejs-slim, bundlerEnv, nixosTests, yarn, callPackage
, imagemagick, ffmpeg, file, ruby_3_0, writeShellScript, fetchYarnDeps
{ lib
, stdenv
, nodejs-slim
, bundlerEnv
, nixosTests
, yarn
, callPackage
, imagemagick
, ffmpeg
, file
, ruby_3_0
, writeShellScript
, fetchYarnDeps
, fixup_yarn_lock
# Allow building a fork or custom version of Mastodon:
, pname ? "mastodon", version ? import ./version.nix, srcOverride ? null
# Allow building a fork or custom version of Mastodon:
, pname ? "mastodon"
, version ? import ./version.nix
, srcOverride ? null
, dependenciesDir ? ./. # Should contain gemset.nix, yarn.nix and package.json.
}:
@ -106,12 +119,14 @@ stdenv.mkDerivation rec {
ln -s /tmp tmp
'';
installPhase = let
installPhase =
let
run-streaming = writeShellScript "run-streaming.sh" ''
# NixOS helper script to consistently use the same NodeJS version the package was built with.
${nodejs-slim}/bin/node ./streaming
'';
in ''
in
''
mkdir -p $out
cp -r * $out/
ln -s ${run-streaming} $out/run-streaming.sh

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,13 @@
# This file was generated by pkgs.mastodon.updateScript.
{ fetchgit, applyPatches }: let
{ fetchgit, applyPatches }:
let
src = fetchgit {
url = "https://github.com/glitch-soc/mastodon.git";
rev = "a1df9fdb06854bd55f018918236132ccfa7d9d84";
sha256 = "0amqiigq3qgag6qm119aaysmd2k93vwgr1aynxjxmbpn35ykcay3";
};
in applyPatches {
in
applyPatches {
inherit src;
patches = [];
patches = [ ];
}

View File

@ -1,5 +1,14 @@
{ runCommand, lib, makeWrapper, yarn2nix, bundix, coreutils, diffutils
, nix-prefetch-git, gnused, jq }:
{ runCommand
, lib
, makeWrapper
, yarn2nix
, bundix
, coreutils
, diffutils
, nix-prefetch-git
, gnused
, jq
}:
let
binPath = lib.makeBinPath [
yarn2nix
@ -10,7 +19,9 @@ let
gnused
jq
];
in runCommand "mastodon-update-script" {
in
runCommand "mastodon-update-script"
{
nativeBuildInputs = [ makeWrapper ];
meta = {

View File

@ -2,8 +2,10 @@
let
sources = builtins.fromJSON (builtins.readFile ./sources.json);
source = lib.findFirst (x: x.platform == stdenv.hostPlatform.system)
(throw "unsupported platform: ${stdenv.hostPlatform.system}") sources;
in plexRaw.overrideAttrs (attrs: {
(throw "unsupported platform: ${stdenv.hostPlatform.system}")
sources;
in
plexRaw.overrideAttrs (attrs: {
pname = attrs.pname + "-plexpass";
inherit (source) version;
src = fetchurl {

View File

@ -6,7 +6,8 @@ let
mkdir -p $out/plugins/
cp -r ${src} $out/plugins/swipe
'';
in roundcubePlugin rec {
in
roundcubePlugin rec {
pname = "roundcube-swipe";
version = "0.5";

View File

@ -7,7 +7,8 @@ let
mailserver.nixosModules.mailserver
attic.nixosModules.atticd
];
type_import = let
type_import =
let
import_cases = {
"lxc" = [
"${nixpkgs}/nixos/modules/virtualisation/lxc-container.nix"
@ -19,7 +20,8 @@ let
./common/desktop
];
};
in type: import_cases.${type} ++ base_imports;
in
type: import_cases.${type} ++ base_imports;
# Helper function to resolve what should be imported depending on the type of config (lxc, vm, bare metal)
resolve_imports = { hostname, realm, profile ? hostname, type ? "lxc", ... }:
type_import type
@ -46,12 +48,20 @@ let
# outputs
# Helper function to build a colmena host definition
mkColmenaHost = { ip ? null, exposes ? null, hostname, tags, realm
, type ? "lxc", ... }@host:
mkColmenaHost =
{ ip ? null
, exposes ? null
, hostname
, tags
, realm
, type ? "lxc"
, ...
}@host:
let
# this makes local apply work a bit nicer
name = if type == "local" then hostname else "${hostname}.${realm}";
in {
in
{
"${name}" = {
imports = resolve_imports host;
networking = {
@ -73,4 +83,5 @@ let
hosts = add_realm_to_tags (import ./hosts);
flat_hosts = flatten_hosts hosts;
nixHosts = filter_nix_hosts flat_hosts;
in { inherit base_imports mkColmenaHost hosts flat_hosts nixHosts; }
in
{ inherit base_imports mkColmenaHost hosts flat_hosts nixHosts; }

View File

@ -1,6 +1,7 @@
let
flake = builtins.getFlake (toString ./.);
nixpkgs = import <nixpkgs> { };
in {
in
{
inherit flake;
} // flake // builtins // nixpkgs // nixpkgs.lib // flake.nixosConfigurations