Merge branch '24.05'

This commit is contained in:
Motiejus Jakštys 2024-06-05 14:34:48 +03:00
commit 5c76eef615
15 changed files with 53 additions and 5835 deletions

View File

@ -157,16 +157,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1717476296, "lastModified": 1716736833,
"narHash": "sha256-ScHe38Tr+TxGURC17kby4mIIxOG3aJvZWXzPM79UnEk=", "narHash": "sha256-rNObca6dm7Qs524O4st8VJH6pZ/Xe1gxl+Rx6mcWYo0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "095ef64aa3b2ab4a4f1bf07f29997e21e3a5576a", "rev": "a631666f5ec18271e86a5cde998cba68c33d9ac6",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-23.11", "ref": "release-24.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -232,43 +232,27 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1717159533, "lastModified": 1717281328,
"narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", "narHash": "sha256-evZPzpf59oNcDUXxh2GHcxHkTEG4fjae2ytWP85jXRo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", "rev": "b3b2b28c1daa04fe2ae47c21bb76fd226eac4ca1",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-23.11", "ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1717196966,
"narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "57610d2f8f0937f39dbd72251e9614b1561942d8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1717540489, "lastModified": 1717521378,
"narHash": "sha256-rLOvm9eMjybsGfmAYbSs/6SiwBou2ZvWYIL+dRq1x14=", "narHash": "sha256-3UMMPUmY+sqGXuz+cZg5Ul7x8awrgrXmVg9L/Tv91QM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "e8d7e0cdeba6377051f88a2399140566101153f9", "rev": "9a42df165c2851b40e9288564e09b0aa54dda5f5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -319,7 +303,6 @@
"nixgl": "nixgl", "nixgl": "nixgl",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"nur": "nur", "nur": "nur",
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
} }

View File

