dotfiles/flake.nix

159 lines
3.7 KiB
Nix

{
description = "My awesome system config";
##############
### Inputs ###
##############
inputs = {
master.url = "github:nixos/nixpkgs";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
stable.url = "github:nixos/nixpkgs/nixos-22.11";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# Zsh specific
forgit-git = {
url = "github:wfxr/forgit";
flake = false;
};
# Laptop Touchpad
asus-touchpad-numpad-driver = {
url = "github:MoritzBoehme/asus-touchpad-numpad-driver/german-layout";
flake = false;
};
arkenfox-userjs = {
url = "github:arkenfox/user.js";
flake = false;
};
howdy = {
url = "sourcehut:~moritzboehme/howdy";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "github:hyprwm/Hyprland";
hyprpaper.url = "github:hyprwm/hyprpaper";
};
outputs =
inputs@{ self, nixpkgs, utils, ... }:
utils.lib.mkFlake {
inherit self inputs;
supportedSystems = [ "x86_64-linux" ];
channelsConfig.allowUnfree = true;
################
### Overlays ###
################
overlay = import ./overlays { inherit inputs; };
channels.nixpkgs.overlaysBuilder = channels: [
self.overlay
inputs.agenix.overlay
inputs.emacs-overlay.overlay
inputs.howdy.overlays.default
inputs.hyprland.overlays.default
inputs.hyprpaper.overlays.default
inputs.utils.overlay
];
# overlays = utils.lib.exportOverlays {
# inherit (self) pkgs inputs;
# };
overlays.default = self.overlay;
###############
### Modules ###
###############
nixosModules = utils.lib.exportModules [
./modules/profiles/base.nix
./modules/profiles/gaming.nix
./modules/profiles/desktop.nix
];
hostDefaults.modules = [
./modules/default.nix
self.nixosModules.base
inputs.home-manager.nixosModule
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs self; };
};
}
inputs.hyprland.nixosModules.default
inputs.agenix.nixosModules.age
inputs.howdy.nixosModules.default
];
hosts.nixos-laptop.modules = [
./hosts/nixos-laptop
self.nixosModules.desktop
self.nixosModules.gaming
];
hosts.nixos-desktop.modules = [
./hosts/nixos-desktop
self.nixosModules.desktop
self.nixosModules.gaming
];
###############
### Outputs ###
###############
outputsBuilder = channels:
with channels.nixpkgs; {
devShells.default = mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
name = "dotfiles";
packages = [
# Secrets
pkgs.agenix
# cachix
cachix
];
};
checks.pre-commit-check = inputs.pre-commit-hooks.lib."${system}".run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
statix.enable = true;
shellcheck.enable = true;
};
};
packages = utils.lib.exportPackages self.overlays channels;
};
};
}