dotfiles/flake.nix

72 lines
1.9 KiB
Nix
Raw Normal View History

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 { };
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;
inherit (pkgs) lib stdenv stdenvNoCC;
2024-04-05 22:56:00 +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
zig_0_12
] ++
# 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 {
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;
devShells = modopt.config.dev-shells;
2024-04-05 22:56:00 +02:00
});
2024-02-27 17:31:04 +01:00
}