dotfiles/flake.nix

74 lines
2.1 KiB
Nix
Raw Permalink 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
base-pkgs = (import nixpkgs { inherit system; });
common = base-pkgs.callPackage ./lib/common-nix { };
2024-03-09 21:10:03 +01:00
root-mod = { config, pkgs, ... }: {
2024-04-05 22:56:00 +02:00
options.packages = nixpkgs.lib.mkOption { };
options.dev-shells = nixpkgs.lib.mkOption { };
options.nixpkgs.overlays = nixpkgs.lib.mkOption { default = []; };
2024-04-05 22:56:00 +02:00
config._module.args = rec {
pkgs = base-pkgs.appendOverlays config.nixpkgs.overlays;
2024-04-14 16:09:11 +02:00
inherit inputs;
inherit 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;
mzteinit = base-pkgs.callPackage ./scripts/mzteinit/package.nix { };
2024-04-05 22:56:00 +02:00
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
}