nixos-config/flake.nix

66 lines
2 KiB
Nix
Raw Normal View History

2021-03-31 22:15:08 +00:00
{
2021-06-02 20:46:32 +00:00
inputs.nixpkgs.url = "nixpkgs/nixos-21.05";
inputs.unstable.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-08-23 00:42:09 +00:00
outputs = { self, nixpkgs, unstable, impermanence, ... }:
2021-08-20 17:40:05 +00:00
let
mypkgs = pkgs:
{
commander-x16 = pkgs.callPackage ./pkgs/commander-x16 { };
gef = pkgs.callPackage ./pkgs/gef { };
2021-09-09 02:52:11 +00:00
stretchy-spaces = pkgs.callPackage ./pkgs/stretchy-spaces { };
2021-08-20 17:40:05 +00:00
weevely = pkgs.callPackage ./pkgs/weevely { };
}
// (if pkgs.system != "x86_64-linux" then { } else
{
binaryninja = pkgs.callPackage ./pkgs/binary-ninja-personal { };
packettracer = pkgs.callPackage ./pkgs/packettracer { };
});
in
2021-06-05 06:22:38 +00:00
{
2021-09-10 04:42:41 +00:00
nixosModules =
{ inherit (impermanence.nixosModules) impermanence; } //
nixpkgs.lib.mapAttrs'
(name: type: {
name = if (type == "regular") then (nixpkgs.lib.removeSuffix ".nix" name) else name;
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;
inherit nixpkgs unstable;
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-09-10 19:55:20 +00:00
forAllSystems = f: builtins.mapAttrs
(name: _: f name)
(nixpkgs.legacyPackages);
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-28 01:20:04 +00:00
let
2021-08-05 19:58:27 +00:00
jupy = python3.withPackages (p: with p; [ jupyterlab ipython ]);
2021-06-28 01:20:04 +00:00
in
2021-06-12 02:41:50 +00:00
{
2021-08-05 19:58:27 +00:00
jupyterlab = writeShellScriptBin "jupyterlab" ''
exec ${jupy}/bin/python -m jupyterlab "$@"
'';
2021-06-25 05:04:30 +00:00
}
);
};
2021-03-31 22:15:08 +00:00
}