mirror of
https://github.com/davegallant/nix-config
synced 2026-03-03 04:26:36 +00:00
145 lines
3.8 KiB
Nix
145 lines
3.8 KiB
Nix
{
|
|
description = "nixos and macos configurations";
|
|
|
|
inputs = {
|
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
|
darwin = {
|
|
url = "github:lnl7/nix-darwin/nix-darwin-25.11";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
home-manager.url = "github:nix-community/home-manager/release-25.11";
|
|
nixvim = {
|
|
url = "github:nix-community/nixvim/nixos-25.11";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
vpngate.url = "github:davegallant/vpngate";
|
|
weathr.url = "github:Veirt/weathr";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
darwin,
|
|
home-manager,
|
|
nixpkgs,
|
|
nixpkgs-unstable,
|
|
vpngate,
|
|
weathr,
|
|
...
|
|
}@inputs:
|
|
let
|
|
mkUnstable =
|
|
system:
|
|
import nixpkgs-unstable {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
};
|
|
|
|
mkSharedModules =
|
|
{
|
|
username,
|
|
system,
|
|
hmModule,
|
|
extraModules ? [ ],
|
|
}:
|
|
let
|
|
unstable = mkUnstable system;
|
|
in
|
|
[
|
|
./packages.nix
|
|
hmModule
|
|
(
|
|
{ ... }:
|
|
{
|
|
config = {
|
|
nixpkgs.config.allowUnfree = true;
|
|
nixpkgs.overlays = [ (import ./overlays) ];
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
users.${username}.imports = [
|
|
./home.nix
|
|
inputs.nixvim.homeModules.nixvim
|
|
weathr.homeModules.weathr
|
|
];
|
|
extraSpecialArgs = { inherit unstable; };
|
|
};
|
|
};
|
|
}
|
|
)
|
|
]
|
|
++ extraModules;
|
|
in
|
|
{
|
|
nixosConfigurations =
|
|
let
|
|
system = "x86_64-linux";
|
|
unstable = mkUnstable system;
|
|
in
|
|
{
|
|
hephaestus = nixpkgs.lib.nixosSystem {
|
|
specialArgs = {
|
|
inherit
|
|
unstable
|
|
vpngate
|
|
inputs
|
|
;
|
|
};
|
|
modules = mkSharedModules {
|
|
username = "dave";
|
|
inherit system;
|
|
hmModule = home-manager.nixosModules.home-manager;
|
|
extraModules = [
|
|
./hosts/hephaestus.nix
|
|
(
|
|
{ ... }:
|
|
{
|
|
config.nix = {
|
|
settings = {
|
|
auto-optimise-store = true;
|
|
substituters = [ "https://davegallant.cachix.org" ];
|
|
trusted-users = [ "root" ];
|
|
trusted-public-keys = [
|
|
"davegallant.cachix.org-1:SsUMqL4+tF2R3/G6X903E9laLlY1rES2QKFfePegF08="
|
|
];
|
|
};
|
|
registry = {
|
|
nixpkgs.flake = nixpkgs;
|
|
};
|
|
gc = {
|
|
automatic = true;
|
|
dates = "daily";
|
|
options = "--delete-older-than 14d";
|
|
};
|
|
};
|
|
}
|
|
)
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
darwinConfigurations =
|
|
let
|
|
system = "aarch64-darwin";
|
|
unstable = mkUnstable system;
|
|
in
|
|
{
|
|
zelus = darwin.lib.darwinSystem {
|
|
inherit system;
|
|
specialArgs = {
|
|
inherit unstable inputs;
|
|
};
|
|
modules = mkSharedModules {
|
|
username = "dave.gallant";
|
|
inherit system;
|
|
hmModule = home-manager.darwinModules.home-manager;
|
|
extraModules = [
|
|
./hosts/zelus.nix
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|