177 lines
4.3 KiB
Nix
177 lines
4.3 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
|
preservation.url = "github:nix-community/preservation";
|
|
|
|
disko = {
|
|
url = "github:nix-community/disko";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
xivlauncher-rb = {
|
|
url = "github:dawei-nh/xivlauncher-rb-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
lazyvim = {
|
|
url = "github:pfassina/lazyvim-nix/v16.0.0";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
pi = {
|
|
url = "github:earendil-works/pi/stable";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-26.05";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
nix-darwin = {
|
|
url = "github:nix-darwin/nix-darwin";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
inputs@{
|
|
self,
|
|
nixpkgs,
|
|
nix-darwin,
|
|
preservation,
|
|
disko,
|
|
home-manager,
|
|
sops-nix,
|
|
...
|
|
}:
|
|
let
|
|
home-manager-configuration = { home-manager, ... }: {
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
extraSpecialArgs = { inherit inputs; };
|
|
users.frank = ./home/frank.nix;
|
|
};
|
|
};
|
|
|
|
trusted-users-configuration = { nix, config, ... }: {
|
|
nix.settings.trusted-users = [ config.users.users.frank.name ];
|
|
};
|
|
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-darwin"
|
|
];
|
|
|
|
forAllSystems = nixpkgs.lib.genAttrs systems;
|
|
|
|
formatterFor =
|
|
system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
pkgs.writeShellApplication {
|
|
name = "nixfmt";
|
|
runtimeInputs = [ pkgs.nixfmt ];
|
|
text = ''
|
|
flags=()
|
|
paths=()
|
|
for arg in "$@"; do
|
|
case "$arg" in
|
|
-*) flags+=("$arg") ;;
|
|
*) paths+=("$arg") ;;
|
|
esac
|
|
done
|
|
if [ "''${#paths[@]}" -eq 0 ]; then
|
|
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
mapfile -t paths < <(git ls-files '*.nix')
|
|
else
|
|
mapfile -t paths < <(find . -name '*.nix' -not -path './.devenv/*')
|
|
fi
|
|
fi
|
|
nixfmt "''${flags[@]}" "''${paths[@]}"
|
|
'';
|
|
};
|
|
in
|
|
{
|
|
formatter = forAllSystems formatterFor;
|
|
nixosConfigurations = {
|
|
nero = nixpkgs.lib.nixosSystem {
|
|
specialArgs = { inherit inputs; };
|
|
|
|
modules = [
|
|
home-manager.nixosModules.home-manager
|
|
sops-nix.nixosModules.sops
|
|
disko.nixosModules.disko
|
|
preservation.nixosModules.default
|
|
|
|
home-manager-configuration
|
|
trusted-users-configuration
|
|
|
|
./hosts/nero/hardware.nix
|
|
./hosts/nero/configuration.nix
|
|
./hosts/nero/disko.nix
|
|
./hosts/nero/preservation.nix
|
|
];
|
|
};
|
|
|
|
vergil = nixpkgs.lib.nixosSystem {
|
|
specialArgs = { inherit inputs; };
|
|
|
|
modules = [
|
|
home-manager.nixosModules.home-manager
|
|
home-manager-configuration
|
|
trusted-users-configuration
|
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
./hosts/vergil/hardware.nix
|
|
./hosts/vergil/configuration.nix
|
|
];
|
|
};
|
|
|
|
pdw-frankiel = nixpkgs.lib.nixosSystem {
|
|
specialArgs = { inherit inputs; };
|
|
|
|
modules = [
|
|
home-manager.nixosModules.home-manager
|
|
home-manager-configuration
|
|
trusted-users-configuration
|
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
./hosts/pdw-frankiel/hardware.nix
|
|
./hosts/pdw-frankiel/configuration.nix
|
|
];
|
|
};
|
|
};
|
|
|
|
darwinConfigurations = {
|
|
franks-macbook-pro = nix-darwin.lib.darwinSystem {
|
|
specialArgs = {
|
|
inherit inputs;
|
|
inherit self;
|
|
};
|
|
|
|
modules = [
|
|
home-manager.darwinModules.home-manager
|
|
home-manager-configuration
|
|
|
|
sops-nix.darwinModules.sops
|
|
|
|
{
|
|
users.users.frank.home = "/Users/frank";
|
|
}
|
|
|
|
./hosts/franks-macbook-pro/configuration.nix
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|