-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
53 lines (47 loc) · 1.64 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
{
description = "Personal NixOS Config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ { self, nixpkgs, home-manager, nur, ... }:
let
user = "noe";
# credits to sioodmy's config
# https://github.com/sioodmy/dotfiles/blob/722966ad0b03807bc1e661174c4be6bc876f1ed0/flake.nix
mkSystem = pkgs: system: hostname: desktop:
pkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit user hostname inputs; };
modules = [
./hosts/configuration.nix # default config
./hosts/${hostname}/configuration.nix # host specific config
./hosts/${hostname}/hardware-configuration.nix # generated hardware config
./modules/desktop/${desktop} # DE / WM for the given system
home-manager.nixosModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit user hostname; };
users.${user} = ./hosts/${hostname}/home.nix;
};
nixpkgs.overlays = [
nur.overlay
];
}
];
};
in {
nixosConfigurations = {
desktop = mkSystem inputs.nixpkgs "x86_64-linux" "desktop" "gnome";
thinkpad = mkSystem inputs.nixpkgs "x86_64-linux" "thinkpad" "gnome";
};
};
}