nix-config/flake.in.nix

119 lines
3.8 KiB
Nix
Raw Permalink Normal View History

2024-05-07 03:23:55 -04:00
{
inputs = let
2024-05-28 04:08:06 -04:00
mkCustomUrl = url: {inherit url;};
2024-05-16 02:40:39 -04:00
2024-05-28 04:08:06 -04:00
mkInput = url: {url = "github:${url}";};
2024-05-07 03:23:55 -04:00
mkFollowingNixpkgs = url: {
url = "github:${url}";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-05-28 04:08:06 -04:00
mkFollowing = url: input: {
url = "github:${url}";
inputs.${input}.follows = input;
};
mkWithSubmodules = url: {
inherit url;
submodules = true;
type = "git";
};
2024-05-07 03:23:55 -04:00
in {
2024-11-10 22:15:07 -05:00
determinate = mkInput "DeterminateSystems/determinate";
2024-05-07 03:23:55 -04:00
agenix = mkInput "ryantm/agenix";
2024-05-16 02:40:39 -04:00
catppuccin = mkInput "catppuccin/nix";
2024-05-07 03:23:55 -04:00
chaotic = mkInput "chaotic-cx/nyx/nyxpkgs-unstable";
2024-08-13 00:59:18 -04:00
emacs = mkCustomUrl "git+https://git.pupbrained.xyz/pupbrained/nixmacs.git";
2024-05-28 04:08:06 -04:00
hyprland = mkWithSubmodules "https://github.com/hyprwm/Hyprland";
hyprland-plugins = mkFollowing "hyprwm/hyprland-plugins" "hyprland";
2024-05-07 03:23:55 -04:00
impermanence = mkInput "nix-community/impermanence";
2024-05-28 04:08:06 -04:00
nix-colors = mkInput "Misterio77/nix-colors";
2024-10-30 12:04:46 -04:00
nixos-facter-modules = mkInput "numtide/nixos-facter-modules";
2024-05-28 04:08:06 -04:00
nixpkgs = mkInput "NixOS/nixpkgs/nixos-unstable";
2024-07-28 02:49:27 -04:00
nixvim = mkInput "pupbrained/nvim-config";
2024-05-07 03:23:55 -04:00
treefmt-nix = mkInput "numtide/treefmt-nix";
2024-09-28 22:03:51 -04:00
xmonad-contrib = mkInput "xmonad/xmonad-contrib";
2024-10-18 00:43:17 -04:00
zen-browser = mkInput "fufexan/zen-browser-flake";
2024-05-07 03:23:55 -04:00
2024-08-15 01:59:55 -04:00
cosmic = mkFollowingNixpkgs "lilyinstarlight/nixos-cosmic";
2024-07-28 21:52:06 -04:00
darwin = mkFollowingNixpkgs "LnL7/nix-darwin/master";
home-manager = mkFollowingNixpkgs "nix-community/home-manager";
2024-05-07 03:23:55 -04:00
nix-index-database = mkFollowingNixpkgs "nix-community/nix-index-database";
2024-05-16 02:40:39 -04:00
snowfall-flake = mkFollowingNixpkgs "snowfallorg/flake";
2024-05-07 03:23:55 -04:00
snowfall-lib = mkFollowingNixpkgs "snowfallorg/lib/dev";
};
2024-05-16 02:40:39 -04:00
outputs = {...} @ inputs:
2024-07-28 03:29:11 -04:00
with inputs;
2024-05-16 02:40:39 -04:00
snowfall-lib.mkFlake {
2024-05-07 03:23:55 -04:00
inherit inputs;
src = ./.;
2024-05-16 02:40:39 -04:00
overlays = [
snowfall-flake.overlays.default
];
2024-05-07 03:23:55 -04:00
channels-config = {
2024-05-16 02:40:39 -04:00
allowAliases = true;
2024-05-07 03:23:55 -04:00
allowUnfree = true;
2024-05-16 02:40:39 -04:00
allowUnsupportedSystem = true;
cudaSupport = true;
permittedInsecurePackages = ["freeimage-unstable-2021-11-01"];
home-manager.useGlobalPkgs = true;
2024-05-07 03:23:55 -04:00
};
2024-09-28 22:03:51 -04:00
systems.modules.nixos =
[
agenix.nixosModules.default
catppuccin.nixosModules.catppuccin
chaotic.nixosModules.default
cosmic.nixosModules.default
2024-10-30 12:04:46 -04:00
determinate.nixosModules.default
2024-09-28 22:03:51 -04:00
impermanence.nixosModules.impermanence
2024-11-07 01:27:11 -05:00
nixos-facter-modules.nixosModules.facter
2024-09-28 22:03:51 -04:00
]
++ xmonad-contrib.nixosModules;
2024-05-07 03:23:55 -04:00
systems.modules.darwin = [
"${home-manager}/nix-darwin"
];
2024-07-28 03:29:11 -04:00
outputs-builder = channels: {
formatter = treefmt-nix.lib.mkWrapper channels.nixpkgs {
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true;
deadnix.enable = true;
2024-11-11 15:57:56 -05:00
jsonfmt.enable = true;
2024-07-28 03:29:11 -04:00
stylua.enable = true;
taplo.enable = true;
};
2024-05-07 03:23:55 -04:00
};
2024-07-28 03:29:11 -04:00
devShells.default = with channels.nixpkgs;
mkShellNoCC {
packages = [
alejandra
git
2024-08-12 03:12:52 -04:00
lua-language-server
2024-11-11 15:57:56 -05:00
nvfetcher
2024-07-28 03:29:11 -04:00
statix
2024-08-03 02:43:51 -04:00
2024-11-11 15:57:56 -05:00
(writeScriptBin "build" ''
sudo nix run \
--option experimental-features "nix-command flakes" \
--option extra-substituters https://numtide.cachix.org \
--option extra-trusted-public-keys numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE= \
github:numtide/nixos-facter -- -o systems/${system}/$(hostname)/facter.json
nix fmt
nh os switch
'')
(writeScriptBin "up" "nix flake update && nvfetcher")
2024-07-28 03:29:11 -04:00
];
};
};
2024-05-07 03:23:55 -04:00
};
}