-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
94 lines (80 loc) · 2.43 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
{
description = "Nixos Configuration (Flake-based)";
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
# NixOS Hardware Profiles
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# Secure Boot
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";
inputs.nixpkgs.follows = "nixpkgs";
};
# Sops (Secrets Management)
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home Manager
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# COSMIC Flake
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
inputs.nixpkgs.follows = "nixos-cosmic/nixpkgs-stable";
};
# Nixvim (Neovim configured with nix)
nixvim = {
url = "github:nix-community/nixvim/nixos-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# Stylix (Theme management)
stylix = {
url = "github:danth/stylix/release-24.11";
};
# Encrypted Secrets Repo
nix-secrets = {
url = "git+ssh://git@github.com/cfrenette/nix-secrets.git?ref=main&shallow=1";
flake = false;
};
};
outputs = { nixpkgs, home-manager, ... } @inputs:
let
# Function for NixOS configuration by host
mkHost = hostname: arch:
nixpkgs.lib.nixosSystem {
system = "${arch}";
specialArgs.inputs = inputs;
modules =
[
# Cosmic
{
nix.settings = {
substituters = [ "https://cosmic.cachix.org/" ];
trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
};
}
inputs.nixos-cosmic.nixosModules.default
# System Configuration
./hosts/${hostname}/configuration.nix
# Home Manager Configuration
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.cory.imports = [ ./home/cory/${hostname}.nix ];
extraSpecialArgs.inputs = inputs;
};
}
];
};
in
{
nixosConfigurations = {
frmwrk = mkHost "frmwrk" "x86_64-linux";
};
};
}