2021-03-31 22:15:08 +00:00
|
|
|
{
|
2021-10-06 04:16:18 +00:00
|
|
|
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
|
2021-08-13 16:14:42 +00:00
|
|
|
inputs.impermanence.url = "github:nix-community/impermanence";
|
2021-04-06 03:11:17 +00:00
|
|
|
|
2021-10-06 04:16:18 +00:00
|
|
|
outputs = { self, nixpkgs, impermanence, ... }:
|
2021-08-20 17:40:05 +00:00
|
|
|
let
|
2021-11-18 20:45:24 +00:00
|
|
|
|
2021-11-01 18:45:18 +00:00
|
|
|
mypkgs = import ./pkgs;
|
2021-11-18 20:45:24 +00:00
|
|
|
|
|
|
|
pins = _: {
|
|
|
|
nix.registry.nixpkgs.flake = nixpkgs;
|
|
|
|
nix.registry.bck.to = {
|
|
|
|
owner = "buckley310";
|
|
|
|
repo = "nixos-config";
|
|
|
|
type = "github";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-08-20 17:40:05 +00:00
|
|
|
in
|
2021-06-05 06:22:38 +00:00
|
|
|
{
|
2021-09-10 04:42:41 +00:00
|
|
|
nixosModules =
|
2021-11-18 20:45:24 +00:00
|
|
|
{
|
|
|
|
inherit pins;
|
|
|
|
inherit (impermanence.nixosModules) impermanence;
|
|
|
|
} //
|
2021-09-10 04:42:41 +00:00
|
|
|
nixpkgs.lib.mapAttrs'
|
|
|
|
(name: type: {
|
2021-10-08 17:31:06 +00:00
|
|
|
name = nixpkgs.lib.removeSuffix ".nix" name;
|
2021-09-10 04:42:41 +00:00
|
|
|
value = import (./modules + "/${name}");
|
|
|
|
})
|
|
|
|
(builtins.readDir ./modules);
|
2021-06-12 01:32:23 +00:00
|
|
|
|
2021-08-16 03:20:11 +00:00
|
|
|
nixosModule = { pkgs, ... }: {
|
|
|
|
imports = builtins.attrValues self.nixosModules;
|
2021-08-20 17:40:05 +00:00
|
|
|
nixpkgs.overlays = [ (_: mypkgs) ];
|
2021-08-16 03:20:11 +00:00
|
|
|
};
|
2021-06-05 06:22:38 +00:00
|
|
|
|
2021-08-23 00:42:09 +00:00
|
|
|
nixosConfigurations = self.lib.getHosts {
|
|
|
|
path = ./hosts;
|
2021-10-06 04:16:18 +00:00
|
|
|
inherit nixpkgs;
|
2021-08-23 00:42:09 +00:00
|
|
|
inherit (self) nixosModule;
|
|
|
|
};
|
2021-06-05 06:22:38 +00:00
|
|
|
|
2021-06-25 05:04:30 +00:00
|
|
|
lib = {
|
|
|
|
getHosts = import lib/hosts.nix;
|
2021-09-10 03:46:13 +00:00
|
|
|
morphHosts = import lib/morph.nix;
|
2021-10-30 03:37:16 +00:00
|
|
|
forAllSystems = f: builtins.listToAttrs (map
|
|
|
|
(name: { inherit name; value = f name; })
|
2021-11-09 16:02:28 +00:00
|
|
|
(with nixpkgs.lib.systems.supported; tier1 ++ tier2));
|
2021-06-25 05:04:30 +00:00
|
|
|
};
|
2021-06-10 19:51:04 +00:00
|
|
|
|
2021-08-20 17:40:05 +00:00
|
|
|
packages = self.lib.forAllSystems
|
|
|
|
(system: mypkgs nixpkgs.legacyPackages.${system});
|
2021-06-12 02:41:50 +00:00
|
|
|
|
2021-06-25 05:04:30 +00:00
|
|
|
apps = self.lib.forAllSystems (system:
|
|
|
|
with nixpkgs.legacyPackages.${system};
|
2021-06-12 02:41:50 +00:00
|
|
|
{
|
2021-11-05 18:02:48 +00:00
|
|
|
gnome-extensions = writeShellScriptBin "gnome-extensions" ''
|
|
|
|
cat ${path}/pkgs/desktops/gnome/extensions/extensions.json |
|
|
|
|
${jq}/bin/jq -c '.[]|{name,ver:(.shell_version_map|keys)}'
|
|
|
|
'';
|
|
|
|
|
2021-11-05 18:04:19 +00:00
|
|
|
jupyterlab =
|
|
|
|
let
|
|
|
|
jupy = python3.withPackages (p: with p; [ jupyterlab ipython ]);
|
|
|
|
in
|
|
|
|
writeShellScriptBin "jupyterlab" ''
|
|
|
|
exec ${jupy}/bin/python -m jupyterlab "$@"
|
|
|
|
'';
|
2021-06-25 05:04:30 +00:00
|
|
|
}
|
|
|
|
);
|
2021-04-05 21:56:06 +00:00
|
|
|
};
|
2021-03-31 22:15:08 +00:00
|
|
|
}
|