114 lines
2.9 KiB
Nix
114 lines
2.9 KiB
Nix
{
|
|
description = "My awesome system config";
|
|
|
|
##############
|
|
### Inputs ###
|
|
##############
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
stable.url = "github:nixos/nixpkgs/nixos-21.11";
|
|
nur.url = "github:nix-community/NUR";
|
|
utils.url = "github:gytis-ivaskevicius/flake-utils-plus/1.3.0";
|
|
agenix.url = "github:ryantm/agenix";
|
|
|
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
|
|
|
statix.url = "github:nerdypepper/statix";
|
|
|
|
picom = {
|
|
url = "github:jonaburg/picom";
|
|
flake = false;
|
|
};
|
|
forgit-git = {
|
|
url = "github:wfxr/forgit";
|
|
flake = false;
|
|
};
|
|
};
|
|
|
|
outputs = inputs@{ self, agenix, home-manager, nixpkgs, utils, ... }:
|
|
utils.lib.mkFlake {
|
|
inherit self inputs;
|
|
|
|
channelsConfig.allowUnfree = true;
|
|
|
|
################
|
|
### Overlays ###
|
|
################
|
|
|
|
overlay = import ./overlays { inherit inputs; };
|
|
overlays = utils.lib.exportOverlays { inherit (self) pkgs inputs; };
|
|
|
|
channels.nixpkgs.overlaysBuilder = channels: [
|
|
self.overlay
|
|
inputs.utils.overlay
|
|
inputs.emacs-overlay.overlay
|
|
inputs.nur.overlay
|
|
];
|
|
|
|
###############
|
|
### Modules ###
|
|
###############
|
|
|
|
nixosModules = utils.lib.exportModules [
|
|
./modules/default.nix
|
|
./modules/containers
|
|
./modules/gaming
|
|
];
|
|
|
|
hostDefaults.modules = [
|
|
home-manager.nixosModule
|
|
{
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
extraSpecialArgs = { inherit inputs self; };
|
|
};
|
|
}
|
|
self.nixosModules.default
|
|
agenix.nixosModules.age
|
|
];
|
|
|
|
hosts.nixos-laptop.modules = [ ./hosts/nixos-laptop ];
|
|
hosts.nixos-desktop.modules = [
|
|
./hosts/nixos-desktop
|
|
self.nixosModules.containers
|
|
self.nixosModules.gaming
|
|
];
|
|
|
|
###############
|
|
### Outputs ###
|
|
###############
|
|
|
|
outputsBuilder = channels:
|
|
with channels.nixpkgs; {
|
|
devShell = mkShell {
|
|
name = "dotfiles";
|
|
shellHook = ''
|
|
alias "lint"='echo "Running nixpkgs-fmt ..."
|
|
nixpkgs-fmt --check $(find . -name "*.nix")
|
|
echo ""
|
|
echo "Running statix ..."
|
|
statix check'
|
|
alias "fix"='echo "Running nixpkgs-fmt ..."
|
|
nixpkgs-fmt $(find . -name "*.nix")
|
|
echo ""
|
|
echo "Running statix ..."
|
|
statix fix'
|
|
'';
|
|
packages = [
|
|
# Linting
|
|
nixpkgs-fmt
|
|
statix
|
|
# Secrets
|
|
agenix.defaultPackage.x86_64-linux
|
|
# chachix
|
|
cachix
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|