-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
61 lines (55 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
{
description = "Generic NixOS Configuration";
# All inputs for the system
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
# nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
#nur = {
# url = "github:nix-community/NUR";
# inputs.nixpkgs.follows = "nixpkgs";
#};
};
# All outputs for the system (configs)
outputs = { home-manager, nixpkgs, ... }@inputs:
let
system = "x86_64-linux"; #current system
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
lib = nixpkgs.lib;
# This lets us reuse the code to "create" a system
# Credits go to sioodmy on this one!
# https://github.com/sioodmy/dotfiles/blob/main/flake.nix
mkSystem = pkgs: system: hostname:
pkgs.lib.nixosSystem {
system = system;
modules = [
{ networking.hostName = hostname; }
# General configuration (users, networking, sound, etc)
./modules/system/configuration.nix
# Hardware config (bootloader, kernel modules, filesystems, etc)
# DO NOT USE MY HARDWARE CONFIG!! USE YOUR OWN!!
(./. + "/hosts/${hostname}/hardware-configuration.nix")
home-manager.nixosModules.home-manager
{
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = { inherit inputs; };
# Home manager config (configures programs like firefox, zsh, eww, etc)
users.jklp = (./. + "/hosts/${hostname}/user.nix");
};
}
];
specialArgs = { inherit inputs; };
};
in {
nixosConfigurations = {
nixhp15s = mkSystem inputs.nixpkgs "x86_64-linux" "nixhp15s";
# usb3ssdnixos = mkSystem inputs.nixpkgs "x86_64-linux" "usb3ssdnixos";
};
};
}