ran nix fmt .

This commit is contained in:
2025-02-08 17:38:15 -05:00
parent c12bd0c7ca
commit 300aa1f032
35 changed files with 215 additions and 134 deletions

View File

@@ -2,9 +2,11 @@
inputs, inputs,
lib, lib,
... ...
}: let }:
let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in { in
{
nix = { nix = {
settings = { settings = {
trusted-users = [ trusted-users = [

View File

@@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }: {
inputs,
pkgs,
lib,
config,
...
}:
let let
cfg = config.services.snapshot_manager; cfg = config.services.snapshot_manager;
in in

View File

@@ -2,6 +2,9 @@
{ {
services.printing = { services.printing = {
enable = true; enable = true;
drivers = with pkgs; [ gutenprint hplip ]; drivers = with pkgs; [
gutenprint
hplip
];
}; };
} }

View File

@@ -1,6 +1,9 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
environment.systemPackages = with pkgs; [mangohud steam-run]; environment.systemPackages = with pkgs; [
mangohud
steam-run
];
hardware.steam-hardware.enable = true; hardware.steam-hardware.enable = true;
programs = { programs = {

View File

@@ -49,7 +49,8 @@
}; };
}; };
outputs = { outputs =
{
self, self,
nixpkgs, nixpkgs,
home-manager, home-manager,
@@ -57,7 +58,8 @@
nixos-cosmic, nixos-cosmic,
sops-nix, sops-nix,
... ...
} @ inputs: let }@inputs:
let
inherit (self) outputs; inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib; lib = nixpkgs.lib // home-manager.lib;
forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system});
@@ -68,7 +70,8 @@
config.allowUnfree = true; config.allowUnfree = true;
} }
); );
in { in
{
inherit lib; inherit lib;
overlays = import ./overlays { inherit inputs outputs; }; overlays = import ./overlays { inherit inputs outputs; };

View File

@@ -1,4 +1,5 @@
{inputs, ...}: { { inputs, ... }:
{
# When applied, the stable nixpkgs set (declared in the flake inputs) will be accessible through 'pkgs.stable' # When applied, the stable nixpkgs set (declared in the flake inputs) will be accessible through 'pkgs.stable'
stable = final: _prev: { stable = final: _prev: {
stable = import inputs.nixpkgs-stable { stable = import inputs.nixpkgs-stable {

View File

@@ -1,4 +1,8 @@
{pkgs ? import <nixpkgs> {}, ...}: { {
pkgs ? import <nixpkgs> { },
...
}:
{
default = pkgs.mkShell { default = pkgs.mkShell {
NIX_CONFIG = "extra-experimental-features = nix-command flakes ca-derivations"; NIX_CONFIG = "extra-experimental-features = nix-command flakes ca-derivations";
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [

View File

@@ -3,8 +3,15 @@ let
in in
{ {
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 6881 8082 29432 ]; allowedTCPPorts = [
allowedUDPPorts = [ 6881 29432 ]; 6881
8082
29432
];
allowedUDPPorts = [
6881
29432
];
}; };
virtualisation.oci-containers.containers.qbit = { virtualisation.oci-containers.containers.qbit = {
image = "ghcr.io/linuxserver/qbittorrent:5.0.2"; image = "ghcr.io/linuxserver/qbittorrent:5.0.2";

View File

@@ -3,7 +3,11 @@ let
in in
{ {
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 6882 8081 8118 ]; allowedTCPPorts = [
6882
8081
8118
];
allowedUDPPorts = [ 6882 ]; allowedUDPPorts = [ 6882 ];
}; };
virtualisation.oci-containers.containers.qbitvpn = { virtualisation.oci-containers.containers.qbitvpn = {

View File

@@ -1,4 +1,9 @@
{ config, lib, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
@@ -88,22 +93,32 @@
bypassWorkqueues = true; bypassWorkqueues = true;
allowDiscards = true; allowDiscards = true;
}; };
"luks-storage_pool-wwn-0x5000cca23bc438dd-part1".device = "/dev/disk/by-id/wwn-0x5000cca23bc438dd-part1"; "luks-storage_pool-wwn-0x5000cca23bc438dd-part1".device =
"luks-storage_pool-wwn-0x5000cca23bd035f5-part1".device = "/dev/disk/by-id/wwn-0x5000cca23bd035f5-part1"; "/dev/disk/by-id/wwn-0x5000cca23bc438dd-part1";
"luks-storage_pool-wwn-0x5000cca23bd00ad6-part1".device = "/dev/disk/by-id/wwn-0x5000cca23bd00ad6-part1"; "luks-storage_pool-wwn-0x5000cca23bd035f5-part1".device =
"luks-storage_pool-wwn-0x5000cca23bcf313e-part1".device = "/dev/disk/by-id/wwn-0x5000cca23bcf313e-part1"; "/dev/disk/by-id/wwn-0x5000cca23bd035f5-part1";
"luks-storage_pool-wwn-0x5000cca23bcdf3b8-part1".device = "/dev/disk/by-id/wwn-0x5000cca23bcdf3b8-part1"; "luks-storage_pool-wwn-0x5000cca23bd00ad6-part1".device =
"luks-storage_pool-wwn-0x5000cca23bd02746-part1".device = "/dev/disk/by-id/wwn-0x5000cca23bd02746-part1"; "/dev/disk/by-id/wwn-0x5000cca23bd00ad6-part1";
"luks-storage_pool-wwn-0x5000cca23bcf9f89-part1".device = "/dev/disk/by-id/wwn-0x5000cca23bcf9f89-part1"; "luks-storage_pool-wwn-0x5000cca23bcf313e-part1".device =
"luks-storage_pool-wwn-0x5000cca23bd00ae9-part1".device = "/dev/disk/by-id/wwn-0x5000cca23bd00ae9-part1"; "/dev/disk/by-id/wwn-0x5000cca23bcf313e-part1";
"luks-storage_pool-wwn-0x5000cca23bcdf3b8-part1".device =
"/dev/disk/by-id/wwn-0x5000cca23bcdf3b8-part1";
"luks-storage_pool-wwn-0x5000cca23bd02746-part1".device =
"/dev/disk/by-id/wwn-0x5000cca23bd02746-part1";
"luks-storage_pool-wwn-0x5000cca23bcf9f89-part1".device =
"/dev/disk/by-id/wwn-0x5000cca23bcf9f89-part1";
"luks-storage_pool-wwn-0x5000cca23bd00ae9-part1".device =
"/dev/disk/by-id/wwn-0x5000cca23bd00ae9-part1";
# Torrenting pool # Torrenting pool
"luks-torrenting_pool-wwn-0x500a0751e6c3c01e-part1" = { "luks-torrenting_pool-wwn-0x500a0751e6c3c01e-part1" = {
device = "/dev/disk/by-id/wwn-0x500a0751e6c3c01e-part1"; device = "/dev/disk/by-id/wwn-0x500a0751e6c3c01e-part1";
bypassWorkqueues = true; bypassWorkqueues = true;
allowDiscards = true; allowDiscards = true;
}; };
"luks-torrenting_pool-wwn-0x5000cca264f080a3-part1".device = "/dev/disk/by-id/wwn-0x5000cca264f080a3-part1"; "luks-torrenting_pool-wwn-0x5000cca264f080a3-part1".device =
"luks-torrenting_pool-wwn-0x5000cca298c33ae5-part1".device = "/dev/disk/by-id/wwn-0x5000cca298c33ae5-part1"; "/dev/disk/by-id/wwn-0x5000cca264f080a3-part1";
"luks-torrenting_pool-wwn-0x5000cca298c33ae5-part1".device =
"/dev/disk/by-id/wwn-0x5000cca298c33ae5-part1";
# cspell:enable # cspell:enable
}; };
}; };
@@ -122,8 +137,8 @@
fsType = "zfs"; fsType = "zfs";
}; };
"/nix" = "/nix" = {
{ device = "root_pool/nix"; device = "root_pool/nix";
fsType = "zfs"; fsType = "zfs";
}; };

View File

@@ -15,7 +15,6 @@
groups.github-runners.gid = 601; groups.github-runners.gid = 601;
}; };
services.nix_builder.containers = { services.nix_builder.containers = {
nix-builder-0.enable = true; nix-builder-0.enable = true;
nix-builder-1.enable = true; nix-builder-1.enable = true;

View File

@@ -7,14 +7,20 @@ let
in in
{ {
options.services.nix_builder.containers = mkOption { options.services.nix_builder.containers = mkOption {
type = types.attrsOf (types.submodule ({ name, ... }: { type = types.attrsOf (
types.submodule (
{ name, ... }:
{
options.enable = mkEnableOption "GitHub runner container"; options.enable = mkEnableOption "GitHub runner container";
})); }
)
);
default = { }; default = { };
description = "GitHub runner container configurations"; description = "GitHub runner container configurations";
}; };
config.containers = mapAttrs (name: cfg: config.containers = mapAttrs (
name: cfg:
mkIf cfg.enable { mkIf cfg.enable {
autoStart = true; autoStart = true;
bindMounts = { bindMounts = {
@@ -25,7 +31,14 @@ in
"/secrets".mountPoint = "${vars.storage_secrets}/services/github-runners/${name}"; "/secrets".mountPoint = "${vars.storage_secrets}/services/github-runners/${name}";
"ssh-keys".mountPoint = "${vars.storage_secrets}/services/github-runners/id_ed25519_github-runners"; "ssh-keys".mountPoint = "${vars.storage_secrets}/services/github-runners/id_ed25519_github-runners";
}; };
config = { config, pkgs, lib, ... }: { config =
{
config,
pkgs,
lib,
...
}:
{
nix.settings = { nix.settings = {
trusted-substituters = [ trusted-substituters = [
"https://cache.nixos.org" "https://cache.nixos.org"
@@ -65,7 +78,10 @@ in
tokenFile = "${vars.storage_secrets}/services/github-runners/${name}"; tokenFile = "${vars.storage_secrets}/services/github-runners/${name}";
user = "github-runners"; user = "github-runners";
group = "github-runners"; group = "github-runners";
extraPackages = with pkgs; [ nixos-rebuild openssh ]; extraPackages = with pkgs; [
nixos-rebuild
openssh
];
}; };
users = { users = {
users.github-runners = { users.github-runners = {

View File

@@ -8,6 +8,7 @@ in
openFirewall = true; openFirewall = true;
host = "192.168.90.40"; host = "192.168.90.40";
}; };
systemd.services.audiobookshelf.serviceConfig.WorkingDirectory = lib.mkForce "${vars.media_docker_configs}/audiobookshelf"; systemd.services.audiobookshelf.serviceConfig.WorkingDirectory =
lib.mkForce "${vars.media_docker_configs}/audiobookshelf";
users.users.audiobookshelf.home = lib.mkForce "${vars.media_docker_configs}/audiobookshelf"; users.users.audiobookshelf.home = lib.mkForce "${vars.media_docker_configs}/audiobookshelf";
} }

View File

@@ -15,4 +15,3 @@ in
}; };
}; };
} }

View File

@@ -1,5 +1,8 @@
{ {
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [
80
443
];
services.haproxy = { services.haproxy = {
enable = true; enable = true;

View File

@@ -1,4 +1,9 @@
{ config, lib, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

View File

@@ -266,7 +266,7 @@ def installer(
if encrypt_key: if encrypt_key:
pool_disks = [ pool_disks = [
f'/dev/mapper/luks-root-pool-{disk.split("/")[-1]}-part2' for disk in disks f"/dev/mapper/luks-root-pool-{disk.split('/')[-1]}-part2" for disk in disks
] ]
else: else:
pool_disks = [f"{disk}-part2" for disk in disks] pool_disks = [f"{disk}-part2" for disk in disks]
@@ -448,7 +448,7 @@ def draw_device_menu(
type_padding = calculate_device_menu_padding(devices, "type", padding) type_padding = calculate_device_menu_padding(devices, "type", padding)
mountpoints_padding = calculate_device_menu_padding(devices, "mountpoints", padding) mountpoints_padding = calculate_device_menu_padding(devices, "mountpoints", padding)
device_header = f"{"Name":{name_padding}}{"Size":{size_padding}}{"Type":{type_padding}}{"Mountpoints":{mountpoints_padding}}" device_header = f"{'Name':{name_padding}}{'Size':{size_padding}}{'Type':{type_padding}}{'Mountpoints':{mountpoints_padding}}"
menu_width = range(menu_start_x, len(device_header) + menu_start_x) menu_width = range(menu_start_x, len(device_header) + menu_start_x)

View File

@@ -16,8 +16,7 @@
shell = pkgs.zsh; shell = pkgs.zsh;
group = "gaming"; group = "gaming";
extraGroups = extraGroups = [
[
"audio" "audio"
"video" "video"
"users" "users"

View File

@@ -137,7 +137,8 @@
"permissions.default.desktop-notification" = 0; # allow websites to ask "permissions.default.desktop-notification" = 0; # allow websites to ask
# PREF: allow websites to ask you for your location # PREF: allow websites to ask you for your location
"permissions.default.geo" = 0; "permissions.default.geo" = 0;
"geo.provider.network.url" = "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%"; "geo.provider.network.url" =
"https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%";
"permissions.manager.defaultsUrl" = ""; "permissions.manager.defaultsUrl" = "";
"webchannel.allowObject.urlWhitelist" = ""; "webchannel.allowObject.urlWhitelist" = "";

View File

@@ -2,9 +2,11 @@
pkgs, pkgs,
config, config,
... ...
}: let }:
let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in { in
{
sops.secrets.richie_password = { sops.secrets.richie_password = {
sopsFile = ../secrets.yaml; sopsFile = ../secrets.yaml;

View File

@@ -17,7 +17,11 @@
search = { search = {
force = true; force = true;
default = "kagi"; default = "kagi";
order = [ "kagi" "DuckDuckGo" "Google" ]; order = [
"kagi"
"DuckDuckGo"
"Google"
];
}; };
settings = { settings = {
# SECTION: FASTFOX # SECTION: FASTFOX
@@ -138,7 +142,8 @@
"permissions.default.desktop-notification" = 0; # allow websites to ask "permissions.default.desktop-notification" = 0; # allow websites to ask
# PREF: allow websites to ask you for your location # PREF: allow websites to ask you for your location
"permissions.default.geo" = 0; "permissions.default.geo" = 0;
"geo.provider.network.url" = "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%"; "geo.provider.network.url" =
"https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%";
"permissions.manager.defaultsUrl" = ""; "permissions.manager.defaultsUrl" = "";
"webchannel.allowObject.urlWhitelist" = ""; "webchannel.allowObject.urlWhitelist" = "";

View File

@@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.kitty = { programs.kitty = {
enable = true; enable = true;
font.name = "IntoneMono Nerd Font"; font.name = "IntoneMono Nerd Font";

View File

@@ -4,8 +4,10 @@ let
in in
{ {
# mutable symlinks to key binds and settings # mutable symlinks to key binds and settings
xdg.configFile."Code/User/settings.json".source = config.lib.file.mkOutOfStoreSymlink "${vscode_dir}/settings.json"; xdg.configFile."Code/User/settings.json".source =
xdg.configFile."Code/User/keybindings.json".source = config.lib.file.mkOutOfStoreSymlink "${vscode_dir}/keybindings.json"; config.lib.file.mkOutOfStoreSymlink "${vscode_dir}/settings.json";
xdg.configFile."Code/User/keybindings.json".source =
config.lib.file.mkOutOfStoreSymlink "${vscode_dir}/keybindings.json";
home.packages = with pkgs; [ nil ]; home.packages = with pkgs; [ nil ];