-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
71 lines (66 loc) · 2.04 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
{
description = "My NixOS home-manager config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
xremap-flake.url = "github:xremap/nix-flake";
};
outputs =
{
self,
nixpkgs,
home-manager,
...
}@inputs:
let
# ---- SYSTEM SETTINGS ---- #
systemSettings = {
system = "x86_64-linux";
hostname = "nixos";
profile = "personal"; # select a profile defined from ./profiles directory
timezone = "Europe/Istanbul";
locale = "en_US.UTF-8"; # default locale
locale_extra = "en_GB.UTF-8"; # extra locale
threads = 16; # cpu threads
};
# ----- USER SETTINGS ----- #
userSettings = rec {
username = "emre"; # username
name = "EHD"; # name/identifier
dotfilesDir = "/home/${username}/Desktop/dotfiles"; # absolute path of the local repo
};
in
{
# sudo nix-rebuild switch --flake ~/Desktop/dotfiles/#myNixos
nixosConfigurations."myNixos" = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit userSettings systemSettings;
};
modules = [
# load configuration.nix from selected PROFILE
(./. + "/profiles" + ("/" + systemSettings.profile) + "/configuration.nix")
# load overlays
./overlay.nix
];
};
# home-manager switch --flake ~/Desktop/dotfiles/#emre
homeConfigurations."${userSettings.username}" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = systemSettings.system;
config.allowUnfree = true;
};
extraSpecialArgs = {
inherit inputs systemSettings userSettings;
};
modules = [
# load home.nix from selected PROFILE
(./. + "/profiles" + ("/" + systemSettings.profile) + "/home.nix")
# load overlays
./overlay.nix
];
};
};
}