feat: Massive update

This commit is contained in:
Kyle Brown 2023-12-31 14:19:50 -08:00
parent 0fef5894a0
commit fe89e67a70
9 changed files with 194 additions and 48 deletions

View file

@ -25,4 +25,19 @@
pipewire
wireplumber
];
environment.etc.
"wireplumber/main.lua.d/99-alsa-lowlatency.lua".text = ''
alsa_monitor.rules = {
{
matches = {{{ "node.name", "matches", "alsa_output.usb-DENAFRIPS*" }}};
apply_properties = {
["audio.format"] = "S32LE",
["audio.rate"] = "128000", -- for USB soundcards it should be twice your desired rate
["api.alsa.period-size"] = 2, -- defaults to 1024, tweak by trial-and-error
-- ["api.alsa.disable-batch"] = true, -- generally, USB soundcards use the batch mode
},
},
}
'';
}

View file

@ -31,5 +31,10 @@
what = "morbo:/backups";
where = "/mnt/gbackups";
}
{
type = "glusterfs";
what = "morbo:/minecraft";
where = "/mnt/gminecraft";
}
];
}

View file

@ -26,5 +26,9 @@
wantedBy = ["multi-user.target"];
where = "/mnt/gbackups";
}
{
wantedBy = ["multi-user.target"];
where = "/mnt/gminecraft";
}
];
}

View file

@ -31,5 +31,10 @@
what = "127.0.0.1:/backups";
where = "/mnt/gbackups";
}
{
type = "glusterfs";
what = "127.0.0.1:/minecraft";
where = "/mnt/gminecraft";
}
];
}

View file

@ -10,7 +10,7 @@
./packages.nix
./users.nix
./locale.nix
./smart.nix
# ./smart.nix
# ./prometheus.nix
../../common/style/stylix.nix
];

View file

@ -23,5 +23,6 @@
home-manager
git
nix-tree
xfsprogs
];
}

View file

@ -3,8 +3,11 @@
lib,
pkgs,
...
}: {
}: let
hostname = builtins.getEnv "HOSTNAME";
in {
services.prometheus = {
enable = true;
port = 9001;
scrapeConfigs = [
{
@ -12,6 +15,7 @@
static_configs = [
{
targets = ["localhost:${toString config.services.prometheus.exporters.node.port}"];
labels.host = hostname;
}
];
}
@ -39,4 +43,115 @@
};
};
};
services.promtail = {
enable = true;
configuration = {
server = {
http_listen_port = 3031;
grpc_listen_port = 0;
};
# Pushes to loki
clients = [
{
url = "http://127.0.0.1:${toString config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push";
}
];
scrape_configs = [
{
job_name = "journal";
journal = {
max_age = "12h";
labels = {
job = "systemd-journal";
host = hostname;
};
};
relabel_configs = [
{
source_labels = ["__journal__systemd_unit"];
target_label = "unit";
}
];
}
];
};
};
services.loki = {
# Data collection
enable = true;
configuration = {
server.http_listen_port = 3029;
auth_enabled = false;
ingester = {
lifecycler = {
address = "127.0.0.1";
ring = {
kvstore = {
store = "inmemory";
};
replication_factor = 1;
};
};
chunk_idle_period = "1h";
max_chunk_age = "1h";
chunk_target_size = 999999;
chunk_retain_period = "30s";
max_transfer_retries = 0;
};
schema_config = {
configs = [
{
from = "2022-06-06";
store = "boltdb-shipper";
object_store = "filesystem";
schema = "v11";
index = {
prefix = "index_";
period = "24h";
};
}
];
};
storage_config = {
boltdb_shipper = {
active_index_directory = "/var/lib/loki/boltdb-shipper-active";
cache_location = "/var/lib/loki/boltdb-shipper-cache";
cache_ttl = "24h";
shared_store = "filesystem";
};
filesystem = {
directory = "/var/lib/loki/chunks";
};
};
limits_config = {
reject_old_samples = true;
reject_old_samples_max_age = "168h";
};
chunk_store_config = {
max_look_back_period = "0s";
};
table_manager = {
retention_deletes_enabled = false;
retention_period = "0s";
};
compactor = {
working_directory = "/var/lib/loki";
shared_store = "filesystem";
compactor_ring = {
kvstore = {
store = "inmemory";
};
};
};
};
# user, group, dataDir, extraFlags, (configFile)
};
}

