nixos-config/nixos/flake.nix

97 lines
3.3 KiB
Nix
Raw Normal View History

2021-09-25 20:28:25 +02:00
{
description = "system flake.nix";
inputs = {
sops-nix.url = "github:Mic92/sops-nix";
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
2021-09-29 05:05:26 +02:00
polygon-art = {
url = "git+https://git.ingolf-wagner.de/palo/polygon-art.git";
#inputs.nixpkgs.follows = "nixpkgs";
};
2021-09-25 20:28:25 +02:00
doom-emacs-nix = {
url = "github:vlaci/nix-doom-emacs";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-21.05";
inputs.nixpkgs.follows = "nixpkgs";
};
2021-09-29 22:42:48 +02:00
home-manager-utils = {
url = "github:mrvandalo/home-manager-utils";
inputs.home-manager.follows = "home-manager";
};
2021-09-25 20:28:25 +02:00
backup-module = {
url = "git+https://git.ingolf-wagner.de/nix-modules/backup.git";
flake = false;
};
krops-lib = {
url = "git+https://git.ingolf-wagner.de/nix-modules/krops.git";
flake = false;
};
cluster-module = {
url =
"git+https://git.ingolf-wagner.de/nix-modules/cluster.git?rev=ef621797a30f8a57de16bf33672abdd411cbcece";
flake = false;
};
};
2021-10-26 07:54:50 +02:00
outputs = { self, sops-nix, nixpkgs, home-manager, home-manager-utils
, doom-emacs-nix, backup-module, nixpkgs-unstable, krops-lib, cluster-module
, polygon-art, ... }:
2021-09-25 20:28:25 +02:00
let
nixosSystem = nixpkgs.lib.nixosSystem;
defaultModules = [
sops-nix.nixosModules.sops
{ imports = [ "${krops-lib}" "${cluster-module}" "${backup-module}" ]; }
({ pkgs, ... }: {
2021-09-27 18:53:45 +02:00
nix = {
# no channesl needed this way
nixPath = [ "nixpkgs=${pkgs.path}" ];
# make flakes available
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
2021-09-25 20:28:25 +02:00
# defined overlays injected by the nixflake
nixpkgs.overlays = [
(_self: _super: {
# we assign the overlay created before to the overlays of nixpkgs.
unstable = nixpkgs-unstable.legacyPackages.${pkgs.system};
2021-09-29 05:05:26 +02:00
polygon-art = polygon-art.packages.${pkgs.system};
2021-09-25 20:28:25 +02:00
})
];
})
];
desktopModules = [
home-manager.nixosModules.home-manager
{
home-manager.users.mainUser = {
2021-10-26 07:54:50 +02:00
imports = [ doom-emacs-nix.hmModule home-manager-utils.hmModule ];
2021-09-25 20:28:25 +02:00
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
];
desktopConfiguration = initPath:
nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ desktopModules ++ [ initPath ];
};
serverConfiguration = initPath:
nixosSystem {
system = "x86_64-linux";
modules = defaultModules ++ [ initPath ];
};
in {
nixosConfigurations = {
sterni = desktopConfiguration ./configs/sterni/configuration.nix;
sternchen = desktopConfiguration ./configs/sternchien/configuration.nix;
pepe = serverConfiguration ./configs/pepe/configuration.nix;
workhorse = serverConfiguration ./configs/workhorse/configuration.nix;
sputnik = serverConfiguration ./configs/sputnik/configuration.nix;
};
};
}