{ description = "system flake.nix"; inputs = { sops-nix.url = "github:Mic92/sops-nix"; nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; doom-emacs-nix = { url = "github:vlaci/nix-doom-emacs"; inputs.nixpkgs.follows = "nixpkgs"; }; home-manager = { url = "github:nix-community/home-manager/release-21.05"; inputs.nixpkgs.follows = "nixpkgs"; }; backup-module = { url = "git+https://git.ingolf-wagner.de/nix-modules/backup.git"; flake = false; }; krops-lib = { url = "git+https://git.ingolf-wagner.de/nix-modules/krops.git"; flake = false; }; cluster-module = { url = "git+https://git.ingolf-wagner.de/nix-modules/cluster.git?rev=ef621797a30f8a57de16bf33672abdd411cbcece"; flake = false; }; }; outputs = { self, sops-nix, nixpkgs, home-manager, doom-emacs-nix , backup-module, nixpkgs-unstable, krops-lib, cluster-module, ... }: let nixosSystem = nixpkgs.lib.nixosSystem; defaultModules = [ sops-nix.nixosModules.sops { imports = [ "${krops-lib}" "${cluster-module}" "${backup-module}" ]; } ({ pkgs, ... }: { nix = { # no channesl needed this way nixPath = [ "nixpkgs=${pkgs.path}" ]; # make flakes available package = pkgs.nixUnstable; extraOptions = '' experimental-features = nix-command flakes ''; }; # defined overlays injected by the nixflake nixpkgs.overlays = [ (_self: _super: { # we assign the overlay created before to the overlays of nixpkgs. unstable = nixpkgs-unstable.legacyPackages.${pkgs.system}; }) ]; }) ]; desktopModules = [ home-manager.nixosModules.home-manager { home-manager.users.mainUser = { imports = [ doom-emacs-nix.hmModule ]; }; home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; } ]; desktopConfiguration = initPath: nixosSystem { system = "x86_64-linux"; modules = defaultModules ++ desktopModules ++ [ initPath ]; }; serverConfiguration = initPath: nixosSystem { system = "x86_64-linux"; modules = defaultModules ++ [ initPath ]; }; in { nixosConfigurations = { sterni = desktopConfiguration ./configs/sterni/configuration.nix; sternchen = desktopConfiguration ./configs/sternchien/configuration.nix; pepe = serverConfiguration ./configs/pepe/configuration.nix; workhorse = serverConfiguration ./configs/workhorse/configuration.nix; sputnik = serverConfiguration ./configs/sputnik/configuration.nix; }; }; }