{ 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"; }; fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; vscode-server = { url = "github:nix-community/nixos-vscode-server"; }; }; outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, nix-matlab, vscode-server, ... }@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 attrs; 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 ]) vscode-server.nixosModules.default ./machines/kcnhub/configuration.nix sops-nix.nixosModules.sops ]; }; overlays = { default = applyOverlays [ unfree-overlay unstable-overlay python-overlay ]; unstable = unstable-overlay; }; }; }