nix-config/flake.nix

108 lines
4 KiB
Nix
Raw Permalink Normal View History

{
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";
2023-09-25 18:53:08 +00:00
agenix.url = "github:ryantm/agenix";
2023-09-26 17:44:54 +00:00
agenix.inputs.nixpkgs.follows = "nixpkgs";
2023-09-25 18:53:08 +00:00
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
2023-11-15 18:42:10 +00:00
#fh.url = "https://flakehub.com/f/DeterminateSystems/fh/*.tar.gz";
2023-10-02 16:36:47 +00:00
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
2023-09-26 17:44:54 +00:00
# "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
2023-09-26 17:44:54 +00:00
# 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;
};
}
);
2023-09-26 17:44:54 +00:00
# Custom packages and modifications, exported as overlays
overlays = import ./overlays { inherit inputs outputs; };
2023-09-26 18:39:38 +00:00
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; }
);
};
}