-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
60 lines (51 loc) · 2.62 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
description = "bphenriques's machines expressed using nix";
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
"https://nixpkgs-wayland.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; # Stable(ish) enough. Plus home-manager is _always_ on unstable
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05"; # I don't really use it, but leaving it here.
darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# Private dotfiles for confidential information that can't be covered by sops or want exposed
dotfiles-private.url = "git+ssh://git@github.com/bphenriques/dotfiles-private";
dotfiles-private.inputs.nixpkgs.follows = "nixpkgs";
# Community flakes
sops-nix.url = "github:Mic92/sops-nix"; # Manage secrets using sops
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko"; # Declaratively describe my disks layout
disko.inputs.nixpkgs.follows = "nixpkgs";
nur.url = "github:nix-community/nur"; # Collection of packages. Use it for Firefox extensions
ghostty.url = "git+ssh://git@github.com/mitchellh/ghostty"; # Terminal
};
outputs = inputs @ { nixpkgs, ... }:
let
inherit (mylib.builders) forAllSystems;
mylib = import ./lib { inherit inputs; lib = nixpkgs.lib; };
in {
apps = import ./apps { inherit nixpkgs mylib; };
packages = import ./packages { inherit nixpkgs mylib; };
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
devShells = forAllSystems (system: {
default = import ./shell.nix { pkgs = nixpkgs.legacyPackages.${system}; };
});
overlays = import ./overlays { inherit inputs; };
nixosModules = import ./modules/nixos;
# Hosts - Each host defines what it needs from the inputs.
nixosConfigurations.laptop = import ./hosts/laptop (inputs // { inherit mylib; });
darwinConfigurations.work-macos = import ./hosts/work-macos (inputs // { inherit mylib; });
# Non standard flake outputs
homeManagerModules = import ./modules/home-manager;
darwinModules = import ./modules/darwin;
};
}