nixos-config/flake.nix

73 lines
1.8 KiB
Nix
Raw Normal View History

2021-03-31 18:15:08 -04:00
{
2021-11-30 02:24:32 -05:00
inputs.nixpkgs.url = "nixpkgs/nixos-21.11";
2021-04-05 23:11:17 -04:00
outputs = { self, nixpkgs, ... }:
2021-08-20 13:40:05 -04:00
let
2021-11-18 15:45:24 -05:00
2021-11-01 14:45:18 -04:00
mypkgs = import ./pkgs;
2021-12-27 13:21:16 -05:00
deploy = import lib/deploy.nix;
2022-01-02 16:37:05 -05:00
hardware = import lib/hardware.nix;
2021-11-29 02:05:40 -05:00
2022-03-07 11:10:35 -05:00
forAllSystems = f: nixpkgs.lib.genAttrs
[ "x86_64-linux" "aarch64-linux" ]
(system: f system);
2021-11-18 15:45:24 -05:00
2021-11-22 00:38:03 -05:00
pins = {
nix.registry.nixpkgs.to = {
inherit (nixpkgs) rev;
owner = "NixOS";
repo = "nixpkgs";
type = "github";
};
2021-11-18 15:45:24 -05:00
nix.registry.bck.to = {
owner = "buckley310";
repo = "nixos-config";
type = "github";
};
};
2021-08-20 13:40:05 -04:00
in
2021-06-05 02:22:38 -04:00
{
2021-12-27 13:21:16 -05:00
lib = { inherit forAllSystems hardware deploy; };
2021-11-29 02:05:40 -05:00
2021-09-10 00:42:41 -04:00
nixosModules =
2021-12-03 21:45:41 -05:00
{ inherit pins; } //
2021-09-10 00:42:41 -04:00
nixpkgs.lib.mapAttrs'
(name: type: {
2021-10-08 13:31:06 -04:00
name = nixpkgs.lib.removeSuffix ".nix" name;
2021-09-10 00:42:41 -04:00
value = import (./modules + "/${name}");
})
(builtins.readDir ./modules);
2021-06-11 21:32:23 -04:00
2021-11-22 00:38:03 -05:00
nixosModule = {
2021-08-15 23:20:11 -04:00
imports = builtins.attrValues self.nixosModules;
2022-01-05 22:31:42 -05:00
nixpkgs.overlays = [
(_: mypkgs)
];
2021-08-15 23:20:11 -04:00
};
2021-06-05 02:22:38 -04:00
2021-12-10 01:34:46 -05:00
nixosConfigurations = import ./hosts nixpkgs hardware self.nixosModule;
2021-06-05 02:22:38 -04:00
2021-11-29 02:05:40 -05:00
packages = forAllSystems
2021-08-20 13:40:05 -04:00
(system: mypkgs nixpkgs.legacyPackages.${system});
2021-06-11 22:41:50 -04:00
2021-11-29 02:05:40 -05:00
apps = forAllSystems (system:
2021-06-25 01:04:30 -04:00
with nixpkgs.legacyPackages.${system};
2021-06-11 22:41:50 -04:00
{
2021-11-05 14:04:19 -04:00
jupyterlab =
let
jupy = python3.withPackages (p: with p; [ jupyterlab ipython ]);
in
writeShellScriptBin "jupyterlab" ''
exec ${jupy}/bin/python -m jupyterlab "$@"
'';
2022-03-18 01:36:18 -04:00
qemu-uefi = writeShellScriptBin "qemu-uefi" ''
exec ${qemu_kvm}/bin/qemu-kvm -bios ${OVMF.fd}/FV/OVMF.fd "$@"
'';
2021-06-25 01:04:30 -04:00
}
);
};
2021-03-31 18:15:08 -04:00
}