1
1
mirror of https://github.com/divnix/digga.git synced 2024-12-28 18:41:51 +03:00
digga/hosts/default.nix

63 lines
1.5 KiB
Nix
Raw Normal View History

inputs@{ home, nixpkgs, unstablePkgs, self, pkgs, system, ... }:
let
inherit (nixpkgs) lib;
utils = import ../lib/utils.nix { inherit lib; };
inherit (utils) recImport;
2019-12-31 04:00:09 +03:00
2020-01-04 08:06:31 +03:00
inherit (builtins) attrValues removeAttrs;
config = hostName:
lib.nixosSystem {
inherit system;
modules = let
inherit (home.nixosModules) home-manager;
2020-07-17 00:27:39 +03:00
core = self.nixosModules.profiles.core;
global = {
networking.hostName = hostName;
2019-12-16 07:36:05 +03:00
nix.nixPath = [
"nixpkgs=${nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix"
"nixpkgs-overlays=/etc/nixos/overlays"
2019-12-16 07:36:05 +03:00
];
nixpkgs = { inherit pkgs; };
nix.registry = {
nixpkgs.flake = nixpkgs;
nixflk.flake = self;
master.flake = inputs.unstable;
};
};
unstables = {
systemd.package = unstablePkgs.systemd;
nixpkgs.overlays = [
(final: prev:
with unstablePkgs; {
2020-07-30 08:39:24 +03: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 08:06:31 +03:00
hosts = recImport {
dir = ./.;
_import = config;
};
in hosts