nixos-configs/lib.nix
matt1432 2a8eb46b03
All checks were successful
Discord / discord commits (push) Successful in 38s
feat(servers): make 7 Days to Die server work
2024-07-06 23:55:05 -04:00

63 lines
1.5 KiB
Nix

{...} @ inputs: rec {
mkVersion = src: "0pre+" + src.shortRev;
buildPlugin = pname: src:
inputs.pkgs.vimUtils.buildVimPlugin {
inherit pname src;
version = mkVersion src;
};
# Import pkgs from a nixpkgs
mkPkgs = system: input:
import input {
inherit system;
config.allowUnfree = true;
overlays = [
inputs.discord-overlay.overlays.default
inputs.grim-hyprland.overlays.default
inputs.jovian.overlays.default
inputs.nixpkgs-wayland.overlays.default
];
};
# Function that makes the attrs that make up the specialArgs
mkArgs = system:
inputs
// {
pkgs = mkPkgs system inputs.nixpkgs;
};
# Default system
mkNixOS = mods:
inputs.nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = mkArgs system;
modules =
[
{home-manager.extraSpecialArgs = specialArgs;}
./common
]
++ mods;
};
mkNixOnDroid = mods:
inputs.nix-on-droid.lib.nixOnDroidConfiguration rec {
extraSpecialArgs = mkArgs "aarch64-linux";
home-manager-path = inputs.home-manager.outPath;
pkgs = extraSpecialArgs.pkgs;
modules =
[
{
options = with pkgs.lib; {
environment.variables.FLAKE = mkOption {
type = with types; nullOr str;
};
};
}
{home-manager = {inherit extraSpecialArgs;};}
./common/nix-on-droid.nix
]
++ mods;
};
}