summaryrefslogblamecommitdiff
path: root/flake.nix
blob: 3e5f310dcaaa701168bcf8c2591dd1ff199cf3e2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
 
                                                     
 

                                                        
 



                                         




                                                

    
                                                          

                      
                                               

                     
                      
                                       

                                         

                                  
      
 






                                                                           

    
                         


                                                           
                                     
                                           

    
{
  description = "sinan's reproducible nixos systems";

  inputs = {
    nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable";

    sops-nix = {
      url = "github:Mic92/sops-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, nixpkgs, sops-nix, home-manager }: let
    lib = nixpkgs.lib;

    makeNixos = host: system: lib.nixosSystem {
      inherit system;
      modules = [
        ./userdata.nix
        { networking.hostName = host; }
        ./nixos/${host}/configuration.nix

        sops-nix.nixosModules.sops
      ];
    };

    makeHome = useType: system: home-manager.lib.homeManagerConfiguration {
      pkgs = nixpkgs.legacyPackages.${system};
      modules = [
        ./userdata.nix
        ./home-manager/${useType}/home.nix
      ];
    };
  in
  {
    nixosConfigurations =
      lib.genAttrs [ "cez" "kay" "lia" "fscusat" "dspace" ]
      (host: makeNixos host "x86_64-linux");
    homeConfigurations =
      lib.genAttrs [ "common" "gui" ]
      (host: makeHome host "x86_64-linux");
  };
}