/
flake.nix
102 lines (81 loc) · 3.74 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{
description = "NixOS and Home Manager configuration for Milo's laptops";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
agenix.inputs.home-manager.follows = "home-manager";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
# TODO: replace with a custom module, this just acts as a module definition
nix-colors.url = "github:misterio77/nix-colors";
nixos-hardware.url = "github:nixos/nixos-hardware";
# ——— Packages
git-leave.url = "github:mrnossiom/git-leave";
git-leave.inputs.nixpkgs.follows = "nixpkgs";
mind.url = "github:sayanarijit/mind";
mind.inputs.nixpkgs.follows = "nixpkgs";
radicle.url = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5";
radicle.inputs.nixpkgs.follows = "nixpkgs";
wakatime-lsp.url = "github:mrnossiom/wakatime-lsp";
wakatime-lsp.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, ... }:
let
inherit (self) outputs;
inherit (flakeLib) forAllSystems;
flakeLib = import ./lib/flake (nixpkgs // { inherit self; });
keys = import ./secrets/keys.nix;
forAllPkgs = func: forAllSystems (system: func pkgs.${system});
# This should be the only constructed nixpkgs instances in this flake
pkgs = forAllSystems (system: (import nixpkgs {
inherit system;
config.allowUnfreePredicate = import ./lib/unfree.nix;
overlays = [ outputs.overlays.all ];
}));
in
{
formatter = forAllPkgs (pkgs: pkgs.nixpkgs-fmt);
packages = forAllPkgs (import ./pkgs);
apps = forAllPkgs (import ./apps { inherit forAllPkgs; });
devShells = forAllPkgs (import ./shells.nix);
overlays = import ./overlays (nixpkgs // { inherit self; });
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
templates = import ./templates;
# Custom exports
inherit flakeLib;
lib = forAllPkgs (import ./lib);
nixosConfigurations = with flakeLib;
{
# Desktops
"neo-wiro-laptop" = createSystem pkgs."x86_64-linux" [
(system "neo-wiro-laptop" "laptop")
(managedDiskLayout "luks-btrfs" { device = "nvme0n1"; swapSize = 12; })
(user "milomoisson" { description = "Milo Moisson"; profile = "desktop"; keys = keys.users; })
];
"archaic-wiro-laptop" = createSystem pkgs."x86_64-linux" [
(system "archaic-wiro-laptop" "laptop")
(user "milomoisson" { description = "Milo Moisson"; profile = "desktop"; keys = keys.users; })
];
# # Servers
# "weird-row-server" = createSystem pkgs."x86_64-linux" [
# (system "weird-row-server" "server")
# (user "milomoisson" { description = "Milo Moisson"; profile = "minimal"; keys = keys.users; })
# ];
};
# I bundle my Home Manager config via the NixOS modules which create system generations and give free rollbacks.
# However, in non-NixOS contexts, you can still use Home Manager to manage dotfiles using this template.
homeConfigurations = {
# "<username>@<hostname>" = homeManagerConfiguration {
# pkgs = pkgs."<system>";
# extraSpecialArgs = { inherit self; osConfig = null; };
# modules = [ ./home-manager/profiles/desktop.nix ];
# };
};
};
}