-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
50 lines (43 loc) · 1.33 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
{
description = "Yash Raj's NixOS Flake";
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: let
inherit (lib) nixosSystem genAttrs hasPrefix;
lib = nixpkgs.lib.extend (final: prev: (import ./lib final) // home-manager.lib);
systems = ["x86_64-linux"];
forEachSystem = f:
genAttrs systems (system:
f (nixpkgs.legacyPackages.${system}));
mkHost = hostname: username: system: {
${hostname} = nixosSystem {
inherit system;
specialArgs = {
inherit self inputs hostname username lib;
};
modules =
if (hasPrefix "installer" hostname)
then [./hosts/installer]
else [
./hosts/${hostname}
./modules/nixos
];
};
};
in {
formatter = forEachSystem (pkgs: pkgs.alejandra);
templates = import ./templates;
nixosConfigurations = mkHost "hana" "yashraj" "x86_64-linux";
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
firefox-addons.url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
firefox-addons.inputs.nixpkgs.follows = "nixpkgs";
};
}