2023-03-21 13:38:03 +01:00
|
|
|
# flake.nix
|
|
|
|
{
|
|
|
|
inputs = {
|
2024-01-24 00:24:04 +00:00
|
|
|
dotfiles = {
|
|
|
|
url = "gitlab:steveeJ/dotfiles";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2023-05-21 11:58:57 +02:00
|
|
|
# flake and infra basics
|
2023-07-05 15:55:04 +02:00
|
|
|
nixpkgs-2211.url = "github:nixos/nixpkgs/nixos-22.11";
|
2024-01-22 22:50:51 +01:00
|
|
|
radicalePkgs.follows = "nixpkgs-2211";
|
2023-07-05 15:55:04 +02:00
|
|
|
nixpkgs-2305.url = "github:nixos/nixpkgs/nixos-23.05";
|
2024-01-25 00:32:37 +01:00
|
|
|
nixpkgs-2311.url = "github:nixos/nixpkgs/nixos-23.11";
|
2024-06-01 21:46:09 +02:00
|
|
|
nixpkgs-2405.url = "github:nixos/nixpkgs/nixos-24.05";
|
2024-04-01 13:37:21 +02:00
|
|
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
2024-06-01 21:46:09 +02:00
|
|
|
nixpkgs.follows = "nixpkgs-2405";
|
2023-04-15 12:21:22 +02:00
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
get-flake.url = "github:ursi/get-flake";
|
2023-07-06 22:42:24 +02:00
|
|
|
|
|
|
|
srvos.url = "github:numtide/srvos";
|
|
|
|
srvos.inputs.nixpkgs.follows = "nixpkgs";
|
2024-01-22 22:50:51 +01:00
|
|
|
nixos-anywhere.url = "github:numtide/nixos-anywhere/main";
|
2023-04-25 22:06:14 +02:00
|
|
|
nixos-anywhere.inputs.nixpkgs.follows = "nixpkgs";
|
2023-07-06 22:42:24 +02:00
|
|
|
disko.follows = "nixos-anywhere/disko";
|
2023-05-21 11:58:57 +02:00
|
|
|
|
2023-05-23 18:11:30 +02:00
|
|
|
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
|
|
|
|
2024-04-01 13:37:21 +02:00
|
|
|
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
|
|
|
|
nixpkgs-vscodium.url = "github:nixos/nixpkgs/nixos-unstable";
|
2024-05-25 11:36:21 +02:00
|
|
|
|
|
|
|
# needs to be in sync with `vscodium --version` from `nixpkgs-vscodium`
|
|
|
|
openvscode-server.url = "github:gitpod-io/openvscode-server/openvscode-server-v1.88.1";
|
2024-03-07 21:58:24 +01:00
|
|
|
openvscode-server.flake = false;
|
|
|
|
|
2023-05-21 11:58:57 +02:00
|
|
|
colmena = {
|
|
|
|
url = "github:zhaofengli/colmena";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
# libraries for building applications
|
|
|
|
fenix = {
|
|
|
|
url = "github:nix-community/fenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
crane = {
|
|
|
|
url = "github:ipetkov/crane";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2023-07-05 15:55:04 +02:00
|
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
|
|
|
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
2023-05-21 11:58:57 +02:00
|
|
|
# applications
|
|
|
|
aphorme_launcher = {
|
|
|
|
url = "github:Iaphetes/aphorme_launcher/main";
|
|
|
|
flake = false;
|
|
|
|
};
|
2023-05-23 18:11:30 +02:00
|
|
|
|
2023-05-21 11:58:57 +02:00
|
|
|
yofi = {
|
2023-05-23 18:11:30 +02:00
|
|
|
url = "github:l4l/yofi/master";
|
2023-05-21 11:58:57 +02:00
|
|
|
flake = true;
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
ofi-pass = {
|
|
|
|
url = "github:sereinity/ofi-pass";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
jay = {
|
|
|
|
url = "github:mahkoh/jay";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2023-05-23 18:11:30 +02:00
|
|
|
salut = {
|
|
|
|
url = "gitlab:snakedye/salut";
|
|
|
|
flake = false;
|
|
|
|
};
|
2024-01-18 14:59:17 +00:00
|
|
|
|
|
|
|
prs = {
|
2024-07-26 13:59:34 +02:00
|
|
|
# https://gitlab.com/timvisee/prs/-/merge_requests/42/
|
|
|
|
# $ find "$(dirname $(readlink $(which prs)))/.." -name "_prs"
|
|
|
|
url = "gitlab:timvisee/prs/07f17a93d19fb6bc92c9c7f3ae3f5cc750b1f973";
|
|
|
|
# url = "gitlab:steveej/prs/zsh-autocomplete-query";
|
2024-01-18 14:59:17 +00:00
|
|
|
flake = false;
|
|
|
|
};
|
2024-01-22 22:50:51 +01:00
|
|
|
|
2024-04-04 21:07:24 +02:00
|
|
|
rperf = {
|
|
|
|
url = "github:steveej-forks/rperf";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2024-01-22 22:50:51 +01:00
|
|
|
### inputs for thinkpad x13s
|
|
|
|
# see https://github.com/jhovold/linux/wiki/X13s for status updates
|
|
|
|
linux_x13s.url = "github:jhovold/linux/wip/sc8280xp-v6.7";
|
|
|
|
linux_x13s.flake = false;
|
|
|
|
|
|
|
|
brainwart_x13s-nixos = {
|
|
|
|
url = "github:BrainWart/x13s-nixos/flake";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
adamcstephens_stop-export = {
|
|
|
|
flake = false;
|
|
|
|
url = "git+https://codeberg.org/adamcstephens/stop-export.git";
|
|
|
|
};
|
|
|
|
|
2024-10-13 20:06:36 +02:00
|
|
|
logseq_0_10_9_aarch64_appimage = {
|
2024-01-25 00:32:37 +01:00
|
|
|
flake = false;
|
2024-10-13 20:06:36 +02:00
|
|
|
url = "https://www.stefanjunker.de/downloads/Logseq-0.10.9.AppImage";
|
2024-01-25 00:32:37 +01:00
|
|
|
};
|
2024-05-02 09:48:15 +02:00
|
|
|
|
|
|
|
espanso = {
|
|
|
|
flake = false;
|
|
|
|
url = "github:espanso/espanso/db97658d1d80697a635b57801696c594eacf057b";
|
|
|
|
};
|
2024-08-04 09:31:50 +02:00
|
|
|
|
|
|
|
x13s-bt-firmware = {
|
|
|
|
flake = false;
|
|
|
|
|
|
|
|
# revisions for this file: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/log/qca/hpbtfw21.tlv
|
|
|
|
|
|
|
|
# 2024-07-29
|
|
|
|
# not working well
|
|
|
|
# url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qca/hpbtfw21.tlv?id=d118dc8ad5562ac0ae0c07be748cbe35a9361b47";
|
|
|
|
|
|
|
|
# 2024-05-30
|
|
|
|
# url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qca/hpbtfw21.tlv?id=436b0a920352d13290043d9ec9e50c420ab10f92";
|
|
|
|
|
|
|
|
# 2023-12-18
|
|
|
|
# not working well
|
|
|
|
# url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qca/hpbtfw21.tlv?id=598f5bd22361d7e92eebe8452d1f8013a1d35b9a";
|
|
|
|
|
|
|
|
# 2013-01-17
|
|
|
|
url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qca/hpbtfw21.tlv?id=2ba1beaae0c649ce8a50baecc8df9e81cd524e65";
|
|
|
|
};
|
|
|
|
|
|
|
|
ath11k-firmware = {
|
|
|
|
url = "git+https://git.codelinaro.org/clo/ath-firmware/ath11k-firmware.git";
|
|
|
|
flake = false;
|
|
|
|
};
|
2023-03-21 13:38:03 +01:00
|
|
|
};
|
|
|
|
|
2024-02-08 20:53:22 +01:00
|
|
|
outputs = inputs @ {
|
|
|
|
self,
|
|
|
|
flake-parts,
|
|
|
|
nixpkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (nixpkgs) lib;
|
|
|
|
|
|
|
|
systems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
];
|
|
|
|
in
|
|
|
|
flake-parts.lib.mkFlake {inherit inputs;}
|
|
|
|
({withSystem, ...}: {
|
|
|
|
flake.colmena =
|
|
|
|
lib.lists.foldl (sum: cur: lib.attrsets.recursiveUpdate sum cur)
|
|
|
|
{
|
|
|
|
meta.nixpkgs = import inputs.nixpkgs.outPath {
|
|
|
|
system = builtins.elemAt systems 0;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
# FIXME: this doesn't seem to work to apply overlays into a node's nixpkgs import
|
|
|
|
# try this instead: https://github.com/zhaofengli/colmena/issues/60#issuecomment-1510496861
|
|
|
|
(builtins.map
|
|
|
|
(nodeName:
|
|
|
|
import ./nix/os/devices/${nodeName} {
|
|
|
|
inherit nodeName;
|
|
|
|
repoFlake = self;
|
|
|
|
repoFlakeWithSystem = withSystem;
|
|
|
|
nodeFlake = self.inputs.get-flake ./nix/os/devices/${nodeName};
|
|
|
|
}) [
|
|
|
|
"steveej-t14"
|
|
|
|
"steveej-x13s"
|
|
|
|
"steveej-x13s-rmvbl"
|
|
|
|
# "elias-e525"
|
|
|
|
# "justyna-p300"
|
|
|
|
|
|
|
|
# "srv0-dmz0"
|
2024-08-22 14:33:00 +02:00
|
|
|
# "router0-dmz0"
|
2024-06-08 21:04:38 +02:00
|
|
|
"router0-ifog"
|
|
|
|
"router0-hosthatch"
|
2024-02-08 20:53:22 +01:00
|
|
|
|
|
|
|
"sj-srv1"
|
2024-07-26 13:47:57 +02:00
|
|
|
|
|
|
|
"hstk0"
|
2024-02-08 20:53:22 +01:00
|
|
|
]);
|
|
|
|
|
2024-08-22 14:33:00 +02:00
|
|
|
flake.lib = {
|
|
|
|
inherit withSystem;
|
|
|
|
};
|
|
|
|
|
2024-02-08 20:53:22 +01:00
|
|
|
# this makes nixos-anywhere work
|
|
|
|
flake.nixosConfigurations = let
|
|
|
|
colmenaHive = (inputs.colmena.lib.makeHive self.outputs.colmena).nodes;
|
|
|
|
router0-dmz0 = (inputs.get-flake ./nix/os/devices/router0-dmz0).nixosConfigurations;
|
|
|
|
in (
|
|
|
|
colmenaHive
|
|
|
|
// {
|
|
|
|
router0-dmz0 = router0-dmz0.native;
|
|
|
|
|
|
|
|
# for now deploy directly with:
|
|
|
|
# nixos-rebuild switch --flake .\#router0-dmz0_cross --build-host localhost --target-host root@192.168.10.1
|
|
|
|
router0-dmz0_cross = router0-dmz0.cross;
|
|
|
|
|
|
|
|
steveej-x13s_cross = (inputs.get-flake ./nix/os/devices/steveej-x13s).nixosConfigurations.cross;
|
|
|
|
steveej-x13s-rmvbl_cross = (inputs.get-flake ./nix/os/devices/steveej-x13s-rmvbl).nixosConfigurations.cross;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
inherit systems;
|
|
|
|
|
|
|
|
perSystem = {
|
|
|
|
self',
|
|
|
|
inputs',
|
|
|
|
system,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
imports = [
|
|
|
|
./nix/modules/flake-parts/perSystem/default.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
packages = let
|
|
|
|
dcpj4110dw = pkgs.callPackage (self + /nix/pkgs/dcpj4110dw) {};
|
|
|
|
|
2024-07-26 13:59:27 +02:00
|
|
|
craneLibFn = (inputs.crane.mkLib inputs.nixpkgs.legacyPackages.${system}).overrideToolchain;
|
|
|
|
|
2024-02-08 20:53:22 +01:00
|
|
|
craneLib =
|
2024-07-26 13:59:27 +02:00
|
|
|
craneLibFn
|
2024-02-08 20:53:22 +01:00
|
|
|
inputs'.fenix.packages.stable.toolchain;
|
|
|
|
|
|
|
|
craneLibOfiPass =
|
2024-07-26 13:59:27 +02:00
|
|
|
craneLibFn
|
2024-02-08 20:53:22 +01:00
|
|
|
(
|
|
|
|
inputs'.fenix.packages.stable.toolchain
|
|
|
|
# .override {
|
|
|
|
# date = "1.60.0";
|
|
|
|
# }
|
|
|
|
);
|
|
|
|
in {
|
|
|
|
dcpj4110dwDriver = dcpj4110dw.driver;
|
|
|
|
dcpj4110dwCupswrapper = dcpj4110dw.cupswrapper;
|
|
|
|
|
|
|
|
# broken as of 2023-04-27 because it doesn't load without a config
|
|
|
|
# aphorme_launcher = craneLib.buildPackage {src = inputs.aphorme_launcher;};
|
|
|
|
# yofi = inputs'.yofi.packages.default;
|
|
|
|
# ofi-pass = craneLibOfiPass.buildPackage {src = inputs.ofi-pass;};
|
|
|
|
|
|
|
|
inherit (inputs'.colmena.packages) colmena;
|
|
|
|
|
|
|
|
# jay = pkgs.callPackage (self + /nix/pkgs/jay.nix) {
|
|
|
|
# src = inputs.jay;
|
|
|
|
# rustPlatform = pkgs.makeRustPlatform {
|
|
|
|
# cargo = inputs'.fenix.packages.stable.toolchain;
|
|
|
|
# rustc = inputs'.fenix.packages.stable.toolchain;
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
|
|
|
|
salut = craneLib.buildPackage {
|
|
|
|
src = inputs.salut;
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgs.pkg-config
|
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
pkgs.libxkbcommon
|
|
|
|
pkgs.fontconfig
|
2023-05-23 18:11:30 +02:00
|
|
|
];
|
2024-02-08 20:53:22 +01:00
|
|
|
};
|
2023-08-08 17:50:44 +02:00
|
|
|
|
2024-02-08 20:53:22 +01:00
|
|
|
prs =
|
|
|
|
pkgs.callPackage
|
|
|
|
({
|
|
|
|
pkgs,
|
|
|
|
dbus,
|
|
|
|
glib,
|
|
|
|
gpgme,
|
|
|
|
gtk3,
|
|
|
|
libxcb,
|
|
|
|
libxkbcommon,
|
|
|
|
installShellFiles,
|
|
|
|
pkg-config,
|
|
|
|
python3,
|
|
|
|
}:
|
|
|
|
craneLib.buildPackage {
|
|
|
|
pname = "prs";
|
|
|
|
version = inputs.prs.shortRev;
|
|
|
|
src = inputs.prs;
|
|
|
|
nativeBuildInputs = [gpgme installShellFiles pkg-config python3];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
dbus
|
|
|
|
glib
|
|
|
|
gpgme
|
|
|
|
gtk3
|
|
|
|
libxcb
|
|
|
|
libxkbcommon
|
|
|
|
];
|
|
|
|
|
|
|
|
cargoExtraArgs = "--features backend-gpgme";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for shell in bash fish zsh; do
|
|
|
|
installShellCompletion --cmd prs --$shell <($out/bin/prs internal completions $shell --stdout)
|
|
|
|
done
|
2024-01-18 14:59:17 +00:00
|
|
|
'';
|
2024-02-08 20:53:22 +01:00
|
|
|
})
|
|
|
|
{};
|
|
|
|
|
2024-05-02 09:48:15 +02:00
|
|
|
nomad = inputs'.nixpkgs-unstable.legacyPackages.nomad_1_6;
|
2024-02-08 20:53:22 +01:00
|
|
|
|
|
|
|
ledger-live-desktop-wrapped = pkgs.writeShellScriptBin "ledger-live-desktop-wrapped" ''
|
|
|
|
set -x
|
|
|
|
pkill -9 wayland-proxy-v
|
|
|
|
export NIXOS_OZONE_WL=""
|
|
|
|
${pkgs.wayland-proxy-virtwl}/bin/wayland-proxy-virtwl \
|
|
|
|
--wayland-display=wayland-3 \
|
|
|
|
--xwayland-binary=${pkgs.xwayland}/bin/Xwayland \
|
|
|
|
--x-display=3 \
|
|
|
|
&
|
|
|
|
# --x-unscale=3 \
|
|
|
|
#--verbose \
|
|
|
|
|
|
|
|
export PROXYPID="$!"
|
|
|
|
|
|
|
|
trap "kill -9 \$PROXYPID" EXIT
|
|
|
|
# trap "pkill -9 wayland-proxy-v" EXIT
|
|
|
|
|
|
|
|
env \
|
|
|
|
WAYLAND_DISPLAY=wayland-3 \
|
|
|
|
DISPLAY=:3 \
|
|
|
|
ledger-live-desktop
|
|
|
|
'';
|
|
|
|
|
|
|
|
syncthing-container-webui = pkgs.writeShellScriptBin "reverse-port-forward-syncthing-container" ''
|
|
|
|
ssh root@${self.colmena.sj-vps-htz0.deployment.targetHost} -L 8385:syncthing.containers:8384
|
|
|
|
'';
|
|
|
|
|
|
|
|
logseq =
|
|
|
|
pkgs.callPackage ./nix/pkgs/logseq
|
|
|
|
(lib.attrsets.optionalAttrs pkgs.stdenv.isAarch64 {
|
2024-10-13 20:06:36 +02:00
|
|
|
overrideSrc = self.inputs.logseq_0_10_9_aarch64_appimage;
|
2024-02-08 20:53:22 +01:00
|
|
|
});
|
2024-04-04 21:07:24 +02:00
|
|
|
|
2024-05-02 09:48:15 +02:00
|
|
|
rperf = craneLib.buildPackage {
|
2024-04-04 21:07:24 +02:00
|
|
|
src = inputs.rperf;
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgs.pkg-config
|
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
];
|
|
|
|
};
|
2024-08-04 09:31:50 +02:00
|
|
|
|
|
|
|
x13s-bt-firmware = pkgs.runCommand "x13s-bt-firmware" {} ''
|
|
|
|
mkdir -p $out/lib/firmware/qca
|
|
|
|
cp -v ${self}/misc/x13s_bt_firmware/hpnv21g.b8c.crypt.fw $out/lib/firmware/qca/hpnv21.bin
|
|
|
|
cp -v ${inputs.x13s-bt-firmware} $out/lib/firmware/qca//hpbtfw21.tlv
|
|
|
|
'';
|
|
|
|
|
|
|
|
x13s-ath11k-firmware = pkgs.runCommand "x13s-ath11k-firmware-before" {} ''
|
|
|
|
mkdir -p $out/lib/firmware/ath11k/WCN6855/hw2.1/
|
|
|
|
cp -v ${inputs.ath11k-firmware}/WCN6855/hw2.1/{board-2,regdb}.bin $out/lib/firmware/ath11k/WCN6855/hw2.1/
|
|
|
|
cp -v ${inputs.ath11k-firmware}/WCN6855/hw2.1/1.1/WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41/{amss,m3}.bin $out/lib/firmware/ath11k/WCN6855/hw2.1/
|
|
|
|
'';
|
2024-02-08 20:53:22 +01:00
|
|
|
};
|
2024-01-18 14:59:17 +00:00
|
|
|
|
2024-02-08 20:53:22 +01:00
|
|
|
formatter = pkgs.alejandra;
|
2024-01-25 00:32:37 +01:00
|
|
|
|
2024-02-08 20:53:22 +01:00
|
|
|
devShells = let
|
|
|
|
all = import ./nix/devShells.nix {
|
|
|
|
inherit
|
|
|
|
self'
|
|
|
|
inputs'
|
|
|
|
pkgs
|
|
|
|
;
|
2024-01-18 14:59:17 +00:00
|
|
|
};
|
2024-02-08 20:53:22 +01:00
|
|
|
in (all // {default = all.develop;});
|
|
|
|
};
|
2024-01-22 22:50:51 +01:00
|
|
|
|
2024-02-08 20:53:22 +01:00
|
|
|
flake.nixosModules = {
|
|
|
|
# thinkpad-x13s = { pkgs, config, lib, options, ... } @ args: (import ./nix/os/modules/hardware.thinkpad-x13s.nix (args // { inherit self; }));
|
|
|
|
};
|
|
|
|
});
|
2023-03-21 13:38:03 +01:00
|
|
|
}
|