-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
94 lines (83 loc) · 3.53 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 = "Flake of JohnRTitor (Hyprland, Secure-Boot)";
outputs = { self, nixpkgs, nixpkgs-edge, ... }@inputs: # Also pass all inputs
let
# ---- SYSTEM SETTINGS ---- #
systemSettings = {
systemarch = "x86_64-linux"; # system arch
hostname = "Ainz-NIX"; # hostname
timezone = "Asia/Kolkata"; # select timezone
locale = "en_US.UTF-8"; # select locale
localeoverride = "en_IN";
stableversion = "24.05";
kernel = "cachyos"; # cachyos, xanmod, zen # default: latest generic kernel
secureboot = true;
virtualisation = false;
laptop = false;
};
# ----- USER SETTINGS ----- #
userSettings = {
username = "masum"; # username
name = "Masum R."; # name/identifier
email = "[email protected]"; # email (used for certain configurations)
gitname = "John Titor"; # git name
gitemail = "[email protected]"; # git email
gpgkey = "29B0514F4E3C1CC0"; # gpg key
shell = "zsh"; # user default shell # choose either zsh or bash
};
# configure pkgs from unstable (default)
pkgs = import nixpkgs {
# Add zen4 support
localSystem = let
featureSupport = arch:
nixpkgs.lib.mapAttrs (_: f: f arch) nixpkgs.lib.systems.architectures.predicates;
in {
system = systemSettings.systemarch;
} // featureSupport "znver4";
config = { allowUnfree = true;
allowUnfreePredicate = (_: true); };
};
# bleeding edge packages from nixpkgs unstable branch, for packages that need immediate updates
pkgs-edge = import nixpkgs-edge {
system = pkgs.system;
config = { allowUnfree = true;
allowUnfreePredicate = (_: true); };
};
# system is built on nixos unstable
lib = nixpkgs.lib;
in {
nixosConfigurations.${systemSettings.hostname} = lib.nixosSystem {
modules = [
./configuration.nix # main nix configuration
inputs.chaotic.nixosModules.default # chaotic nix bleeding edge packages
# make home-manager as a module of nixos
# so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch`
inputs.home-manager.nixosModules.default
]
++
# Enable Lanzaboote if secureboot is configured
lib.optionals (systemSettings.secureboot) [
inputs.lanzaboote.nixosModules.lanzaboote
];
# pass the custom settings and flakes to system
specialArgs = {
inherit inputs;
inherit pkgs-edge;
inherit systemSettings;
inherit userSettings;
};
};
};
# Main sources and repositories
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable"; # Unstable NixOS system (default)
nixpkgs-edge.url = "nixpkgs/master"; # Only used for bleeding edge packages
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; # Bleeding edge packages from chaotic nix
lanzaboote.url = "github:nix-community/lanzaboote"; # lanzaboote, used for secureboot
hyprland.url = "github:hyprwm/Hyprland"; # Latest Hyprland from official repo
home-manager = { url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs"; };
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; # latest vs code extensions flake
devenv.url = "github:cachix/devenv"; # Devenv flake
};
}