2021-12-16 12:28:43 -08:00
|
|
|
{
|
|
|
|
description = "You new nix config";
|
|
|
|
|
|
|
|
inputs = {
|
2022-04-24 16:35:26 -07:00
|
|
|
# Nixpkgs
|
2021-12-16 12:28:43 -08:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
|
2022-04-24 16:35:26 -07:00
|
|
|
# Home manager
|
2021-12-16 12:28:43 -08:00
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
2022-04-24 16:35:26 -07:00
|
|
|
# Utilities for building our flake
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
|
|
|
|
# Extra flakes for modules, packages, etc
|
|
|
|
hardware.url = "github:nixos/nixos-hardware"; # Convenience modules for hardware-specific quirks
|
|
|
|
# nur.url = "github:nix-community/NUR"; # User contributed pkgs and modules
|
|
|
|
# nix-colors.url = "github:misterio77/nix-colors"; # Color schemes for usage with home-manager
|
2021-12-16 12:51:06 -08:00
|
|
|
# impermanence.url = "github:riscadoa/impermanence"; # Utilities for opt-in persistance
|
2022-04-24 16:35:26 -07:00
|
|
|
# TODO: Add any other flakes you need
|
2021-12-16 12:28:43 -08:00
|
|
|
};
|
|
|
|
|
2022-04-24 16:35:26 -07:00
|
|
|
outputs = { nixpkgs, home-manager, flake-utils, ... }@inputs:
|
|
|
|
let
|
|
|
|
# Bring some functions into scope (from builtins and other flakes)
|
|
|
|
inherit (builtins) attrValues;
|
|
|
|
inherit (flake-utils.lib) eachSystemMap defaultSystems;
|
|
|
|
inherit (nixpkgs.lib) nixosSystem;
|
|
|
|
inherit (home-manager.lib) homeManagerConfiguration;
|
|
|
|
eachDefaultSystemMap = eachSystemMap defaultSystems;
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
# TODO: If you want to use packages exported from other flakes, add their overlays here.
|
|
|
|
# They will be added to your 'pkgs'
|
|
|
|
overlays = {
|
|
|
|
default = import ./overlay; # Our own overlay
|
|
|
|
# nur = nur.overlay
|
|
|
|
};
|
2021-12-16 12:28:43 -08:00
|
|
|
|
2022-04-24 16:35:26 -07:00
|
|
|
# System configurations
|
|
|
|
# Accessible via 'nixos-rebuild'
|
|
|
|
nixosConfigurations = {
|
|
|
|
# FIXME: Replace with your hostname
|
|
|
|
cool-computer = nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
2021-12-16 13:36:16 -08:00
|
|
|
|
2022-04-24 16:35:26 -07:00
|
|
|
modules = [
|
|
|
|
# >> Main NixOS configuration file <<
|
|
|
|
./nixos/configuration.nix
|
|
|
|
# Add your custom NixOS modules
|
|
|
|
./modules/nixos
|
|
|
|
# Add overlays
|
|
|
|
{ nixpkgs.overlays = attrValues overlays; }
|
|
|
|
];
|
|
|
|
# Make our inputs available to the config (for importing modules)
|
|
|
|
specialArgs = { inherit inputs; };
|
|
|
|
};
|
2021-12-16 12:28:43 -08:00
|
|
|
};
|
|
|
|
|
2022-04-24 16:35:26 -07:00
|
|
|
# Home configurations
|
|
|
|
# Accessible via 'home-manager'
|
|
|
|
homeConfigurations = {
|
|
|
|
# FIXME: Replace with your username@hostname
|
|
|
|
"you@cool-computer" = homeManagerConfiguration rec {
|
|
|
|
# FIXME: Replace with your username
|
|
|
|
username = "you";
|
|
|
|
homeDirectory = "/home/${username}";
|
|
|
|
system = "x86_64-linux";
|
2021-12-16 13:36:16 -08:00
|
|
|
|
2022-04-24 16:35:26 -07:00
|
|
|
# >> Main home-manager configuration file <<
|
|
|
|
configuration = ./home-manager/home.nix;
|
|
|
|
extraModules = [
|
|
|
|
# Add your custom home-manager modules
|
|
|
|
./modules/home-manager
|
|
|
|
# Add overlays
|
|
|
|
{ nixpkgs.overlays = attrValues overlays; }
|
|
|
|
];
|
|
|
|
# Make our inputs available to the config (for importing modules)
|
|
|
|
extraSpecialArgs = { inherit inputs; };
|
|
|
|
};
|
2021-12-16 12:28:43 -08:00
|
|
|
};
|
|
|
|
|
2022-04-24 16:35:26 -07:00
|
|
|
# Packages
|
|
|
|
# Accessible via 'nix build'
|
|
|
|
packages = eachDefaultSystemMap (system:
|
|
|
|
# Propagate nixpkgs' packages, with our overlays applied
|
|
|
|
import nixpkgs { inherit system; overlays = attrValues overlays; }
|
|
|
|
);
|
|
|
|
|
|
|
|
# Devshell for bootstrapping
|
2021-12-16 12:48:46 -08:00
|
|
|
# Accessible via 'nix develop'
|
2022-04-24 16:35:26 -07:00
|
|
|
devShells = eachDefaultSystemMap (system: {
|
|
|
|
default = import ./shell.nix { pkgs = packages.${system}; };
|
|
|
|
});
|
|
|
|
};
|
2021-12-16 12:28:43 -08:00
|
|
|
}
|