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

@@ -31,7 +31,7 @@
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {inherit inputs outputs;};
extraSpecialArgs = { inherit inputs outputs; };
backupFileExtension = "backup";
};

View File

@@ -2,9 +2,11 @@
inputs,
lib,
...
}: let
}:
let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
in
{
nix = {
settings = {
trusted-users = [
@@ -37,7 +39,7 @@ in {
};
# Add each flake input as a registry and nix_path
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
}

View File

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

View File

@@ -67,5 +67,5 @@
};
};
networking.firewall.allowedTCPPorts = [ 22 ];
networking.firewall.allowedTCPPorts = [ 22 ];
}

View File

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

View File

@@ -1,6 +1,9 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [mangohud steam-run];
environment.systemPackages = with pkgs; [
mangohud
steam-run
];
hardware.steam-hardware.enable = true;
programs = {
@@ -11,7 +14,7 @@
remotePlay.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
protontricks.enable = true;
extraCompatPackages = with pkgs; [proton-ge-bin];
extraCompatPackages = with pkgs; [ proton-ge-bin ];
extest.enable = true;
};
gamescope = {

View File

@@ -49,51 +49,54 @@
};
};
outputs = {
self,
nixpkgs,
home-manager,
systems,
nixos-cosmic,
sops-nix,
...
} @ inputs: let
inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib;
forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system});
pkgsFor = lib.genAttrs (import systems) (
system:
outputs =
{
self,
nixpkgs,
home-manager,
systems,
nixos-cosmic,
sops-nix,
...
}@inputs:
let
inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib;
forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system});
pkgsFor = lib.genAttrs (import systems) (
system:
import nixpkgs {
inherit system;
config.allowUnfree = true;
}
);
in {
inherit lib;
overlays = import ./overlays {inherit inputs outputs;};
);
in
{
inherit lib;
overlays = import ./overlays { inherit inputs outputs; };
devShells = forEachSystem (pkgs: import ./shell.nix {inherit pkgs;});
formatter = forEachSystem (pkgs: pkgs.treefmt);
devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; });
formatter = forEachSystem (pkgs: pkgs.treefmt);
nixosConfigurations = {
bob = lib.nixosSystem {
modules = [
./systems/bob
];
specialArgs = {inherit inputs outputs;};
};
jeeves = lib.nixosSystem {
modules = [
./systems/jeeves
];
specialArgs = {inherit inputs outputs;};
};
rhapsody-in-green = lib.nixosSystem {
modules = [
./systems/rhapsody-in-green
];
specialArgs = {inherit inputs outputs;};
nixosConfigurations = {
bob = lib.nixosSystem {
modules = [
./systems/bob
];
specialArgs = { inherit inputs outputs; };
};
jeeves = lib.nixosSystem {
modules = [
./systems/jeeves
];
specialArgs = { inherit inputs outputs; };
};
rhapsody-in-green = lib.nixosSystem {
modules = [
./systems/rhapsody-in-green
];
specialArgs = { 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'
stable = final: _prev: {
stable = import inputs.nixpkgs-stable {

View File

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

View File

@@ -66,4 +66,4 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
}

View File

@@ -2,7 +2,7 @@
services = {
ollama = {
enable = true;
loadModels = [
loadModels = [
"codellama:7b"
"deepseek-r1:1.5b"
"deepseek-r1:7b"
@@ -19,6 +19,6 @@
enable = true;
openFirewall = true;
host = "192.168.90.25";
};
};
}
};
};
}

View File

@@ -1,4 +1,4 @@
{
{
services.syncthing.settings.folders = {
"dotfiles" = {
path = "/home/richie/dotfiles";

View File

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

View File

@@ -3,7 +3,11 @@ let
in
{
networking.firewall = {
allowedTCPPorts = [ 6882 8081 8118 ];
allowedTCPPorts = [
6882
8081
8118
];
allowedUDPPorts = [ 6882 ];
};
virtualisation.oci-containers.containers.qbitvpn = {
@@ -36,7 +40,7 @@ in
DELUGE_DAEMON_LOG_LEVEL = "debug";
DELUGE_WEB_LOG_LEVEL = "debug";
};
environmentFiles = ["${vars.storage_secrets}/docker/qbitvpn"];
environmentFiles = [ "${vars.storage_secrets}/docker/qbitvpn" ];
autoStart = true;
};
}

View File

@@ -1,6 +1,11 @@
{ config, lib, modulesPath, ... }:
{
imports =[ (modulesPath + "/installer/scan/not-detected.nix") ];
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
loader = {
@@ -88,22 +93,32 @@
bypassWorkqueues = true;
allowDiscards = true;
};
"luks-storage_pool-wwn-0x5000cca23bc438dd-part1".device = "/dev/disk/by-id/wwn-0x5000cca23bc438dd-part1";
"luks-storage_pool-wwn-0x5000cca23bd035f5-part1".device = "/dev/disk/by-id/wwn-0x5000cca23bd035f5-part1";
"luks-storage_pool-wwn-0x5000cca23bd00ad6-part1".device = "/dev/disk/by-id/wwn-0x5000cca23bd00ad6-part1";
"luks-storage_pool-wwn-0x5000cca23bcf313e-part1".device = "/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";
"luks-storage_pool-wwn-0x5000cca23bc438dd-part1".device =
"/dev/disk/by-id/wwn-0x5000cca23bc438dd-part1";
"luks-storage_pool-wwn-0x5000cca23bd035f5-part1".device =
"/dev/disk/by-id/wwn-0x5000cca23bd035f5-part1";
"luks-storage_pool-wwn-0x5000cca23bd00ad6-part1".device =
"/dev/disk/by-id/wwn-0x5000cca23bd00ad6-part1";
"luks-storage_pool-wwn-0x5000cca23bcf313e-part1".device =
"/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
"luks-torrenting_pool-wwn-0x500a0751e6c3c01e-part1" = {
device = "/dev/disk/by-id/wwn-0x500a0751e6c3c01e-part1";
bypassWorkqueues = true;
allowDiscards = true;
};
"luks-torrenting_pool-wwn-0x5000cca264f080a3-part1".device = "/dev/disk/by-id/wwn-0x5000cca264f080a3-part1";
"luks-torrenting_pool-wwn-0x5000cca298c33ae5-part1".device = "/dev/disk/by-id/wwn-0x5000cca298c33ae5-part1";
"luks-torrenting_pool-wwn-0x5000cca264f080a3-part1".device =
"/dev/disk/by-id/wwn-0x5000cca264f080a3-part1";
"luks-torrenting_pool-wwn-0x5000cca298c33ae5-part1".device =
"/dev/disk/by-id/wwn-0x5000cca298c33ae5-part1";
# cspell:enable
};
};
@@ -122,8 +137,8 @@
fsType = "zfs";
};
"/nix" =
{ device = "root_pool/nix";
"/nix" = {
device = "root_pool/nix";
fsType = "zfs";
};
@@ -146,7 +161,7 @@
options = [
"fmask=0077"
"dmask=0077"
];
];
};
};

View File

@@ -12,7 +12,7 @@
"10-1GB_Primary" = {
matchConfig.Name = "enp98s0f0";
address = [ "192.168.95.14/24" ];
routes = [{ Gateway = "192.168.95.1"; }];
routes = [ { Gateway = "192.168.95.1"; } ];
linkConfig.RequiredForOnline = "routable";
};
"10-1GB_Secondary" = {

View File

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

View File

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

View File

@@ -8,6 +8,7 @@ in
openFirewall = true;
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";
}

View File

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

View File

@@ -1,8 +1,11 @@
{
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedTCPPorts = [
80
443
];
services.haproxy = {
enable = true;
config = builtins.readFile ./haproxy.cfg;
};
}
}

View File

@@ -2,7 +2,7 @@ let
vars = import ../vars.nix;
in
{
services ={
services = {
home-assistant = {
enable = true;
openFirewall = true;
@@ -62,9 +62,9 @@ in
extraComponents = [ "isal" ];
};
esphome = {
enable = true;
openFirewall = true;
address = "192.168.90.40";
enable = true;
openFirewall = true;
address = "192.168.90.40";
};
};
}

View File

@@ -16,7 +16,7 @@ in
#type database DBuser origin-address auth-method
local all all trust
# ipv4
host all all 127.0.0.1/32 trust
host all all 192.168.90.1/24 trust

View File

@@ -2,8 +2,8 @@ let
vars = import ./vars.nix;
in
{
networking.firewall.allowedTCPPorts = [ 8384 ];
networking.firewall.allowedTCPPorts = [ 8384 ];
services.syncthing = {
guiAddress = "192.168.90.40:8384";
settings = {
@@ -77,7 +77,7 @@ in
];
fsWatcherEnabled = true;
};
#
#
"davids-backup1" = {
id = "8229p-8z3tm"; # cspell:disable-line
path = "${vars.storage_syncthing}/davids_backups/1";

View File

@@ -11,7 +11,7 @@ in
media_docker_configs = "${zfs_media}/docker/configs";
media_mirror = "${zfs_media}/mirror";
media_share = "${zfs_media}/share";
media_services = "${zfs_media}/services";
media_services = "${zfs_media}/services";
media_notes = "${zfs_media}/notes";
media_plex = "${zfs_media}/plex";
media_home_assistant = "${zfs_media}/home_assistant";

View File

@@ -26,7 +26,7 @@
services = {
openssh.ports = [ 922 ];
desktopManager.cosmic.enable = true;
desktopManager.cosmic.enable = true;
};
system.stateVersion = "24.05";

View File

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

View File

@@ -1,4 +1,4 @@
{
{
services.syncthing.settings.folders = {
"dotfiles" = {
path = "/home/richie/dotfiles";

View File

@@ -266,7 +266,7 @@ def installer(
if encrypt_key:
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:
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)
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)

View File

@@ -2,7 +2,7 @@
pkgs,
config,
...
}:
}:
{
sops.secrets.gaming_password = {
sopsFile = ../secrets.yaml;
@@ -16,8 +16,7 @@
shell = pkgs.zsh;
group = "gaming";
extraGroups =
[
extraGroups = [
"audio"
"video"
"users"
@@ -27,5 +26,5 @@
groups.gaming.gid = 1100;
};
home-manager.users.gaming = import ./systems/${config.networking.hostName}.nix;
home-manager.users.gaming = import ./systems/${config.networking.hostName}.nix;
}

View File

@@ -137,7 +137,8 @@
"permissions.default.desktop-notification" = 0; # allow websites to ask
# PREF: allow websites to ask you for your location
"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" = "";
"webchannel.allowObject.urlWhitelist" = "";

View File

@@ -2,9 +2,11 @@
pkgs,
config,
...
}: let
}:
let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in {
in
{
sops.secrets.richie_password = {
sopsFile = ../secrets.yaml;
@@ -23,28 +25,28 @@ in {
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYZFsc9CSH03ZUP7y81AHwSyjLwFmcshVFCyxDcYhBT rhapsody-in-green" # cspell:disable-line
];
extraGroups =
[
"audio"
"video"
"wheel"
"users"
]
++ ifTheyExist [
"dialout"
"docker"
"hass"
"libvirtd"
"networkmanager"
"plugdev"
"scanner"
"uaccess"
"wireshark"
];
[
"audio"
"video"
"wheel"
"users"
]
++ ifTheyExist [
"dialout"
"docker"
"hass"
"libvirtd"
"networkmanager"
"plugdev"
"scanner"
"uaccess"
"wireshark"
];
uid = 1000;
};
groups.richie.gid = 1000;
};
home-manager.users.richie = import ./systems/${config.networking.hostName}.nix;
home-manager.users.richie = import ./systems/${config.networking.hostName}.nix;
}

View File

@@ -17,7 +17,11 @@
search = {
force = true;
default = "kagi";
order = [ "kagi" "DuckDuckGo" "Google" ];
order = [
"kagi"
"DuckDuckGo"
"Google"
];
};
settings = {
# SECTION: FASTFOX
@@ -138,7 +142,8 @@
"permissions.default.desktop-notification" = 0; # allow websites to ask
# PREF: allow websites to ask you for your location
"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" = "";
"webchannel.allowObject.urlWhitelist" = "";

View File

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

View File

@@ -4,8 +4,10 @@ let
in
{
# 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/keybindings.json".source = config.lib.file.mkOutOfStoreSymlink "${vscode_dir}/keybindings.json";
xdg.configFile."Code/User/settings.json".source =
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 ];