nix-config/flake.nix

152 lines
5.1 KiB
Nix
Raw Normal View History

2023-10-13 20:52:26 +02:00
{
2023-12-23 21:20:40 +01:00
description = "Your new nix config";
2023-10-13 20:52:26 +02:00
2023-12-23 21:20:40 +01:00
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
2023-12-23 21:20:40 +01:00
# You can access packages and modules from different nixpkgs revs
# at the same time. Here's an working example:
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
2023-10-13 20:52:26 +02:00
2023-12-23 21:20:40 +01:00
# Home manager
home-manager.url = "github:nix-community/home-manager/release-24.05";
2023-12-23 21:20:40 +01:00
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2023-10-13 20:52:26 +02:00
2023-12-24 11:16:59 +01:00
hardware.url = "github:nixos/nixos-hardware";
2024-03-02 17:17:52 +01:00
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-12-26 13:59:30 +01:00
nix-colors.url = "github:misterio77/nix-colors";
2023-12-26 23:25:22 +01:00
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
arkenfox = {
url = "github:dwarfmaster/arkenfox-nixos";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-12-27 10:57:55 +01:00
xremap.url = "github:xremap/nix-flake";
2024-09-19 18:32:05 +02:00
flatpaks.url = "github:GermanBread/declarative-flatpak/stable-v3";
heliox-cli.url = "git+https://git.ghoscht.com/heliox/cli?ref=custom-dimming";
2024-03-14 14:20:33 +01:00
picokontroller.url = "git+https://git.ghoscht.com/ghoscht/picoKontroller";
2024-03-03 20:04:13 +01:00
sops-nix.url = "github:Mic92/sops-nix";
arion.url = "github:hercules-ci/arion";
2023-12-23 21:20:40 +01:00
};
2023-10-13 20:52:26 +02:00
2023-12-23 21:20:40 +01:00
outputs = {
2023-10-13 20:52:26 +02:00
self,
nixpkgs,
home-manager,
...
2023-12-23 21:20:40 +01:00
} @ inputs: let
inherit (self) outputs;
# Supported systems for your flake packages, shell, etc.
systems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
2023-12-25 23:11:54 +01:00
vars = import ./vars.nix;
2023-10-13 20:52:26 +02:00
in {
2023-12-23 21:20:40 +01:00
# Your custom packages
# Accessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
2023-10-14 18:53:32 +02:00
2023-12-23 21:20:40 +01:00
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
2023-12-23 22:05:10 +01:00
adalbert = nixpkgs.lib.nixosSystem {
2023-12-25 23:11:54 +01:00
specialArgs = {inherit inputs outputs vars;};
2023-12-23 21:20:40 +01:00
modules = [
2023-12-23 22:05:10 +01:00
./hosts/adalbert
2023-12-23 21:20:40 +01:00
];
};
2024-02-02 19:59:41 +01:00
ludwig = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs vars;};
modules = [
./hosts/ludwig
];
};
2024-03-02 18:59:18 +01:00
leopold = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs vars;};
modules = [
./hosts/leopold
];
};
2024-03-02 17:17:52 +01:00
franz = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs vars;};
modules = [
./hosts/franz
];
};
2024-05-30 23:47:03 +02:00
# build with nix build .#nixosConfigurations.eustachius.config.system.build.sdImage
eustachius = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
./hosts/eustachius
# extra config for sdImage generator
{
sdImage.compressImage = false;
}
];
};
2023-12-23 21:20:40 +01:00
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
2024-02-04 20:53:09 +01:00
"${vars.user}@adalbert" = home-manager.lib.homeManagerConfiguration {
2023-12-23 21:20:40 +01:00
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
2023-12-25 23:11:54 +01:00
extraSpecialArgs = {inherit inputs outputs vars;};
2023-12-23 21:20:40 +01:00
modules = [
2023-12-26 11:49:58 +01:00
./home/adalbert.nix
2023-12-23 21:20:40 +01:00
];
};
};
2024-02-04 20:53:09 +01:00
"${vars.user}@ludwig" = home-manager.lib.homeManagerConfiguration {
2024-02-02 19:59:41 +01:00
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs vars;};
modules = [
./home/ludwig.nix
];
};
2024-03-02 17:17:52 +01:00
"${vars.user}@franz" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs vars;};
modules = [
./home/franz.nix
];
};
2024-02-04 20:53:09 +01:00
# "${vars.user}@eustachius" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.aarch64-linux; # Home-manager requires 'pkgs' instance
# extraSpecialArgs = {inherit inputs outputs vars;};
# modules = [
# ./home/eustachius.nix
# ];
# };
2023-10-13 20:52:26 +02:00
};
}