2024-02-27 17:31:04 +01:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
2024-03-10 21:04:36 +01:00
|
|
|
outputs =
|
|
|
|
{ self
|
|
|
|
, nixpkgs
|
|
|
|
, utils
|
2024-04-14 16:09:11 +02:00
|
|
|
, ...
|
|
|
|
}@inputs: utils.lib.eachDefaultSystem
|
2024-04-05 22:56:00 +02:00
|
|
|
(system:
|
|
|
|
let
|
2024-05-09 08:28:26 +02:00
|
|
|
base-pkgs = (import nixpkgs { inherit system; });
|
|
|
|
common = base-pkgs.callPackage ./lib/common-nix { };
|
2024-03-09 21:10:03 +01:00
|
|
|
|
2024-05-09 08:28:26 +02:00
|
|
|
root-mod = { config, pkgs, ... }: {
|
2024-06-17 21:17:17 +02:00
|
|
|
options.nixpkgs.overlays = nixpkgs.lib.mkOption { default = [ ]; };
|
|
|
|
options.output = nixpkgs.lib.mkOption {
|
|
|
|
default = { };
|
|
|
|
type = with nixpkgs.lib.types; attrsOf anything;
|
|
|
|
};
|
2024-04-05 22:56:00 +02:00
|
|
|
|
2024-05-09 08:28:26 +02:00
|
|
|
config._module.args = rec {
|
|
|
|
pkgs = base-pkgs.appendOverlays config.nixpkgs.overlays;
|
2024-04-14 16:09:11 +02:00
|
|
|
inherit inputs;
|
2024-05-09 08:28:26 +02:00
|
|
|
inherit system;
|
2024-04-21 16:22:11 +02:00
|
|
|
inherit (pkgs) lib stdenv stdenvNoCC;
|
2024-04-05 22:56:00 +02:00
|
|
|
};
|
|
|
|
|
2024-04-13 21:32:27 +02:00
|
|
|
# devshell for the dotfiles
|
2024-06-17 21:17:17 +02:00
|
|
|
config.output.devShells.default = nixpkgs.legacyPackages.${system}.mkShell {
|
2024-04-13 21:32:27 +02:00
|
|
|
buildInputs = with pkgs;
|
|
|
|
[
|
|
|
|
# packages required to build scripts
|
|
|
|
libGL
|
|
|
|
libgit2
|
|
|
|
luajit
|
|
|
|
pkg-config
|
|
|
|
racket
|
|
|
|
roswell
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
haxe
|
|
|
|
mpv-unwrapped
|
2024-06-29 21:36:13 +02:00
|
|
|
zig_0_13
|
2024-04-13 21:32:27 +02:00
|
|
|
] ++
|
|
|
|
# shorthands for setup.rkt
|
|
|
|
builtins.map
|
|
|
|
(cmd: pkgs.writeShellScriptBin cmd ''
|
|
|
|
./setup.rkt ${cmd}
|
|
|
|
'') [
|
|
|
|
"install-scripts"
|
|
|
|
"install-plugins"
|
|
|
|
"install-lsps-paru"
|
|
|
|
"setup-nvim-config"
|
|
|
|
"setup-nix"
|
|
|
|
"run-confgen"
|
|
|
|
];
|
|
|
|
};
|
2024-06-17 21:17:17 +02:00
|
|
|
|
|
|
|
config.output.mzteinit = base-pkgs.callPackage ./scripts/mzteinit/package.nix { };
|
|
|
|
|
|
|
|
config.output.overlay = final: prev: config.output.packages;
|
2024-04-05 22:56:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
modopt = nixpkgs.lib.evalModules {
|
2024-04-13 21:32:27 +02:00
|
|
|
modules = [ root-mod ./nix ] ++ common.localconf;
|
2024-04-05 22:56:00 +02:00
|
|
|
specialArgs = { inherit common; };
|
|
|
|
};
|
|
|
|
in
|
2024-06-17 21:17:17 +02:00
|
|
|
modopt.config.output // {
|
2024-04-14 16:09:11 +02:00
|
|
|
config = modopt;
|
2024-04-05 22:56:00 +02:00
|
|
|
});
|
2024-02-27 17:31:04 +01:00
|
|
|
}
|