fmt: alejandra

This commit is contained in:
♥ Minnie ♥ 2024-08-08 09:02:42 +08:00
parent 53378cdfc9
commit 3350d19a45
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
79 changed files with 432 additions and 511 deletions

View file

@ -31,8 +31,12 @@
nixvim.url = "git+https://git.sajenim.dev/jasmine/nvim.nix.git";
};
outputs = { self, nixpkgs, home-manager, ... }@inputs:
let
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: let
inherit (self) outputs;
# Supported systems for your flake packages, shell, etc.
systems = [
@ -45,8 +49,7 @@
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
in {
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
imports = [
./git.nix
./nvim.nix

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home.packages = with pkgs; [
lazygit
];

View file

@ -1,7 +1,8 @@
{ inputs, pkgs, ... }:
{
inputs,
pkgs,
...
}: {
# Install our nixvim configuration for neovim.
home.packages = [inputs.nixvim.packages.${pkgs.system}.default];
}

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home.packages = with pkgs; [
fzf # command-line fuzzy finder
];
@ -66,4 +64,3 @@
'';
};
}

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
let
{pkgs, ...}: let
awesome = pkgs.awesome.overrideAttrs (oa: {
version = "ad0290bc1aac3ec2391aa14784146a53ebf9d1f0";
src = pkgs.fetchFromGitHub {
@ -15,10 +14,12 @@ let
patchShebangs tests/examples/_postprocess.lua
'';
});
in
{
in {
xdg.configFile = {
awesome = { source = ./config; recursive = true; };
awesome = {
source = ./config;
recursive = true;
};
};
xsession.windowManager.awesome = {
@ -26,4 +27,3 @@ in
package = awesome;
};
}

View file

@ -1,6 +1,8 @@
{ inputs, pkgs, ... }:
{
inputs,
pkgs,
...
}: {
imports = [
./discord
./rofi

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
nixpkgs.overlays = [
(final: prev: {
discord = prev.discord.override {withOpenASAR = true;};

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home.packages = with pkgs; [
# protonmail-bridge requires password manager
pass
@ -115,4 +113,3 @@
];
};
}

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home.packages = with pkgs; [
weechat
];
@ -16,4 +14,3 @@
];
};
}

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
services.mpd = {
enable = true;
musicDirectory = "nfs://viridian.kanto.dev/srv/multimedia/library/music";

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
services.picom = {
enable = true;
shadow = true;

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
programs.rofi = {
enable = true;
font = "Fisa Code 10";
@ -16,4 +14,3 @@
recursive = true;
};
}

View file

@ -1,12 +1,12 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home.packages = with pkgs.unstable; [
wezterm
];
xdg.configFile = {
wezterm = { source = ./config; recursive = true; };
wezterm = {
source = ./config;
recursive = true;
};
};
}

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
imports = [
./mangohud.nix
];

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
programs.mangohud = {
enable = true;
package = pkgs.mangohud;

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home = {
packages = with pkgs; [
blender

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
imports = [
./global
./features/desktop
@ -51,4 +49,3 @@
};
};
}

View file

@ -1,4 +1,8 @@
{ inputs, outputs, ... }: {
{
inputs,
outputs,
...
}: {
imports = [
inputs.impermanence.nixosModules.home-manager.impermanence
../features/cli
@ -12,7 +16,7 @@
];
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
allowUnfreePredicate = _: true;
};
};

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
imports = [
./global
];

View file

@ -1,6 +1,5 @@
# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
# These should be stuff you would like to share with others, not your personal configurations.
{
# List your module files here
# my-module = import ./my-module.nix;

View file

@ -1,6 +1,5 @@
# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
# These should be stuff you would like to share with others, not your personal configurations.
{
# List your module files here
# my-module = import ./my-module.nix;

View file

@ -1,8 +1,11 @@
{ config, pkgs, inputs, ... }:
let
hostname = config.networking.hostName;
in
{
config,
pkgs,
inputs,
...
}: let
hostname = config.networking.hostName;
in {
imports = [
inputs.agenix.nixosModules.default
inputs.agenix-rekey.nixosModules.default

View file

@ -1,6 +1,4 @@
{ outputs, ... }:
{
{outputs, ...}: {
imports = [
./age.nix
./env.nix

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
environment = {
binsh = "${pkgs.bash}/bin/bash";
shells = with pkgs; [zsh];

View file

@ -1,6 +1,9 @@
{ config, inputs, lib, ... }:
{
config,
inputs,
lib,
...
}: {
nix = {
gc = {
# Automatically run the garbage collector an a specified time.

View file

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

View file

@ -1,8 +1,10 @@
{ lib, config, ... }:
let
hostname = config.networking.hostName;
in
{
lib,
config,
...
}: let
hostname = config.networking.hostName;
in {
imports = [
./persist.nix
];

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
# Enables files to be encrypted to age identities stored on YubiKeys
age-plugin-yubikey

View file

@ -1,6 +1,4 @@
{ inputs, ... }:
{
{inputs, ...}: {
imports = [
inputs.impermanence.nixosModules.impermanence
];

View file

@ -1,6 +1,10 @@
{ inputs, outputs, pkgs, config, ... }:
{
inputs,
outputs,
pkgs,
config,
...
}: {
imports = [
inputs.home-manager.nixosModules.home-manager
];

View file

@ -1,6 +1,8 @@
{ pkgs, config, ... }:
{
pkgs,
config,
...
}: {
age.secrets.smb-secrets = {
rekeyFile = ./smb-secrets.age;
};
@ -14,7 +16,6 @@
options = let
# this line prevents hanging on network split
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,user,users";
in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"];
};
@ -22,4 +23,3 @@
"nixos/smb-secrets".source = config.age.secrets.smb-secrets.path;
};
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
fileSystems."/home/sajenim/.local/share/Steam" = {
device = "/dev/disk/by-label/data";
fsType = "btrfs";

View file

@ -1,6 +1,8 @@
{ inputs, pkgs, ... }:
{
inputs,
pkgs,
...
}: {
imports = [
inputs.home-manager.nixosModules.home-manager
];

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
imports = [
../common/global
@ -15,7 +13,7 @@
./hardware-configuration.nix
];
/* Boot configuration */
# Boot configuration
boot = {
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = [
@ -26,7 +24,7 @@
initrd.kernelModules = ["amdgpu"];
};
/* Hardware configuration */
# Hardware configuration
hardware = {
bluetooth = {
enable = true;
@ -49,7 +47,7 @@
};
};
/* Networking configuration */
# Networking configuration
networking = {
hostName = "fuchsia";
networkmanager.enable = true;

View file

@ -1,6 +1,8 @@
{ config, lib, ... }:
{
config,
lib,
...
}: {
imports = [
../common/optional/ephemeral-btrfs.nix
];
@ -25,7 +27,8 @@
};
swapDevices = [
{ device = "/swap/swapfile";
{
device = "/swap/swapfile";
size = 16 * 1024;
}
];

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
programs = {
zsh.enable = true;
# Load and unload environment variables.
@ -9,4 +7,3 @@
adb.enable = true;
};
}

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
# Our custom power state
environment.etc = {
"default/amdgpu-custom-states.card0" = {
@ -28,4 +26,3 @@
# Install our overclocking script.
environment.systemPackages = with pkgs; [amdgpu-clocks];
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
imports = [
./amdgpu-clocks.nix
./flatpak.nix

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
# Required to install flatpak
xdg.portal = {
enable = true;

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
services.libinput = {
enable = true;
mouse = {accelProfile = "flat";};

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
# Get up and running with large language models locally.
services.ollama = {
enable = true;

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
# Enable necessary udev rules.
services.udev.packages = with pkgs; [
openrgb

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
# Setup our display server
services.xserver = {
enable = true;

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
imports = [
../common/global
../common/users/sajenim
@ -65,4 +63,3 @@
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
imports = [
./jellyfin.nix
./jellyseerr.nix

View file

@ -1,8 +1,6 @@
{ ... }:
let
{...}: let
port = "8096";
in
{
in {
virtualisation.oci-containers.containers = {
# Volunteer-built media solution that puts you in control of your media
jellyfin = {
@ -52,4 +50,3 @@ in
];
};
}

View file

@ -1,8 +1,6 @@
{ ... }:
let
{...}: let
port = "5055";
in
{
in {
virtualisation.oci-containers.containers = {
# Request management
jellyseerr = {
@ -43,4 +41,3 @@ in
];
};
}

View file

@ -1,8 +1,6 @@
{ ... }:
let
{...}: let
port = "8686";
in
{
in {
virtualisation.oci-containers.containers = {
# # Music collection manager for Usenet and BitTorrent users
lidarr = {
@ -46,4 +44,3 @@ in
];
};
}

View file

@ -1,8 +1,6 @@
{ ... }:
let
{...}: let
port = "9925";
in
{
in {
virtualisation.oci-containers.containers = {
mealie = {
autoStart = true;
@ -46,6 +44,4 @@ in
{url = "http://127.0.0.1:${port}";}
];
};
}

View file

@ -1,8 +1,6 @@
{ config, ... }:
let
{config, ...}: let
port = "8181";
in
{
in {
age.secrets.microbin = {
# Environment variables for microbin
rekeyFile = ./environment.age;
@ -47,4 +45,3 @@ in
];
};
}

View file

@ -1,8 +1,6 @@
{ ... }:
let
{...}: let
port = "9696";
in
{
in {
virtualisation.oci-containers.containers = {
# Indexer manager/proxy built on the popular arr .net/reactjs base stack to integrate with your various PVR apps.
prowlarr = {
@ -43,4 +41,3 @@ in
];
};
}

View file

@ -1,8 +1,6 @@
{ ... }:
let
{...}: let
port = "8487";
in
{
in {
virtualisation.oci-containers.containers = {
# # Open-source software alternative to µTorrent
qbittorrent = {
@ -46,4 +44,3 @@ in
];
};
}

View file

@ -1,8 +1,6 @@
{ ... }:
let
{...}: let
port = "7878";
in
{
in {
virtualisation.oci-containers.containers = {
# Movie collection manager for Usenet and BitTorrent users
radarr = {
@ -45,4 +43,3 @@ in
];
};
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
virtualisation.oci-containers.containers = {
# Automatically synchronize recommended settings from the TRaSH guides to your Sonarr/Radarr instances
recyclarr = {

View file

@ -1,8 +1,6 @@
{ ... }:
let
{...}: let
port = "8989";
in
{
in {
virtualisation.oci-containers.containers = {
# PVR for Usenet and BitTorrent users
sonarr = {
@ -46,4 +44,3 @@ in
];
};
}

View file

@ -1,8 +1,10 @@
{ config, lib, ... }:
let
hostname = config.networking.hostName;
in
{
config,
lib,
...
}: let
hostname = config.networking.hostName;
in {
imports = [
../common/optional/ephemeral-btrfs.nix
];
@ -56,7 +58,8 @@ in
};
swapDevices = [
{ device = "/swap/swapfile";
{
device = "/swap/swapfile";
size = 16 * 1024;
}
];

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
services.borgbackup.jobs = {
containers = {
paths = [
@ -33,4 +31,3 @@
};
};
}

View file

@ -1,8 +1,11 @@
{ config, inputs, pkgs, ... }:
let
port = "8080";
in
{
config,
inputs,
pkgs,
...
}: let
port = "8080";
in {
imports = [
inputs.crowdsec.nixosModules.crowdsec
inputs.crowdsec.nixosModules.crowdsec-firewall-bouncer
@ -86,9 +89,12 @@ in
environment.persistence."/persist" = {
directories = [
{ directory = "/var/lib/crowdsec"; user = "crowdsec"; group = "crowdsec"; }
{
directory = "/var/lib/crowdsec";
user = "crowdsec";
group = "crowdsec";
}
];
hideMounts = true;
};
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
imports = [
./traefik
./crowdsec

View file

@ -1,6 +1,4 @@
{ config, ... }:
{
{config, ...}: {
services.forgejo = {
enable = true;
stateDir = "/srv/services/forgejo";
@ -38,4 +36,3 @@
];
};
}

View file

@ -1,6 +1,4 @@
{ config, ... }:
{
{config, ...}: {
# Setup grafana our grafana instance.
services.grafana = {
enable = true;
@ -24,12 +22,14 @@
# Setup our database for grafana.
services.mysql = {
ensureUsers = [{
ensureUsers = [
{
name = "grafana";
ensurePermissions = {
"grafana.*" = "ALL PRIVILEGES";
};
}];
}
];
ensureDatabases = ["grafana"];
};

View file

@ -1,6 +1,4 @@
{ config, ... }:
{
{config, ...}: {
services.lighttpd = {
enable = true;
port = 5624;
@ -27,4 +25,3 @@
];
};
}

View file

@ -1,5 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
let
{
inputs,
pkgs,
lib,
config,
...
}: let
modpack = pkgs.fetchPackwizModpack rec {
version = "7091175a49";
url = "https://git.sajenim.dev/jasmine/minecraft-modpack/raw/commit/${version}/pack.toml";
@ -8,8 +13,7 @@ let
mcVersion = modpack.manifest.versions.minecraft;
fabricVersion = modpack.manifest.versions.fabric;
serverVersion = lib.replaceStrings ["."] ["_"] "fabric-${mcVersion}";
in
{
in {
imports = [
inputs.nix-minecraft.nixosModules.minecraft-servers
];
@ -94,4 +98,3 @@ in
];
};
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
services.mpd = {
enable = true;
musicDirectory = "/srv/multimedia/library/music";

View file

@ -1,10 +1,7 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
services.mysql = {
enable = true;
package = pkgs.mariadb;
dataDir = "/srv/services/mysql";
};
}

View file

@ -1,6 +1,4 @@
{ config, ... }:
{
{config, ...}: {
services.prometheus = {
enable = true;
port = 9001; # Port to listen on.
@ -23,11 +21,12 @@
scrapeConfigs = [
{
job_name = "node";
static_configs = [{
static_configs = [
{
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
}];
}
];
}
];
};
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
services.samba = {
enable = true;
securityType = "user";

View file

@ -1,6 +1,9 @@
{ inputs, config, pkgs, ... }:
{
inputs,
config,
pkgs,
...
}: {
disabledModules = ["services/web-servers/traefik.nix"];
imports = [
@ -86,11 +89,13 @@
# List of domains in our network
domains = [
# Internal services
{ main = "kanto.dev";
{
main = "kanto.dev";
sans = ["*.kanto.dev"];
}
# Public services
{ main = "sajenim.dev";
{
main = "sajenim.dev";
sans = ["*.sajenim.dev"];
}
];
@ -144,20 +149,33 @@
services.prometheus.scrapeConfigs = [
{
job_name = "traefik";
static_configs = [{
static_configs = [
{
targets = ["127.0.0.1:8082"];
}];
}
];
}
];
# Persist our traefik data & logs
environment.persistence."/persist" = {
directories = [
{ directory = "/var/lib/traefik"; user = "traefik"; group = "traefik"; }
{ directory = "/var/log/traefik"; user = "traefik"; group = "traefik"; }
{ directory = "/plugins-storage"; user = "traefik"; group = "traefik"; }
{
directory = "/var/lib/traefik";
user = "traefik";
group = "traefik";
}
{
directory = "/var/log/traefik";
user = "traefik";
group = "traefik";
}
{
directory = "/plugins-storage";
user = "traefik";
group = "traefik";
}
];
hideMounts = true;
};
}

View file

@ -1,6 +1,4 @@
{ config, ... }:
{
{config, ...}: {
# Crowdsec Local API key for the bouncer.
age.secrets.traefik-bouncer-key = {
rekeyFile = ../crowdsec/traefik-bouncer-key.age;
@ -57,4 +55,3 @@
};
};
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
services.traefik.dynamicConfigOptions.http.routers = {
traefik-dashboard = {
rule = "Host(`traefik.kanto.dev`)";
@ -25,4 +23,3 @@
};
};
}

View file

@ -1,10 +1,7 @@
{ ... }:
{
{...}: {
services.traefik.dynamicConfigOptions.http.services = {
ender1.loadBalancer.servers = [
{url = "http://192.168.1.103:80";}
];
};
}

View file

@ -1,7 +1,5 @@
# This file defines overlays
{ inputs, ... }:
{
{inputs, ...}: {
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs final.pkgs;

View file

@ -1,9 +1,10 @@
{ stdenv
, lib
, fetchFromGitHub
, bash
, subversion
, makeWrapper
{
stdenv,
lib,
fetchFromGitHub,
bash,
subversion,
makeWrapper,
}:
stdenv.mkDerivation {
pname = "amdgpu-clocks";
@ -24,4 +25,3 @@
--prefix PATH : ${lib.makeBinPath [bash subversion]}
'';
}

View file

@ -1,6 +1,5 @@
# Custom packages, that can be defined similarly to ones from nixpkgs
# You can build them using 'nix build .#example'
pkgs: {
xmobar = pkgs.callPackage ./xmobar-config {};
xmonad = pkgs.callPackage ./xmonad-config {};

View file

@ -1,5 +1,4 @@
{pkgs}:
pkgs.haskellPackages.developPackage {
root = ./.;
}

View file

@ -1,12 +1,10 @@
{pkgs}:
pkgs.haskellPackages.developPackage {
root = ./.;
source-overrides = {
xmonad = (builtins.fetchTarball {
xmonad = builtins.fetchTarball {
url = "https://github.com/xmonad/xmonad/archive/refs/tags/v0.18.0.tar.gz";
sha256 = "0jlc60n5jarcxgjxm1vcsgc3s2lwmn3c3n56hialhzx54wfskkbc";
});
};
};
}