aboutsummaryrefslogblamecommitdiff
path: root/flake.nix
blob: e7926684840ed00b637db844df7453960b9d86e0 (plain) (tree)
1
2
3
4
5

                                                


                                                       








                                                                          


                                             









                                             
        




















                                                                                    
 
{
  description = "personal NixOS configurations";
  inputs = {
    # Nixpkgs, NixOS's official repo
    nixpkgs.url = "github:nixos/nixpkgs/release-21.11";

    # We use the unstable nixpkgs repo for some packages.
    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";

    home-manager = {
      url = "github:nix-community/home-manager/release-21.11";
      # We want home-manager to use the same set of nixpkgs as our system.
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  # Output config, or config for NixOS system
  outputs = { ... }@inputs:
    let
      lib = import ./lib { inherit inputs; };
    in: {
      nixosConfigurations = {
        carmel = lib.mkSystem {
          hostname = "carmel";
          system = "x86_64-linux";
          desktop = true;
        };
      };

      homeConfigurations = {
        "fcuny@carmel" = lib.mkHome {
          username = "fcuny";
          system = "x86_64-linux";
          hostname = "carmel";
          desktop = true;
        };
      };
    } // inputs.utils.lib.eachDefaultSystem (system:
      let
        pkgs = import inputs.nixpkgs { inherit system overlays; };
        home-manager = inputs.home-manager.defaultPackage."${system}";
      in
      {
        packages = pkgs // { inherit home-manager; };

        devShell = pkgs.mkShell {
          buildInputs = with pkgs; [ nixUnstable nixfmt rnix-lsp home-manager git ];
        };
      });
}