124 lines
2.8 KiB
Nix
124 lines
2.8 KiB
Nix
{
|
|
description = "NixOS configuration with flakes";
|
|
outputs = { self, flake-utils, home-manager, nixpkgs-nixos-unstable, nixpkgs-stable, nixos-hardware, nur, agenix, neuron, sops } @ inputs:
|
|
|
|
let
|
|
mkServer = pkgs: system: hostname:
|
|
pkgs.lib.nixosSystem {
|
|
system = system;
|
|
modules = [
|
|
(./. + "/nixos/boxes/${hostname}")
|
|
agenix.nixosModules.age
|
|
sops.nixosModules.sops
|
|
];
|
|
specialArgs = { inherit inputs; };
|
|
};
|
|
mkWorkstation = pkgs: system: hostname:
|
|
pkgs.lib.nixosSystem {
|
|
system = system;
|
|
modules = [
|
|
(./. + "/nixos/boxes/${hostname}")
|
|
(import ./nixos/email-accounts.nix)
|
|
sops.nixosModules.sops
|
|
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users.cyryl = {
|
|
imports = [ ./nixos/home-manager ];
|
|
_module.args.inputs = inputs;
|
|
};
|
|
}
|
|
|
|
];
|
|
specialArgs = { inherit inputs; };
|
|
};
|
|
in
|
|
|
|
{
|
|
nixosConfigurations = {
|
|
bootstrap = nixpkgs-stable.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
(./. + "/nixos/boxes/bootstrap")
|
|
];
|
|
specialArgs = { inherit inputs; };
|
|
};
|
|
foureighty = mkWorkstation nixpkgs-nixos-unstable "x86_64-linux" "foureighty";
|
|
skinnyv = mkWorkstation nixpkgs-stable "x86_64-linux" "skinnyv";
|
|
thinky = mkWorkstation nixpkgs-stable "x86_64-linux" "thinky";
|
|
bolty = mkServer nixpkgs-nixos-unstable "x86_64-linux" "bolty";
|
|
vultr1 = mkServer nixpkgs-stable "x86_64-linux" "vultr1";
|
|
};
|
|
};
|
|
inputs = {
|
|
nixpkgs-nixos-unstable = {
|
|
type = "github";
|
|
owner = "NixOS";
|
|
repo = "nixpkgs";
|
|
ref = "nixos-unstable";
|
|
};
|
|
|
|
nixpkgs-stable = {
|
|
type = "github";
|
|
owner = "NixOS";
|
|
repo = "nixpkgs";
|
|
ref = "nixos-21.05";
|
|
};
|
|
|
|
nixos-hardware = {
|
|
type = "github";
|
|
owner = "NixOS";
|
|
repo = "nixos-hardware";
|
|
ref = "master";
|
|
};
|
|
|
|
home-manager = {
|
|
type = "github";
|
|
owner = "nix-community";
|
|
repo = "home-manager";
|
|
ref = "master";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs-nixos-unstable";
|
|
};
|
|
};
|
|
|
|
flake-utils = {
|
|
type = "github";
|
|
owner = "numtide";
|
|
repo = "flake-utils";
|
|
ref = "master";
|
|
};
|
|
|
|
nur = {
|
|
type = "github";
|
|
owner = "nix-community";
|
|
repo = "NUR";
|
|
ref = "master";
|
|
};
|
|
|
|
agenix = {
|
|
type = "github";
|
|
owner = "ryantm";
|
|
repo = "agenix";
|
|
ref = "master";
|
|
};
|
|
|
|
neuron = {
|
|
type = "github";
|
|
owner = "srid";
|
|
repo = "neuron";
|
|
ref = "master";
|
|
};
|
|
|
|
sops = {
|
|
type = "github";
|
|
owner = "Mic92";
|
|
repo = "sops-nix";
|
|
ref = "master";
|
|
};
|
|
};
|
|
|
|
}
|
|
|