dotfiles/flake.nix

78 lines
2.2 KiB
Nix
Raw Normal View History

2024-02-27 17:31:04 +01:00
{
inputs = {
2024-08-21 10:35:20 +02:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
2024-02-27 17:31:04 +01:00
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-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
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
2024-06-17 21:17:17 +02:00
config.output.devShells.default = nixpkgs.legacyPackages.${system}.mkShell {
buildInputs = with pkgs;
[
# packages required to build scripts
libGL
libgit2
luajit
2024-08-23 22:04:25 +02:00
luajitPackages.luafilesystem
pkg-config
racket
roswell
wayland
wayland-protocols
haxe
mpv-unwrapped
2024-06-29 21:36:13 +02:00
zig_0_13
] ++
# 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 {
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
}