215 lines
6.2 KiB
Nix
215 lines
6.2 KiB
Nix
{
|
|
description = "flake for matt-nixos";
|
|
|
|
inputs = {
|
|
# nixpgs
|
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
# nixpkgs-unstable-small
|
|
nixpkgs-unstable-small.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
|
|
|
# nixpgs
|
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
|
|
|
|
# Authentik
|
|
authentik-nix.url = "github:nix-community/authentik-nix";
|
|
|
|
# Chaotic-nix
|
|
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
|
|
|
|
# Impermenance
|
|
impermanence.url = "github:nix-community/impermanence";
|
|
|
|
# Home Manager
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
|
};
|
|
|
|
# Lanzaboote
|
|
lanzaboote = {
|
|
url = "github:nix-community/lanzaboote/v0.4.1";
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
|
};
|
|
|
|
# Nix hardware
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
|
|
|
# Sops-nix
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
|
|
|
#Apple
|
|
nixos-apple-silicon.url = "github:mjallen18/nixos-apple-silicon";
|
|
# nixos-apple-silicon.url = "git+file:///home/matt/nixos-apple-silicon";
|
|
nix-darwin.url = "github:LnL7/nix-darwin";
|
|
|
|
cosmic = {
|
|
url = "github:lilyinstarlight/nixos-cosmic";
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
|
};
|
|
|
|
git-hooks.url = "github:cachix/git-hooks.nix";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs-unstable,
|
|
nixpkgs-unstable-small,
|
|
nixpkgs-stable,
|
|
chaotic,
|
|
lanzaboote,
|
|
impermanence,
|
|
home-manager,
|
|
nixos-hardware,
|
|
nix-darwin,
|
|
nixos-apple-silicon,
|
|
cosmic,
|
|
authentik-nix,
|
|
sops-nix,
|
|
git-hooks,
|
|
}@inputs:
|
|
let
|
|
inherit (self) outputs;
|
|
supportedSystems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"aarch64-darwin"
|
|
];
|
|
forAllSystems = nixpkgs-unstable.lib.genAttrs supportedSystems;
|
|
in
|
|
{
|
|
overlays = import ./overlays { inherit inputs; };
|
|
|
|
nixosConfigurations = {
|
|
# Desktop
|
|
"matt-nixos" = nixpkgs-unstable.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
specialArgs = {
|
|
inherit inputs outputs;
|
|
};
|
|
modules = [
|
|
impermanence.nixosModules.impermanence
|
|
lanzaboote.nixosModules.lanzaboote
|
|
./hosts/desktop/configuration.nix
|
|
./share/impermanence
|
|
chaotic.nixosModules.default
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users.matt = import ./hosts/desktop/home.nix;
|
|
home-manager.backupFileExtension = "bakup";
|
|
}
|
|
|
|
nixos-hardware.nixosModules.common-cpu-amd
|
|
nixos-hardware.nixosModules.common-gpu-amd
|
|
nixos-hardware.nixosModules.common-hidpi
|
|
nixos-hardware.nixosModules.common-pc
|
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
cosmic.nixosModules.default
|
|
];
|
|
};
|
|
|
|
# NAS
|
|
"jallen-nas" = nixpkgs-unstable.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
specialArgs = {
|
|
inherit inputs outputs;
|
|
};
|
|
modules = [
|
|
impermanence.nixosModules.impermanence
|
|
./hosts/nas/configuration.nix
|
|
./hosts/nas/impermanence.nix
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users.admin = import ./hosts/nas/home.nix;
|
|
home-manager.backupFileExtension = "backup";
|
|
}
|
|
|
|
authentik-nix.nixosModules.default
|
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
nixos-hardware.nixosModules.common-pc
|
|
nixos-hardware.nixosModules.common-cpu-amd
|
|
nixos-hardware.nixosModules.common-hidpi
|
|
# nixos-hardware.nixosModules.common-gpu-nvidia
|
|
];
|
|
};
|
|
|
|
# mac nix
|
|
"mac-nixos" = nixpkgs-unstable.lib.nixosSystem {
|
|
system = "aarch64-linux";
|
|
modules = [
|
|
nixos-apple-silicon.nixosModules.apple-silicon-support
|
|
./hosts/mac-nixos/configuration.nix
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users.matt = import ./hosts/mac-nixos/home.nix;
|
|
}
|
|
];
|
|
};
|
|
|
|
# Pi4
|
|
"pi4" = nixpkgs-unstable.lib.nixosSystem {
|
|
system = "aarch64-linux";
|
|
modules = [
|
|
nixos-hardware.nixosModules.raspberry-pi-4
|
|
./hosts/pi4/configuration.nix
|
|
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users.matt = import ./hosts/pi4/home.nix;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
|
|
darwinConfigurations = {
|
|
"MacBook-Pro" = nix-darwin.lib.darwinSystem {
|
|
system = "aarch64-darwin";
|
|
modules = [
|
|
./hosts/mac/configuration.nix
|
|
home-manager.darwinModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users.mattjallen = import ./hosts/mac/home.nix;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
|
|
# Expose the package set, including overlays, for convenience.
|
|
darwinPackages = self.darwinConfigurations."MacBook-Pro".pkgs;
|
|
|
|
# Set Git commit hash for darwin-version.
|
|
system.configurationRevision = self.rev or self.dirtyRev or null;
|
|
|
|
# checks = forAllSystems (system: {
|
|
# pre-commit-check = git-hooks.lib.${system}.run {
|
|
# src = ./.;
|
|
# hooks = {
|
|
# nixpkgs-fmt.enable = true;
|
|
# };
|
|
# };
|
|
# });
|
|
|
|
# devShells = forAllSystems (system: {
|
|
# default = nixpkgs-unstable.legacyPackages.${system}.mkShell {
|
|
# inherit (self.checks.${system}.pre-commit-check) shellHook;
|
|
# buildInputs = self.checks.${system}.pre-commit-check.enabledPackages;
|
|
# };
|
|
# });
|
|
};
|
|
}
|