Compare commits
33 Commits
67c9ce550d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b08d81ab0 | |||
| a3df8a8162 | |||
|
|
48dc241b0b | ||
|
|
7b70909a16 | ||
|
|
ff07a0a8c6 | ||
| 05aac965f1 | |||
| a4f23b64d3 | |||
|
|
268a06af61 | ||
|
|
fbbef69fa1 | ||
|
|
998200233c | ||
|
|
34aab3550d | ||
| c9478fa513 | |||
| 4acde426e9 | |||
| 40a288f413 | |||
| 2e09c668e5 | |||
|
|
43020e5b51 | ||
|
|
0b3b7c1822 | ||
|
|
497a318d0b | ||
|
|
302a4fe136 | ||
|
|
99b008305c | ||
|
|
c696e8702f | ||
|
|
ded04993c8 | ||
|
|
23058e5831 | ||
| 68f4726bcf | |||
|
|
c54bf86f7f | ||
|
|
e15989f29f | ||
| a1fe50ee54 | |||
| ac5425e5b1 | |||
| 77c77a298b | |||
| 00ebec0062 | |||
| ca3c740b66 | |||
| 4b3a369c6e | |||
| b7e89f4da4 |
200
flake.lock
generated
200
flake.lock
generated
@@ -1,5 +1,108 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"blueprint": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"llm-agents",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"systems": [
|
||||||
|
"llm-agents",
|
||||||
|
"systems"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1776249299,
|
||||||
|
"narHash": "sha256-Dt9t1TGRmJFc0xVYhttNBD6QsAgHOHCArqGa0AyjrJY=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "blueprint",
|
||||||
|
"rev": "56131e8628f173d24a27f6d27c0215eff57e40dd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "blueprint",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bun2nix": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": [
|
||||||
|
"llm-agents",
|
||||||
|
"flake-parts"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"llm-agents",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"systems": [
|
||||||
|
"llm-agents",
|
||||||
|
"systems"
|
||||||
|
],
|
||||||
|
"treefmt-nix": [
|
||||||
|
"llm-agents",
|
||||||
|
"treefmt-nix"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1777369708,
|
||||||
|
"narHash": "sha256-1xW7cRZNsFNPQD+cE0fwnLVStnDth0HSoASEIFeT7uI=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "bun2nix",
|
||||||
|
"rev": "e659e1cc4b8e1b21d0aa85f1c481f9db61ecfa98",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "staging-2.1.0",
|
||||||
|
"repo": "bun2nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": [
|
||||||
|
"llm-agents",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1777988971,
|
||||||
|
"narHash": "sha256-qIoWPDs+0/8JecyYgE3gpKQxW/4bLW/gp45vow9ioCQ=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "0678d8986be1661af6bb555f3489f2fdfc31f6ff",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"glide": {
|
||||||
|
"inputs": {
|
||||||
|
"home-manager": [
|
||||||
|
"home-manager"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1777767341,
|
||||||
|
"narHash": "sha256-lV2i2hBWxUKU2dgHza9SGfizOsV+uUcTQD/De+6/X3M=",
|
||||||
|
"owner": "glide-browser",
|
||||||
|
"repo": "glide.nix",
|
||||||
|
"rev": "790c9d37e3dcf9bb04ae4486a0320b999a8eec32",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "glide-browser",
|
||||||
|
"repo": "glide.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -7,11 +110,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1772060133,
|
"lastModified": 1778248595,
|
||||||
"narHash": "sha256-VuyRptb8v1lVGMlLp4/1vRX3Efwec0CN0S6mKmDPzLg=",
|
"narHash": "sha256-dhFgEjoeJMYN/7OY6xfxS799YB4IjbbYXTjyGIJyLpc=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "ce9b6e52500a0ea0ec48f0bbf6d7a3e431d9dfa4",
|
"rev": "fdb2ccba9d5e1238d32e0c4a3ec1a277efa80c1d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -61,6 +164,29 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"llm-agents": {
|
||||||
|
"inputs": {
|
||||||
|
"blueprint": "blueprint",
|
||||||
|
"bun2nix": "bun2nix",
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
"systems": "systems",
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1778247177,
|
||||||
|
"narHash": "sha256-ZSe9r9xbx72NnBCCiC1UZxmIFzFA9IPno10Esp1kjiE=",
|
||||||
|
"owner": "Qumulo",
|
||||||
|
"repo": "llm-agents",
|
||||||
|
"rev": "02444d83933d3ca28c9fd5d0be28812bdcf1232e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Qumulo",
|
||||||
|
"repo": "llm-agents",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1768564909,
|
"lastModified": 1768564909,
|
||||||
@@ -79,11 +205,27 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771848320,
|
"lastModified": 1778124196,
|
||||||
"narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=",
|
"narHash": "sha256-pYEytCNic/czazbV9r3tbQ6BZzqRBg/41x2dIC5ymOo=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "68a8af93ff4297686cb68880845e61e5e2e41d92",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1777954456,
|
||||||
|
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "2fc6539b481e1d2569f25f8799236694180c0993",
|
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -103,11 +245,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767662275,
|
"lastModified": 1775856943,
|
||||||
"narHash": "sha256-d5Q1GmQ+sW1Bt8cgDE0vOihzLaswsm8cSdg8124EqXE=",
|
"narHash": "sha256-b7Mp7P+q2Md5AGt4rjHfMcBykzMumFTen10ST++AuTU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "plasma-manager",
|
"repo": "plasma-manager",
|
||||||
"rev": "51816be33a1ff0d4b22427de83222d5bfa96d30e",
|
"rev": "a524a6160e6df89f7673ba293cf7d78b559eb1a5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -118,11 +260,49 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"glide": "glide",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
"nixpkgs": "nixpkgs",
|
"llm-agents": "llm-agents",
|
||||||
|
"nixpkgs": "nixpkgs_3",
|
||||||
"plasma-manager": "plasma-manager"
|
"plasma-manager": "plasma-manager"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"llm-agents",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1775636079,
|
||||||
|
"narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|||||||
25
flake.nix
25
flake.nix
@@ -11,12 +11,19 @@
|
|||||||
# to avoid problems caused by different versions of nixpkgs.
|
# to avoid problems caused by different versions of nixpkgs.
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
glide = {
|
||||||
|
url = "github:glide-browser/glide.nix";
|
||||||
|
# optionally: follow your flake's inputs
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.home-manager.follows = "home-manager";
|
||||||
|
};
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
plasma-manager = {
|
plasma-manager = {
|
||||||
url = "github:nix-community/plasma-manager";
|
url = "github:nix-community/plasma-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.home-manager.follows = "home-manager";
|
inputs.home-manager.follows = "home-manager";
|
||||||
};
|
};
|
||||||
|
llm-agents.url = "github:Qumulo/llm-agents";
|
||||||
# nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.6.0";
|
# nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.6.0";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -27,6 +34,8 @@
|
|||||||
home-manager,
|
home-manager,
|
||||||
impermanence,
|
impermanence,
|
||||||
plasma-manager,
|
plasma-manager,
|
||||||
|
llm-agents,
|
||||||
|
glide,
|
||||||
# nix-flatpak,
|
# nix-flatpak,
|
||||||
}@inputs:
|
}@inputs:
|
||||||
let
|
let
|
||||||
@@ -70,6 +79,22 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
latitude = nixpkgs.lib.nixosSystem {
|
||||||
|
specialArgs = { inherit inputs outputs; };
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./machines/latitude/configuration.nix
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager.extraSpecialArgs = { inherit inputs outputs; };
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
|
||||||
|
home-manager.users.laythe = import ./machines/latitude/home.nix;
|
||||||
|
home-manager.sharedModules = [ plasma-manager.homeModules.plasma-manager ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,12 +16,14 @@
|
|||||||
nix-fast-build
|
nix-fast-build
|
||||||
colmena
|
colmena
|
||||||
;
|
;
|
||||||
|
openldap = prev.openldap.overrideAttrs {
|
||||||
|
doCheck = !prev.stdenv.hostPlatform.isi686;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
nix.package = pkgs.lixPackageSets.stable.lix;
|
nix.package = pkgs.lixPackageSets.stable.lix;
|
||||||
|
|
||||||
nixpkgs.config.packageOverrides = pkgs: {
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
|
|
||||||
# Stolen from https://www.nijho.lt/post/llama-nixos/
|
# Stolen from https://www.nijho.lt/post/llama-nixos/
|
||||||
llama-cpp =
|
llama-cpp =
|
||||||
(pkgs.llama-cpp.override {
|
(pkgs.llama-cpp.override {
|
||||||
@@ -33,13 +35,13 @@
|
|||||||
blasSupport = true;
|
blasSupport = true;
|
||||||
}).overrideAttrs
|
}).overrideAttrs
|
||||||
(oldAttrs: rec {
|
(oldAttrs: rec {
|
||||||
version = "8184";
|
version = "8940";
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
owner = "aagit";
|
owner = "ggml-org";
|
||||||
repo = "llama.cpp";
|
repo = "llama.cpp";
|
||||||
# tag = "b${version}";
|
tag = "b${version}";
|
||||||
rev = "6ebf2e0d00d31acfc1a1fa9662e9a7d38bd07bf7"; # https://github.com/ggml-org/llama.cpp/pull/19970
|
# rev = "6ebf2e0d00d31acfc1a1fa9662e9a7d38bd07bf7"; # https://github.com/ggml-org/llama.cpp/pull/19970
|
||||||
hash = "sha256-xryajW0Cs1d+WDijspMTW21FDaZP9Grkb+uErMQCQ48=";
|
hash = "sha256-JlJeNO7eID6JvxZMkck136mC/Rvd5v8320tAuQabzhU=";
|
||||||
leaveDotGit = true;
|
leaveDotGit = true;
|
||||||
postFetch = ''
|
postFetch = ''
|
||||||
git -C "$out" rev-parse --short HEAD > $out/COMMIT
|
git -C "$out" rev-parse --short HEAD > $out/COMMIT
|
||||||
@@ -47,16 +49,41 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
# Must update npm deps hash to match the new version's webui dependencies
|
# Must update npm deps hash to match the new version's webui dependencies
|
||||||
npmDepsHash = "sha256-FKjoZTKm0ddoVdpxzYrRUmTiuafEfbKc4UD2fz2fb8A=";
|
npmDepsHash = "sha256-RAFtsbBGBjteCt5yXhrmHL39rIDJMCFBETgzId2eRRk=";
|
||||||
# Enable native CPU optimizations for massively better CPU performance
|
# Enable native CPU optimizations for massively better CPU performance
|
||||||
# This enables AVX, AVX2, AVX-512, FMA, etc. for your specific CPU
|
# This enables AVX, AVX2, AVX-512, FMA, etc. for your specific CPU
|
||||||
# NOTE: This is intentionally opposite of nixpkgs (which uses -DGGML_NATIVE=off
|
# NOTE: This is intentionally opposite of nixpkgs (which uses -DGGML_NATIVE=off
|
||||||
# for reproducible builds). We sacrifice portability for faster CPU layers.
|
# for reproducible builds). We sacrifice portability for faster CPU layers.
|
||||||
cmakeFlags = (oldAttrs.cmakeFlags or [ ]) ++ [
|
cmakeFlags = (oldAttrs.cmakeFlags or [ ]) ++ [
|
||||||
"-DGGML_NATIVE=ON"
|
"-DGGML_NATIVE=ON"
|
||||||
"-DCMAKE_CUDA_ARCHITECTURES=86" # RTX 3090 - needed since sandbox has no GPU
|
"-DGGML_LTO=ON" # Link Time Optimization for overall binary speed
|
||||||
|
"-DCMAKE_CUDA_ARCHITECTURES=86" # RTX 3090
|
||||||
|
"-DGGML_CUDA=ON"
|
||||||
|
"-DGGML_CUDA_FA=ON" # FlashAttention kernels (accelerated attention)
|
||||||
|
"-DGGML_CUDA_FA_ALL_QUANTS=ON" # Support for all KV cache quant types in FA
|
||||||
|
"-DGGML_CUDA_GRAPHS=ON" # CUDA Graphs for lower overhead inference
|
||||||
|
"-DGGML_CUDA_FORCE_CUBLAS=ON" # cuBLAS optimized prompt processing for Ampere+
|
||||||
|
"-DGGML_CUDA_PEER_MAX_BATCH_SIZE=256" # Increased for multi-GPU efficiency (split mode)
|
||||||
|
"-DGGML_CUDA_COMPRESSION_MODE=speed" # Fast binary loading (CUDA 12.8+)
|
||||||
|
"-DGGML_OPENMP=ON" # Optimal multi-threading on CPU
|
||||||
|
"-DGGML_LLAMAFILE=ON" # Use llamafile sgemm for faster CPU layers
|
||||||
|
"-DGGML_CPU_REPACK=ON" # Optimize Q4_0 quant handling
|
||||||
|
"-DGGML_AVX=ON"
|
||||||
|
"-DGGML_AVX2=ON"
|
||||||
|
"-DGGML_FMA=ON"
|
||||||
|
"-DGGML_F16C=ON"
|
||||||
|
"-DGGML_AVX512=ON" # Intel AVX-512 extensions
|
||||||
|
"-DGGML_AVX512_VNNI=ON" # Vector Neural Network Instructions
|
||||||
|
"-DGGML_AVX512_BF16=ON" # Bfloat16 support
|
||||||
|
"-DGGML_AVX_VNNI=ON" # VNNI for processors without AVX-512
|
||||||
|
"-DGGML_AMX_TILE=ON" # Intel Advanced Matrix Extensions (Sapphire Rapids+)
|
||||||
|
"-DGGML_AMX_INT8=ON"
|
||||||
|
"-DGGML_AMX_BF16=ON"
|
||||||
|
"-DGGML_BLAS=ON" # Uses internal BLAS provided by Nix (blasSupport=true works)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
postPatch = "";
|
||||||
|
|
||||||
# Disable Nix's NIX_ENFORCE_NO_NATIVE which strips -march=native flags
|
# Disable Nix's NIX_ENFORCE_NO_NATIVE which strips -march=native flags
|
||||||
# See: https://github.com/NixOS/nixpkgs/issues/357736
|
# See: https://github.com/NixOS/nixpkgs/issues/357736
|
||||||
# See: https://github.com/NixOS/nixpkgs/pull/377484 (intentionally contradicts this)
|
# See: https://github.com/NixOS/nixpkgs/pull/377484 (intentionally contradicts this)
|
||||||
@@ -77,7 +104,6 @@
|
|||||||
} -C $out/bin
|
} -C $out/bin
|
||||||
chmod +x $out/bin/llama-swap
|
chmod +x $out/bin/llama-swap
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# 🇺🇸
|
# 🇺🇸
|
||||||
@@ -178,7 +204,7 @@
|
|||||||
qpwgraph
|
qpwgraph
|
||||||
libimobiledevice
|
libimobiledevice
|
||||||
ifuse
|
ifuse
|
||||||
neofetch
|
fastfetch
|
||||||
gimp # Despite the fact it falls under creative an image editor is too important to leave out.
|
gimp # Despite the fact it falls under creative an image editor is too important to leave out.
|
||||||
zip
|
zip
|
||||||
xz
|
xz
|
||||||
@@ -205,8 +231,26 @@
|
|||||||
nixfmt
|
nixfmt
|
||||||
units
|
units
|
||||||
android-tools
|
android-tools
|
||||||
|
jq
|
||||||
|
nasctui
|
||||||
|
trilium-desktop
|
||||||
|
haruna
|
||||||
|
(pkgs.runCommand "nvenc-compress" { nativeBuildInputs = [ pkgs.bash ]; }
|
||||||
|
''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp ${./nvenc_compress.sh} $out/bin/nvenc-compress
|
||||||
|
chmod +x $out/bin/nvenc-compress
|
||||||
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
|
fonts.packages = with pkgs; [
|
||||||
|
twitter-color-emoji
|
||||||
|
];
|
||||||
|
|
||||||
|
fonts.fontconfig.defaultFonts = {
|
||||||
|
emoji = [ "Twitter Color Emoji" ];
|
||||||
|
};
|
||||||
|
|
||||||
services.usbmuxd = {
|
services.usbmuxd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.usbmuxd2;
|
package = pkgs.usbmuxd2;
|
||||||
|
|||||||
87
global/nvenc_compress.sh
Executable file
87
global/nvenc_compress.sh
Executable file
@@ -0,0 +1,87 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Usage: nvenc_compress.sh <video_path> [target_size_mb]
|
||||||
|
|
||||||
|
VIDEO="$1"
|
||||||
|
TARGET_MB="${2:-9}"
|
||||||
|
TARGET_BYTES=$((TARGET_MB * 1024 * 1024))
|
||||||
|
|
||||||
|
if [[ ! -f "$VIDEO" ]]; then
|
||||||
|
echo "Error: file not found: $VIDEO"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
BASENAME="${VIDEO##*/}"
|
||||||
|
BASENAME="${BASENAME%.*}"
|
||||||
|
OUTDIR="$(dirname "$VIDEO")"
|
||||||
|
OUTFILE="$OUTDIR/${BASENAME}_compressed.mp4"
|
||||||
|
|
||||||
|
# nvenc cq range: 0 (best/largest) to 51 (worst/smallest)
|
||||||
|
# We binary search this range to hit the target file size
|
||||||
|
LO=0
|
||||||
|
HI=51
|
||||||
|
BEST_DIFF=999999999
|
||||||
|
BEST_CQ=23
|
||||||
|
MAX_ITERATIONS=20
|
||||||
|
|
||||||
|
echo "Target size: ${TARGET_MB}MB (${TARGET_BYTES} bytes)"
|
||||||
|
echo "Encoding with nvenc (h264_nvenc)..."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
for ((i=0; i<MAX_ITERATIONS; i++)); do
|
||||||
|
CQ=$(( (LO + HI) / 2 ))
|
||||||
|
TMPFILE="${OUTFILE}_iter_${i}_cq${CQ}.mp4"
|
||||||
|
|
||||||
|
echo "--- Iteration $((i+1))/$MAX_ITERATIONS ---"
|
||||||
|
echo "Trying cq=$CQ (lo=$LO, hi=$HI)"
|
||||||
|
|
||||||
|
ffmpeg -y -i "$VIDEO" -c:v h264_nvenc -cq "$CQ" -c:a copy -preset p7 -f mp4 "$TMPFILE" 2>/dev/null
|
||||||
|
|
||||||
|
if [[ ! -f "$TMPFILE" ]]; then
|
||||||
|
echo "Error: ffmpeg failed at cq=$CQ"
|
||||||
|
rm -f "$TMPFILE"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
FILE_SIZE=$(stat -c%s "$TMPFILE" 2>/dev/null || stat -f%z "$TMPFILE" 2>/dev/null)
|
||||||
|
DIFF=$(( FILE_SIZE - TARGET_BYTES ))
|
||||||
|
ABS_DIFF=${DIFF#-}
|
||||||
|
|
||||||
|
echo " Size: $(( FILE_SIZE / 1024 / 1024 ))MB (diff: $(( DIFF / 1024 / 1024 ))MB)"
|
||||||
|
|
||||||
|
if (( ABS_DIFF < BEST_DIFF )); then
|
||||||
|
BEST_DIFF=$ABS_DIFF
|
||||||
|
BEST_CQ=$CQ
|
||||||
|
cp "$TMPFILE" "$OUTFILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f "$TMPFILE"
|
||||||
|
|
||||||
|
# If within 1% of target, we're close enough
|
||||||
|
if (( ABS_DIFF < TARGET_BYTES / 100 )); then
|
||||||
|
echo ""
|
||||||
|
echo "Within tolerance! Stopping."
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Binary search direction:
|
||||||
|
# Higher cq = smaller file, lower cq = larger file
|
||||||
|
if (( FILE_SIZE > TARGET_BYTES )); then
|
||||||
|
# File too big, need higher cq (smaller)
|
||||||
|
LO=$(( CQ + 1 ))
|
||||||
|
else
|
||||||
|
# File too small, need lower cq (larger)
|
||||||
|
HI=$(( CQ - 1 ))
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( LO > HI )); then
|
||||||
|
echo ""
|
||||||
|
echo "Range exhausted. Stopping."
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Done! Best cq=$BEST_CQ, final size: $(( BEST_DIFF / 1024 / 1024 ))MB from target"
|
||||||
|
echo "Output: $OUTFILE"
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
inputs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
@@ -31,6 +32,8 @@
|
|||||||
# Configure network connections interactively with nmcli or nmtui.
|
# Configure network connections interactively with nmcli or nmtui.
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
virtualization.podman.enableNvidia = true;
|
||||||
|
|
||||||
# Only computer I own that can actually run ollama, and I don't want to make an ai folder.
|
# Only computer I own that can actually run ollama, and I don't want to make an ai folder.
|
||||||
# services.ollama = {
|
# services.ollama = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
@@ -42,11 +45,16 @@
|
|||||||
# TODO: honestly, while I currently only have one pc that can run local AI, might change in the future.
|
# TODO: honestly, while I currently only have one pc that can run local AI, might change in the future.
|
||||||
# And this config is getting a bit complicated for a single pc config
|
# And this config is getting a bit complicated for a single pc config
|
||||||
# Should be moved to it's own shit
|
# Should be moved to it's own shit
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = [
|
||||||
ollama-cuda
|
pkgs.ollama-cuda
|
||||||
opencode
|
pkgs.opencode
|
||||||
llama-cpp
|
pkgs.llama-cpp
|
||||||
llama-swap
|
pkgs.llama-swap
|
||||||
|
# pkgs.agent-browser
|
||||||
|
pkgs.nvidia-container-toolkit
|
||||||
|
|
||||||
|
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.pi
|
||||||
|
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.rtk
|
||||||
];
|
];
|
||||||
|
|
||||||
services.ollama = {
|
services.ollama = {
|
||||||
@@ -86,33 +94,42 @@
|
|||||||
# As long as this is here the models are declarative. llama-server will grab them if not downloaded already.
|
# As long as this is here the models are declarative. llama-server will grab them if not downloaded already.
|
||||||
environment.etc."llama-swap/config.yaml".text = ''
|
environment.etc."llama-swap/config.yaml".text = ''
|
||||||
models:
|
models:
|
||||||
|
"Qwen3.6-35B-A3B-GGUF":
|
||||||
|
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.6-35B-A3B-GGUF:UD-Q4_K_S --ctx-size 128000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -np 1 --fit-target 256 --ubatch-size 1024 -fa on --slots --slot-save-path /home/laythe/llamapcache --jinja -kvu --no-mmproj --swa-checkpoints 32 --chat-template-kwargs '{\"preserve_thinking\": true}'"
|
||||||
|
ttl: 2400
|
||||||
|
"Qwen3.6-35B-A3B-FLASH":
|
||||||
|
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.6-35B-A3B-GGUF:UD-Q3_K_M --ctx-size 128000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -np 1 --fit-target 256 --ubatch-size 1024 -fa on --slots --slot-save-path /home/laythe/llamapcache --jinja -kvu --no-mmproj --swa-checkpoints 32 --chat-template-kwargs '{\"preserve_thinking\": true}'"
|
||||||
|
ttl: 2400
|
||||||
"Qwen3.5-35B-A3B-GGUF":
|
"Qwen3.5-35B-A3B-GGUF":
|
||||||
cmd: llama-server --port ''${PORT} -hf unsloth/Qwen3.5-35B-A3B-GGUF:Q4_K_S --ctx-size 128000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -np 1 --cpu-moe --fit-target 256 --ubatch-size 1024 -fa on --slots --slot-save-path /home/laythe/llamapcache --jinja -kvu --no-mmproj --swa-checkpoints 32
|
cmd: llama-server --port ''${PORT} -hf mudler/Qwen3.5-35B-A3B-APEX-GGUF:Mini --ctx-size 128000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -np 1 --fit-target 256 --ubatch-size 1024 -fa on --slots --slot-save-path /home/laythe/llamapcache --jinja -kvu --no-mmproj --swa-checkpoints 32 --no-kv-offload
|
||||||
|
ttl: 2400
|
||||||
|
"Gemma4-26B-A4B":
|
||||||
|
cmd: llama-server --port ''${PORT} -hf mudler/gemma-4-26B-A4B-it-heretic-APEX-GGUF:Mini --ctx-size 128000 --temp 1.0 --top-p 0.95 --top-k 64 --min-p 0.00 -np 1 --fit-target 256 --ubatch-size 1024 -fa on --slots --slot-save-path /home/laythe/llamapcache --jinja -kvu --no-mmproj --swa-checkpoints 32 --no-kv-offload
|
||||||
ttl: 2400
|
ttl: 2400
|
||||||
"Qwen3-1.7B-GGUF":
|
"Qwen3-1.7B-GGUF":
|
||||||
cmd: llama-server --port ''${PORT} -hf unsloth/Qwen3-1.7B-GGUF:Q4_K_S --ctx-size 32768 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu
|
cmd: llama-server --port ''${PORT} -hf unsloth/Qwen3-1.7B-GGUF:Q4_K_S --ctx-size 32768 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu
|
||||||
ttl: 120
|
ttl: 300
|
||||||
"Qwen3-8B-GGUF":
|
"Qwen3-8B-GGUF":
|
||||||
cmd: llama-server --port ''${PORT} -hf unsloth/Qwen3-8B-GGUF:Q4_K_S --ctx-size 32768 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1
|
cmd: llama-server --port ''${PORT} -hf unsloth/Qwen3-8B-GGUF:Q4_K_S --ctx-size 32768 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1
|
||||||
ttl: 120
|
ttl: 300
|
||||||
"Qwen3-4B-Claude-Opus-Distill":
|
"Qwen3-4B-Claude-Opus-Distill":
|
||||||
cmd: llama-server --port ''${PORT} -hf TeichAI/Qwen3-4B-Thinking-2507-Claude-4.5-Opus-High-Reasoning-Distill-GGUF:Q4_K_M --ctx-size 32768 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256
|
cmd: llama-server --port ''${PORT} -hf TeichAI/Qwen3-4B-Thinking-2507-Claude-4.5-Opus-High-Reasoning-Distill-GGUF:Q4_K_M --ctx-size 32768 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256
|
||||||
ttl: 120
|
ttl: 300
|
||||||
"Qwen3.5-9B-Thinking":
|
"Qwen3.5-9B":
|
||||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-9B-GGUF:Q4_K_M --ctx-size 32000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256 --chat-template-kwargs '{\"enable_thinking\": true}' --no-mmproj"
|
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-9B-GGUF:Q4_K_M --ctx-size 64000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256"
|
||||||
ttl: 120
|
ttl: 300
|
||||||
"Qwen3.5-4B-Thinking":
|
"Qwen3.5-9B-Claude-Opus-Distill":
|
||||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-4B-GGUF:Q4_K_M --ctx-size 64000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256 --chat-template-kwargs '{\"enable_thinking\": true}'"
|
cmd: "llama-server --port ''${PORT} -hf Jackrong/Qwen3.5-9B-Claude-4.6-Opus-Reasoning-Distilled-GGUF:Q4_K_S --ctx-size 32000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 512 --chat-template-kwargs '{\"enable_thinking\": true}' --no-mmproj"
|
||||||
ttl: 120
|
ttl: 300
|
||||||
"Qwen3.5-9B-Non-Thinking":
|
"Qwen3.5-4B":
|
||||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-9B-GGUF:Q4_K_M --ctx-size 32000 --temp 0.7 --top-p 0.8 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256 --no-mmproj"
|
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-4B-GGUF:Q4_K_M --ctx-size 64000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256"
|
||||||
ttl: 120
|
ttl: 300
|
||||||
"Qwen3.5-4B-Non-Thinking":
|
"Gemma4-E4B":
|
||||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-4B-GGUF:Q4_K_M --ctx-size 64000 --temp 0.7 --top-p 0.8 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256"
|
cmd: "llama-server --port ''${PORT} -hf Abhiray/gemma-4-E4B-it-heretic-GGUF:Q4_K_M --ctx-size 64000 --temp 0.7 --top-p 0.8 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256"
|
||||||
ttl: 120
|
ttl: 300
|
||||||
"Qwen3.5-0.8B-Non-Thinking":
|
"Qwen3.5-0.8B-Non-Thinking":
|
||||||
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-0.8B-GGUF:Q4_K_M --ctx-size 64000 --temp 0.7 --top-p 0.8 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256"
|
cmd: "llama-server --port ''${PORT} -hf unsloth/Qwen3.5-0.8B-GGUF:Q4_K_M --ctx-size 64000 --temp 0.7 --top-p 0.8 --top-k 20 --min-p 0.00 -fa on --jinja -kvu -np 1 --fit-target 256"
|
||||||
ttl: 120'';
|
ttl: 300'';
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
# time.timeZone = "Europe/Amsterdam";
|
# time.timeZone = "Europe/Amsterdam";
|
||||||
|
|||||||
@@ -93,10 +93,10 @@
|
|||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.settings = {
|
# nix.settings = {
|
||||||
substituters = [ "https://cache.nixos-cuda.org" ];
|
# substituters = [ "https://cache.nixos-cuda.org" ];
|
||||||
trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
|
# trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
|
||||||
};
|
# };
|
||||||
|
|
||||||
system.stateVersion = "24.11"; # No touchy
|
system.stateVersion = "24.11"; # No touchy
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
{config, pkgs, lib, inputs, outputs, ...}:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
inputs,
|
||||||
|
outputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
# These both are probably always going to be the same, but I'll keep them local just in case:tm:
|
# These both are probably always going to be the same, but I'll keep them local just in case:tm:
|
||||||
home.username = "laythe";
|
home.username = "laythe";
|
||||||
@@ -11,4 +18,6 @@
|
|||||||
home.stateVersion = "24.11";
|
home.stateVersion = "24.11";
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
|
fonts.fontconfig.subpixelRendering = "none";
|
||||||
}
|
}
|
||||||
138
machines/latitude/configuration.nix
Executable file
138
machines/latitude/configuration.nix
Executable file
@@ -0,0 +1,138 @@
|
|||||||
|
# Edit this configuration file to define what should be installed on
|
||||||
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
../../global/default.nix
|
||||||
|
../../modules/communication/default.nix
|
||||||
|
../../modules/creative/default.nix
|
||||||
|
../../modules/development/default.nix
|
||||||
|
../../modules/fabrication/default.nix
|
||||||
|
../../modules/gaming/default.nix
|
||||||
|
../../modules/sway/default.nix
|
||||||
|
../../modules/virtualization/default.nix
|
||||||
|
# ../../modules/vr/default.nix
|
||||||
|
# ../../global/eraseyourdarlings.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# Use the systemd-boot EFI boot loader.
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
# boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
networking.hostName = "latitude"; # Define your hostname.
|
||||||
|
|
||||||
|
# Configure network connections interactively with nmcli or nmtui.
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
# Only computer I own that can actually run ollama, and I don't want to make an ai folder.
|
||||||
|
# services.ollama = {
|
||||||
|
# enable = true;
|
||||||
|
# acceleration = "cuda";
|
||||||
|
# host = "[::]";
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
# time.timeZone = "Europe/Amsterdam";
|
||||||
|
|
||||||
|
# Configure network proxy if necessary
|
||||||
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
# i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
# console = {
|
||||||
|
# font = "Lat2-Terminus16";
|
||||||
|
# keyMap = "us";
|
||||||
|
# useXkbConfig = true; # use xkb.options in tty.
|
||||||
|
# };
|
||||||
|
|
||||||
|
# services.xserver.enable = true; # On anything else modern this should be false.
|
||||||
|
|
||||||
|
# Configure keymap in X11
|
||||||
|
# services.xserver.xkb.layout = "us";
|
||||||
|
# services.xserver.xkb.options = "eurosign:e,caps:escape";
|
||||||
|
|
||||||
|
# Enable CUPS to print documents.
|
||||||
|
# services.printing.enable = true;
|
||||||
|
|
||||||
|
# Enable sound.
|
||||||
|
# services.pulseaudio.enable = true;
|
||||||
|
# OR
|
||||||
|
# services.pipewire = {
|
||||||
|
# enable = true;
|
||||||
|
# pulse.enable = true;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
|
# services.libinput.enable = true;
|
||||||
|
|
||||||
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
|
# users.users.alice = {
|
||||||
|
# isNormalUser = true;
|
||||||
|
# extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||||||
|
# packages = with pkgs; [
|
||||||
|
# tree
|
||||||
|
# ];
|
||||||
|
# };
|
||||||
|
|
||||||
|
# programs.firefox.enable = true;
|
||||||
|
|
||||||
|
# List packages installed in system profile.
|
||||||
|
# You can use https://search.nixos.org/ to find more packages (and options).
|
||||||
|
environment.systemPackages = [
|
||||||
|
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.pi
|
||||||
|
];
|
||||||
|
|
||||||
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
|
# started in user sessions.
|
||||||
|
# programs.mtr.enable = true;
|
||||||
|
# programs.gnupg.agent = {
|
||||||
|
# enable = true;
|
||||||
|
# enableSSHSupport = true;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# List services that you want to enable:
|
||||||
|
|
||||||
|
# Enable the OpenSSH daemon.
|
||||||
|
# services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Open ports in the firewall.
|
||||||
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
|
# Or disable the firewall altogether.
|
||||||
|
# networking.firewall.enable = false;
|
||||||
|
|
||||||
|
# Copy the NixOS configuration file and link it from the resulting system
|
||||||
|
# (/run/current-system/configuration.nix). This is useful in case you
|
||||||
|
# accidentally delete configuration.nix.
|
||||||
|
# system.copySystemConfiguration = true;
|
||||||
|
|
||||||
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||||
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||||
|
#
|
||||||
|
# Most users should NEVER change this value after the initial install, for any reason,
|
||||||
|
# even if you've upgraded your system to a new NixOS release.
|
||||||
|
#
|
||||||
|
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||||
|
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||||
|
# to actually do that.
|
||||||
|
#
|
||||||
|
# This value being lower than the current NixOS release does NOT mean your system is
|
||||||
|
# out of date, out of support, or vulnerable.
|
||||||
|
#
|
||||||
|
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||||
|
# and migrated your data accordingly.
|
||||||
|
#
|
||||||
|
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||||
|
system.stateVersion = "25.11"; # Did you read the comment?
|
||||||
|
|
||||||
|
}
|
||||||
86
machines/latitude/hardware-configuration.nix
Executable file
86
machines/latitude/hardware-configuration.nix
Executable file
@@ -0,0 +1,86 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
# services.tlp.enable = true;
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"thunderbolt"
|
||||||
|
"nvme"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
"sdhci_pci"
|
||||||
|
];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-label/NIXROOT";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
boot.resumeDevice = "/dev/disk/by-label/NIXSWAP";
|
||||||
|
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "/dev/disk/by-label/NIXBOOT";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [
|
||||||
|
"fmask=0022"
|
||||||
|
"dmask=0022"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [
|
||||||
|
{
|
||||||
|
device = "/dev/disk/by-label/NIXSWAP";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
services.power-profiles-daemon.enable = true;
|
||||||
|
# Suspend first then hibernate when closing the lid
|
||||||
|
services.logind.settings.Login.LidSwitch = "ignore";
|
||||||
|
# Hibernate on power button pressed
|
||||||
|
services.logind.settings.Login.PowerKey = "hibernate";
|
||||||
|
services.logind.settings.Login.PowerKeyLongPress = "poweroff";
|
||||||
|
|
||||||
|
# Suspend first
|
||||||
|
boot.kernelParams = [
|
||||||
|
"mem_sleep_default=deep"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Define time delay for hibernation
|
||||||
|
systemd.sleep.settings.Sleep = {
|
||||||
|
HibernateDelaySec = 300;
|
||||||
|
};
|
||||||
|
|
||||||
|
# facial recognition
|
||||||
|
security.pam.howdy.enable = true;
|
||||||
|
services.howdy.enable = true;
|
||||||
|
services.linux-enable-ir-emitter.enable = true; # lmao
|
||||||
|
# by default face is good enough
|
||||||
|
security.pam.howdy.control = "sufficient";
|
||||||
|
services.howdy.settings = {
|
||||||
|
core = {
|
||||||
|
workaround = "off";
|
||||||
|
};
|
||||||
|
video = {
|
||||||
|
timeout = "20";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
23
machines/latitude/home.nix
Executable file
23
machines/latitude/home.nix
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
inputs,
|
||||||
|
outputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
# These both are probably always going to be the same, but I'll keep them local just in case:tm:
|
||||||
|
home.username = "laythe";
|
||||||
|
home.homeDirectory = lib.mkForce "/home/laythe";
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
../../home/default.nix
|
||||||
|
../../modules/sway/home.nix
|
||||||
|
# ../../modules/kde/home.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
home.stateVersion = "25.11";
|
||||||
|
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
blender
|
blender
|
||||||
# davinci-resolve
|
# davinci-resolve
|
||||||
shotcut
|
shotcut
|
||||||
glaxnimate
|
glaxnimate
|
||||||
kdePackages.kdenlive
|
kdePackages.kdenlive
|
||||||
|
krita
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||||
|
protontricks.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
kdePackages.kate
|
kdePackages.kate
|
||||||
kdePackages.filelight
|
kdePackages.filelight
|
||||||
|
thunderbird
|
||||||
# kdePackages.kdeconnect-kde
|
# kdePackages.kdeconnect-kde
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
policies.ExtensionSettings = {
|
policies.ExtensionSettings = {
|
||||||
"*".installation_mode = "blocked"; # blocks all addons except the ones specified below
|
|
||||||
# uBlock Origin:
|
# uBlock Origin:
|
||||||
"uBlock0@raymondhill.net" = {
|
"uBlock0@raymondhill.net" = {
|
||||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
||||||
|
|||||||
77
modules/sway/default.nix
Normal file
77
modules/sway/default.nix
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
configure-gtk = pkgs.writeTextFile {
|
||||||
|
name = "configure-gtk";
|
||||||
|
destination = "/bin/configure-gtk";
|
||||||
|
executable = true;
|
||||||
|
text =
|
||||||
|
let
|
||||||
|
schema = pkgs.gsettings-desktop-schemas;
|
||||||
|
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
|
||||||
|
in
|
||||||
|
''
|
||||||
|
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
|
||||||
|
gnome_schema=org.gnome.desktop.interface
|
||||||
|
gsettings set $gnome_schema gtk-theme 'Dracula'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
wl-clipboard # Copy/Paste functionality.
|
||||||
|
mako # Notification utility.
|
||||||
|
];
|
||||||
|
|
||||||
|
# Enables Gnome Keyring to store secrets for applications.
|
||||||
|
services.gnome.gnome-keyring.enable = true;
|
||||||
|
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
extraPortals = [
|
||||||
|
pkgs.xdg-desktop-portal-gtk
|
||||||
|
pkgs.xdg-desktop-portal-wlr
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
security.polkit.enable = true;
|
||||||
|
|
||||||
|
# Enable Sway.
|
||||||
|
programs.sway = {
|
||||||
|
enable = true;
|
||||||
|
wrapperFeatures.gtk = false;
|
||||||
|
extraPackages = [
|
||||||
|
pkgs.foot
|
||||||
|
pkgs.swayidle
|
||||||
|
pkgs.swaylock
|
||||||
|
pkgs.wmenu
|
||||||
|
pkgs.wl-clipboard
|
||||||
|
pkgs.mako
|
||||||
|
pkgs.kdePackages.kate
|
||||||
|
pkgs.kdePackages.filelight
|
||||||
|
inputs.glide.packages.${pkgs.stdenv.hostPlatform.system}.default
|
||||||
|
pkgs.swaybg
|
||||||
|
pkgs.pulseaudioFull
|
||||||
|
pkgs.waybar
|
||||||
|
pkgs.dracula-theme # gtk theme
|
||||||
|
pkgs.brightnessctl
|
||||||
|
configure-gtk
|
||||||
|
pkgs.mpvpaper
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.greetd = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
default_session = {
|
||||||
|
command = "${pkgs.tuigreet}/bin/tuigreet --remember --time --cmd sway";
|
||||||
|
user = "greeter";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
354
modules/sway/home.nix
Normal file
354
modules/sway/home.nix
Normal file
@@ -0,0 +1,354 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
wayland.windowManager.sway = {
|
||||||
|
enable = true;
|
||||||
|
wrapperFeatures.gtk = true; # Fixes common issues with GTK 3 apps
|
||||||
|
config = rec {
|
||||||
|
modifier = "Mod4";
|
||||||
|
# Use kitty as default terminal
|
||||||
|
terminal = "foot";
|
||||||
|
keybindings = {
|
||||||
|
# Brightness Controls
|
||||||
|
"XF86MonBrightnessDown" = "exec brightnessctl s 5%-";
|
||||||
|
"XF86MonBrightnessUp" = "exec brightnessctl s 5%+";
|
||||||
|
|
||||||
|
# Volume Controls
|
||||||
|
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%";
|
||||||
|
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%";
|
||||||
|
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||||
|
|
||||||
|
"Mod4+q" = "kill";
|
||||||
|
"Mod4+Return" = "exec foot";
|
||||||
|
"Mod4+Shift+q" = "kill";
|
||||||
|
"Mod4+d" = "exec wmenu-run";
|
||||||
|
|
||||||
|
"Mod4+Left" = "focus left";
|
||||||
|
"Mod4+Down" = "focus down";
|
||||||
|
"Mod4+Up" = "focus up";
|
||||||
|
"Mod4+Right" = "focus right";
|
||||||
|
|
||||||
|
"Mod4+Shift+Left" = "move left";
|
||||||
|
"Mod4+Shift+Down" = "move down";
|
||||||
|
"Mod4+Shift+Up" = "move up";
|
||||||
|
"Mod4+Shift+Right" = "move right";
|
||||||
|
|
||||||
|
"Mod4+b" = "splith";
|
||||||
|
"Mod4+v" = "splitv";
|
||||||
|
"Mod4+f" = "fullscreen toggle";
|
||||||
|
"Mod4+a" = "focus parent";
|
||||||
|
|
||||||
|
"Mod4+s" = "layout stacking";
|
||||||
|
"Mod4+w" = "layout tabbed";
|
||||||
|
"Mod4+e" = "layout toggle split";
|
||||||
|
|
||||||
|
"Mod4+Shift+space" = "floating toggle";
|
||||||
|
"Mod4+space" = "focus mode_toggle";
|
||||||
|
|
||||||
|
"Mod4+1" = "workspace number 1";
|
||||||
|
"Mod4+2" = "workspace number 2";
|
||||||
|
"Mod4+3" = "workspace number 3";
|
||||||
|
"Mod4+4" = "workspace number 4";
|
||||||
|
"Mod4+5" = "workspace number 5";
|
||||||
|
"Mod4+6" = "workspace number 6";
|
||||||
|
"Mod4+7" = "workspace number 7";
|
||||||
|
"Mod4+8" = "workspace number 8";
|
||||||
|
"Mod4+9" = "workspace number 9";
|
||||||
|
"Mod4+0" = "workspace number 10";
|
||||||
|
|
||||||
|
"Mod4+Shift+1" = "move container to workspace number 1";
|
||||||
|
"Mod4+Shift+2" = "move container to workspace number 2";
|
||||||
|
"Mod4+Shift+3" = "move container to workspace number 3";
|
||||||
|
"Mod4+Shift+4" = "move container to workspace number 4";
|
||||||
|
"Mod4+Shift+5" = "move container to workspace number 5";
|
||||||
|
"Mod4+Shift+6" = "move container to workspace number 6";
|
||||||
|
"Mod4+Shift+7" = "move container to workspace number 7";
|
||||||
|
"Mod4+Shift+8" = "move container to workspace number 8";
|
||||||
|
"Mod4+Shift+9" = "move container to workspace number 9";
|
||||||
|
"Mod4+Shift+0" = "move container to workspace number 10";
|
||||||
|
|
||||||
|
"Mod4+Shift+minus" = "move scratchpad";
|
||||||
|
"Mod4+minus" = "scratchpad show";
|
||||||
|
|
||||||
|
"Mod4+p" = "[app_id=\"trilium\"] scratchpad show, resize set 90 ppt 90 ppt, move position center";
|
||||||
|
"Mod4+g" = "exec glide-browser";
|
||||||
|
|
||||||
|
"Mod4+Shift+i" = "exec makoctl invoke && makoctl dismiss";
|
||||||
|
"Mod4+i" = "exec makoctl dismiss";
|
||||||
|
|
||||||
|
"Mod4+Shift+c" = "reload";
|
||||||
|
"Mod4+Shift+e" =
|
||||||
|
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
||||||
|
|
||||||
|
"Mod4+r" = "mode resize";
|
||||||
|
|
||||||
|
"Mod4+c" = "[app_id=\"discord\"] scratchpad show, resize set 90 ppt 90 ppt, move position center";
|
||||||
|
|
||||||
|
"Mod4+j" = "[class=\"Jami\"] scratchpad show, resize set 90 ppt 90 ppt, move position center";
|
||||||
|
|
||||||
|
"Print" = "exec flameshot gui";
|
||||||
|
};
|
||||||
|
bars = [
|
||||||
|
{
|
||||||
|
command = "${pkgs.waybar}/bin/waybar";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
output = {
|
||||||
|
eDP-1 = {
|
||||||
|
scale = "1.25";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
input = {
|
||||||
|
"type:touchpad" = {
|
||||||
|
# Enables or disables tap for specified input device.
|
||||||
|
tap = "enabled";
|
||||||
|
# Enables or disables natural (inverted) scrolling for the specified input device.
|
||||||
|
natural_scroll = "enabled";
|
||||||
|
# Enables or disables disable-while-typing for the specified input device.
|
||||||
|
dwt = "disabled";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
bindswitches = {
|
||||||
|
"lid:on" = {
|
||||||
|
reload = true;
|
||||||
|
locked = true;
|
||||||
|
action = "exec systemctl suspend-then-hibernate";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
startup = [
|
||||||
|
# { command = "swaybg -i ~/.background-image -m fill"; }
|
||||||
|
{ command = "discord --enable-features=UseOzonePlatform --ozone-platform=wayland"; }
|
||||||
|
{ command = "trilium"; }
|
||||||
|
{ command = "jami"; }
|
||||||
|
];
|
||||||
|
window.commands = [
|
||||||
|
{
|
||||||
|
criteria = {
|
||||||
|
app_id = "discord";
|
||||||
|
};
|
||||||
|
command = "move scratchpad";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
criteria = {
|
||||||
|
app_id = "trilium";
|
||||||
|
};
|
||||||
|
command = "move scratchpad";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
criteria = {
|
||||||
|
class = "Jami";
|
||||||
|
};
|
||||||
|
command = "move scratchpad";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services.random-background = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Universal Wallpaper Rotator (Images, GIFs, Videos)";
|
||||||
|
After = [ "graphical-session.target" ];
|
||||||
|
PartOf = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
Install = {
|
||||||
|
WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
Type = "simple";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = 5;
|
||||||
|
|
||||||
|
ExecStart = "${pkgs.writeShellScript "wallpaper-rotator" ''
|
||||||
|
WALLPAPER_DIR="$HOME/wallpapers"
|
||||||
|
INTERVAL=60 # Time in seconds between wallpaper changes (600 = 10 mins)
|
||||||
|
|
||||||
|
# 1. Safely find Wayland and Sway sockets
|
||||||
|
if [ -z "$WAYLAND_DISPLAY" ]; then
|
||||||
|
shopt -s nullglob
|
||||||
|
W_SOCKETS=("$XDG_RUNTIME_DIR"/wayland-[0-9]*)
|
||||||
|
if [ ''${#W_SOCKETS[@]} -gt 0 ]; then
|
||||||
|
export WAYLAND_DISPLAY=$(basename "''${W_SOCKETS[0]}")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$SWAYSOCK" ]; then
|
||||||
|
shopt -s nullglob
|
||||||
|
S_SOCKETS=("$XDG_RUNTIME_DIR"/sway-ipc.*.sock)
|
||||||
|
if [ ''${#S_SOCKETS[@]} -gt 0 ]; then
|
||||||
|
export SWAYSOCK="''${S_SOCKETS[0]}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# State tracking for mpvpaper
|
||||||
|
MPV_PID=""
|
||||||
|
|
||||||
|
# Clean up mpvpaper gracefully if systemd stops the service
|
||||||
|
cleanup() {
|
||||||
|
if [ -n "$MPV_PID" ]; then
|
||||||
|
kill $MPV_PID 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
trap cleanup SIGINT SIGTERM
|
||||||
|
|
||||||
|
# 2. Infinite rotation loop
|
||||||
|
while true; do
|
||||||
|
if [ ! -d "$WALLPAPER_DIR" ]; then
|
||||||
|
echo "Wallpaper directory not found. Waiting..."
|
||||||
|
${pkgs.coreutils}/bin/sleep 60
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Find images, gifs, and videos
|
||||||
|
MEDIA=$(${pkgs.findutils}/bin/find "$WALLPAPER_DIR" -type f \( \
|
||||||
|
-iname \*.jpg -o -iname \*.jpeg -o -iname \*.png -o \
|
||||||
|
-iname \*.mp4 -o -iname \*.webm -o -iname \*.mkv -o -iname \*.gif \
|
||||||
|
\) 2>/dev/null | ${pkgs.coreutils}/bin/shuf -n 1 || true)
|
||||||
|
|
||||||
|
if [ -n "$MEDIA" ]; then
|
||||||
|
echo "Selected: $MEDIA"
|
||||||
|
EXT="''${MEDIA##*.}"
|
||||||
|
EXT=$(echo "$EXT" | tr '[:upper:]' '[:lower:]') # Convert to lowercase
|
||||||
|
|
||||||
|
# If it's a static image, use Sway directly (saves battery/RAM)
|
||||||
|
if [[ "$EXT" == "jpg" || "$EXT" == "jpeg" || "$EXT" == "png" ]]; then
|
||||||
|
if [ -n "$MPV_PID" ]; then
|
||||||
|
kill $MPV_PID 2>/dev/null || true
|
||||||
|
MPV_PID=""
|
||||||
|
fi
|
||||||
|
${pkgs.sway}/bin/swaymsg output "*" bg "$MEDIA" fill
|
||||||
|
|
||||||
|
# If it's a video/gif, use mpvpaper
|
||||||
|
else
|
||||||
|
if [ -n "$MPV_PID" ]; then
|
||||||
|
kill $MPV_PID 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
# Start mpvpaper in the background and record its process ID
|
||||||
|
${pkgs.mpvpaper}/bin/mpvpaper -o "loop no-audio" "*" "$MEDIA" &
|
||||||
|
MPV_PID=$!
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No media found in $WALLPAPER_DIR."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Wait for the next rotation
|
||||||
|
${pkgs.coreutils}/bin/sleep $INTERVAL
|
||||||
|
done
|
||||||
|
''}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.waybar = {
|
||||||
|
enable = true;
|
||||||
|
style = ./waybar.css;
|
||||||
|
settings = {
|
||||||
|
mainBar = {
|
||||||
|
layer = "top";
|
||||||
|
position = "bottom"; # Puts the bar at the bottom
|
||||||
|
height = 30;
|
||||||
|
|
||||||
|
# Define what goes where on the bar
|
||||||
|
modules-left = [
|
||||||
|
"sway/workspaces"
|
||||||
|
"sway/mode"
|
||||||
|
];
|
||||||
|
modules-center = [ "sway/window" ];
|
||||||
|
modules-right = [
|
||||||
|
"backlight"
|
||||||
|
"pulseaudio"
|
||||||
|
"battery"
|
||||||
|
"clock"
|
||||||
|
"tray"
|
||||||
|
];
|
||||||
|
backlight = {
|
||||||
|
format = "{icon} {percent}%";
|
||||||
|
format-icons = [
|
||||||
|
"🌑"
|
||||||
|
"🌘"
|
||||||
|
"🌗"
|
||||||
|
"🌖"
|
||||||
|
"🌕"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
pulseaudio = {
|
||||||
|
format = "{icon} {volume}%";
|
||||||
|
format-muted = "🔇 Muted";
|
||||||
|
format-icons = {
|
||||||
|
default = [
|
||||||
|
"🔈"
|
||||||
|
"🔉"
|
||||||
|
"🔊"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
scroll-step = 1;
|
||||||
|
on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||||
|
};
|
||||||
|
|
||||||
|
clock = {
|
||||||
|
"format" = "{:%I:%M %p}";
|
||||||
|
"format-alt" = "{:%d-%m-%Y}";
|
||||||
|
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
|
||||||
|
};
|
||||||
|
battery = {
|
||||||
|
states = {
|
||||||
|
warning = 30;
|
||||||
|
critical = 15;
|
||||||
|
};
|
||||||
|
format = "{icon} {capacity}% ({time})";
|
||||||
|
format-charging = "⚡ {capacity}% ({time})";
|
||||||
|
format-plugged = "🔌 {capacity}% ({time})";
|
||||||
|
format-icons = [
|
||||||
|
"🪫"
|
||||||
|
"🔋"
|
||||||
|
"🔋"
|
||||||
|
"🔋"
|
||||||
|
"🔋"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.swayidle.events = {
|
||||||
|
"before-sleep" = "${pkgs.swaylock}/bin/swaylock -fF";
|
||||||
|
};
|
||||||
|
services.swayidle.enable = true;
|
||||||
|
|
||||||
|
# Configure Qt to use kvantum theming
|
||||||
|
qt = {
|
||||||
|
enable = true;
|
||||||
|
platformTheme.name = "org.kde.breezedark.desktop";
|
||||||
|
style = {
|
||||||
|
name = "org.kde.breezedark.desktop";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.flameshot = {
|
||||||
|
# Also installs/enables flameshot
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
General = {
|
||||||
|
useGrimAdapter = true;
|
||||||
|
# Stops warnings for using Grim
|
||||||
|
disabledGrimWarning = true;
|
||||||
|
uiColor = "#00ff73";
|
||||||
|
contrastUiColor = "#002f01";
|
||||||
|
drawColor = "#ff0000";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Install packages for better Qt support and kvantum themes
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
kdePackages.breeze
|
||||||
|
];
|
||||||
|
|
||||||
|
# Environment variables for kvantum theming
|
||||||
|
home.sessionVariables = {
|
||||||
|
QT_QPA_PLATFORMTHEME = "org.kde.breezedark.desktop";
|
||||||
|
QT_STYLE_OVERRIDE = "org.kde.breezedark.desktop";
|
||||||
|
GTK_THEME = "Materia-dark-compact";
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
329
modules/sway/waybar.css
Normal file
329
modules/sway/waybar.css
Normal file
@@ -0,0 +1,329 @@
|
|||||||
|
* {
|
||||||
|
/* `otf-font-awesome` is required to be installed for icons */
|
||||||
|
font-family: Roboto, Helvetica, Arial, sans-serif;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar {
|
||||||
|
background-color: rgba(43, 48, 59, 0.5);
|
||||||
|
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
|
||||||
|
color: #ffffff;
|
||||||
|
transition-property: background-color;
|
||||||
|
transition-duration: .5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar.hidden {
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
window#waybar.empty {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
window#waybar.solo {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
window#waybar.termite {
|
||||||
|
background-color: #3F3F3F;
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar.chromium {
|
||||||
|
background-color: #000000;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
/* Use box-shadow instead of border so the text isn't offset */
|
||||||
|
box-shadow: inset 0 -3px transparent;
|
||||||
|
/* Avoid rounded borders under each button name */
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||||
|
button:hover {
|
||||||
|
background: inherit;
|
||||||
|
box-shadow: inset 0 -3px #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* you can set a style on hover for any module like this */
|
||||||
|
#pulseaudio:hover {
|
||||||
|
background-color: #a37800;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button {
|
||||||
|
padding: 0 5px;
|
||||||
|
background-color: transparent;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.focused,
|
||||||
|
#workspaces button.active {
|
||||||
|
background-color: #64727D;
|
||||||
|
box-shadow: inset 0 -3px #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.urgent {
|
||||||
|
background-color: #eb4d4b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mode {
|
||||||
|
background-color: #64727D;
|
||||||
|
box-shadow: inset 0 -3px #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock,
|
||||||
|
#battery,
|
||||||
|
#cpu,
|
||||||
|
#memory,
|
||||||
|
#disk,
|
||||||
|
#temperature,
|
||||||
|
#backlight,
|
||||||
|
#network,
|
||||||
|
#pulseaudio,
|
||||||
|
#wireplumber,
|
||||||
|
#custom-media,
|
||||||
|
#tray,
|
||||||
|
#mode,
|
||||||
|
#idle_inhibitor,
|
||||||
|
#scratchpad,
|
||||||
|
#power-profiles-daemon,
|
||||||
|
#mpd {
|
||||||
|
padding: 0 10px;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#window,
|
||||||
|
#workspaces {
|
||||||
|
margin: 0 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If workspaces is the leftmost module, omit left margin */
|
||||||
|
.modules-left>widget:first-child>#workspaces {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If workspaces is the rightmost module, omit right margin */
|
||||||
|
.modules-right>widget:last-child>#workspaces {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock {
|
||||||
|
background-color: #64727D;
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery {
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery.charging,
|
||||||
|
#battery.plugged {
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #26A65B;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes blink {
|
||||||
|
to {
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Using steps() instead of linear as a timing function to limit cpu usage */
|
||||||
|
#battery.critical:not(.charging) {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
color: #ffffff;
|
||||||
|
animation-name: blink;
|
||||||
|
animation-duration: 0.5s;
|
||||||
|
animation-timing-function: steps(12);
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-direction: alternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
#power-profiles-daemon {
|
||||||
|
padding-right: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#power-profiles-daemon.performance {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#power-profiles-daemon.balanced {
|
||||||
|
background-color: #2980b9;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#power-profiles-daemon.power-saver {
|
||||||
|
background-color: #2ecc71;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
label:focus {
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cpu {
|
||||||
|
background-color: #2ecc71;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#memory {
|
||||||
|
background-color: #9b59b6;
|
||||||
|
}
|
||||||
|
|
||||||
|
#disk {
|
||||||
|
background-color: #964B00;
|
||||||
|
}
|
||||||
|
|
||||||
|
#backlight {
|
||||||
|
background-color: #90b1b1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#network {
|
||||||
|
background-color: #2980b9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#network.disconnected {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pulseaudio {
|
||||||
|
background-color: #f1c40f;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pulseaudio.muted {
|
||||||
|
background-color: #90b1b1;
|
||||||
|
color: #2a5c45;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wireplumber {
|
||||||
|
background-color: #fff0f5;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wireplumber.muted {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-media {
|
||||||
|
background-color: #66cc99;
|
||||||
|
color: #2a5c45;
|
||||||
|
min-width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-media.custom-spotify {
|
||||||
|
background-color: #66cc99;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-media.custom-vlc {
|
||||||
|
background-color: #ffa000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#temperature {
|
||||||
|
background-color: #f0932b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#temperature.critical {
|
||||||
|
background-color: #eb4d4b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tray {
|
||||||
|
background-color: #2980b9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tray>.passive {
|
||||||
|
-gtk-icon-effect: dim;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tray>.needs-attention {
|
||||||
|
-gtk-icon-effect: highlight;
|
||||||
|
background-color: #eb4d4b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#idle_inhibitor {
|
||||||
|
background-color: #2d3436;
|
||||||
|
}
|
||||||
|
|
||||||
|
#idle_inhibitor.activated {
|
||||||
|
background-color: #ecf0f1;
|
||||||
|
color: #2d3436;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd {
|
||||||
|
background-color: #66cc99;
|
||||||
|
color: #2a5c45;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd.disconnected {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd.stopped {
|
||||||
|
background-color: #90b1b1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd.paused {
|
||||||
|
background-color: #51a37a;
|
||||||
|
}
|
||||||
|
|
||||||
|
#language {
|
||||||
|
background: #00b093;
|
||||||
|
color: #740864;
|
||||||
|
padding: 0 5px;
|
||||||
|
margin: 0 5px;
|
||||||
|
min-width: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#keyboard-state {
|
||||||
|
background: #97e1ad;
|
||||||
|
color: #000000;
|
||||||
|
padding: 0 0px;
|
||||||
|
margin: 0 5px;
|
||||||
|
min-width: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#keyboard-state>label {
|
||||||
|
padding: 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#keyboard-state>label.locked {
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#scratchpad {
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#scratchpad.empty {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#privacy {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#privacy-item {
|
||||||
|
padding: 0 5px;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#privacy-item.screenshare {
|
||||||
|
background-color: #cf5700;
|
||||||
|
}
|
||||||
|
|
||||||
|
#privacy-item.audio-in {
|
||||||
|
background-color: #1ca000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#privacy-item.audio-out {
|
||||||
|
background-color: #0069d4;
|
||||||
|
}
|
||||||
@@ -14,6 +14,6 @@
|
|||||||
virtualisation.podman = {
|
virtualisation.podman = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dockerCompat = true;
|
dockerCompat = true;
|
||||||
enableNvidia = true;
|
# enableNvidia = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user