nix-config/flake.nix

107 lines
4 KiB
Nix

{
description = "Greg Burd's NixOS and Home Manager Configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
# You can access packages and modules from different nixpkgs revs at the
# same time. See 'unstable-packages' overlay in 'overlays/default.nix'.
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
fh.url = "https://flakehub.com/f/DeterminateSystems/fh/*.tar.gz";
home-manager.url = "github:nix-community/home-manager/release-23.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixos-hardware.url = "github:nixos/nixos-hardware/master";
impermanence.url = "github:nix-community/impermanence";
nix-formatter-pack.url = "github:Gerschtli/nix-formatter-pack";
nix-formatter-pack.inputs.nixpkgs.follows = "nixpkgs";
vscode-server.url = "github:nix-community/nixos-vscode-server";
vscode-server.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
nh.url = "github:viperml/nh";
nh.inputs.nixpkgs.follows = "nixpkgs";
firefox-addons.url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
firefox-addons.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{ self
, nixpkgs
, nix-formatter-pack
, ...
} @ inputs:
let
inherit (self) outputs;
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
stateVersion = "23.05";
libx = import ./lib { inherit inputs outputs stateVersion; };
in
{
# home-manager switch -b backup --flake $HOME/ws/nix-config
# nix build .#homeConfigurations."gburd@floki".activationPackage
homeConfigurations = {
# .iso images
# "gburd@iso-console" = libx.mkHome { hostname = "iso-console"; username = "nixos"; };
# "gburd@iso-desktop" = libx.mkHome { hostname = "iso-desktop"; username = "nixos"; desktop = "pantheon"; };
# Workstations
"gburd@floki" = libx.mkHome { hostname = "floki"; username = "gburd"; desktop = "pantheon"; };
# Servers
};
nixosConfigurations = {
# .iso images
# - nix build .#nixosConfigurations.{iso-console|iso-desktop}.config.system.build.isoImage
# iso-console = libx.mkHost { hostname = "iso-console"; username = "nixos"; installer = nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"; };
# iso-desktop = libx.mkHost { hostname = "iso-desktop"; username = "nixos"; installer = nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares.nix"; desktop = "pantheon"; };
# Workstations
# Lenovo Carbon X1 Extreme Gen 5 - x86_64
floki = libx.mkHost { hostname = "floki"; username = "gburd"; desktop = "pantheon"; };
# Servers
};
# Devshell for bootstrapping; acessible via 'nix develop' or 'nix-shell' (legacy)
devShells = libx.forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./shell.nix { inherit pkgs; }
);
# nix fmt
formatter = libx.forAllSystems (system:
nix-formatter-pack.lib.mkFormatter {
pkgs = nixpkgs.legacyPackages.${system};
config.tools = {
alejandra.enable = false;
deadnix.enable = true;
nixpkgs-fmt.enable = true;
statix.enable = true;
};
}
);
# Custom packages and modifications, exported as overlays
overlays = import ./overlays { inherit inputs outputs; };
homeManagerModules = import ./modules/home-manager;
# Custom packages; acessible via 'nix build', 'nix shell', etc
packages = libx.forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./pkgs { inherit pkgs; }
);
};
}