-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
111 lines (97 loc) · 3.42 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
103
104
105
106
107
108
109
110
111
{
description = "Flake of Drakeguard";
outputs = { self, nixpkgs, nixpkgs-stable, home-manager, ... }@inputs:
let
# ---- SYSTEM SETTINGS ---- #
systemSettings = {
system = "x86_64-linux"; # system arch
hostname = "nixos"; # hostname
profile = "personal"; # select a profile defined from my profiles directory
timezone = "Europe/Vienna"; # select timezone
locale = "de_AT.UTF-8"; # select locale
bootMode = "uefi"; # uefi or bios
bootMountPath = "/boot"; # mount path for efi boot partition; only used for uefi boot mode
grubDevice = ""; # device identifier for grub; only used for legacy (bios) boot mode
};
# ----- USER SETTINGS ----- #
userSettings = rec {
username = "arunm"; # username
name = "Arun Maybusch"; # name/identifier
email = "[email protected]"; # email (used for certain configurations)
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
};
# create patched nixpkgs
nixpkgs-patched = (import nixpkgs { system = systemSettings.system; }).applyPatches {
name = "nixpkgs-patched";
src = nixpkgs;
patches = [
#./patches/emacs-no-version-check.patch
#./patches/nixos-nixpkgs-268027.patch
];
};
# configure pkgs
pkgs = import nixpkgs-patched {
system = systemSettings.system;
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
#overlays = [ rust-overlay.overlays.default ];
};
pkgs-stable = import nixpkgs-stable {
system = systemSettings.system;
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
#overlays = [ rust-overlay.overlays.default ];
};
# configure lib
lib = nixpkgs.lib;
in
{
homeConfigurations = {
user = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
(./. + "/profiles" + ("/" + systemSettings.profile) + "/home.nix") # load home.nix from selected PROFILE
# inputs.nix-flatpak.homeManagerModules.nix-flatpak # Declarative flatpaks
];
extraSpecialArgs = {
# pass config variables from above
inherit pkgs-stable;
inherit systemSettings;
inherit userSettings;
};
};
};
nixosConfigurations = {
system = lib.nixosSystem {
system = systemSettings.system;
modules = [ (./. + "/profiles" + ("/" + systemSettings.profile) + "/configuration.nix") ]; # load configuration.nix from selected PROFILE
specialArgs = {
# pass config variables from above
inherit pkgs-stable;
inherit systemSettings;
inherit userSettings;
inherit (inputs) blocklist-hosts;
inherit (inputs) nh;
};
};
};
};
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs-stable.url = "nixpkgs/nixos-23.11";
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
blocklist-hosts = {
url = "github:StevenBlack/hosts";
flake = false;
};
nh = {
url = "github:viperML/nh";
inputs.nixpkgs.follows = "nixpkgs"; # override this repo's nixpkgs snapshot
};
};
}