nix-config/flake.in.nix

98 lines
2.8 KiB
Nix

{
inputs = let
mkCustomUrl = url: {inherit url;};
mkInput = url: {url = "github:${url}";};
mkFollowingNixpkgs = url: {
url = "github:${url}";
inputs.nixpkgs.follows = "nixpkgs";
};
mkFollowing = url: input: {
url = "github:${url}";
inputs.${input}.follows = input;
};
mkWithSubmodules = url: {
inherit url;
submodules = true;
type = "git";
};
in {
agenix = mkInput "ryantm/agenix";
catppuccin = mkInput "catppuccin/nix";
chaotic = mkInput "chaotic-cx/nyx/nyxpkgs-unstable";
hyprland = mkWithSubmodules "https://github.com/hyprwm/Hyprland";
hyprland-plugins = mkFollowing "hyprwm/hyprland-plugins" "hyprland";
impermanence = mkInput "nix-community/impermanence";
nix-colors = mkInput "Misterio77/nix-colors";
nixpkgs = mkInput "NixOS/nixpkgs/nixos-unstable";
nix-super = mkCustomUrl "git+https://git.privatevoid.net/max/nix-super.git";
nixvim = mkInput "pupbrained/nvim-config";
treefmt-nix = mkInput "numtide/treefmt-nix";
darwin = mkFollowingNixpkgs "LnL7/nix-darwin/master";
home-manager = mkFollowingNixpkgs "nix-community/home-manager";
nix-index-database = mkFollowingNixpkgs "nix-community/nix-index-database";
snowfall-flake = mkFollowingNixpkgs "snowfallorg/flake";
snowfall-lib = mkFollowingNixpkgs "snowfallorg/lib/dev";
};
outputs = {...} @ inputs:
with inputs;
snowfall-lib.mkFlake {
inherit inputs;
src = ./.;
overlays = [
snowfall-flake.overlays.default
];
channels-config = {
allowAliases = true;
allowUnfree = true;
allowUnsupportedSystem = true;
cudaSupport = true;
permittedInsecurePackages = ["freeimage-unstable-2021-11-01"];
home-manager.useGlobalPkgs = true;
};
systems.modules.nixos = [
agenix.nixosModules.default
catppuccin.nixosModules.catppuccin
chaotic.nixosModules.default
impermanence.nixosModules.impermanence
];
systems.modules.darwin = [
"${home-manager}/nix-darwin"
];
outputs-builder = channels: {
formatter = treefmt-nix.lib.mkWrapper channels.nixpkgs {
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true;
deadnix.enable = true;
stylua.enable = true;
taplo.enable = true;
};
};
devShells.default = with channels.nixpkgs;
mkShellNoCC {
packages = [
alejandra
git
nvfetcher
statix
(writeScriptBin "build" "nix fmt && nh os switch . -- --impure")
(writeScriptBin "up" "nix flake update")
];
};
};
};
}