devos/hosts/default.nix

59 lines
1.4 KiB
Nix
Raw Normal View History

{ home, nixpkgs, unstable, unstablePkgs, self, pkgs, system, utils, ... }:
let
inherit (nixpkgs) lib;
inherit (utils) recImport;
2020-01-04 06:06:31 +01:00
inherit (builtins) attrValues removeAttrs;
config = hostName:
lib.nixosSystem {
inherit system;
modules = let
inherit (home.nixosModules) home-manager;
2020-07-16 23:27:39 +02:00
core = self.nixosModules.profiles.core;
global = {
networking.hostName = hostName;
2019-12-16 05:36:05 +01:00
nix.nixPath = [
"nixpkgs=${nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix"
"nixpkgs-overlays=/etc/nixos/overlays"
2019-12-16 05:36:05 +01:00
];
nixpkgs = { inherit pkgs; };
nix.registry = {
nixpkgs.flake = nixpkgs;
nixflk.flake = self;
master.flake = unstable;
};
};
unstables = {
systemd.package = unstablePkgs.systemd;
nixpkgs.overlays = [
(final: prev:
with unstablePkgs; {
2020-07-30 07:39:24 +02:00
inherit starship element-desktop discord signal-desktop mpv
dhall;
})
];
};
local = import "${toString ./.}/${hostName}.nix";
# Everything in `./modules/list.nix`.
flakeModules =
attrValues (removeAttrs self.nixosModules [ "profiles" ]);
in flakeModules ++ [ core global local home-manager unstables ];
};
2020-01-04 06:06:31 +01:00
hosts = recImport {
dir = ./.;
_import = config;
};
in hosts