This repository has been archived on 2024-07-15. You can view files and clone it, but cannot push or open issues or pull requests.
nix-config/flake.nix

109 lines
3.3 KiB
Nix
Raw Normal View History

2023-12-26 14:48:53 -06:00
{
description = "NixOS Homelab";
2023-12-26 14:48:53 -06:00
# This is the standard format for flake.nix.
# `inputs` are the dependencies of the flake,
# and `outputs` function will return all the build results of the flake.
# Each item in `inputs` will be passed as a parameter to
# the `outputs` function after being pulled and built.
inputs = {
# There are many ways to reference flake inputs.
# The most widely used is `github:owner/name/reference`,
# which represents the GitHub repository URL + branch/commit-id/tag.
2024-02-20 21:58:32 -06:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
# Home Manager
2023-12-26 14:48:53 -06:00
home-manager = {
2024-02-20 21:58:32 -06:00
url = "github:nix-community/home-manager/release-23.11";
2023-12-26 14:48:53 -06:00
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-23 12:29:48 -06:00
# nix-fast-build
nix-fast-build = {
url = "github:Mic92/nix-fast-build";
inputs.nixpkgs.follows = "nixpkgs";
};
# sops-nix
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-23 14:02:08 -06:00
# deploy-rs
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-28 22:38:27 -06:00
# atuin
atuin = {
url = "github:atuinsh/atuin";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-12-26 14:48:53 -06:00
};
2024-02-23 12:29:48 -06:00
2023-12-26 14:48:53 -06:00
# The `@` syntax here is used to alias the attribute set of the
# inputs's parameter, making it convenient to use inside the function.
outputs = { self, nixpkgs, home-manager, ... }@inputs:
2024-02-23 15:36:14 -06:00
let
inherit (self) outputs;
2024-02-23 15:36:14 -06:00
forAllSystems = nixpkgs.lib.genAttrs [
# "aarch64-linux"
2024-02-23 15:36:14 -06:00
"x86_64-linux"
];
in
{
2023-12-26 14:48:53 -06:00
nixosConfigurations = {
"durincore" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs outputs;};
2023-12-26 14:48:53 -06:00
modules = [
# Import the configuration.nix here, so that the
# old configuration file can still take effect.
# Note: configuration.nix itself is also a Nixpkgs Module,
./nixos/durincore/configuration.nix
2024-02-21 10:35:38 -06:00
./nixos/common.nix
2024-02-28 22:38:27 -06:00
# { nixpkgs.overlays = [ (self: super: { atuin = atuin.packages.${self.pkgs.system}.atuin; }) ]; }
2023-12-26 14:48:53 -06:00
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jahanson = import ./home-manager/durincore.nix;
}
];
};
"este" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs outputs;};
modules = [
./nixos/este/configuration.nix
2024-02-21 10:35:38 -06:00
./nixos/common.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jahanson = import ./home-manager/este.nix;
}
];
};
"gandalf" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs outputs;};
modules = [
./nixos/gandalf/configuration.nix
2024-02-21 10:35:38 -06:00
./nixos/common.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jahanson = import ./home-manager/gandalf.nix;
2023-12-26 14:48:53 -06:00
}
];
};
};
2024-02-23 15:36:14 -06:00
2023-12-26 14:48:53 -06:00
};
}