View file

@ -1,6 +1,7 @@
{pkgs, ...}: let
vimix-cursors = pkgs.callPackage ./vimix-cursors.nix {};
in {
fonts.fontDir.enable = true;
stylix = {
image = pkgs.fetchurl {
url = "https://git.kdb424.xyz/kdb424/wallpapers/raw/branch/main/wallhaven-7p3we9.png";

92
flake.lock generated
View file

@ -9,11 +9,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1703043529,
"narHash": "sha256-3OCMEA/RPwgdzFfQGXRQyvHlWYKY0tTbrlR5ETBzEYI=",
"lastModified": 1703450140,
"narHash": "sha256-ZNNcuLJAjJbkRlU/53KKOgs1xI+y/LXWBdBukbm3hxY=",
"owner": "tpwrules",
"repo": "nixos-apple-silicon",
"rev": "56c1ef38d3e04eae9b5867669ed131601fa99a7d",
"rev": "9f81761270e6343d00b99d3e07e1feee8f3ba4b5",
"type": "github"
},
"original": {
@ -159,11 +159,11 @@
]
},
"locked": {
"lastModified": 1703271201,
"narHash": "sha256-9uB7x1XP+/+We4mYpxC8UMgxlC0efP6P+4dsgqFuxCU=",
"lastModified": 1703990467,
"narHash": "sha256-LItEeQVwDfLnavNskwdfRnonbEdq8DYiJlWRtF+bwng=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "010a625bd74bc623153344f52f71cc965b31d75a",
"rev": "1a41453cba42a3a1af2fff003be455ddbd75386c",
"type": "github"
},
"original": {
@ -181,11 +181,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1702399955,
"narHash": "sha256-FnB5O1RVFzj3h7Ayf7UxFnOL1gsJuG6gn1LCTd9dKFs=",
"lastModified": 1704039425,
"narHash": "sha256-rckPbxzkdkn7i6yg71K7aMmoC1taLR18Rv1FadWKLPw=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "47798c4ab07d5f055bb2625010cf6d8e3f384923",
"rev": "3eaaeef710b852dc55ef09b85cc438ca8c7f58b8",
"type": "github"
},
"original": {
@ -395,11 +395,11 @@
]
},
"locked": {
"lastModified": 1703265279,
"narHash": "sha256-5jVtOwyMH1FzclxHrsFWzBdB+VyjUUSu1wyZhZlR6WU=",
"lastModified": 1703995158,
"narHash": "sha256-oYMwbObpWheGeeNWY1LjO/+omrbAWDNdyzNDxTr2jo8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "07c322a7cff03267fd881adae1afe63367c5d608",
"rev": "2e8634c252890cb38c60ab996af04926537cbc27",
"type": "github"
},
"original": {
@ -438,11 +438,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1703282436,
"narHash": "sha256-HbRWVLnTkQN8TAaD5WvnCz8x+jRSLASRzAvUzaaQo/A=",
"lastModified": 1704027264,
"narHash": "sha256-RzzCNXrSjQAIB4C84/WZ5eYna20d2ZBKhE/PtWK89SM=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "79ef29d6e0d0a33818cbe90b52f7657d920b3e54",
"rev": "46997a764304366d772456c20b1c719960927aa7",
"type": "github"
},
"original": {
@ -483,11 +483,11 @@
]
},
"locked": {
"lastModified": 1702864432,
"narHash": "sha256-xR5Igg2hnm979W3YgMDrSjErHFhHo4rbMboF6DC0mbc=",
"lastModified": 1703992163,
"narHash": "sha256-709CGmwU34dxv8DjSpRBZ+HibVJIVaFcA4JH+GFnhyM=",
"owner": "Mic92",
"repo": "nix-index-database",
"rev": "4605ccd764fac78b9e4b5b058698cb9f04430b91",
"rev": "d6510ce144f5da7dd9bac667ba3d5a4946c00d11",
"type": "github"
},
"original": {
@ -498,11 +498,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1702312524,
"narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=",
"lastModified": 1703438236,
"narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a9bf124c46ef298113270b1f84a164865987a91c",
"rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b",
"type": "github"
},
"original": {
@ -514,16 +514,16 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1702221085,
"narHash": "sha256-Br3GCSkkvkmw46cT6wCz6ro2H1WgDMWbKE0qctbdtL0=",
"lastModified": 1703900474,
"narHash": "sha256-Zu+chYVYG2cQ4FCbhyo6rc5Lu0ktZCjRbSPE0fDgukI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c2786e7084cbad90b4f9472d5b5e35ecb57958af",
"rev": "9dd7699928e26c3c00d5d46811f1358524081062",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
@ -562,11 +562,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1703013332,
"narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=",
"lastModified": 1703637592,
"narHash": "sha256-8MXjxU0RfFfzl57Zy3OfXCITS0qWDNLzlBAdwxGZwfY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6",
"rev": "cfc3698c31b1fb9cdcf10f36c9643460264d0ca8",
"type": "github"
},
"original": {
@ -578,11 +578,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1703013332,
"narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=",
"lastModified": 1703637592,
"narHash": "sha256-8MXjxU0RfFfzl57Zy3OfXCITS0qWDNLzlBAdwxGZwfY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6",
"rev": "cfc3698c31b1fb9cdcf10f36c9643460264d0ca8",
"type": "github"
},
"original": {
@ -601,11 +601,11 @@
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1703260550,
"narHash": "sha256-wPe+0oCgzvf9Ixscme+NUS4iRX0n/alJvt3msnu9vPA=",
"lastModified": 1704054753,
"narHash": "sha256-9T+qOi0QDE9t9WLtD7XZteP8b29gbhR2BoTtUJmcSxY=",
"owner": "pta2002",
"repo": "nixvim",
"rev": "e0521dde87825e4ed16e1ac5b6df9f1b7e60af05",
"rev": "2bcdcfafe5b3fd0d434a1bac1aa242b0a59b5112",
"type": "github"
},
"original": {
@ -626,11 +626,11 @@
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1702456155,
"narHash": "sha256-I2XhXGAecdGlqi6hPWYT83AQtMgL+aa3ulA85RAEgOk=",
"lastModified": 1703426812,
"narHash": "sha256-aODSOH8Og8ne4JylPJn+hZ6lyv6K7vE5jFo4KAGIebM=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "007a45d064c1c32d04e1b8a0de5ef00984c419bc",
"rev": "7f35ec30d16b38fe0eed8005933f418d1a4693ee",
"type": "github"
},
"original": {
@ -650,11 +650,11 @@
"nixpkgs-stable": "nixpkgs-stable_3"
},
"locked": {
"lastModified": 1702456155,
"narHash": "sha256-I2XhXGAecdGlqi6hPWYT83AQtMgL+aa3ulA85RAEgOk=",
"lastModified": 1703939133,
"narHash": "sha256-Gxe+mfOT6bL7wLC/tuT2F+V+Sb44jNr8YsJ3cyIl4Mo=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "007a45d064c1c32d04e1b8a0de5ef00984c419bc",
"rev": "9d3d7e18c6bc4473d7520200d4ddab12f8402d38",
"type": "github"
},
"original": {
@ -711,11 +711,11 @@
]
},
"locked": {
"lastModified": 1703276680,
"narHash": "sha256-x6TFGuFZntWhr03T3gazkEbrfATqodnZg7lCXcidPnQ=",
"lastModified": 1703880383,
"narHash": "sha256-YAIbWRAKOCaWDQ4A29xXr79VTuAk9lPJSPYhMBk/VjU=",
"owner": "danth",
"repo": "stylix",
"rev": "ecbbe933a97217b8211408a81a6c7a35db80633a",
"rev": "5a7f3f15ccc2a272e5873bb44fe378ab5d99e0ff",
"type": "github"
},
"original": {
@ -834,11 +834,11 @@
]
},
"locked": {
"lastModified": 1702334919,
"narHash": "sha256-ibOZ3TLjqndGMcj2f+07NFwDWoum4IbzF58byZuJJNg=",
"lastModified": 1703514399,
"narHash": "sha256-VRr5Xc4S/VPr/gU3fiOD3vSIL2+GJ+LUrmFTWTwnTz4=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "f5c3576c3b6cb1c31a8dfa3e4113f59bfe40cd71",
"rev": "0a318a7a217a6402b0b705837cd5b50b0e94b31b",
"type": "github"
},
"original": {