WS-KCNHUB/flake.nix

54 lines
1.5 KiB
Nix

{
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-23.11";
};
nixpkgs-unstable = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
sops-nix = {
url = "github:Mic92/sops-nix";
# Follow the system nixpkgs
inputs.nixpkgs.follows = "nixpkgs";
};
nix-matlab = {
url = "gitlab:doronbehar/nix-matlab";
# Follow the system nixpkgs
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, nix-matlab }@attrs: let
system = "x86_64-linux";
unfree-overlay = final: prev: {
unfree = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
};
unstable-overlay = final: prev: {
unstable = import nixpkgs-unstable { inherit system; } ;
};
unstable-unfree-overlay = final: prev: {
unstable-unfree = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
config.cudaSupport = true;
};
};
python-overlay = import ./overlays/python.nix;
applyOverlays = overlays: ({...}:{ nixpkgs.overlays = overlays; });
flakes = {...}: {nix.settings.experimental-features = [ "nix-command" "flakes" ];};
in {
nixosConfigurations.kcnhub = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = attrs;
modules = [
flakes
(applyOverlays [ unfree-overlay unstable-overlay python-overlay ])
./machines/kcnhub/configuration.nix
sops-nix.nixosModules.sops
];
};
};
}