@ -2,14 +2,13 @@
description = "motiejus/config"; description = "motiejus/config";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "github:nix-community/flake-compat"; flake-compat.url = "github:nix-community/flake-compat";
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
home-manager.url = "github:nix-community/home-manager/release-23.11"; home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
agenix = { agenix = {
@ -76,7 +75,6 @@
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
nixpkgs-unstable,
agenix, agenix,
deploy-rs, deploy-rs,
flake-utils, flake-utils,
@ -115,10 +113,6 @@
# TODO: copied from 24.05 # TODO: copied from 24.05
turbo = super.callPackage ./pkgs/turbo.nix {}; turbo = super.callPackage ./pkgs/turbo.nix {};
pkgs-unstable = import nixpkgs-unstable {
inherit (super) system;
};
crossArm64 = import nixpkgs { crossArm64 = import nixpkgs {
system = "x86_64-linux"; system = "x86_64-linux";
hostPlatform.config = "aarch64-linux"; hostPlatform.config = "aarch64-linux";

View File

@ -10,7 +10,6 @@
boot = { boot = {
initrd.availableKernelModules = ["usb_storage" "sd_mod" "xhci_pci" "thunderbolt" "nvme" "usbhid"]; initrd.availableKernelModules = ["usb_storage" "sd_mod" "xhci_pci" "thunderbolt" "nvme" "usbhid"];
kernelPackages = pkgs.zfs.latestCompatibleLinuxPackages;
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
supportedFilesystems = ["zfs"]; supportedFilesystems = ["zfs"];
zfs = { zfs = {

View File

@ -1,5 +1,4 @@
{ {
pkgs,
config, config,
myData, myData,
... ...

View File

@ -174,7 +174,6 @@
tailscale.enable = true; tailscale.enable = true;
node_exporter.enable = true; node_exporter.enable = true;
gitea.enable = true; gitea.enable = true;
snmp_exporter.enable = true;
sshguard.enable = true; sshguard.enable = true;
hass.enable = true; hass.enable = true;
@ -516,41 +515,6 @@
job_name = "vno1-vinc.vincentas.jakst"; job_name = "vno1-vinc.vincentas.jakst";
static_configs = [{targets = ["${myData.hosts."vno1-vinc.vincentas.jakst".jakstIP}:9100"];}]; static_configs = [{targets = ["${myData.hosts."vno1-vinc.vincentas.jakst".jakstIP}:9100"];}];
} }
{
job_name = "snmp_exporter";
static_configs = [{targets = ["127.0.0.1:9116"];}];
}
{
job_name = "snmp-mikrotik";
static_configs = [
{
targets = [
"192.168.189.2" # kids
"192.168.189.3" # livingroom
"192.168.189.4" # commbox
];
}
];
metrics_path = "./snmp";
params = {
auth = ["public_v2"];
module = ["mikrotik"];
};
relabel_configs = [
{
source_labels = ["__address__"];
target_label = "__param_target";
}
{
source_labels = ["__param_target"];
target_label = "instance";
}
{
target_label = "__address__";
replacement = "127.0.0.1:9116";
}
];
}
]; ];
}; };

View File

@ -48,7 +48,7 @@ in {
"kernel.kptr_restrict" = "0"; "kernel.kptr_restrict" = "0";
}; };
kernelPackages = lib.mkDefault pkgs.zfs.latestCompatibleLinuxPackages; kernelPackages = lib.mkDefault pkgs.linuxPackages;
supportedFilesystems = ["btrfs"]; supportedFilesystems = ["btrfs"];
}; };

View File

@ -53,27 +53,29 @@ in {
avahi = { avahi = {
enable = true; enable = true;
nssmdns = true; nssmdns4 = true;
openFirewall = true; openFirewall = true;
}; };
xserver = { xserver = {
enable = true; enable = true;
xkb = {
layout = "us,lt"; layout = "us,lt";
xkbOptions = "grp:alt_shift_toggle"; options = "grp:alt_shift_toggle";
};
desktopManager.xfce.enable = true; desktopManager.xfce.enable = true;
windowManager.awesome.enable = true; windowManager.awesome.enable = true;
displayManager.lightdm.enable = true;
};
displayManager = { displayManager = {
lightdm.enable = true;
defaultSession = "none+awesome"; defaultSession = "none+awesome";
autoLogin = { autoLogin = {
enable = true; enable = true;
user = username; user = username;
}; };
}; };
};
pipewire = { pipewire = {
enable = true; enable = true;
@ -238,19 +240,15 @@ in {
] ]
(lib.mkIf (pkgs.stdenv.hostPlatform.system == "x86_64-linux") [ (lib.mkIf (pkgs.stdenv.hostPlatform.system == "x86_64-linux") [
i7z i7z
(nvtop.override { nvtopPackages.amd
amd = true; nvtopPackages.intel
intel = true;
msm = false;
nvidia = false;
})
joplin-desktop joplin-desktop
intel-gpu-tools intel-gpu-tools
winetricks winetricks
wineWowPackages.full wineWowPackages.full
]) ])
[pkgs.pkgs-unstable.undocker] [pkgs.undocker]
]; ];
# https://discourse.nixos.org/t/nixos-rebuild-switch-upgrade-networkmanager-wait-online-service-failure/30746 # https://discourse.nixos.org/t/nixos-rebuild-switch-upgrade-networkmanager-wait-online-service-failure/30746

View File

@ -12,7 +12,6 @@
./nsd-acme ./nsd-acme
./postfix ./postfix
./remote-builder ./remote-builder
./snmp_exporter
./sshguard ./sshguard
./syncthing ./syncthing
./tailscale ./tailscale

View File

@ -1,8 +0,0 @@
How to upgrade snmp.yml
1. Extend generator.yml from the upstream generator.yml in snmp_exporter/generator/generator.yml
2. Generate snmp.yml:
snmp_exporter/generator$ make mibs
packages/snmp-yaml $ MIBDIRS=$HOME/code/snmp_exporter/generator/mibs /nix/store/wmymig1r9jfiaffbdpv1lyaj32rydbzc-snmp_exporter-0.21.0/bin/generator generate

View File

@ -1,28 +0,0 @@
{
config,
lib,
pkgs,
myData,
...
}: {
options.mj.services.snmp_exporter = with lib.types; {
enable = lib.mkEnableOption "Enable prometheus snmp_exporter";
};
config = lib.mkIf config.mj.services.snmp_exporter.enable {
mj.services.friendlyport.ports = [
{
subnets = [myData.subnets.tailscale.cidr];
tcp = [config.services.prometheus.exporters.snmp.port];
}
];
services.prometheus.exporters.snmp = {
enable = true;
configurationPath = pkgs.concatTextFile {
name = "snmp.yml";
files = [./snmp.yml];
};
};
};
}

View File

@ -1,50 +0,0 @@
modules:
# Default IF-MIB interfaces table with ifIndex.
if_mib:
walk: [sysUpTime, interfaces, ifXTable]
lookups:
- source_indexes: [ifIndex]
lookup: ifAlias
- source_indexes: [ifIndex]
# Uis OID to avoid conflict with PaloAlto PAN-COMMON-MIB.
lookup: 1.3.6.1.2.1.2.2.1.2 # ifDescr
- source_indexes: [ifIndex]
# Use OID to avoid conflict with Netscaler NS-ROOT-MIB.
lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName
overrides:
ifAlias:
ignore: true # Lookup metric
ifDescr:
ignore: true # Lookup metric
ifName:
ignore: true # Lookup metric
ifType:
type: EnumAsInfo
# Mikrotik Router
#
# http://download2.mikrotik.com/Mikrotik.mib
mikrotik:
walk:
- interfaces
- ifMIB
- laIndex
- sysUpTime
- sysDescr
- host
- mikrotik
lookups:
- source_indexes: [ifIndex]
lookup: ifName
- source_indexes: [mtxrInterfaceStatsIndex]
lookup: ifName
- source_indexes: [hrStorageIndex]
lookup: hrStorageDescr
- source_indexes: [laIndex]
lookup: laNames
drop_source_indexes: true
overrides:
ifName:
ignore: true # Lookup metric
ifType:
type: EnumAsInfo

File diff suppressed because it is too large Load Diff

View File

@ -70,9 +70,9 @@ in {
[extract_url] [extract_url]
(lib.mkIf devTools [ (lib.mkIf devTools [
pkgs-unstable.go_1_22 go_1_22
pkgs-unstable.go-tools go-tools
pkgs-unstable.zig_0_12 zig_0_12
]) ])
(lib.mkIf hmOnly [ (lib.mkIf hmOnly [
@ -149,8 +149,8 @@ in {
plugins = lib.mkMerge [ plugins = lib.mkMerge [
[pkgs.vimPlugins.fugitive] [pkgs.vimPlugins.fugitive]
(lib.mkIf devTools [ (lib.mkIf devTools [
pkgs.pkgs-unstable.vimPlugins.vim-go pkgs.vimPlugins.vim-go
pkgs.pkgs-unstable.vimPlugins.zig-vim pkgs.vimPlugins.zig-vim
]) ])
]; ];
extraConfig = builtins.readFile ./vimrc; extraConfig = builtins.readFile ./vimrc;

View File

@ -4,15 +4,16 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: let }:
#crossFast = pkgs.crossArm64.pkgsCross.aarch64-multiplatform; #let
crossNative = pkgs.pkgsCross.aarch64-multiplatform; #crossFast = pkgs.crossArm64.pkgsCross.aarch64-multiplatform;
in { #in
{
mj.skipPerf = true; mj.skipPerf = true;
boot = { boot = {
#kernelPackages = crossNative.linuxPackagesFor (crossFast.buildLinux rec { #kernelPackages = crossNative.linuxPackagesFor (crossFast.buildLinux rec {
kernelPackages = crossNative.linuxPackagesFor (crossNative.buildLinux rec { kernelPackages = pkgs.linuxPackagesFor (pkgs.buildLinux rec {
version = "6.9.0-rc1"; version = "6.9.0-rc1";
modDirVersion = "6.9.0-rc1"; modDirVersion = "6.9.0-rc1";
@ -59,6 +60,6 @@ in {
inherit config lib pkgs; inherit config lib pkgs;
}; };
#uboot = crossFast.callPackage ../../hacks/orangepi5plus/uboot {}; #uboot = crossFast.callPackage ../../hacks/orangepi5plus/uboot {};
uboot = crossNative.callPackage ../../hacks/orangepi5plus/uboot {}; uboot = pkgs.callPackage ../../hacks/orangepi5plus/uboot {};
}; };
} }

View File

@ -6,8 +6,7 @@
mj.base.users.email = null; mj.base.users.email = null;
mj.base.users.user.extraGroups = ["docker"]; mj.base.users.user.extraGroups = ["docker"];
environment.systemPackages = environment.systemPackages = with pkgs; [
(with pkgs; [
#swc #swc
#nodejs #nodejs
#typescript #typescript
@ -18,10 +17,7 @@
kubectl-node-shell kubectl-node-shell
kubectx kubectx
google-cloud-sdk google-cloud-sdk
]) ];
++ (with pkgs.pkgs-unstable; [
#turbo
]);
services.clamav = { services.clamav = {
updater.enable = true; updater.enable = true;