nixos-config/flake.nix

79 lines
2.6 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 { };
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-06-12 01:32:23 +00:00
nixosModules = {
2021-08-13 16:14:42 +00:00
inherit (impermanence.nixosModules) impermanence;
2021-08-13 04:09:14 +00:00
baseline = import ./modules/baseline.nix;
cli = import ./modules/cli.nix;
gnome = import ./modules/gnome.nix;
gnome-monitor-settings-tweak = import ./modules/gnome-monitor-settings-tweak;
mouse-dpi = import ./modules/mouse-dpi.nix;
phpipam = import ./modules/phpipam.nix;
pipewire = import ./modules/pipewire.nix;
plasma = import ./modules/plasma.nix;
profiles = import ./modules/profiles.nix;
scansnap_s1300 = import ./modules/scansnap_s1300.nix;
scroll-boost = import ./modules/scroll-boost;
security-tools = import ./modules/security-tools.nix;
status-on-console = import ./modules/status-on-console.nix;
sway = import ./modules/sway.nix;
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;
forAllSystems = f: builtins.listToAttrs (map
(name: { inherit name; value = f name; })
2021-08-20 18:02:56 +00:00
(builtins.attrNames 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
binScript = x: writeShellScriptBin "script" "exec ${x}";
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-06-28 01:20:04 +00:00
luks-mirror = binScript ./misc/luks-mirror.sh;
luks-single = binScript ./misc/luks-single.sh;
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
}