Personal-use NixOS configuration
1{
2 inputs,
3 flake,
4 flakeRoot,
5}:
6
7{
8 hostName,
9 system,
10 extraModules ? [ ],
11 isLaptop ? false,
12}:
13
14let
15 pkgs = import inputs.nixpkgs {
16 inherit system;
17
18 config.allowUnfree = true;
19 };
20
21 pkgs-unstable = import inputs.nixpkgs-unstable {
22 inherit system;
23
24 config.allowUnfree = true;
25 };
26
27 pkgs-flake = flake.packages.${system};
28
29 pkgs-firefox-addons = inputs.nix-firefox-addons.addons.${system};
30
31 lib = inputs.nixpkgs.lib;
32
33 flakeLib = import ./default.nix {
34 inherit pkgs lib;
35
36 nix-jetbrains-plugins = inputs.nix-jetbrains-plugins;
37 };
38in
39lib.nixosSystem {
40 inherit system;
41
42 modules = [
43 inputs.lix-module.nixosModules.default
44 inputs.disko.nixosModules.disko
45
46 ../hosts/${hostName}
47
48 {
49 nixpkgs.pkgs = pkgs;
50
51 networking.hostName = hostName;
52 }
53 ]
54 ++ builtins.attrValues flake.nixosModules
55 ++ lib.optionals isLaptop [
56 ../hardware/battery.nix
57 ]
58 ++ extraModules;
59
60 specialArgs = {
61 inherit
62 flakeRoot
63 flakeLib
64 pkgs-unstable
65 pkgs-flake
66 pkgs-firefox-addons
67 isLaptop
68 hostName
69 ;
70
71 # TODO: use better inherit syntax for these
72 lanzaboote = inputs.lanzaboote;
73 nixos-hardware = inputs.nixos-hardware;
74 home-manager = inputs.home-manager;
75 nixcord = inputs.nixcord;
76 };
77}