dotfiles/flake.nix

97 lines
3.2 KiB
Nix
Raw Normal View History

{
description = "A Very Flakey Home Manager";
inputs = {
2023-07-27 14:41:24 +00:00
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
2023-07-27 14:41:24 +00:00
# You can access packages and modules from different nixpkgs revs
# at the same time. Here's a working example:
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
2023-07-27 14:41:24 +00:00
# Also see the 'unstable-packages' overlay at 'nix/overlays/default.nix'.
# Home manager
home-manager = {
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-07-27 14:41:24 +00:00
# TODO: Add any other flake you might need
# hardware.url = "github.com/nixos/nixos-hardware";
};
outputs = { self, nixpkgs, home-manager, ... }@inputs:
let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
"x86_64-linux"
];
in
rec {
2023-07-27 14:41:24 +00:00
# Your custom packages
# Accessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./nix/pkgs { inherit pkgs; }
);
2023-07-27 14:41:24 +00:00
# Devshell for bootstrapping
# Accessible through 'nix develop' or 'nix-shell' (legacy)
devShells = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./nix/shell.nix { inherit pkgs; }
);
2023-07-27 14:41:24 +00:00
# Your custom packages and modifications, exported as overlays
overlays = import ./nix/overlays { inherit inputs; };
2023-07-27 14:41:24 +00:00
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./nix/modules/nixos;
2023-07-27 14:41:24 +00:00
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./nix/modules/home-manager;
2023-07-27 14:41:24 +00:00
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
pixnix = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
2023-07-24 02:27:51 +00:00
modules = [
2023-07-27 14:41:24 +00:00
# > Our main nixos configuration file <
./nix/nixos/configuration.nix
];
};
};
2023-07-27 14:41:24 +00:00
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"john@penguin-fw" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
2023-07-26 21:55:10 +00:00
./nix/home/penguin-fw.nix
{
home = {
username = "john";
homeDirectory = "/home/john";
};
}
];
};
2023-07-27 14:41:24 +00:00
"john@penguin-duet" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.aarch64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./nix/home/penguin-duet.nix
{
home = {
username = "john";
homeDirectory = "/home/john";
};
}
];
};
};
};
2023-07-27 14:41:24 +00:00
}