configuration.nix/flake.nix
2023-08-04 18:04:51 +05:30

111 lines
2.7 KiB
Nix

{
description = "NixOS Configuration";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
};
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
home-manager,
impermanence,
lanzaboote,
nixvim,
agenix,
} @ inputs: let
secrets = import ./secrets-legacy.nix;
in {
formatter."x86_64-linux" = nixpkgs.legacyPackages."x86_64-linux".alejandra;
nixosConfigurations = {
Skipper = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
overlays = [(import ./packages) agenix.overlays.default];
};
specialArgs = inputs // {inherit secrets;};
modules = [
{
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
}
home-manager.nixosModules.home-manager
impermanence.nixosModules.impermanence
lanzaboote.nixosModules.lanzaboote
agenix.nixosModules.default
./common
./hosts/skipper
{
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {inherit secrets;};
users.${secrets.users.primary.userName} = {pkgs, ...}: {
imports = [
impermanence.nixosModules.home-manager.impermanence
nixvim.homeManagerModules.nixvim
agenix.homeManagerModules.default
./home
];
};
};
}
];
};
Rico2 = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
overlays = [agenix.overlays.default];
};
specialArgs = inputs // {inherit secrets;};
modules = [
{
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
}
nixvim.nixosModules.nixvim
agenix.nixosModules.default
./common
./hosts/rico2
];
};
};
};
}