nix-config/flake.in.nix

75 lines
2 KiB
Nix
Raw Normal View History

2024-05-07 03:17:46 -04:00
{
inputs = let
mkInput = url: {
url = "github:${url}";
};
mkFollowingNixpkgs = url: {
url = "github:${url}";
inputs.nixpkgs.follows = "nixpkgs";
};
in {
agenix = mkInput "ryantm/agenix";
chaotic = mkInput "chaotic-cx/nyx/nyxpkgs-unstable";
flakegen = mkInput "jorsn/flakegen";
impermanence = mkInput "nix-community/impermanence";
nixpkgs = mkInput "nixos/nixpkgs/nixos-unstable";
nixvim = mkInput "pupbrained/nixvim";
sops-nix = mkInput "Mic92/sops-nix";
treefmt-nix = mkInput "numtide/treefmt-nix";
home-manager = mkFollowingNixpkgs "nix-community/home-manager";
kwin-effects-forceblur = mkFollowingNixpkgs "taj-ny/kwin-effects-forceblur";
nix-index-database = mkFollowingNixpkgs "nix-community/nix-index-database";
snowfall-lib = mkFollowingNixpkgs "snowfallorg/lib/dev";
};
outputs = inputs: let
pkgs = import inputs.nixpkgs {inherit system;};
system = "x86_64-linux";
in
with inputs;
inputs.snowfall-lib.mkFlake {
inherit inputs;
src = ./.;
formatter.${system} = treefmt-nix.lib.mkWrapper pkgs {
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true;
deadnix.enable = true;
};
};
channels-config = {
allowUnfree = true;
};
homes.modules = [
chaotic.homeManagerModules.default
nix-index-database.hmModules.nix-index
];
systems.modules.nixos = [
agenix.nixosModules.default
chaotic.nixosModules.default
impermanence.nixosModules.impermanence
];
devShells.${system}.default = with pkgs;
mkShellNoCC {
packages = [
alejandra
git
statix
(writeScriptBin "build" ''
nix fmt
nh os switch
nh home switch
'')
(writeScriptBin "up" "nix flake update")
];
};
};
}