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
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
common = pkgs.callPackage ./lib/common-nix { };
|
2024-03-09 21:10:03 +01:00
|
|
|
|
2024-04-05 22:56:00 +02:00
|
|
|
root-mod = {
|
|
|
|
options.packages = nixpkgs.lib.mkOption { };
|
2024-04-13 21:32:27 +02:00
|
|
|
options.dev-shells = nixpkgs.lib.mkOption { };
|
2024-04-05 22:56:00 +02:00
|
|
|
|
|
|
|
config._module.args = {
|
2024-04-14 16:09:11 +02:00
|
|
|
inherit inputs;
|
2024-04-05 22:56:00 +02:00
|
|
|
inherit pkgs 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
|
|
|
|
config.dev-shells.default = nixpkgs.legacyPackages.${system}.mkShell {
|
|
|
|
buildInputs = with pkgs;
|
|
|
|
[
|
|
|
|
# packages required to build scripts
|
|
|
|
libGL
|
|
|
|
libgit2
|
|
|
|
luajit
|
|
|
|
pkg-config
|
|
|
|
racket
|
|
|
|
roswell
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
haxe
|
|
|
|
mpv-unwrapped
|
2024-05-01 00:10:27 +02:00
|
|
|
zig_0_12
|
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-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-04-14 16:09:11 +02:00
|
|
|
config = modopt;
|
2024-04-05 22:56:00 +02:00
|
|
|
mzteinit = pkgs.callPackage ./scripts/mzteinit/package.nix { };
|
|
|
|
packages = modopt.config.packages;
|
2024-04-13 21:32:27 +02:00
|
|
|
devShells = modopt.config.dev-shells;
|
2024-04-05 22:56:00 +02:00
|
|
|
});
|
2024-02-27 17:31:04 +01:00
|
|
|
}
|