WS-KCNHUB/flake.nix

52 lines
1.4 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;
};
};
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 ])
./machines/kcnhub/configuration.nix
sops-nix.nixosModules.sops
];
};
};
}